Coding methods and related apparatuses
Patent Information
- Application Number
- PCT/RU2025/000085
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2025-02-28
- Filing Date
- 2025-04-01
- Publication Date
- 2026-09-03
Smart Images

Figure RU2025000085_03092026_PF_FP_ABST
Abstract
Description
CODING METHODS AND RELATED APPARATUSESCROSS-REFERENCE TO RELATED APPLICATION
[0001] This application claims the benefit of and priority to PCT / RU2025 / 000051, filed on February 28, 2025, the content of which is hereby incorporated by reference in its entirety.TECHNICAL FIELD
[0002] The present disclosure relates generally to the field of video coding technologies, and more particularly to coding methods and apparatuses.BACKGROUND
[0003] Video coding (encoding and decoding) is widely used in digital video applications, for example, a broadcast digital television, video transmission over the Internet and / or mobile networks, real-time conversational applications such as video chat and / or video conferencing, high-density digital versatile discs (DVDs) that are also referred to as BLU-RAY discs, video content capturing and editing systems, or security applications of camcorders.
[0004] With the development of the block-based hybrid video coding approach in the H.261 standard in 1990, some video coding technologies and tools are developed and form a basis for some video coding standards. Some video coding standards may include moving picture experts group 1 (MPEG-1) video, MPEG-2 video, international telecommunication union telecommunication standardization sector (ITU-T) H.262 / MPEG-2, ITU-T H.263, ITU-T H.264 / MPEG-4 part 10: advanced video coding (AVC), ITU-T H.265 / high efficiency video coding (HEVC), ITU-T H.266 / versatile video coding (VVC), or extensions, for example, scalability and / or 3D (three-dimensional) extensions, of these standards.
[0005] As videos are created and used more widely, video traffic is one of burdens on networks and data storage. Therefore, one of goals of most video coding standards is to reduce a bit rate without sacrificing picture quality.
[0006] Entropy encoding converts a sequence of symbols or syntax elements, such as transform coefficients, prediction choices, and block sizes, into a bitstream. An encoder may perform entropy encoding based on a probability model, and the probability model may be updated. Some solutions have been proposed for updating the probability model. The process of updating the probability model may further be improved to improve coding efficiency.SUMMARY
[0007] Implementations and / or aspects of the present disclosure provide encoding methods, decoding methods, and related apparatuses thereof, to reduce effectively computation and coding latency caused by updating a probability model and thus improve coding efficiency.
[0008] According to a first aspect, an entropy decoding method is described. The method may be applied at a decoder side, for example, a decoder or a module in a decoder, a circuit or a chip that is responsible for a decoding function in a decoder, or a logical module or software that can implement all or some functions of a decoder. For example, the method is applied to a decoder. The method includes: obtaining a bitstream; obtaining S first symbols by decoding a first bit sequence in the bitstream based on a first probability model, where S is a positive integer; obtaining a first statistical value of each symbol in a set of symbols based on a number of occurrences of the each symbol in the S first symbols; obtaining a second probability model by updating the first probability model based on the first statistical value of the each symbol in a case where a sum of the first statistical value of the each symbol is greater than or equal to a first threshold; and obtaining Q second symbols by decoding a second bit sequence in the bitstream based on the second probability model, where Q is a positive integer, and the S first symbols and the Q second symbols are used for reconstructing data.
[0009] In the entropy decoding method according to the first aspect, the probability model may not be updated until the sum of the first statistical value of the each symbol reach a threshold. Therefore, the probability model may not be updated after decoding each symbol. Compared with solutions where the probability model is updated after decoding each symbol, in the entropy decoding method according to the first aspect, the probability model may be updated less frequently, and computation and coding latency caused by updating the probability model may be effectively reduced and thus coding efficiency may be improved.
[0010] In some implementations, the updating the first probability model includes: determining one or more remaining first symbols of the first bit sequence excluding the S first symbols; and updating the first probability model based on the first statistical value of the each value while decoding the one or more remaining first symbols of the first bit sequence based on the first probability model.
[0011] In this case, the decoder may decode the remaining symbols without waiting for the complete of updating the probability model so that the encoder may decode the remaining symbols while updating the probability model. Therefore, the decoding latency may be further reduced and thus the coding efficiency may be further improved.
[0012] In some implementations, the first bit sequence is a first one in the bitstream, and the first statistical value of the each symbol equals to the number of occurrences of the each symbol in the S first symbols; or the first statistical value of the each symbol equals to an integer multiple of the number of occurrences of the each symbol in the S first symbols.
[0013] In the case where the first statistical value of the each symbol equals to the number of occurrences of the each symbol in the S first symbols, the decoder may obtain the first statistical value in a simple way and the computational complexity may be reduced. In the case where the first statistical value of the each symbol equals to an integer multiple of the number of occurrences of the each symbol in the S first symbols, the integer multiple may be set according to the actual need, thereby improving the flexibility of collecting the first statistical value and the flexibility of updating the probability model. Moreover, the integer multiple may be greater than one, and the sum of the first statistical value of the each symbol may reach the first threshold faster.
[0014] In some implementations, the first bit sequence is an Nthone in the bitstream, N is an integer greater than one, and the method further includes: obtaining a second statistical value of the each symbol, where the second statistical value is obtained based on a number of occurrences of the each symbol in symbols of (N-1) bit sequences previous to the first bit sequence in the bitstream; and the obtaining a first statistical value of each symbol in a set of symbols includes: obtaining the first statistical value of the each symbol in the set of symbols further based on the second statistical value of the each symbol. In this case, the first statistical value may be obtained further based on the number of occurrences of the each symbol in the (N-l) bit sequences previous to the Nthone in the bitstream. In other words, the first statistical value may be obtained both based on the number of occurrences of the each symbol in the S first symbols in the Nthone and the number of occurrences of the each symbol in the symbols of the (N-l) bit sequences previous to the Nthone.
[0015] In some implementations, the method further includes: obtaining a third statistical value of the each symbol based on a number of occurrences of the each symbol in the Q second symbols and a historical statistical value of the each symbol, where the historical statistical value of the each symbol is associated to the first statistical value of the each symbol; and obtaining a third probability model by updating the second probability model based on the third statistical value of the each symbol, in a case where a sum of the third statistical value of the each symbol is greater or equal to the first threshold.
[0016] The historical statistical value may be used for updating the previous probability model. In this case, when the decoder is to update the current probability model, the historical statistical value for updating the previous probability model may be taken into consideration again. Therefore,after the current probability model is updated to an updated probability model, the updated probability model may estimate a probability of future symbols more accurately.
[0017] In some implementations, the historical statistical value of the each symbol includes a product of a first parameter and the first statistical value of the each symbol.
[0018] In this case, the first statistical value may be scaled by the first parameter, and the scaled first statistical value may act as the historical statistical value. The larger the first parameter, the more statistical value for updating the previous probability model may be used for updating the current probability model. As such, the historical statistical value may be obtained in a flexible way. It is noted that the first statistical value of the each symbol may also be directly used as the historical statistical value of the each symbol.
[0019] In some implementations, the first probability model includes a first cumulative distribution function (CDF), and the updating the first probability model includes: obtaining a second cumulative distribution function by updating parameters in the first cumulative distribution function based on a second parameter and the first statistical value of the each symbol, where the second cumulative distribution function belongs to the second probability model, and the second parameter is a non-negative real number.
[0020] The second parameter may act as a basis value to guarantee that a statistical number of occurrences of the each symbol is greater than zero while obtaining the second cumulative distribution function. In this case, even if a first statistical value of a symbol equals to zero, the probability of this symbol shown in the CDF may be greater than zero. As such, the decoder may obtain a more accurate probability model.
[0021] In some implementations, the parameters in the first cumulative distribution function include a cumulative probability of the each symbol, symbols in the set of symbols are arranged in an ascending order, and the updating parameters in the first cumulative distribution function includes one or more of: obtaining an updated cumulative probability of a first one in the set of symbols based on the second parameter and a first statistical value of the first one; or obtaining an updated cumulative probability of an ithone in the set of symbols based on the second parameter, an updated cumulative probability of an (i-1)thone in the set of symbols, and a first statistical value of the ithone, where i is an integer greater than one.
[0022] According to a second aspect, an entropy encoding method is described. The method may be applied to an encoder side, for example, an encoder or a module in an encoder, a circuit or a chip that is responsible for an encoding function in an encoder, or a logical module or software that can implement all or some functions of an encoder. For example, the method is applied to an encoder. The method includes: obtaining S first symbols of a first sequence, where S is a positiveinteger; encoding the S first symbols into a bitstream based on a first probability model; obtaining a first statistical value of each symbol in a set of symbols based on a number of occurrences of the each symbol in the S first symbols; obtaining a second probability model by updating the first probability model based on the first statistical value of the each symbol in a case where a sum of the first statistical value of the each symbol is greater than or equal to a first threshold; obtaining Q second symbols of a second sequence, where Q is a positive integer; and encoding the Q second symbols into the bitstream based on the second probability model.
[0023] In some implementations, the updating the first probability model includes: determining one or more remaining first symbols of the first sequence excluding the S first symbols; and updating the first probability model based on the first statistical value of the each value while encoding the one or more remaining first symbols of the first sequence based on the first probability model.
[0024] In some implementations, the first sequence is a first one in a plurality of sequences, and the first statistical value of the each symbol equals to the number of occurrences of the each symbol in the S first symbols; or the first statistical value of the each symbol equals to an integer multiple of the number of occurrences of the each symbol in the S first symbols.
[0025] In some implementations, the first sequence is anone in the plurality of sequences, N is an integer greater than one, and the method further includes: obtaining a second statistical value of the each symbol, where the second statistical value is obtained based on a number of occurrences of the each symbol in symbols of (N-1) sequences previous to the first sequence in the plurality of sequences; and the obtaining a first statistical value of each symbol in a set of symbols includes: obtaining the first statistical value of the each symbol in the set of symbols further based on the second statistical value of the each symbol.
[0026] In some implementations, the method further includes: obtaining a third statistical value of the each symbol based on a number of occurrences of the each symbol in the Q second symbols and a historical statistical value of the each symbol, where the historical statistical value of the each symbol is associated to the first statistical value of the each symbol; and obtaining a third probability model by updating the second probability model based on the third statistical value of the each symbol, in a case where a sum of the third statistical value of the each symbol is greater or equal to the first threshold.
[0027] In some implementations, the historical statistical value of the each symbol includes a product of a first parameter and the first statistical value of the each symbol.
[0028] In some implementations, the first probability model includes a first cumulative distribution function, and the updating the first probability model includes: obtaining a secondcumulative distribution function by updating parameters in the first cumulative distribution function based on a second parameter and the first statistical value of the each symbol, where the second cumulative distribution function belongs to the second probability model, and the second parameter is a non-negative real number.
[0029] In some implementations, the parameters in the first cumulative distribution function include a cumulative probability of the each symbol, symbols in the set of symbols are arranged in an ascending order, and the updating parameters in the first cumulative distribution function includes one or more of: obtaining an updated cumulative probability of a first one in the set of symbols based on the second parameter and a first statistical value of the first one; or obtaining an updated cumulative probability of an ithone in the set of symbols based on the second parameter, an updated cumulative probability of an (i-1)thone in the set of symbols, and a first statistical value of the ithone, where i is an integer greater than one.
[0030] According to a third aspect, an apparatus for processing image data is described. The apparatus has a function of implementing the first aspect or any implementation in the first aspect. For example, the apparatus includes a corresponding module, unit, or means for performing operations in the first aspect or any implementation in the first aspect. The module, unit, or means may be specifically implemented by using software, may be implemented by using hardware, or may be implemented by using software in combination with hardware.
[0031] According to a fourth aspect, an apparatus for processing image data is described. The apparatus has a function of implementing the second aspect or any implementation in the second aspect. For example, the apparatus includes a corresponding module, unit, or means for performing operations in the second aspect or any implementation in the second aspect. The module, unit, or means may be specifically implemented by using software, may be implemented by using hardware, or may be implemented by using software in combination with hardware.
[0032] According to a fifth aspect, another apparatus for processing image data is described. The apparatus includes a memory and one or more processors. The memory is configured to store a part or all of a necessary computer program or instructions for implementing a function in the first aspect or any implementation in the first aspect. The one or more processors may execute the computer program or the instructions, and when the computer program or the instructions is / are executed, the apparatus is enabled to implement the method in the first aspect or any implementation in the first aspect.
[0033] According to a sixth aspect, another apparatus for processing image data is described. The apparatus includes a memory and one or more processors. The memory is configured to store a part or all of a necessary computer program or instructions for implementing a function in thesecond aspect or any implementation in the second aspect. The one or more processors may execute the computer program or the instructions, and when the computer program or the instructions is / are executed, the apparatus is enabled to implement the method in the second aspect or any implementation in the second aspect.
[0034] According to a seventh aspect, a system is described. The system includes an apparatus for implementing the first aspect or any implementation in the first aspect and an apparatus for implementing the second aspect or any implementation in the second aspect.
[0035] According to an eighth aspect, a computer-readable storage medium is described. The computer-readable storage medium stores computer-readable instructions, and when a computer reads and executes the computer-readable instructions, the computer is enabled to perform the method in any one of the implementations of the first aspect to the second aspect.
[0036] According to a ninth aspect, a computer program product is described. When a computer reads and executes the computer program product, a computer is enabled to perform the method in any one of the implementations of the first aspect to the second aspect.BRIEF DESCRIPTION OF THE DRAWINGS
[0037] For a better understanding of the present disclosure, as well as other aspects and further features thereof, reference is made to the following description which is to be used in conjunction with the accompanying drawings.
[0038] FIG. 1 A is a block diagram of an example of a video coding system for implementing one or more embodiments of the present disclosure;
[0039] FIG. IB is a block diagram of an example of another video coding system for implementing one or more embodiments of the present disclosure;
[0040] FIG. 2 is a block diagram of an example structure of an encoder for implementing one or more embodiments of the present disclosure;
[0041] FIG. 3 is a block diagram of an example structure of a decoder for implementing one or more embodiments of the present disclosure;
[0042] FIG. 4 is a block diagram of an example structure of an encoder for implementing one or more embodiments of the present disclosure;
[0043] FIG. 5 is a schematic diagram of an example of subfigure partitioning for implementing one or more embodiments of the present disclosure;
[0044] FIG. 6 is a schematic diagram of an example of a wavelet transform for implementing one or more embodiments of the present disclosure;
[0045] FIG. 7A is a schematic diagram of an example structure of a decoder for implementing one or more embodiments of the present disclosure;
[0046] FIG. 7B is a schematic diagram of another example structure of a decoder for implementing one or more embodiments of the present disclosure;
[0047] FIG. 8 is a schematic diagram of a structure of an example of a figure bitstream for implementing one or more embodiments of the present disclosure;
[0048] FIG. 9 is a block diagram of an example of a video coding device for implementing one or more embodiments of the present disclosure;
[0049] FIG. 10 is a block diagram of an example of another video coding device for implementing one or more embodiments of the present disclosure;
[0050] FIG. 11 illustrates a flowchart for processing coefficients according to CDF;
[0051] FIG. 12 illustrates an encoding process CAB AC which involves updating a probability model;
[0052] FIG. 13 illustrates an example flowchart of an entropy encoding method in accordance with one or more embodiments of the present disclosure;
[0053] FIG. 14 is a schematic diagram of an example histogram in accordance with one or more embodiments of the present disclosure;
[0054] FIG. 15 illustrates an example of sequences where a first sequence is a first one in a plurality of sequences;
[0055] FIG. 16 illustrates an example of sequences where a first sequence is aNthone in a plurality of sequences;
[0056] FIG. 17 illustrates an example histogram in different stages during encoding in accordance with one or more embodiments of the present disclosure;
[0057] FIG. 18 illustrates a flow chart outlining an encoding process using a context-based probability adaptation model in accordance with one or more embodiments of the present disclosure;
[0058] FIG. 19 illustrates a flow chart outlining updating the CDF in accordance with one or more embodiments of the present disclosure;
[0059] FIG. 20, illustrates an example flowchart of a video decoding method in accordance with one or more embodiments of the present disclosure; and
[0060] FIG. 21 is a schematic block of an example scanning apparatus for processing image data in accordance with one or more embodiments of the present disclosure.DETAILED DESCRIPTION
[0061] The following describes embodiments of the present disclosure with reference to the accompanying drawings in embodiments of the present disclosure. In the following description,specific aspects of embodiments of the present disclosure or specific aspects in which embodiments of the present disclosure may be used are shown by the accompanying drawings.
[0062] In embodiments of the present disclosure, “at least one” means one or more, and “a plurality of’ means two or more. “And / or” describes an association relationship between associated objects, and represents that three relationships may exist. For example, A and / or B may represent the following cases: only A exists, both A and B exist, and only B exists, where A and B may be singular or plural. The character “ / ” generally indicates an “or” relationship between the associated objects. “At least one item (piece) of the following” or a similar expression thereof means any combination of these items, including a singular item (piece) or any combination of plural items (pieces). For example, at least one of a, b, or c may indicate: a; b; c; a and b; a and c; b and c; or a, b, and c, where a, b, and c may be singular or plural.
[0063] Technical solutions described in some embodiments of the present disclosure may be applicable to digital video applications, for example, broadcast digital television, video transmission over the Internet and / or mobile networks, real-time conversational applications such as video chat and / or video conferencing, high-density digital versatile discs (DVDs), also referred to as Blu-ray discs, video content capturing and editing systems, or security applications of camcorders.
[0064] Technical solutions described in some embodiments of the present disclosure may be applicable to video coding standards. The video coding standards may include, but are not limited to moving picture experts group 1 (MPEG-1), MPEG-2, MPEG-4, international telecommunication union telecommunication standardization sector (ITU-T) H.262 / MPEG-2, H.263, H.264 / advanced video coding (AVC), H.265 / high efficiency video coding (HEVC), H.266 / versatile video coding (VVC), video processing 8 (VP8), VP9, audio video coding standard (AVS), AOMedia video 1 (AVI), or extensions of these standards, for example, scalability and / or 3D (three-dimensional) extensions. Technical solutions described in some embodiments of the present disclosure may also be applicable to future or next video coding standards.
[0065] Terms used in embodiments of the present disclosure are merely used to explain specific embodiments of the present disclosure, but are not intended to limit the present disclosure. The following first briefly describes some concepts that may be mentioned in embodiments of the present disclosure. These concepts are introduced solely to explain embodiments of the present disclosure and are not intended to limit the scope of the present disclosure.
[0066] Residual: A difference between a reconstructed value and a predicted value of a sample or data element.
[0067] Residual Block: An MxN matrix (or array) of residuals corresponding to a coding block, where M and N are integers greater than or equal to 1.
[0068] Dequantization: A process of obtaining reconstructed residuals by scaling quantized residuals.
[0069] Partition: A division of a set into subsets, where each element of the set belongs to and is only in one subset.
[0070] Partition Type: An organizational method of subsets obtained through partitioning.
[0071] Decoded Picture: An image reconstructed by a decoder based on a bitstream.
[0072] Prediction: A specific implementation of a prediction process.
[0073] Prediction Process: A process of obtaining predicted values of current samples using previously decoded samples.
[0074] Syntax Element: A result obtained after parsing a data unit in the bitstream.
[0075] Bitstream: A binary data stream formed by all or part of samples of an encoded image.
[0076] Video coding usually refers to processing of a sequence of pictures, where the sequence of pictures forms a video or a video sequence. In the field of video coding, the terms “picture”, “frame”, or “image” may be used as synonyms or interchangeably. Video coding used in this specification indicates video encoding or video decoding. Video encoding is performed on a source side and usually includes processing (for example, compressing) an original video picture to reduce an amount of data for representing the video picture, thereby enabling more efficient storage and / or transmission. Video decoding is performed on a destination side and usually includes inverse processing relative to the source side, to reconstruct the video picture. Video picture “coding” in embodiments is understood as “encoding” or “decoding” of a video sequence. A combination of an encoding part and a decoding part is also referred to as coding (encoding and decoding).
[0077] A video sequence includes a series of pictures, a picture is further partitioned into slices, and a slice is further partitioned into blocks. In video coding, coding processing is performed on a per-block basis. In some video coding standards, a concept “block” is further extended. For example, a macroblock (MB) is introduced in the H.264 standard. The macroblock may be further partitioned into a plurality of prediction blocks for predictive coding. In the HEVC standard, a plurality of block units are functionally classified by using basic concepts such as a coding unit (CU), a prediction unit (PU), and a transform unit (TU). The plurality of block units are described by employing a tree-based structure. For example, a CU may be partitioned into smaller CUs based on a quadtree, and a smaller CU may continue to be partitioned to generate a quadtree structure. The CU may correspond to a coding block and is a basic unit for partitioning and coding a to-be-coded image. A PU and a TU also have a similar tree structure. The PU may correspond to a prediction block and is a basic unit of predictive coding. The PU is further partitioned into a plurality of PUs in a partition mode. The TU may correspond to a transform block and is a basic unit for transforming a prediction residual. However, in essence, all of the CU, the PU, and the TU are conceptually blocks (or image blocks). For a concept of image data in embodiments of this disclosure may include any of blocks described herein and refer to description herein for details.
[0078] In this specification, for ease of description and understanding, a to-be-processed image block in a current coding image may be referred to as a current block, for example, in encoding, the to-be-processed image block refers to a block currently being encoded, and in decoding, the to-be-processed image block refers to a block currently being decoded. A decoded image block that is in a reference image and that is for predicting the current block is referred to as a reference block. In other words, the reference block is a block that provides a reference signal for the current block, where the reference signal indicates a pixel value, a sampling value, or a sampling signal in the image block. A block that provides a prediction signal for the current block in a reference image may be referred to as a prediction block. The prediction signal indicates a pixel value, a sampling value, or a sampling signal in the prediction block. For example, after a plurality of reference blocks are traversed, an optimal reference block is found, and the optimal reference block will provide prediction for the current block, and may be referred to as a prediction block.
[0079] In a case of lossless video coding, original video pictures can be reconstructed. In other words, reconstructed video pictures have same quality as the original video pictures (assuming that no transmission loss or other data loss occurs during storage or transmission). In a case of lossy video coding, further compression is performed through, for example, quantization, to reduce an amount of data for representing video pictures, and the video pictures may not be completely reconstructed on a decoder side. In other words, quality of reconstructed video pictures is lower or poorer than that of the original video pictures.
[0080] The following describes a system architecture to which embodiments of the present disclosure are applicable. Modules / components shown in block diagrams (or schematic diagrams, conceptual diagrams, structural diagrams, or system diagrams) are examples of the present disclosure. The actual block diagrams (or schematic diagrams, conceptual diagrams, structural diagrams, or system diagrams) may include more or fewer modules / components than those shown in the diagrams, or may have different component configurations. Moreover, various components / modules shown in the diagrams may be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing units and / or application-specific integrated circuits.PC17RU2025 / 000085
[0081] FIG. 1A is a schematic block diagram of an example of a video encoding and decoding system 10 to which one or more embodiments of the present disclosure is applicable. As shown in FIG. 1A, the video encoding and decoding system 10 may include a source device 12 and a destination device 14. The source device 12 generates encoded video data, and therefore the source device 12 may be referred to as a video encoding apparatus. The destination device 14 may decode the encoded video data generated by the source device 12, and therefore the destination device 14 may be referred to as a video decoding apparatus. In various implementation solutions, the source device 12, the destination device 14, or both the source device 12 and the destination device 14 may include one or more processors and a memory coupled to the one or more processors. The memory may include but is not limited to a random-access memory (RAM), a read-only memory (ROM), an electrically erasable programmable ROM (EEPROM), a flash memory, or any other medium that can be used to store desired program code in a form of instructions or a data structure accessible to a computer, as described in this specification. The source device 12 and the destination device 14 may include various apparatuses, including a desktop computer, a mobile computing apparatus, a notebook (for example, a laptop) computer, a tablet computer, a set-top box, a telephone handset such as a “smart” phone, a television, a camera, a display apparatus, a digital media player, a video game console, a vehicle-mounted computer, a wireless communication device, or the like.
[0082] Although FIG. 1A depicts the source device 12 and the destination device 14 as separate devices, in one or more device embodiments, both the source device 12 and the destination device 14 or functionalities of both the source device 12 and the destination device 14, that is, the source device 12 or a corresponding functionality and the destination device 14 or a corresponding functionality, may alternatively be included in a single device. In such one or more embodiments, the source device 12 or the corresponding functionality and the destination device 14 or the corresponding functionality may be implemented by using same hardware and / or software or by using separate hardware and / or software or any combination thereof.
[0083] A communication connection between the source device 12 and the destination device 14 may be implemented through a link 13, and the destination device 14 may receive encoded video data from the source device 12 through the link 13. The link 13 may include one or more media or apparatuses capable of moving the encoded video data from the source device 12 to the destination device 14. In an example, the link 13 may include one or more communication media that enable the source device 12 to transmit the encoded video data directly to the destination device 14 in real time. In this example, the source device 12 may modulate the encoded video data according to a communication standard (for example, a wireless communication protocol), and may transmitmodulated video data to the destination device 14. The one or more communication media may include a wireless communication medium and / or a wired communication medium, for example, a radio frequency (RF) spectrum or one or more physical transmission lines. The one or more communication media may form a part of a packet-based network, and the packet-based network is, for example, a local area network, a wide area network, or a global network (for example, the Internet). The one or more communication media may include a router, a switch, a base station, or another device that facilitates communication from the source device 12 to the destination device 14.
[0084] The source device 12 includes an encoder 20. For example, the source device 12 may further include a picture source 16, a picture preprocessor 18, and a communication interface 22. In a specific implementation form, the encoder 20, the picture source 16, the picture preprocessor 18, and the communication interface 22 may be hardware components in the source device 12, or may be software programs in the source device 12. The following describes the components separately.
[0085] The picture source 16 may include or be any type of picture capturing device configured to, for example, capture a real-world picture, and / or any type of device for generating a picture or comment (for screen content encoding, some text on a screen is also considered as a part of a to-be-encoded picture or image), for example, a computer graphics processor configured to generate a computer animation picture, and / or any type of device configured to obtain and / or provide a real-world picture or a computer animation picture (for example, screen content or a virtual reality (VR) picture), and / or any combination thereof (for example, an augmented reality (AR) picture). The picture source 16 may be a camera configured to capture a picture or a memory configured to store a picture. The picture source 16 may further include any type of (internal or external) interface through which a previously captured or generated picture is stored and / or a picture is obtained or received. When the picture source 16 is a camera, the picture source 16 may be, for example, a local camera, or an integrated camera integrated into the source device. When the picture source 16 is a memory, the picture source 16 may be a local memory or, for example, an integrated memory integrated into the source device. When the picture source 16 includes an interface, the interface may be, for example, an external interface for receiving a picture from an external video source. The external video source is, for example, an external picture capturing device such as a camera, an external memory, or an external picture generation device. The external picture generation device is, for example, an external computer graphics processor, a computer, or a server. The interface may be any type of interface, for example, a wired or wireless interface or an optical interface, according to any proprietary or standardized interface protocol.
[0086] A picture may be considered as a two-dimensional (2D) array or matrix of picture elements. A pixel in the array may also be referred to as a sample. A quantity of samples in horizontal and vertical directions (or axes) of the array or the picture defines a size and / or resolution of the picture. For representation of a color, three color components are usually employed. To be specific, the picture may be represented as or include three sample arrays. For example, in a red, green, and blue (RGB) format or color space, a picture includes a corresponding red, green, and blue sample array. However, in video coding, each sample is usually represented in a luminance / chrominance format or color space. For example, a picture in a YUV format includes a luminance component indicated by Y (or sometimes L) and two chrominance components indicated by U and V. The luminance (luma) component Y represents luminance or gray level intensity (for example, both are the same in a gray-scale picture), and the two chrominance (chroma) components U and V represent chrominance or color information components. Accordingly, the picture in the YUV format includes a luminance sample array of luminance sample values (Y) and two chrominance sample arrays of chrominance values (U and V). A picture in an RGB format may be transformed or converted to a picture in a YUV format and vice versa. This process is also referred to as color conversion or transform. If a picture is monochrome, the picture may include only a luminance sample array. In one or more embodiments of the present disclosure, a picture transmitted by the picture source 16 to the picture processor such as a picture preprocessor 18 may also be referred to as raw picture data 17.
[0087] The picture preprocessor 18 is configured to receive raw picture data 17 and perform preprocessing on the raw picture data 17 to obtain a preprocessed picture 19 or preprocessed picture data 19. For example, the picture preprocessor 18 may perform preprocessing: trimming, color format transformation (for example, from the RGB format to the YUV format), color correction, denoising, or the like.
[0088] The encoder 20 is configured to receive the preprocessed picture data 19, and process the preprocessed picture data 19 in related prediction mode, and / or transform manner, and / or quantization manner, and / or compress manner to provide the encoded picture data 21 (the following further describes structural details of the encoder 20 based on FIG. 2, FIG. 4, or FIG. 5). In some embodiments, the encoder 20 may be configured to perform embodiments described below, to implement scanning methods for processing image data in described in the present disclosure.
[0089] The communication interface 22 may be configured to receive the encoded picture data 21 from the encoder directly or indirectly, and transmit the encoded picture data 21 to the destination device 14 or any other device (for example, a memory) through the link 13 for storage or directreconstruction. The any other device may be any device configured for decoding or storage. The communication interface 22 may be, for example configured to encapsulate the encoded picture data 21 into an appropriate format, for example, a data packet, for transmission through the link 13.
[0090] The destination device 14 includes a decoder 30. For example, the destination device 14 may further include a communication interface 28, a picture post-processor 32, and a display device 34. The following describes the components separately.
[0091] The communication interface 28 may be configured to receive the encoded picture data 21 from the source device 12 or any other source. The any other source is, for example, a storage device. The storage device is, for example, an encoded picture data storage device. The communication interface 28 may be configured to transmit or receive the encoded picture data 21 through the link 13 between the source device 12 and the destination device 14 or through any type of network. The link 13 is, for example, a direct wired or wireless connection, and the any type of network is, for example, a wired or wireless network or any combination thereof, or any type of private or public network, or any combination thereof. The communication interface 28 may be, for example configured to decapsulate the data packet transmitted through the communication interface 22, to obtain the encoded picture data 21.
[0092] Both the communication interface 28 and the communication interface 22 may be configured as unidirectional communication interfaces or bidirectional communication interfaces, and may be configured to, for example, transmit and receive messages to establish a connection, and acknowledge and exchange any other information related to a communication link and / or data transmission such as encoded picture data transmission.
[0093] The decoder 30 is configured to receive the encoded picture data 21 and provide the decoded picture data 31 or the decoded picture 31 (the following further describes structural details of the decoder 30 based on FIG. 3, FIG. 4, or FIG. 5). In some embodiments, the decoder 30 may be configured to perform embodiments described below, to implement scanning methods for processing image data described in the present disclosure.
[0094] The picture post-processor 32 is configured to post-process the decoded picture data 31 (also referred to as reconstructed picture data) to obtain post-processed picture data 33. The picture post-processor 32 may perform post-processing of color format transformation (for example, from a YUV format to an RGB format), color correction, trimming, re-sampling, or any other processing, and may be further configured to transmit the post-processed picture data 33 to the display device 34.
[0095] The display device 34 is configured to receive the post-processed picture data 33 to display a picture, for example, to a user or a viewer. The display device 34 may be or include any type of display configured to present a reconstructed picture, for example, an integrated or external display or monitor. For example, the display may include a liquid-crystal display (LCD), an organic lightemitting diode (LED) (OLED) display, a plasma display, a projector, a micro-LED display, a liquid-crystal on silicon (LCoS), a digital light processor (DLP), or any type of other display.
[0096] As will be apparent for a person skilled in the art based on the description, existence and (accurate) division of functionalities of the different units or functionalities of the source device 12 and / or the destination device 14 shown in FIG. 1A may vary with an actual device and application. The source device 12 and the destination device 14 each may include any one of a wide range of devices, including any type of handheld or stationary device, for example, a notebook or laptop computer, a mobile phone, a smartphone, a pad or a tablet computer, a video camera, a desktop computer, a set-top box, a television, a camera, a vehicle-mounted device, a display device, a digital media player, a video game console, a video streaming transmission device (such as a content service server or a content distribution server), a broadcast receiver device, and a broadcast transmitter device, and may not use or may use any type of operating system.
[0097] The encoder 20 and the decoder 30 each may be implemented as any one of various appropriate circuits, for example, one or more microprocessors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), discrete logic, hardware, or any combinations thereof. If the technologies are implemented partially by using software, a device may store software instructions in an appropriate and non-transitory computer-readable storage medium and may execute instructions by using hardware such as one or more processors, to perform the technologies of this disclosure. Any of the foregoing content (including hardware, software, a combination of hardware and software, and the like) may be considered as one or more processors.
[0098] In some cases, the video encoding and decoding system 10 shown in FIG. 1A is merely an example, and the technologies of the present disclosure may be applied to a video coding setting (for example, video encoding or video decoding) that does not need to include any data communication between encoding and decoding devices. In another example, data may be retrieved from a local memory, streamed over a network, or the like. A video encoding device may encode data and store data into the memory, and / or a video decoding device may retrieve and decode data from the memory. In some examples, encoding and decoding are performed by devices that do not communicate with each other but simply encode data into the memory and / or retrieve data from the memory and decode the data.
[0099] It is understood that the encoder 20 may be deployed on a terminal device or a server on a cloud side, the decoder 30 may be deployed on a terminal device or a server on a cloud side, or the encoder 20 and the decoder 30 may be jointly deployed on a terminal device or a server on a cloud side.
[0100] In a scenario, the encoder 20 and the decoder 30 may be deployed on a terminal device. The encoder 20 may perform coding compression on a video on the terminal device, perform secondary compression (or incremental storage compression) in the video encoding method provided in embodiments of this disclosure, and store compressed data. When the video needs to be played back, the stored compressed data may be decoded.
[0101] In a scenario, the encoder 20 and the decoder 30 may be deployed on a plurality of terminal devices. The encoder 20 may perform coding compression on a video on the terminal device, perform secondary compression (or incremental storage compression) in the video encoding method provided in embodiments of this disclosure, and transmit compressed data to another terminal device. When the other device needs to play back the video, the other device may decode the stored compressed data.
[0102] In a scenario, the encoder 20 and the decoder 30 may be deployed on a terminal device and a server on a cloud side. The encoder 20 may perform coding compression on a video on the terminal device, perform secondary compression (or incremental storage compression) in the video encoding method provided in embodiments of this disclosure, and transmit compressed data to the server.
[0103] FIG. 1B is an illustrative diagram of an example of a video coding system 10B including the encoder 20 in FIG. 2 and / or the decoder 30 in FIG. 3 according to one or more example embodiments. The video coding system 10B can implement a combination of various technologies in embodiments of the present disclosure. In the illustrated implementations, the video coding system 10B may include an imaging device 41, the encoder 20, the decoder 30 (and / or a video encoder / decoder implemented by using a logic circuit (not shown) of a processing unit 46), an antenna 42, one or more processors 43, one or more memories 44, and / or a display device 45.
[0104] As shown in FIG. 1B, the imaging device 41, the antenna 42, the processing unit 46, the logic circuit, the encoder 20, the decoder 30, the processor 43, the memory 44, and / or the display device 45 can communicate with each other. As described, although the video coding system 10B is depicted by using the encoder 20 and the decoder 30, the video coding system 10B may include only the encoder 20 or only the decoder 30 in different examples.
[0105] In some examples, the antenna 42 may be configured to transmit or receive encoded data of video data. Further, in some examples, the display device 45 may be configured to present thevideo data. In some examples, the logic circuit may be implemented by using the processing unit 46. The processing unit 46 may include ASIC logic, a graphics processor, a general-purpose processor, or the like. The video coding system 10B may alternatively include the optional processor 43. The optional processor 43 may similarly include ASIC logic, a graphics processor, a general-purpose processor, or the like. In some examples, the logic circuit may be implemented by hardware, for example, video coding dedicated hardware, and the processor 43 may be implemented by general-purpose software, an operating system, or the like. In addition, the memory 44 may be any type of memory, for example, a volatile memory (for example, a static RAM (SRAM) or a dynamic RAM (DRAM)) or a non-volatile memory (for example, a flash memory). In a non-limitative example, the memory 44 may be implemented by using a cache memory. In some examples, the logic circuit may access the memory 44 (for example, for implementation of an image buffer). In other examples, the logic circuit and / or the processing unit 46 may include a memory (for example, a cache) for implementation of an image buffer or the like.
[0106] In some examples, the encoder 20 implemented by using the logic circuit may include an image buffer (for example, implemented by using the processing unit 46 or the memory 44) and a graphics processing unit (for example, implemented by using the processing unit 46). The graphics processing unit may be communicatively coupled to the image buffer. The graphics processing unit may include the encoder 20 implemented by using the logic circuit, to implement various modules that are described with reference to FIG. 2 and / or any other encoder system or subsystem described in this specification. The logic circuit may be configured to perform various operations described in this specification.
[0107] In some examples, the decoder 30 may be implemented by using the logic circuit in a similar manner, to implement various modules that are described with reference to the decoder 30 in FIG. 3 and / or any other decoder system or subsystem described in this specification. In some examples, the decoder 30 implemented by using the logic circuit may include an image buffer (implemented by using the processing unit 46 or the memory 44) and a graphics processing unit (for example, implemented by using the processing unit 46). The graphics processing unit may be communicatively coupled to the image buffer. The graphics processing unit may include the decoder 30 implemented by using the logic circuit, to implement various modules that are described with reference to FIG. 3 and / or any other decoder system or subsystem described in this specification.
[0108] In some examples, the antenna 42 may be configured to receive encoded data of video data. As described, the encoded data may include data, an indicator, an index value, mode selection data,or the like related to video frame encoding described in this specification, for example, data related to coding partitioning (for example, a transform coefficient or a quantized transform coefficient, an optional indicator (as described), and / or data defining coding partitioning). The video coding system 10B may further include the decoder 30 that is coupled to the antenna 42 and that is configured to decode the encoded data. The display device 45 is configured to present a video frame.
[0109] It is understood that in some embodiments of the present disclosure, for the example described with reference to the encoder 20, the decoder 30 may be configured to perform a reverse process. With regard to a signaling syntax element, the decoder 30 may be configured to receive and parse such a syntax element and correspondingly decode related video data. In some examples, the encoder 20 may entropy encode the syntax element into encoded video encoded data. In such examples, the decoder 30 may parse such a syntax element and correspondingly decode related video data.
[0110] FIG. 2 is a schematic / conceptual block diagram of an example of an encoder 20 configured to implement one or more embodiments of the present disclosure. In the example of FIG. 2, the encoder 20 includes a residual calculation unit 204, a transform processing unit 206, a quantization unit 208, an inverse quantization unit 210, an inverse transform processing unit 212, a reconstruction unit 214, a buffer 216, a loop filter unit 220, a decoded picture buffer (DPB) 230, a prediction processing unit 260, and an entropy encoding unit 270. The prediction processing unit 260 may include an inter prediction unit 244, an intra prediction unit 254, and a mode selection unit 262. The inter prediction unit 244 may include a motion estimation unit and a motion compensation unit. The encoder 20 shown in FIG. 2 may also be referred to as a hybrid video encoder or a video encoder based on a hybrid video codec.
[0111] The encoder 20 receives, for example, via an input 202, a picture 201 or an image block 203 of the picture 201, for example, a picture in a sequence of pictures forming a video or a video sequence. The image block 203 may also be referred to as a current encoding block or a to-be- processed image block, and the picture 201 may be referred to as a current picture or a to-be-encoded picture (especially when the current picture is distinguished from another picture in video encoding, for example, the other picture is a previously encoded and / or decoded picture in a same video sequence, that is, a video sequence including the current picture).
[0112] The residual calculation unit 204 is configured to calculate a residual block 205 based on the picture image block 203 and a prediction block 265 (further details about the prediction block 265 are provided below), for example, obtain the residual block 205 in a sample domain bysubtracting sample values of the prediction block 265 from sample values of the picture image block 203 sample by sample (pixel by pixel).
[0113] The transform processing unit 206 is configured to apply a transform, for example, a discrete cosine transform (DCT) or a discrete sine transform (DST), to sample values of the residual block 205 to obtain transform coefficients 207 in a transform domain. The transform coefficients 207 may also be referred to as transform residual coefficients and represent the residual block 205 in the transform domain.
[0114] The quantization unit 208 is configured to quantize the transform coefficients 207 to obtain quantized transform coefficients 209, for example, through scalar quantization or vector quantization.[01’15] The inverse quantization unit 210 is configured to apply the inverse quantization of the quantization unit 208 to quantized coefficients to obtain dequantized coefficients 211, for example, apply, based on or by using a same quantization step size as the quantization unit 208, the inverse of a quantization scheme applied by the quantization unit 208. The dequantized coefficients 211 may also be referred to as dequantized residual coefficients 211, and correspond, although usually different from the transform coefficients due to a loss caused by quantization, to the transform coefficients 207.
[0116] The inverse transform processing unit 212 is configured to apply the inverse transform of the transform applied by the transform processing unit 206, for example, an inverse DCT or an inverse DST, to obtain an inverse transform block 213 in the sample domain. The inverse transform block 213 may also be referred to as an inverse transform dequantized block 213 or an inverse transform residual block 213.
[0117] The reconstruction unit 214 (for example, a summer 214) is configured to add the inverse transform block 213 (that is, a reconstructed residual block 213) to the prediction block 265 to obtain a reconstructed block 215 in the sample domain, for example, by adding sample values of the reconstructed residual block 213 and the sample values of the prediction block 265.
[0118] For example, a buffer unit 216 (or a “buffer” 216), for example, a line buffer 216, is configured to buffer or store the reconstructed block 215 and a corresponding sample value, for example, for intra prediction. In other embodiments, the encoder may be configured to use unfiltered reconstructed blocks and / or corresponding sample values stored in the buffer unit 216 for any type of estimation and / or prediction, for example, intra prediction.
[0119] The loop filter unit 220 (or “loop filter” 220) is configured to filter the reconstructed block 215 to obtain the filtered block 221, to smooth pixel transition or improve video quality. The DPB 230 may be a reference picture memory that stores reference picture data for use in video dataencoding by the encoder 20. The DPB 230 may be formed by any one of a variety of memory devices, such as a DRAM (including a synchronous DRAM (SDRAM), a magnetoresistive RAM (MRAM), and a resistive RAM (RRAM)), or another type of memory devices. The DPB 230 and the buffer 216 may be provided by a same memory device or separate memory devices. In an example, the DPB 230 is configured to store the filtered block 221. The DPB 230 may be further configured to store other previously filtered blocks, for example, previously reconstructed and filtered blocks 221, of the same current picture or of different pictures, for example, previously reconstructed pictures, and may provide complete previously reconstructed, namely, decoded, pictures (and corresponding reference blocks and samples) and / or a partially reconstructed cunent picture (and corresponding reference blocks and samples), for example, for inter prediction. In an example, if the reconstructed block 215 is reconstructed without in-loop filtering, the DPB 230 is configured to store the reconstructed block 215.
[0120] The prediction processing unit 260, also referred to as a block prediction processing unit 260, is configured to receive or obtain the image block 203 (a current image block 203 of the current picture 201) and reconstructed picture data, for example, reference samples of the same (current) picture from the buffer 216 and / or reference picture data 231 of one or more previously decoded pictures from the DPB 230, and to process such data for prediction, namely, to provide the prediction block 265 that may be an inter prediction block 245 or an intra prediction block 255.
[0121] The mode selection unit 262 may be configured to select a prediction mode (for example, an intra or inter prediction mode) and / or a corresponding prediction block 245 or 255 to be used as the prediction block 265, for calculation of the residual block 205 and for reconstruction of the reconstructed block 215.
[0122] The prediction processing unit 260 may be further configured to partition the image block 203 into smaller block partitions or subblocks, for example, by iteratively using quadtree (QT) partitioning, binary-tree (BT) partitioning, triple-tree (TT) partitioning, or any combination thereof, and perform, for example, prediction on each of the block partitions or subblocks. Mode selection includes selection of a tree structure of the partitioned image block 203 and selection of a prediction mode used for each of the block partitions or subblocks.
[0123] The inter prediction unit 244 may include a motion estimation (ME) unit (not shown in FIG. 2) and a motion compensation (MC) unit. The motion estimation unit is configured to receive or obtain the picture image block 203 (the current picture image block 203 of the current picture 201) and the decoded picture 231, or at least one or more previously reconstructed blocks, such as one or more reconstructed blocks of other / different previously decoded pictures 231, to perform motion estimation based on the determined inter prediction mode. For example, a video sequencemay include the current picture and the previously decoded pictures 231, or in other words, the current picture and the previously decoded pictures 231 may be a part of or form a sequence of pictures forming a video sequence.
[0124] The intra prediction unit 254 is configured to obtain, for example, receive, the picture block 203 (the current picture block) and one or more previously reconstructed blocks, for example, reconstructed neighbor blocks, of the same picture for intra estimation. The encoder 20 may be, for example configured to select an intra prediction mode from a plurality of (predetermined) intra prediction modes.
[0125] In one or more embodiments, the encoder 20 may be configured to select the intra prediction mode based on an optimization criterion, for example, based on a minimum residual (for example, an intra prediction mode providing the prediction block 255 that is most similar to the current picture block 203) or minimum rate distortion.
[0126] The intra prediction unit 254 is further configured to determine the intra prediction block 255 based on, for example, an intra prediction parameter of the selected intra prediction mode. In any case, after selecting an intra prediction mode for a block, the intra prediction unit 254 is further configured to provide the intra prediction parameter, that is, information indicating the selected intra prediction mode for the block, to the entropy encoding unit 270. In an example, the intra prediction unit 254 may be configured to perform any combination of intra prediction technologies.
[0127] The entropy encoding unit 270 is configured to apply an entropy encoding algorithm or scheme (for example, a variable length coding (VLC) scheme, a context adaptive VLC (CAVLC) scheme, an arithmetic coding scheme, context adaptive binary arithmetic coding (CABAC), syntax-based CABAC (SBAC), probability interval partitioning entropy (PIPE) coding, or another entropy encoding method or technology) to a single one or all (or none) of the quantized residual coefficients 209, the inter prediction parameter, the intra prediction parameter, and / or the loop filter parameter to obtain encoded picture data 21 that can be output by an output 272, for example, in a form of an encoded data 21. The encoded data may be transmitted to the decoder 30 or archived for later transmission or retrieval by the decoder 30. The entropy encoding unit 270 may be further configured to entropy encode another syntax element for a current video slice being encoded.
[0128] FIG. 3 is a schematic / conceptual block diagram of an example of a decoder 30 configured to implement one or more embodiments of the present disclosure. The decoder 30 is configured to receive, for example, encoded picture data (for example, the encoded data) 21 encoded by the encoder 20 to obtain a decoded picture 331. During decoding, the decoder 30 receives video data from the encoder 20, for example, an encoded video encoded data representing a picture block of an encoded video slice and an associated syntax element.
[0129] In the example of FIG. 3, the decoder 30 includes an entropy decoding unit 304, an inverse quantization unit 310, an inverse transform processing unit 312, a reconstruction unit 314 (for example, a summer 314), a buffer 316, a loop filter 320, a DPB 330, and a prediction processing unit 360. The prediction processing unit 360 may include an inter prediction unit 344, an intra prediction unit 354, and a mode selection unit 362. In some examples, the decoder 30 may perform a decoding process substantially inverse to an encoding process performed by the encoder 20 described above with reference to FIG. 2.
[0130] The entropy decoding unit 304 is configured to perform entropy decoding on the encoded picture data 21 to obtain, for example, quantized coefficients 309 and / or decoded coding parameters, for example, any one or all of an inter prediction parameter, an intra prediction parameter, a loop filter parameter, and / or another syntax element (decoded). The entropy decoding unit 304 is further configured to forward the inter prediction parameter, the intra prediction parameter, and / or the other syntax element to the prediction processing unit 360. The decoder 30 may receive a syntax element at a video slice level and / or a video block level.
[0131] The inverse quantization unit 310 may have a same function as the inverse quantization unit 210, the inverse transform processing unit 312 may have a same function as the inverse transform processing unit 212, the reconstruction unit 314 may have a same function as the reconstruction unit 214, the buffer 316 may have a same function as the buffer 216, the loop filter 320 may have a same function as the loop filter 220, and the DPB 330 may have a same function as the DPB 230.
[0132] The prediction processing unit 360 may include an inter prediction unit 344 and an intra prediction unit 354. The inter prediction unit 344 may resemble the inter prediction unit 244 in function, and the intra prediction unit 354 may resemble the intra prediction unit 254 in function. The prediction processing unit 360 is usually configured to perform block prediction and / or obtain a prediction block 365 from the encoded data 21, and (explicitly or implicitly) receive or obtain a prediction-related parameter and / or information about a selected prediction mode, for example, from the entropy decoding unit 304.
[0133] The prediction processing unit 360 is configured to determine prediction information for a video block of the current video slice by parsing the motion vector and the other syntax element, and use the prediction information to generate the prediction block for the current video block being decoded. In one example of the present disclosure, the prediction processing unit 360 uses some of the received syntax elements to determine a prediction mode (for example, intra or inter prediction) for encoding video blocks of the video slice, an inter prediction slice type (for example, a B slice, a P slice, or a generalized P / B (GPB) slice), construction information for one or more ofthe reference picture lists for the slice, a motion vector for each inter-encoded video block of the slice, an inter prediction status for each inter-encoded video block of the slice, and other information, to decode the video blocks in the current video slice. In another example of this disclosure, a syntax element received by the decoder 30 from encoded data includes a syntax element in one or more of an adaptive parameter set (APS), a sequence parameter set (SPS), a picture parameter set (PPS), or a slice header.
[0134] The inverse quantization unit 310 may be configured to inversely quantize (namely, dequantize) quantized transform coefficients provided in the encoded data and decoded by the entropy decoding unit 304. An inverse quantization process may include using a quantization parameter calculated by the encoder 20 for each video block in the video slice, to determine a degree of quantization to be applied and also determine a degree of inverse quantization to be applied.
[0135] The inverse transform processing unit 312 is configured to apply an inverse transform (for example, an inverse DCT, an inverse integer transform, or a conceptually similar inverse transform process) to transform coefficients to generate residual blocks in a pixel domain.
[0136] The reconstruction unit 314 (for example, the summer 314) is configured to add an inverse transform block 313 (that is, a reconstructed residual block 313) to the prediction block 365 to obtain a reconstructed block 315 in a sample domain, for example, by adding sample values of the reconstructed residual block 313 and sample values of the prediction block 365.
[0137] The loop filter unit 320 (in a coding loop or after the coding loop) is configured to filter the reconstructed block 315 to obtain a filtered block 321, to smooth pixel transition or improve video quality. In an example, the loop filter unit 320 may be configured to perform any combination of filtering technologies described below. The loop filter unit 320 is intended to represent one or more loop filters including a de-blocking filter, a SAO filter, and another filter, for example, a bilateral filter, an ALF, a sharpening or smoothing filter, or a collaborative filter. Although the loop filter unit 320 is shown in FIG. 3 as an in-loop filter, the loop filter unit 320 may be implemented as a post-loop filter in other configurations.
[0138] The decoded video blocks 321 in a given frame or picture are then stored in the DPB 330 that stores reference pictures used for subsequent motion compensation.
[0139] The decoder 30 is configured to, for example, output the decoded picture 31 by using an output 332, for presentation to a user or viewing by a user.
[0140] It is understood that, in the encoder 20 and the decoder 30 in the present disclosure, a processing result of a specific phase may be further processed and then output to the next phase. For example, after interpolation filtering, motion vector derivation or loop filtering, a furtheroperation, such as clip or shift, may be performed on the processing result of a corresponding phase.
[0141] As mentioned above, the transform used in video coding may include DCT or DST. The transform used in video coding may further include wavelet transform. The wavelet transform is a localized transform that may perform localized and multi-scale analysis on images, focusing on detailed changes of image signals. It is suitable for image coding tasks.
[0142] A video codec suitable for wavelet transform may be provided according to embodiments of the present disclosure, which may independently perform video coding on low-frequency subbands and high-frequency subbands, effectively reducing video coding complexity and improving video coding efficiency. For example, an image is decomposed into a low-frequency subband and high-frequency subbands through the wavelet transform, and the low-frequency subband and the high-frequency subbands are encoded to generate a low-frequency subband bitstream and a high-frequency subband bitstream respectively. The low-frequency subband may be understood as a subimage representing a low-frequency signal (or low-frequency information) of an original image, and the high-frequency subbands may be understood as subimages representing high-frequency signals (or high-frequency information) of the original image. It is noted that the subband may be further performed with the wavelet transform to obtain a low-frequency subband and high-frequency subbands. That is, the wavelet transform is performed recursively.
[0143] FIG. 4 is a schematic / conceptual block diagram of an example of an encoder 40 configured to implement one or more embodiments of the present disclosure. In an example of FIG. 4, the encoder 40 may include, but is not limited to, a subfigure partitioning unit 410, a wavelet forward transform unit 420, a low-frequency subband processing path 430, and a high-frequency subband processing path 440.
[0144] The subfigure partitioning unit 410 is used to obtain a current figure and partition the current figure to obtain at least one subfigure. The subfigure partitioning unit 410 partitions the cunent figure into N subfigures in a subfigure partitioning manner, where N is an integer greater than 0 (or greater than 1). The subfigure partitioning manner may include, but is not limited to, at least one of the following:
[0145] a width and / or height of the subfigure being a multiple of 128;
[0146] a maximum width of the subfigure being 1024 pixels;
[0147] a minimum height and / or width of the subfigure being 256 pixels;
[0148] a resolution of the original figure being less than or equal to 1080p, where N is an integer greater than 1 and less than or equal to 8; or
[0149] a length of the original figure being greater than or equal to 4320 pixels, and a width of the original figure being greater than or equal to 2160 pixels, where N is an integer greater than 1 and less than or equal to 16; or
[0150] the length of the original figure being greater than or equal to 7680 pixels, and the width of the original figure being greater than or equal to 4320 pixels, where N is an integer greater than 1 and less than or equal to 32.
[0151] The above numerical values are for illustrative purposes only and may be set according to actual needs.
[0152] FIG. 5 is a schematic diagram of an example of subfigure partitioning. In an example of FIG. 5, the subfigure partitioning unit 410 partitions a figure 401 into m*n subfigures in the subfigure partitioning manner. For example, in this example, a width and height of each subfigure are multiples of 128.
[0153] The subfigure partitioning unit 410 partitions the figure into m*n subfigures in the subfigure partitioning manner. For subfigures whose widths and heights are not multiples of 128, the subfigure partitioning unit 410 may pad these subfigures so that heights and widths of the padded subfigures may be multiples of 16.
[0154] The wavelet forward transform unit 420 is used to perform the wavelet transform (which also may be referred to as wavelet forward transform) on the subfigure to obtain a low-frequency subband and high-frequency subbands. The low-frequency subband includes a low-frequency signal in the subfigure, that satisfy low-frequency filter coefficients, and the high-frequency subbands include high-frequency signals in the subfigure, decomposed by a high-frequency filter in the wavelet transform.
[0155] FIG. 6 is a schematic diagram of an example of a wavelet transform for implementing one or more embodiments of the present disclosure. In an example of FIG. 6, the wavelet forward transform unit 420 obtains the current subfigure, such as subfigure 1_1. The wavelet forward transform unit 420 performs a wavelet transform on the current subfigure. The wavelet transform includes one horizontal wavelet transform and one vertical wavelet transform, so as to obtain wavelet coefficients of a low-low (LL) subband (referred to simply as an LL subband), wavelet coefficients of a low-high (LH) subband (referred to simply as an LH subband), wavelet coefficients of a high-high (HH) subband (referred to simply as an HH subband), and wavelet coefficients of a high-low (HL) subband (referred to simply as an HL subband).
[0156] In embodiments of the present disclosure, the low-frequency subband includes the LL subband, and the high-frequency subbands include the LH subband, the HH subband, and the HLsubband. For example, the LL subband, LH subband, HH subband, and HL subband have a same size (including width and height).
[0157] Referring back to FIG. 4, the low-frequency subband processing path 430 is used to obtain the wavelet coefficients 403 of the low-frequency subband to obtain low-frequency subband encoded data 413. The low-frequency subband processing path 430 includes, but is not limited to, a block partitioning unit 431 (which also may be referred to as a low-frequency subband block partitioning unit 431), a residual calculation unit 432, a prediction unit 437, a control unit 438, a transform / quantization unit 433 (which also may be referred to as a low-frequency subband transform / quantization unit 433), an inverse quantization / inverse transform unit 434 (which also may be referred to as a low-frequency subband inverse quantization / inverse transform unit 434), a low-frequency subband reconstruction unit 435, a low-frequency subband splicing unit 436, a low-frequency subband entropy encoding unit 439.
[0158] The high-frequency subband processing path 440 is used to obtain the high-frequency subbands to obtain high-frequency subband encoded data. The high-frequency subband processing path 440 includes, but is not limited to, a block partitioning unit 431 (which also may be referred to as a high-frequency subband block partitioning unit 431 or a second block partitioning unit 431), a transform / quantization unit 442 (which also may be referred to as a high-frequency subband transform / quantization unit 442, or a second transform / quantization unit 442), and a high-frequency subband entropy encoding unit 443.
[0159] For example, in some instances, the encoder 40 may include more or fewer units or modules than those shown in FIG. 4.
[0160] The following describes an encoding method provided in the present disclosure in detail with reference to the encoder shown in FIG 4.
[0161] The codec receives the figure 401. The description of the figure 401 may be found above and will not be repeated here.
[0162] The subfigure partitioning unit 410 partitions the figure 401 into N subfigures and outputs the partitioned N subfigures, where N is an integer greater than 0. In embodiments of the present disclosure, each subfigure is independently encoded and decoded. During the encoding process, the subfigure 402 may be called the current subfigure or the subfigure to be encoded.
[0163] The wavelet forward transform unit 420 performs a wavelet forward transform on the current subfigure to obtain wavelet coefficients 403 of a low-frequency subband (referred to simply as a low-frequency subband) and wavelet coefficients 414 of high-frequency subbands (referred to simply as the high-frequency subbands) of the current subfigure. The wavelet coefficients 403 of the low- frequency subband include the wavelet coefficients of the LL subband,and the high-frequency subbands include the wavelet coefficients of the LH subband, the wavelet coefficients of the HL subband, and the wavelet coefficients of the HH subband. In embodiments of the present disclosure, each subfigure of the figure may be independently encoded and decoded, and the high-frequency subbands and the low-frequency subband of each subfigure are independently encoded and decoded. The LH subband, the HL subband, and the HH subband in the high-frequency subbands may be independently encoded and decoded.
[0164] The block partitioning unit 431 (which may be referred to the low-frequency subband block partitioning unit) is used to obtain the wavelet coefficients 403 of the low-frequency subband of the current subfigure 402 to obtain at least one macroblock 404 of the low-frequency subband of the subfigure 402. The macroblock may be understood as a collection of partial coefficients in the wavelet coefficients of the low-frequency subband.
[0165] The block partitioning unit 431 partitions the wavelet coefficients 403 of the low-frequency subband of the current subfigure 402 into at least one macroblock 404 of the low-frequency subband of the current subfigure in a block partitioning manner, for example, M macroblocks, where M is an integer greater than 0 (or greater than 1). The low-frequency block partitioning unit 431 outputs the macroblocks 404 of the wavelet coefficients 403 of the current low- frequency subband one by one to the residual calculation unit 432 and the control unit 438.
[0166] In embodiments of the present disclosure, the macroblock 404 is a basic video coding unit. During the encoding process, the macroblock 404 may be referred to as a current block, a cunent figure block, a macroblock 404 to be encoded, a block to be encoded, a figure block to be encoded, etc.
[0167] For example, the block partitioning manner includes, but is not limited to the following.
[0168] The wavelet coefficients 403 of the low-frequency subband are partitioned into macroblocks 404 of 8 x 8 (in pixels) as a basic encoding unit.
[0169] For example, as mentioned above, each subband takes the macroblock 404 as the basic encoding unit. The current macroblock 404 to be encoded is referred to as the current macroblock 404. The low- frequency subband processing path 430 encodes each macroblock 404 of the wavelet coefficients 403 of the low-frequency subband block by block. For example, encoding and prediction are performed on each macroblock 404. The following only describes the encoding process of the current macroblock 404, and processing of other macroblocks is the same, which will not be repeated therein. For example, during encoding, it refers to a macroblock currently being encoded; and during decoding, it refers to a macroblock currently being decoded. A decoded macroblock in a reference figure used to predict the current macroblock 404 is referred to as a reference block (i.e., a low-frequency subband reconstruction block 409). That is, the referenceblock is a block that provides a reference signal for the current block. The reference signal represents pixel values in the macroblock 404. A block in the reference figure that provides a prediction signal for the current block is referred to as a prediction block 405. The prediction signal represents the pixel values, sample values, or sampling signals in the prediction block 405. For example, after traversing a plurality of reference blocks, an optimal reference block is found. This optimal reference block will provide prediction for the current block, and is referred to as the prediction block 405.
[0170] Referring back to FIG. 4, the residual calculation unit 432 is used to obtain the current macroblock 404 and the prediction block 405 (details of the prediction block 405 will be provided below) to obtain a residual block 406. The residual calculation unit 432 performs residual calculation on the current macroblock 404 and the prediction block 405 to obtain the residual block 406. The residual calculation unit 432 outputs the residual block 406 to the transform / quantization unit 433.
[0171] The transform / quantization unit 433 is used to obtain the residual block 406, so as to obtain a residual quantization block 407. The transform / quantization unit 433 performs transform and / or quantization processing on the residual block 406 to obtain the residual quantization block 407, which may also be referred to as a quantized residual block. The residual quantization block 407 includes quantization coefficients of the residual block 406.
[0172] The transform / quantization unit 433 outputs the residual quantization block 407 to the inverse quantization / inverse transform unit 434 and the low-frequency subband entropy encoding unit 439.
[0173] The inverse quantization / inverse transform unit 434, also referred to as the dequantization / reverse transform unit, is used to obtain residual coefficients 407 to obtain a reconstructed residual block 408. The inverse quantization / inverse transform unit 434 performs inverse quantization and / or inverse transform processing on the residual quantization block 407 to obtain the reconstructed residual block 408, which may also be referred to as an inverse quantized residual block. The reconstructed residual block 408 includes inverse quantized coefficients of the residual block 406. The inverse quantization / inverse transform unit 434 outputs the reconstructed residual block 408 to the low-frequency subband splicing unit 436.
[0174] The inverse quantization / inverse transform unit 434 may include an inverse quantization unit and an inverse transform unit (not shown in FIG. 4). The inverse quantization unit is used to perform inverse quantization on the input coefficients, and the inverse transform unit is used to perform inverse transform on the input coefficients.
[0175] The low-frequency subband reconstruction unit 435 is used to obtain a low-frequency subband reconstruction block 409 based on the prediction block 405 and the reconstructed residual block 408. The low- frequency subband reconstruction unit 435 adds the reconstructed residual block 408 to the prediction block 405 to obtain the low-frequency subband reconstruction block 409, which may also be referred to as a reconstructed low-frequency subband macroblock. For example, the low-frequency subband reconstruction unit 435 outputs the low- frequency subband reconstruction block 409 to the prediction unit 437 and the low-frequency subband splicing unit 436. For example, the low-frequency subband reconstruction unit 435 outputs the low-frequency subband reconstruction block 409 to the control unit 438.
[0176] The low-frequency subband splicing unit 436 is used to obtain a reconstructed low-frequency subband 411 based on the low-frequency subband reconstruction block 409, which may also be referred to as reconstructed values or reconstructed data of the low-frequency subband. For example, the low-frequency subband splicing unit 436 outputs the reconstructed low-frequency subband 411 to the prediction unit 437. For example, the low-frequency subband splicing unit 436 outputs the reconstructed low-frequency subband 411 to the control unit 438.
[0177] As mentioned above, the low-frequency subband takes the macroblock as the basic encoding unit. The low-frequency subband splicing unit 436 may obtain M low-frequency subband reconstruction blocks of the low-frequency subband. The low-frequency subband splicing unit 436 may reconstruct a corresponding low-frequency subband based on the M low-frequency subband reconstruction blocks, that is, may obtain the reconstructed low-frequency subband 411.
[0178] The control unit 438 is used to obtain control information 418 and output the control information 418 to the low-frequency subband entropy encoding unit 439. For example, the control information 418 may include, but is not limited to, mode information 412. The control unit 438 may determine the mode information 412 based on the macroblock 404 (i.e., the current block), or may determine the mode information 412 based on the current macroblock 404, the low-frequency subband reconstruction block 409, and the reconstructed low-frequency subband 411.
[0179] The mode information may also be referred to as prediction mode information, etc. The mode information is used to indicate a prediction mode (or prediction manner) of the prediction unit 437, such as inter-frame or intra-frame prediction mode. The control unit 438 may output the mode information 412 to the prediction unit 437.
[0180] The prediction unit 437, also referred to as a prediction processing unit, is used to obtain the mode information 412 and perform prediction processing based on the mode information 412. The prediction unit 437 may select the prediction mode based on the mode information 412. In an example, the prediction unit 437 may obtain the low-frequency subband reconstruction block 409based on the mode information 412, so as to obtain the prediction block 405. The prediction unit 437 may perform intra-frame prediction based on the low-frequency subband reconstruction block 409 to obtain the prediction block 405. In another example, the prediction unit 437 may obtain the reconstructed low-frequency subband 411 based on the mode information 412, so as to obtain the prediction block 405.
[0181] The prediction unit 437 outputs the prediction block 405 to the residual calculation unit 432 and the low-frequency subband splicing unit 436.
[0182] The low-frequency subband entropy encoding unit 439 is used to obtain the low-frequency subband encoded data 413 (which may also be referred to as an encoded low-frequency subband) based on the quantized residual block 407 and the mode information 412. The low-frequency subband entropy encoding unit 439 uses entropy encoding algorithms or schemes (e.g., VLC scheme, CAVLC scheme, arithmetic coding scheme, CABAC, SBAC, PIPE coding, or other entropy encoding methods or techniques) to perform entropy encoding on the quantized residual block 407 and the mode information 412 to obtain the low-frequency subband encoded data 413, which is output in a form of an encoded bitstream.
[0183] Referring again to FIG. 4, the block partitioning unit 441, also referred to as a high-frequency subband block partitioning unit, is used to obtain high-frequency subbands of the current subfigure 402 to obtain at least one macroblock 415 of the high-frequency subbands of the subfigure 402. The specific description may refer to the low-frequency subband part and will not be repeated here. The block partitioning unit 441 partitions the high-frequency subbands 414 of the current subfigure 402 (hereinafter referred to as current high-frequency subbands) into at least one macroblock 415 of the current subfigure 402 based on the block partitioning manner, for example, M macroblocks, where M is an integer greater than 0 (or greater than 1). Other parts not described can refer to the relevant description of the block partitioning unit 431 and will not be repeated herein.
[0184] The block partitioning unit 441 outputs the macroblocks of the current high-frequency subbands one by one to the quantization / transform unit 442.
[0185] The transform / quantization unit 442 is used to perform transform and / or quantization processing on the macroblock 415 to obtain quantized coefficients 416 of the high-frequency subband block (i.e., quantized coefficients of the current macroblock). The transform / quantization unit 442 outputs the quantized coefficients 416 of the high-frequency subband block to the high-frequency subband entropy encoding unit 443.
[0186] The high-frequency subband entropy encoding unit 443 is used to perform entropy encoding on the data to be encoded to obtain the high-frequency subband encoded data 417. Thedata to be encoded may include, but is not limited to, quantized coefficients and syntax elements of each high-frequency subband block in the high-frequency subbands. The high-frequency subband encoded data 417 includes, but is not limited to, HH subband encoded data, HL subband encoded data, LH subband encoded data.
[0187] The high-frequency subband entropy encoding unit 443 uses entropy encoding algorithms or schemes to encode the data to be encoded. The entropy encoding schemes may include, for example, at least one encoding scheme of VLC scheme, CAVLC scheme, arithmetic coding scheme, or CABAC scheme.
[0188] The video coding method provided in the present disclosure supports both full I-frame configuration and I / P frame alternate encoding configuration. An architecture of the encoder shown in FIG. 4 adds relevant modules required for the prediction process on the basis of the wavelet transform architecture, which may improve compression efficiency of I / P frame alternate encoding for scenarios such as fixed camera positions and slow camera movements.
[0189] For example, the encoder 40 may further include, but is not limited to, a combination unit (not shown in FIG. 4), which may also be called a multiplexer (MUX), etc. The combination unit is used to generate a figure bitstream based on the low-frequency subband encoded data and the high-frequency subband encoded data.
[0190] The combination unit writes the low-frequency subband encoded data 413 into the figure bitstream, and writes the high-frequency subband encoded data 417 into the figure bitstream. In embodiments of the present disclosure, the low-frequency subband and the high-frequency subbands are encoded separately, so that the low-frequency subband encoded data and the high-frequency subband encoded data may be independently decoded. That is, at a decoding side, it may independently decode the low-frequency subband encoded data and the high-frequency subband encoded data in the figure bitstream, thereby improving decoding efficiency.
[0191] FIG. 7 A is a schematic / conceptual block diagram of an example of a decoder for implementing one or more embodiments of the present disclosure. In an example of FIG. 7A, for example, the decoder receives the figure bitstream encoded by the encoder to obtain a decoding figure of the original figure, which may also be referred to as a decoded figure, a reconstructed figure, etc. During a decoding process, the decoder receives the figure bitstream from the encoder, which may include, but is not limited to, figure header information and figure data.
[0192] In the example shown in FIG. 7A, the decoder includes, but is not limited to, a low- frequency subband processing path 710, a high-frequency subband processing path 720, an inverse wavelet transform unit 730, a figure combination unit 740 (which may also be referred to as a figure splicing unit or a figure composition unit).
[0193] For example, the low-frequency subband processing path 710 is used to obtain low-frequency subband encoded data in order to obtain a reconstructed low-frequency subband 706 (which may also be referred to as a decoded low-frequency subband). The low-frequency subband processing path 710 includes, but is not limited to, a low-frequency subband entropy decoding unit 711, an inverse quantization / inverse transformation unit 712 (which may also be referred to as a low-frequency subband inverse quantization / inverse transformation unit), a low-frequency subband reconstruction unit 713, a low-frequency subband splicing unit 715, a prediction unit 714.
[0194] The high-frequency subband processing path 720 is used to obtain high-frequency subband encoded data to obtain a reconstructed high-frequency subband 731, which may also be referred to as reconstructed values of the high-frequency subbands or reconstructed data of the high-frequency subbands, etc., including but not limited to, a high-frequency subband entropy decoding unit 721, an inverse quantization / inverse transformation unit 722 (which may also be referred to as a high-frequency subband inverse quantization / inverse transformation unit), a high-frequency subband reconstruction unit 723.
[0195] In some instances, the decoder shown in FIG. 7A may perform a decoding process substantially inverse to the encoding process performed by the encoder described with reference to FIG. 4.
[0196] The following describes the decoding method in the embodiments of the present disclosure in detail with reference to the decoder 70 shown in FIG. 7A.
[0197] For example, the decoder 70 may obtain the high-frequency subband encoded data and the low-frequency subband encoded data in the figure bitstream based on figure header information in the figure bitstream. Furthermore, as described above, the encoder uses the macroblock as the basic encoding unit during the encoding process, and accordingly, the decoder also uses the macroblock (for example, the encoded macroblock) as the basic decoding unit for decoding during the decoding process.
[0198] For example, the low-frequency subband entropy decoding unit 711 performs entropy decoding on the low- frequency subband encoded data 701 in the figure bitstream, and uses the macroblock as the basic decoding unit to obtain syntax elements and quantized coefficients 702 of the low-frequency subband block (i.e., quantized coefficients of the current macroblock). The description of the quantized coefficients 702 of the low-frequency subband may refer to the encoder side, which is not repeated herein. The low-frequency subband entropy decoding unit 711 obtains the encoded macroblocks of the low- frequency subband (for example, the LL subband) in each subfigure in the figure bitstream (i.e., the encoded data of the macroblocks), and performs entropy decoding on each encoded macroblock to obtain the quantized coefficients 702 and syntaxelements of the low-frequency subband corresponding to each encoded macroblock (which may be simply referred to as the quantized coefficients of the macroblock of the low-frequency subband). During the decoding process, the encoded macroblock that is currently decoded may be referred to as the current block.
[0199] The low-frequency subband entropy decoding unit 711 is used to output the quantized coefficients 702 of the low-frequency subband blocks to the inverse quantization / inverse transformation unit 712, and to output the mode information 412 to the prediction unit 714.
[0200] The inverse quantization / inverse transformation unit 712 is used to obtain the quantized coefficients 702 of the low-frequency subband blocks, in order to obtain the inverse quantized coefficients 703 of the low-frequency subband blocks. It may also be the inverse transformation coefficients of the current block of the low-frequency subband (depending on whether inverse transformation processing has been performed). The inverse quantization / inverse transformation unit 712 performs inverse quantization, or inverse quantization and inverse transformation on the quantized coefficients of the current block of the low-frequency subband, to obtain the inverse quantization coefficients of the current block of the low-frequency subband. The inverse quantization / inverse transformation unit 712 outputs the inverse quantization coefficients 703 of the low- frequency subband blocks (e.g., the inverse quantization coefficients of the current block of the low-frequency subband) to the low-frequency subband reconstruction unit 713.
[0201] The low-frequency subband reconstruction unit 713 is used to obtain the low-frequency subband reconstruction block 704 based on the quantization coefficients 703 of the low-frequency subband and the prediction block 705, which may also be referred to as reconstruction coefficients of the low-frequency subband block. The low-frequency subband reconstruction unit 713 adds a prediction block to the quantization coefficients of the current block of the low-frequency subband to obtain the low-frequency subband reconstruction block 704 corresponding to the current macroblock.
[0202] The prediction unit 714 is used to obtain the mode information 412 and performs corresponding prediction processing according to the mode information 412. For example, intra¬ frame prediction may be performed based on the low-frequency subband reconstruction block 704, or inter-frame prediction may be performed based on the reconstructed low-frequency subband 706. The execution manner may refer to the encoding side, which is not repeated herein. The prediction unit 714 outputs the prediction block 705 to the low- frequency subband reconstruction block 704.
[0203] For example, the high-frequency subband entropy decoding unit 721 obtains the high- frequency subband encoded data (e.g. syntax elements) 707 in the figure bitstream, and uses themacroblock as the basic decoding unit to obtain quantized coefficients 708 of each high-frequency subband block in the high-frequency subband (as the quantized coefficients of the current macroblock). The high-frequency subband entropy decoding unit 721 performs entropy decoding on the current block of the high-frequency subband encoded data 707 to obtain the quantized coefficients of the current block of the high-frequency subband. For example, control information (such as including mode information 412) corresponding to the current block may further be obtained based on entropy decoding. The high-frequency subband entropy decoding unit 721 outputs the quantized coefficients 708 of the high-frequency subband block to the inverse quantization / inverse transformation unit 722.
[0204] The inverse quantization / inverse transformation unit 722, also called the high-frequency subband inverse quantization / inverse transformation unit, is used to obtain the quantized coefficients 708 of the high-frequency subband blocks to obtain the reconstruction coefficients 709 of the high-frequency subband blocks. The reconstruction coefficients may be dequantized coefficients after dequantization processing, or inverse transformation coefficients after dequantization and inverse transformation processing.
[0205] The high-frequency subband reconstruction unit 723 (also referred to as the high-frequency subband splicing unit) is used to obtain the reconstruction coefficients 709 of the high-frequency subband blocks to obtain reconstructed high-frequency subbands 731, which may also be referred to as reconstructed values of the high-frequency subbands or reconstructed data of the high-frequency subbands, etc. The high-frequency subband reconstruction unit 723 may obtain reconstruction coefficients corresponding to each macroblock of the high-frequency subbands, i.e., the reconstructed high-frequency subband block. The high-frequency subband reconstruction unit 723 may splice the obtained macroblocks to obtain corresponding high-frequency subbands. The reconstructed high-frequency subbands for example include a reconstructed HL subband (for example, reconstruction coefficients of the HL subband), a reconstructed HH subband (for example, reconstruction coefficients of the HH subband), a reconstructed LH subband (for example, reconstruction coefficients of the LH subband).
[0206] The inverse wavelet transform unit 730 is used to obtain the reconstructed high-frequency subbands 731 and the reconstructed low-frequency subband 706, in order to obtain the reconstructed subfigure 732. The inverse wavelet transform unit 730 obtains the reconstructed low-frequency subband 706 output by the low-frequency subband splicing unit 715, as well as the reconstructed high-frequency subbands 731 output by the high-frequency subband reconstruction unit 723, and performs wavelet inverse transformation on the reconstructed low- frequency subband 706 and the reconstructed high-frequency subbands 731 to obtain the reconstructedsubfigure 732. The inverse wavelet transform unit 730 outputs the reconstructed subfigure 732 to the figure combination unit740.
[0207] The figure composition unit 740 is used to obtain the reconstructed subfigure 732, in order to obtain the reconstructed figure 733 of the original figure, which may also be referred to as the decoding figure or the decoded figure, etc. The figure composition unit 740 may obtain N reconstructed subfigures (N being an integer greater than 0) of the figure (referring to the original figure), and splice (or combine) the N reconstructed subfigures in the partitioning manner (including size and position) of each reconstructed subfigure during encoding, in order to obtain the reconstructed figure 733.
[0208] For example, after obtaining the reconstructed figure, the figure composition unit 740 may determine whether the reconstructed figure includes padding based on the figure size information in the figure header information and the size information of the current reconstructed figure. In one example, if the size of the current reconstructed figure is the same as a size indicated by the figure size information (i.e., the same as a size of the original figure), the figure composition unit 740 may send the reconstructed figure to the display device. In this case, sizes of the displayed figure, the original figure, and the reconstructed figure are the same. In another example, if the size of the current reconstructed figure is different from the size indicated by the figure size information (e.g., larger than the size of the original figure), the figure composition unit 740 may remove the padding parts of the current reconstructed figure based on the size indicated by the figure size information to obtain the displayed figure. The size of the displayed figure is the same as the size of the original figure. For example, the decoder is used to, for example, output the reconstructed figure via an output port (or output interface) of the decoder for presentation to the user or for viewing by the user.
[0209] Other variations of the decoder may be used to decode the compressed figure bitstream.
[0210] FIG. 7B is a schematic / conceptual block diagram of an example decoder for implementing one or more embodiments of the present disclosure. In this example, the inverse wavelet transform unit 730 is used to obtain the reconstructed coefficients 709 of the high-frequency subband block (i.e., the high-frequency subband reconstruction block) and the low-frequency subband reconstruction block 704 output by the low-frequency subband reconstruction block unit 713, and performs an inverse wavelet transform on the high-frequency subband reconstruction block (e.g., including the HH subband reconstructed block, HL subband reconstructed block, LH subband reconstructed block) and the low-frequency subband reconstruction block 704 to obtain the reconstructed block 734, which is the reconstructed block of the current subfigure and may alsobe referred to as the reconstructed data or reconstructed values of the current block of the current subfigure.
[0211] The inverse wavelet transform unit 730 outputs the reconstructed block 734 to the subfigure composition unit 750. The subfigure composition unit 750 may obtain the reconstructed subfigure 732 of the current subfigure based on at least one reconstructed block corresponding to the current subfigure, which may also be referred to as the reconstructed values or reconstructed data of the current subfigure, etc. The undescribed parts of FIG. 7B may refer to FIG. 7A, and will not be repeated herein.
[0212] The bitstream output by the encoder in the embodiments of the present disclosure will be described in detail below. A bitstream structure described below may be applied to the encoder shown in FIG. 4, and of course, it may also be applied to other variations of the encoder based on FIG. 4.
[0213] FIG. 8 is a schematic diagram of a structure of an example of a figure bitstream. In an example of FIG. 8, the figure bitstream includes, but is not limited to, figure header information and figure data (which may also be referred to as figure data region(s)).
[0214] For example, the figure data includes at least one figure data region (which may also be referred to as figure data subregion). For example, the at least one figure data region includes, but not limited to, a first figure data region and a second figure data region. During the encoding process, the encoder (e.g., via the composition unit) writes the high-frequency subband encoded data and the low-frequency subband encoded data into the figure bitstream. The encoder writes the high-frequency subband encoded data into the first figure data region and writes the low-frequency subband encoded data into the second figure data region. A writing order of the encoded data is only an illustrative example and will not be repeated below.
[0215] For example, the figure header information includes, but is not limited to, offset information and figure size information.
[0216] For example, the figure size information is used to indicate the size of the original figure. As described above, during the encoding process, some subfigures may be padded during the subfigure partitioning process to ensure that the length and width of each subfigure are multiples of 16. Thus, during decoding, the size of the reconstructed figure obtained by the decoder may be larger than the size of the original figure. The decoder may process the reconstructed figure based on the figure size information to remove the padding parts of the reconstructed figure.
[0217] For example, the offset information is used to indicate a position of the data region in the figure bitstream, which may also be understood as indicating a position of the independently decodable encoded data in the figure bitstream. When the encoded data (i.e., the figure bitstream)is decoded according to the present disclosure, the offset information in the figure header information may be used to obtain encoded data that may be independently encoded, and the decoding operation may be performed on the encoded data. The encoded data that may be independently decoded (e.g., the low-frequency subband encoded data and the high-frequency subband encoded data) may be decoded synchronously during decoding to improve decoding efficiency.
[0218] In one example, the offset information may be a length of a figure data region where adjacent encoded data that may be independently decoded in the figure bitstream is located.
[0219] In another example, the offset information may be an offset (i.e., difference) between a starting position of a figure data region where the encoded data that may be independently decoded is located and an end position of the figure header information.
[0220] It is noted that the embodiments of the present disclosure only take a figure bitstream of a single figure as an example. That is, for example, the bitstream includes one figure data. During the encoding process of video figures, the encoder may generate an encoded figure bitstream for each figure. That is, the figure bitstream includes multiple figure data, and each figure data carries encoded data of a corresponding figure.
[0221] In an example shown in FIG. 8, the high-frequency subband encoded data of each subfigure of the figure (including the LH subband encoded data, HH subband encoded data, and HL subband encoded data) are continuously written into the first figure data region.
[0222] For example, as shown in FIG. 8, a subfigure 1-HL-MB0, a subfigure 1-HH-MB0, and a subfigure 1-LH-MB0 are continuously written into the first figure data region. The subfigure 1-HL-MB0 represents an encoded macroblock MB0 of an HL subband of the subfigure 1, the subfigure 1-HH-MB0 represents an encoded macroblock MB0 of an HH subband of the subfigure 1, and the subfigure 1-LH-MB0 represents an encoded macroblock MB0 of an LH subband of the subfigure 1. The figure only shows an encoded data structure of the subfigure 1 in the bitstream, and other subfigures are similar, so they will not be described one by one.
[0223] In this example, during decoding, the decoder side may decode the high-frequency subband encoded data in an order of subfigures, that is, each subfigure in the first figure data region is independently decoded. The low-frequency subband encoded data is decoded in an order of subfigures, that is, each subfigure in the second figure data region is independently decoded. When decoding the first figure data region, the decoder side may decode each encoded macroblock in sequence according to an order of the encoded macroblocks of each subfigure in the region. That is, the three high-frequency subband encoded data of the subfigure 1 are continuously written into the first figure data region. Therefore, during decoding, the three high-frequency subband encodeddata of the subfigure 1 may be decoded one by one to obtain the decoded high-frequency subband. A structure of the LL subband encoded data also takes each subfigure as a granularity, and the encoded data of each subfigure includes the encoded data of the LL subband of each macroblock of the subfigure.
[0224] In the embodiments of the present disclosure, multiple encoded data that may be independently decoded may be decoded simultaneously, or one or more high-frequency subbands may be decoded simultaneously. The number of simultaneous decodings depends on hardware performance of the decoder.
[0225] FIG. 9 is a schematic diagram of a structure of a video coding device 900 (for example, a video encoding device 900 or a video decoding device 900) according to one or more embodiments of the present disclosure. The video coding device 900 is applicable to implementation of one or more embodiments described in this specification. In some embodiments, the video coding device 900 may be a video decoder (for example, the decoder 30 in FIG. 1A) or a video encoder (for example, the encoder 20 in FIG. 1A). In other some embodiments, the video coding device 900 may be one or more components of the decoder 30 in FIG. 1 A or the encoder 20 in FIG. 1 A.
[0226] The video coding device 900 includes an ingress port 910 and a receiver unit (Rx) 920 for receiving data, a processor, a logic unit, or a central processing unit (CPU) 930 for processing the data, a transmitter unit (Tx) 940 and an egress port 950 for transmitting the data, and a memory 960 for storing the data. The video coding device 900 may further include an optical-to-electrical conversion component and an electrical-to-optical (EO) component that are coupled to the ingress port 910, the receiver unit 920, the transmitter unit 940, and the egress port 950, for egress or ingress of optical or electrical signals.
[0227] The processor 930 is implemented by hardware and software. The processor 930 may be implemented as one or more CPU chips, cores (for example, multi-core processors), FPGAS, ASICs, and DSPs. The processor 930 communicates with the ingress port 910, the receiver unit 920, the transmitter unit 940, the egress port 950, and the memory 960. The processor 930 includes a coding module 970 (for example, an encoding module 970 or a decoding module 970). The encoding / decoding module 970 implements the embodiments disclosed in this specification, to implement methods provided in the embodiments of the present disclosure. For example, the encoding / decoding module 970 implements, processes, or provides various coding operations. Therefore, the encoding / decoding module 970 substantially improves functions of the video coding device 900 and affects transform of the video coding device 900 to a different state. Alternatively, the encoding / decoding module 970 is implemented as instructions stored in the memory 960 and executed by the processor 930.
[0228] The memory 960 includes one or more disks, tape drives, and solid-state drives (SSDs) and may be used as an overflow data storage device, to store programs when such programs are selected for execution, and to store instructions and data that are read during program execution. The memory 960 may be volatile and / or non-volatile, and may be a ROM, a RAM, a ternary content-addressable memory (TCAM), and / or a SRAM.
[0229] FIG. 10 is a simplified block diagram of a device 1000 that can be used as any one or two of the source device 12 and the destination device 14 in FIG. 1 A according to one or more example embodiments. The device 1000 may implement the technologies of the present disclosure. In other words, FIG. 10 is a schematic block diagram of some implementations of an encoding device or a decoding device (or a coding device 1000) according to one or more embodiments of the present disclosure. The coding device 1000 may include a processor 1010, a memory 1030, and a bus system 1050. The processor 1010 and the memory 1030 are connected through the bus system 1050. The memory 1030 is configured to store instructions. The processor 1010 is configured to execute the instructions stored in the memory 1030. The memory 1030 of the coding device 1000 stores program code, and the processor 1010 may invoke the program code stored in the memory 1030 to execute various video encoding or decoding methods described in the present disclosure. To avoid repetition, details are not described herein again.
[0230] In some embodiments of the present disclosure, the processor 1010 may be a CPU, or the processor 1010 may be another general-purpose processor, a DSP, an ASIC, an FPGA or another programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, or the like. The general-purpose processor may be a microprocessor, or the processor may be another processor or the like.
[0231] The memory 1030 may include a ROM device or a RAM device. Any other proper type of storage device may also be used as the memory 1030. The memory 1030 may include code and data 1031 accessed by the processor 1010 by using a bus 1050. The memory 1030 may further include an operating system 1033 and an application program 1035, and the application program 1035 includes at least one program that allows the processor 1010 to execute the video encoding or decoding method described in the present disclosure. For example, the application program 1035 may include applications 1 to N, which further include a video encoding or decoding application (referred to as a video coding application) performing the video encoding or decoding method described in the present disclosure.
[0232] In addition to a data bus, the bus system 1050 may further include a power bus, a control bus, a status signal bus, and the like. However, for clear description, various types of buses in the figure are marked as the bus system 1050.
[0233] For example, the coding device 1000 may further include one or more output devices, for example, a display 1070. In an example, the display 1070 may be a touch display that combines a display and a touch unit that operably senses a touch input. The display 1070 may be connected to the processor 1010 through the bus 1050.
[0234] Although the processor 1010 and the memory 1030 of the device 1000 are depicted in FIG.10 as integrated into a single unit, another configuration may be used. Running of the processor 1010 may be distributed in a plurality of machines that can be directly coupled (each machine has one or more processors), or in a local area or another network. The memory 1030 may be distributed in a plurality of machines, such as network-based memories or memories in a plurality of machines running the device 1000. Although only a single bus is depicted herein, the bus 1050 of the device 1000 may be formed by a plurality of buses. Further, the memory 1030 may be directly coupled to another component of the device 1000 or may be accessed through a network, and may include a single integrated unit such as a storage card, or a plurality of units such as a plurality of storage cards. Therefore, the device 1000 may be implemented in a plurality of configurations.
[0235] In order to facilitate the understanding of solutions of embodiments of the present disclosure, some operations in coding may be introduced below.
[0236] 1. Partitioning
[0237] In the partitioning stage, the input video frame is partitioned into smaller, manageable blocks (e.g., macroblocks, coding tree blocks, or coding blocks) for further processing. The partitioning allows for localized processing and optimization of coding techniques. The partitioning may facilitate parallel processing and enable the application of different coding strategies based on the content of each block. The blocks may be in a hierarchy structure. For example, the input video frame is partitioned into coding tree blocks (CTBs), some CTBs are partitioned into variable-size coding units (CUs), some CUs may be further partitioned into variable-size transform blocks (TBs), and some TBs may be further partitioned into subblocks (SBs).
[0238] 2. Prediction
[0239] In video coding, a process of obtaining predicted values of current samples using previously decoded samples, which may include intra prediction and inter prediction. The prediction block or residuals obtained at the prediction stage may be transformed.
[0240] 3. Transform
[0241] In video coding, the term “transform” may refer to an operation that is used to convert a spatial domain (or time domain) representation of video data into a frequency domainrepresentation of the vide data, or into features / characteristics of the video data, where the frequency domain representation of the vide data or the features / characteristics of the video data, may be easier to analyze and process the video data such as compress the video data. The “transform” is designed to exploit statistical redundancies in video content more effectively, and thus effectively represent the video data and process such as compress the video data. This operation is a component of many video compression standards, for example, H.264 / AVC or H.265 / HEVC.
[0242] 4. Quantization
[0243] The quantization may include quantizing transform coefficients obtained from the transform stage to reduce an amount of data needed to represent the frame while maintaining acceptable visual quality. The quantization may reduce the amount of data by discarding less significant information, so that the quantization may reduce the data precision. Therefore, the quantization introduces controlled loss of information to achieve higher compression ratios, thereby achieving a balance between compression efficiency and visual quality.
[0244] 5. Scanning
[0245] The scanning is used to rearrange or reorder a two-dimensional array of coefficients (e.g., transform coefficients obtained from the transform stage or quantization coefficients obtained from the quantization stage) into a one-dimensional sequence to facilitate more efficient entropy coding. The input to the scanning process is a two-dimensional array of coefficients. The output of the scanning process is a one-dimensional sequence of coefficients, which is passed to the entropy coding stage. Scanning methods include: zigzag scanning, diagonal scanning, horizontal, and vertical scanning. When the transform coefficients obtained from the transform stage are scanned, the transform coefficients may bypass the quantization stage and no quantization is performed on the transform coefficients obtained from the transform stage.
[0246] 6. Entropy coding
[0247] Entropy coding is the final step in the video coding process, following prediction, transform, quantization, and scanning. Entropy coding is used to convert a sequence of symbols or syntax elements (such as quantization coefficients, transform coefficients, prediction choices, or block sizes) into a bitstream. Entropy coding may rely on estimating a probability of each symbol. The more accurately probabilities are modeled, the more efficient the coding. In video coding, a probability of a symbol may depend on its context. For example, in CABAC, the context is determined by surrounding symbols. Probability models may be adapted over time to better match actual statistics of the video content. The following are some types of entropy coding.
[0248] 6.1 Huffman Coding
[0249] Huffman coding is a lossless compression algorithm that assigns variable-length codes to symbols based on probabilities of symbols. Huffman coding is to assign shorter codes for symbols with bigger probabilities and longer codes for symbols with smaller probabilities. Huffman coding minimizes an average code length, achieving efficient compression. Huffman coding is effective in scenarios where probabilities of symbols vary significantly. Huffman codes are always integer¬ length and are assigned based on the probabilities of individual symbols. The probability of the symbol may be obtained based on the frequency of occurrence of the symbol, for example, the probability P[i] of the symbol i is obtained by a formula of P[i] = F[i] / N, where F[i] represents the frequency of occurrence of the symbol i, and N represents the total number of symbols in coded data. The probability of the symbol may be obtained by another manner, such as from a precalculated Huffman tree based on some other probabilities. Huffman coding involves straightforward tree construction and code assignment. Huffman coding provides compression gains when the symbol frequency distribution is highly skewed. Below is a detailed introduction for Huffman coding.
[0250] 6.1.1. Frequency Analysis
[0251] The first step of Huffman coding is to analyze the input data (e.g., video frames) to determine a frequency of each symbol. In video coding, symbols may be pixel values, such as transform coefficients, quantization coefficients, or syntax elements like motion vectors and prediction modes. Frequency analysis may not be performed in a case where a precalculated Huffman tree is provided.
[0252] 6.1.2. Building Huffman Tree
[0253] - Create a leaf node for each symbol and assign its frequency as the node’s weight.
[0254] - Combine two nodes with lowest weights into a new parent node, with a sum of their weights as the parent’s weight.
[0255] - Repeat create and combine until all nodes are combined into a single tree (Huffman Tree).
[0256] 6.1.3. Assigning Codes
[0257] Traverse the Huffman tree from the root to each leaf node. Assign a binary code to each symbol based on the path taken: left branches are assigned “0” and right branches are assigned “1”. The resulting codes are variable-length and optimized for the symbol probabilities.
[0258] 6.2. Arithmetic Coding
[0259] Arithmetic coding is used in video coding standards such as H.264, H.265, H.266, AVI. Arithmetic coding is a form of entropy coding that aims to achieve compression by representing sequences of symbols with fewer bits, where symbols with bigger probabilities contribute to less bits and symbols with smaller probabilities contribute to more bits.
[0260] In arithmetic coding, the entire sequence of symbols is represented by a fraction in an interval [0, 1). The fraction is determined by cumulative probabilities of the symbols in the sequence. The bigger probability a symbol, the smaller a range it contributes to the final fraction, and vice versa. This means that sequences of symbols with bigger probabilities may result in smaller fractions, which may be represented with fewer bits when converted to a binary format.
[0261] Unlike simpler coding methods like Huffman coding, which assign a fixed code to each symbol, arithmetic coding codes a message into a single fractional number. In arithmetic coding, the interval [0, 1) is divided into sub-intervals based on the probabilities of the symbols in the message. The size of each sub-interval corresponds to the probability of the symbol it represents. Compared with Huffman coding, arithmetic coding may represent symbols with probabilities that are not powers of two, achieving higher compression ratios.
[0262] The process of arithmetic coding involves several steps as follow.
[0263] Probability Estimation: Determine the probability of each symbol in the source message. These probabilities are used to define the sub-intervals within the interval [0, 1).
[0264] Interval Initialization: Start with the interval [0, 1).
[0265] Encoding: For each symbol in the message, the symbol is encoded in the current interval, and the current interval is updated to the sub-interval corresponding to the symbol after the symbol is encoded. The next interval is scaled by the length of the current interval when the next symbol is encoded. That is, the sub- interval of the symbol may be considered as a full interval [0, 1) for the next symbol’s encoding process.
[0266] Output: The final encoded message is a single number within the final interval. This number may be represented using a binary fraction, and the length of this fraction determines the size of the compressed message. It is noted that decoding is an inverse of encoding.
[0267] H.265 / HEVC uses CAB AC as the entropy coding method. CAB AC efficiently codes syntax elements related to block structures and transform coefficient levels. H.266 / VVC builds on the techniques used in HEVC, further improving the efficiency of entropy coding through advanced context modeling and probability adaptation.
[0268] 6.3. Range Coding
[0269] Range coding is similar to arithmetic coding but with simpler integer arithmetic operations.
[0270] 7. Cumulative Distribution Function (CDF)
[0271] CDF can be used in arithmetic coding. Probabilities of symbols from M-ary alphabet can be represented using CDF. During encoding, CDF helps determine the sub-intervals for each symbol. During decoding, CDF is used to map the encoded numbers back to the original symbols. CDF may be represented as CDF = {c1(c2,..., ck,..., cM-x, cM= 1}, where ck= Pi>ck isacumulative distribution for symbol k, which is a cumulative sum of probabilities of symbols (from symbol 1 to symbol ), pt is a probability of symbol i, and M is the number of symbols. Therefore, the cumulative distribution for symbol 1 is 0 and the cumulative distribution for symbol M is 1. By using CDF and a probability model, entropy coding can efficiently compress data, reducing the number of bits required and thus improving the efficiency of video coding. The probability model is a model or manner for obtaining a probability of a symbol.
[0272] FIG. 11 illustrates a flowchart for processing coefficients according to CDF during an entropy coding phase.
[0273] As illustrated in FIG. 11, the process begins at step 1101 which is the start of processing a block. For the encoder, the processing means encoding the block. For the decoder, the processing means decoding the encoded block.
[0274] In step 1102, a coefficient from the block is taken for processing, such as coefficient i.
[0275] In step 1103, the coefficient such as coefficient i is encoded or decoded using a probability model. In this step, CDF is used to determine a probability for the coefficient. That is, CDF provides a model for a likelihood of a coefficient occurring.
[0276] In step 1104, the encoder or decoder checks if there are more symbols (i.e. coefficients) of the block. If yes, the process loops back to step 1102 to continue processing the next symbol, for example, i = i+1; if no, processing for the block ends.
[0277] 8. Context-Based Adaptation
[0278] Context-based adaptation in entropy coding refers to the process of adjusting probability models based on the context of the data being encoded / decoded. Context-based adaptation enhances the efficiency of entropy coding by better matching the probability models to the actual data characteristics. In the case of arithmetic coding, context-based adaptation means using context information to refine the probability estimates, leading to more accurate and efficient encoding and decoding.
[0279] For example, CABAC, a specific form of context adaptation in arithmetic coding, is widely used in video compression standards such as VVC and HEVC. CABAC may dynamically adapt the probability models based on the context of the data, thereby optimizing the entropy coding process. CABAC improves the compression ratio and image quality while maintaining low computational complexity.
[0280] There are several technologies that disclose context-based adaptation.
[0281] For example, AVI proposes a context-based adaptation model. In 2018, Alliance for Open Media released an open royalty-free video coding standard AVI (“AVI Bitstream & Decoding Process Specification”) which employs an M-ary symbol arithmetic coding method. This approachPC17RU2025 / 000085uses the context-based probability adaptation model that updates cumulative distribution function for each coding symbol. See 8.2.6. Symbol decoding process of AVI.
[0282] For another example, FIG. 12 outlines an encoding process CAB AC which involves updating a probability mode. It is noted that a decoding process may be understood as an inverse of this encoding process.
[0283] As illustrated in FIG. 12, in step 1201, the encoder receives a sequence of syntax elements that need to be encoded. These syntax elements may include quantized transform coefficients, motion vectors, prediction modes, etc.
[0284] In step 1202, the encoder identifies a probability model. In this step, the encoder selects a probability model based on contextual information to estimate a likelihood of each symbol occurring. The context usually comes from previously encoded adjacent syntax element(s).
[0285] In step 1203, the encoder determines the symbol corresponding to the current syntax element based on its context.
[0286] In step 1204, the encoder encodes the symbol using the probability model selected in step 1202. In CABAC, this step may involve binary arithmetic coding. The probability model may be based on CDF. Consider M-ary alphabet entropy coding. Let PMF = {p1(p2< — > Pm> -PM) — probability mass function for symbols m E {1,2,then cumulative distribution function CDF — {Cj, C2< > Cm> ••• >CM-1> Cm ~ Si=i Pi-
[0287] In step 1205, the encoder updates the probability model after coding the symbol based on the encoding outcome, and the updated probability model may be used for coding a next symbol. Following is a rule for adapting the probability model based on the symbols that are being encoded or decoded.
[0288] For update step n and a given symbol k for each symbol m E {1,2,..., Af }, an element cmin CDF is updated by a formula of:_ f cm(n - 1) * (1 - a),m < k cmW cm(n - 1) + a * (1 - cm(n - l)),m > k where cm(n) is the element cmin CDF at update step n, which is a probability estimate for symbol m at update step n, cm(n — 1) is the element cmin CDF at previous update step «-l, which is a probability estimate for symbol m at previous update step n-1, a is a model update rate which controls a speed at which probability estimate adapts to new information, M is the total number of possible symbols, and k is a given symbol that serves as a reference point for the update rule.
[0289] In step 1206, the encoder checks if there are more syntax elements to encode. If yes, the process loops back to step 1203 to continue encoding the next syntax element; if no, the encoding process concludes.
[0290] In the solution shown in FIG. 12, the probability model is updated after coding every symbol. For example, CDF is recalculated for coding every symbol. In this case, a symbol can be coded only after the probability model is updated according to the previous symbol. Moreover, since every updating requires a lot of iterations to calculate the updated probability estimate, updating the probability model may take certain amount of time. Therefore, the encoder may not encode a symbol immediately after encoding the previous symbol until the probability model is updated. The frequent updating of the probability model may lead to intensive computation and encoding delay.
[0291] In various aspects and / or implementations of the present disclosure, solutions are proposed to solve at least one of the above problems. In some implementations of the present disclosure, a solution for updating a probability model is described. In some implementations, the probability model is updated after a quantity of symbols has been coded instead of being updated after each symbol is coded. In these cases, the probability model may be updated less frequently. In some implementations, statistics of symbols are collected, and the probability model is updated when the collected statistics reaches a certain threshold. In some implementations, a portion of the collected statistics, which is used for updating the probability model, may be further used for future updating for the probability model. In some implementations, statistics of symbols are collected in a collection rate or collection speed.
[0292] Reference is now made to FIG. 13, which illustrates an example flowchart of an entropy encoding method in accordance with some implementations. The method 1300 may be performed by an encoder or a module, a circuit or a chip in the encoder, or a logical module or software that can implement all or some functions of the encoder. The encoder may be any encoder described in FIG. 1 A, FIG. IB, FIG. 2, or FIG. 4. For example, the method 1300 is performed by the encoder and includes the following steps.
[0293] Step 1301: the encoder obtains S first symbols of a first sequence, where S is a positive integer. The first sequence may include multiple first symbols, and the S first symbols may be a part or all of the multiple first symbols. The first symbols may include data or syntax element(s).
[0294] The data or syntax element(s) may be for video coding and may include one or more of: coefficient (e.g. transform coefficient, quantized coefficient), motion vectors (i.e. information about how blocks of pixels are translated from one frame to another), mode information (i.e. details about the prediction mode (e.g., intra-prediction or inter-prediction) used for each block), quantization parameters (i.e. values that control the quantization process), control information (e.g. block sizes, prediction flags), context information (e.g. context information from neighboring blocks or previously encoded data). In a case where the first symbols are syntax elements, the firstsymbols of the first sequence may be syntax elements of a block, macroblock, transform block, or other type of units.
[0295] The first symbols may include M-ary symbols, where for a set of M-ary symbols, the set of M-ary symbols includes M possible distinct values and thus each symbol in the set of M-ary symbols may be distinct. In some cases, M may be a power of 2. For example, in a binary system, the set of M-ary symbols include two symbols represented as 0 and 1. In a quaternary system, the set of M-ary symbols include four possible values (e.g., 00, 01, 10, 11). Similarly, in an 8-ary symbol system, the set of M-ary symbols includes eight possible values, and so on. In other cases, M may not be a power of 2. For example, M may be 3 and the set of M-ary symbols include three possible distinct values, or the like.
[0296] Step 1302: the encoder encodes the S first symbols into a bitstream based on a first probability model.
[0297] The first probability model is used for estimating a probability of a first symbol being a value. In a case where there are no historical statistics to form the first probability model, the first probability model may be preconfigured and served as an original model. For example, the first probability model may be a fixed code table. The terms “probability model” and “context model” may have the same meaning and may be used interchangeably in this disclosure.
[0298] Step 1303: the encoder obtains a first statistical value of each symbol in a set of symbols based on a number of occurrences of the each symbol in the S first symbols.
[0299] The set of symbols may be the above set of M-ary symbols, which may include symbols having all possible values. In this case, the set of symbols may include symbols having values of {0, 1,..., (M-l)}. Each symbol in the set of symbols may be distinct. When the first symbols are the M-ary symbols, all possible values of the first symbols also are 0, 1,..., (M-l). Each symbol in the set of symbols may have different distributed information in the first symbols, for example, the first symbols may not include 0 but include more M. Therefore, the first statistical value for each symbol in the set of symbols may be determined based on the number of occurrences of the each symbol in the S first symbols, which may reflect the number of occurrences of the each symbol in the S first symbols, and may further used for estimating the probability value of future symbols.
[0300] The first statistical value may be represented by a histogram of symbols for M-ary alphabet. The x-axis of the histogram may represent values of {0, 1,..., (M-l)}, and y-axis of the histogram may represent the first statistical value. Each value in the y-axis may be a respective first statistical value, and the first statistical value may be based on the number of occurrences of each symbol in the S first symbols. The values in the x-axis may be considered as indices of the M-ary symbols.In this case, each index of the M-ary symbols may have a respective first statistical value. For example, FIG. 14 is a schematic diagram of an example histogram of symbols, where the set of symbols includes symbol 0, symbol 1, symbol 2, and symbol 3, the first statistical value of symbol 0 is larger than the first statistical value of symbol 2, the first statistical value of symbol 2 is larger than the first statistical value of symbol 3, and the first statistical value of symbol 3 is larger than the first statistical value of symbol 1.
[0301] Step 1304, the encoder obtains a second probability model by updating the first probability model based on the first statistical value of the each symbol in a case where a sum of the first statistical value of the each symbol is greater than or equal to a first threshold.
[0302] In this step, the encoder may update the first probability model to a second probability model. The encoder may update the first probability model after the sum of the first statistical values of the each symbol is greater than or equal to the first threshold, while the encoder may not update the first probability model when the sum of the first statistical value of the each symbol is less than the first threshold. In some implementations, the first threshold may be preconfigured or defined in standards. For example, in FIG. 14, the sum of the first statistical values of the each symbol is a sum of the first statistical value of symbol 0, the first statistical value of symbol 1, the first statistical value of symbol 2, and the first statistical value of symbol 3.
[0303] Step 1305, the encoder obtains Q second symbols of a second sequence, where Q is a positive integer. The second sequence may include multiple second symbols, and the Q second symbols may be a part or all of the multiple second symbols. The second symbols may include data or syntax elements. The second symbols may be M-ary symbols. The second symbols of the second sequence may be syntax elements of a block, macroblock, transform block, or other type of units.
[0304] Details of the second symbols may be referred to that of the first sequence and the first symbols.
[0305] Step 1306: the encoder encodes the Q second symbols into the bitstream based on the second probability model.
[0306] In these implementations, the probability model may not be updated until the sum of the first statistical value of the each symbol reaches the threshold. Therefore, the probability model may not be updated after coding each symbol. Compared with solutions where the probability model is updated after coding each symbol, in these implementations, the probability model may be updated less frequently, and computation and coding latency caused by updating the probability model may be effectively reduced and thus coding efficiency may be improved.
[0307] Moreover, since the probability model may not be updated after coding each symbol, several symbols may be encoded using the same probability model (e.g. the probability model having the same CDF). In some implementations, the encoder may encode several symbols in parallel. As such, the encoding of the symbols may consume less time, and the coding efficiency may further be improved.
[0308] It is noted that the first sequence and the second sequence may be formed by dividing a given sequence, and each of the first sequence and the second sequence may be a portion of the given sequence. The given sequence may include data or syntax elements. Each of the first sequence and the second sequence may correspond to a semantic object like image bock, transform block, or text row. Alternatively, the first sequence and the second sequence may not correspond to any semantic object. Moreover, the given sequence may be divided into portions having the same size or different sizes, and thus the first sequence and the second sequence may have the same size or different sizes.
[0309] In some implementations, the encoder may update the probability model in the case where the sum of the first statistical value of the each symbol is greater than or equal to the first threshold even if the encoding of the first sequence is not completed. In this case, the probability model may be updated based on a part of the first symbols in the first sequence (such as S first symbols) and remaining first symbols in the first sequence may be encoded using the updated probability model. As such, the remaining first symbols may be encoded using a more accurate probability model, thereby improving the efficiency of entropy coding.
[0310] For example, in step 1304, the encoder updates the first probability model by actions of: determining one or more remaining first symbols of the first sequence excluding the S first symbols, and obtaining the second probability model by updating the first probability model based on the first statistical value of the each value and encoding the one or more remaining first symbols of the first sequence based on the second probability model.
[0311] Alternatively, the encoder may update the probability model in the case where the sum of the first statistical value of the each symbol is greater than or equal to the first threshold and the encoding of the first sequence is completed. In this case, the probability model may be updated based on a part of the first symbols in the first sequence (such as S first symbols), and remaining first symbols in the first sequence may be encoded using the original probability model. In this case, the remaining first symbols in the first sequence may be encoded at an earlier time, thereby reducing the encoding time latency.
[0312] For example, in step 1304, the encoder updates the first probability model by actions of: determining one or more remaining first symbols of the first sequence excluding the S first symbols,and updating the first probability model based on the first statistical value of the each value while encoding the one or more remaining first symbols of the first sequence based on the first probability model. As such, the encoder may encode the remaining first symbols before the update of the probability model is completed. That is, the encoder may encode the remaining first symbols while updating the probability model is completed. Therefore, coding latency may be reduced.
[0313] In some implementations, the first sequence is a first one in a plurality of sequences, and the first statistical value of the each symbol equals to the number of occurrences of the each symbol in the S first symbols; or the first statistical value of the each symbol equals to an integer multiple of the number of occurrences of the each symbol in the S first symbols.
[0314] The first statistical value of the each symbol may equal to R times the number of occurrences of the each symbol in the S first symbols, where the parameter R may be called as a collection rate, and R is a positive integer. In this case, the number of occurrences of the each symbol may be scaled by the parameter R, and one actual sample may be considered as R samples. The larger value of R, the faster the sum of the first statistical value may reach the first threshold, and vice versa. The value of R may be preconfigured or dynamically adjusted.
[0315] For example, R=3, the number of occurrences of the symbol 0 (symbol having a value of 0) in the S first symbols is 1, the first statistical value of symbol 0 is calculated by 1 ><3 = 3. In this case, although the symbol 0 appear once in the S first symbols, since R=3, it may be considered as that there are 3 symbols having value of 0 in the S first symbols.
[0316] FIG. 15 illustrates an example of sequences where a first sequence is a first one in a plurality of sequences.
[0317] In this example, the S first symbols in the first sequence are encoded based on the first probability model. After the sum of the statistical value of the each symbol, obtained based on the S first symbols in the first sequence, reaches the first threshold, the encoder may perform a first update to update the first probability model to the second probability model. The encoder may encode the symbols in sequence(s) after the first sequence based on the second probability model, for example, the remaining symbol(s) in the first sequence and the second symbols in the second sequence. In this example, the encoder encodes Q second symbols in the second sequence after the first sequence based on the second probability model. In this example, the encoder may perform the first update when the sum of the statistical value reaches the first threshold even if the encoding of the first sequence is not completed. It is noted that the encoder may also perform the first update after the encoding of the first sequence is completed.
[0318] In some implementations, the first sequence is an Nthone in the plurality of sequences, N is an integer greater than one, and the method 1300 further includes that: the encoder obtains asecond statistical value of the each symbol, where the second statistical value is obtained based on a number of occurrences of the each symbol in symbols of (N- 1 ) sequences previous to the first sequence in the plurality of sequences. In this case, in step 1303, the encoder obtains the first statistical value of the each symbol in the set of symbols further based on the second statistical value of the each symbol. The term “(N-1) sequences previous to the first sequence” may be imply put as “(N-1) sequences”.
[0319] For example, the encoder may count the number of occurrences of the each symbol in symbols of (N-1) sequences. The second statistical value of the each symbol may equal to the number of occurrences of the each symbol in the symbols of (N-1) sequences. Alternatively, the second statistical value of the each symbol equals to an integer multiple of the number of occurrences of the each symbol in the symbols of (N-1) sequences.
[0320] In a possible implementation, the first sequence is the Nthone in the bitstream, and the second statistical value of the each symbol may equal to the number of occurrences of the each symbol in the symbols of (N-1) sequences. The first statistical value of the each symbol include the number of occurrences of the each symbol in the S first symbols of the first sequence (i.e., the Nthone in the bitstream) and the number of occurrences of the each symbol in the symbols of (N-1) sequences.
[0321] In another possible implementation, the first sequence is the Nthone in the bitstream, and the second statistical value of the each symbol may equal to R times the number of occurrences of the each symbol in the symbols of the (N-1) sequences, where the parameter R is the collection rate that has been described above. The first statistical value of the each symbol may include the second statistical value of the each symbol of the (N-1) sequences and R times the number of occurrences of the each symbol in the S first symbols of the first sequence (i.e., the Nlhone in the bitstream). That is, the first statistical value of the each symbol may include R times the number of occurrences of the each symbol in the symbols of the (N-1) sequences and R times the number of occurrences of the each symbol in the S first symbols of the first sequence which is the Nthone in the bitstream.
[0322] FIG. 16 illustrates an example of sequences where a first sequence is a Nthone in a plurality of sequences.
[0323] In this example, the first statistical value of the each symbol may relate to both the number of occurrences of the each symbol in the S first symbols and the number of occurrences of the each symbol in symbols of (N-1) sequences. The part same with FIG. 15 is not repeated herein.
[0324] In some implementations, after step 1305, the method 1300 may further include that: the encoder may obtain a third statistical value of the each symbol based on a number of occurrencesof the each symbol in the Q second symbols and a historical statistical value of the each symbol, where the historical statistical value of the each symbol is associated to the first statistical value of the each symbol. The historical statistical value may be used for updating the previous probability model. The method 1300 may further include that: the encoder may obtain a third probability model by updating the second probability model based on the third statistical value of the each symbol in a case where a sum of the third statistical value of the each symbol is greater or equal to the first threshold.
[0325] The third statistical value of the each symbol may include one or more of: the number of occurrences of the each symbol in the Q second symbols, a number of occurrences of the each symbol in symbols of sequence(s) after the first sequence and previous to the second sequence, and the historical statistical value of the each symbol. In an example where the first sequence is the Nthone, the historical statistical value of the each symbol may include the number of occurrences of the each symbol in symbols of (N-1) sequences, and the number of occurrences of the each symbol in the S first symbols of the first sequence.
[0326] It is noted that, if the first sequence and the second sequence are adjacent sequences, the third statistical value may not include the number of occurrences of the each symbol in symbols of sequence(s) after the first sequence and previous to the second sequence. In addition, the number of occurrences of the each symbol may be scaled by the parameter R. The parameter R may be a positive integer, as described above.
[0327] In some implementations, the historical statistical value of the each symbol includes a product of a first parameter and the first statistical value of the each symbol. The first parameter may be called as a histogram saving rate / ?, 0 < / ? < 1. The value of ft may be a constant or may be dynamically adjusted.
[0328] In the case of a smaller ft, less historical statistical value for updating the previous probability model may contribute to the updating of the current probability model. On the other hand, in the case of a greater?, more historical statistical value for updating the previous probability model may contribute to the updating of the current probability model. Larger / ? may also shorten the time duration between the previous updating and the current updating of the probability model, because less samples may be needed to reach the first threshold for the current updating.
[0329] FIG. 17 illustrates an example histogram in different stages during encoding. In FIG. 17, Histogram (A) include statistics for a first update, and the first update refers to updating the first probability model to the second probability model. When the sum of the statistics in Histogram (A) reaches the first threshold, the encoder may perform the first update. After performing the firstupdate, statistics in Histogram (A) is scaled by the histogram saving rate (3, serving as historical statistics and forming Histogram (B). After this, newly collected statistics are added to Histogram (B) to form Histogram (C). When the sum of the statistics in Histogram (C) reaches the first threshold, the encoder may update the second probability model to the third probability model.
[0330] In some implementations, the first probability model includes a first CDF. In this case, in step 1304, when the encoder updates the first probability model, the encoder obtains a second CDF by updating parameters in the first CDF based on a second parameter and the first statistical value of the each symbol, where the second CDF belongs to the second probability model, and the second parameter is a non-negative real number.
[0331] The encoder may update the first CDF in the first probability model to the second CDF in the second probability model. The encoder may obtain the second CDF based on the first CDF and the first statistical value of the each symbol. The second parameter may act as a basis value to guarantee that the each symbol may contribute to Histogram after updating the first probability model to the second probability model and before updating the second probability model. For example, when symbols having the value of 1 do not appear in symbols that are encoded after updating the first probability model and before updating the second probability model, since the second parameter is a non-negative real number, the statistical value of symbols having the value of 1 in Histogram after updating the first probability model to the second probability model and before updating the second probability model, may equal to the second parameter instead of equal to 0.
[0332] In some implementations, the first CDF and the second CDF each may be an integerized CDF. In this case, the cumulative probability of each symbol may be represented as a corresponding integer. The second parameter may be a non-negative integer which may be called as an integerized smallest probability. The integerized smallest probability may refer to a positive integer that represents the smallest positive probability of the symbol. The integerized smallest probability may be represented as PMIN. For example, the actual probability of the symbol is a real number in interval [0, 1], and the interval [0, 1] may be scaled to a larger interval such that the probability may be represented by a corresponding integer within the scaled interval (i.e. the larger interval). Since it may not be necessary to encode a symbol with a probability of 0, the integerized smallest probability may equal to 1. In this case, PMIN=1 • The upper bound of the scaled interval may be referred to as an integerized greatest probability which may be represented as PMAX- In an example, the interval of [0, 1] for the possibility is scaled to an integer interval of [0, 28]. In this case, PMIN= 1, and PMAX=2*.
[0333] In some implementations, the parameters in the first CDF include a cumulative probability of the each symbol, symbols in the set of symbols are arranged in an ascending order, and the updating parameters in the first parameters includes one or more of: obtaining an updated cumulative probability of a first one in the set of symbols based on the second parameter and a first statistical value of the first one; or obtaining an updated cumulative probability of an ithone in the set of symbols based on the second parameter, an updated cumulative probability of an (i-1)thone in the set of symbols, and a first statistical value of the ithone, where i is an integer greater than one.
[0334] CDF describes a probability that a real-valued random variable x with a given probability distribution may be found at a value less than or equal to X. In other words, for the random variable x, a cumulative distribution F(x) of the random variable x is defined as: F(x):=P(x < X), where P(x < X) is a probability that x takes on a value less than or equal to X. Since symbols in the set of symbols are arranged in an ascending order, the cumulative probability of the symbol may be calculated based on a sum of the probability of this symbol and the cumulative probability of a symbol previous to this symbol. This may provide a simple way to calculate the cumulative probability of each symbol.
[0335] In this case, for the first one in the set of symbols, the updated cumulative probability of the first one in the set of symbols may be calculated as a sum of the second parameter and the first statistical value of the first one in the set of symbols. For example, the updated cumulative probability of the first one in the set of symbols is represented by ci, the second parameter is represented by PMIN, and the first statistical value of the first one in the set of symbols is represented by hi. ci may be calculated by ci= hi+ PMIN. In an example, hi is the statistical value of the first one in the set of symbols in the histogram.
[0336] For the i* one in the set of symbols, the updated cumulative probability Ci of the ithone in the set of symbols may be calculated as a sum of the second parameter PMIN, an updated cumulative probability C of the (i-1)thone in the set of symbols, and a first statistical value hi of the ithone. That is, Ci= CM + hi+ PMIN.
[0337] In other implementations, different probability representations may be used together with or instead of CDF. For example, probability representations may be one or more of: probability mass function (PMF), probability density function (PDF), raw histograms, or Huffman tree. In these implementations, the probability model may be updated similar to the updating procedure in the case of the CDF.
[0338] FIG. 18 illustrates a flow chart outlining an encoding process using a context-based probability adaptation model according to one or more implementations. In this example, theprobability model may include CDF, i.e. CDF = {c1,...,ci,..., cM-1, PMAX}, where q is a cumulative probability of a symbol indexed as i, The symbol indexed as i may be denoted as symbol i. Histogram H is used to collect statistics of symbols from M-ary alphabet, H = {h1(..., hit..., hM}, hi is a statistical value of symbol i, and M > 2.
[0339] Before step 1801, the probability model is initialized. For example, CDF may be initialized with a default distribution. The default distribution may be a uniform distribution or other distributions. Histogram H is initialized with zeros or other values, for example, based on CDF.
[0340] The process begins at step 1801 which is the start of encoding a block. The block may be an NxN image block which may be a portion of symbols from coding sequences. N is a positive integer.
[0341] In step 1802, the encoder encodes symbol i in the block using a probability model. In this step, CDF is used to determine the probability for symbol i. If the model has not been updated, yet default CDF is used.
[0342] In step 1803, the encoder determines whether ent < cntMAX, where ent represents a counter used to avoid recalculating a histogram sum, ent = sum(H) and cntMAXis a preconfigured threshold representing an upper bound of the histogram sum, where cntMAX= PMAX PMINan(i PMAX ~ integerized greatest probability (i.e. the last value of CDF).
[0343] If ent < cntMAX, the encoder performs step 1804. In step 1804, histogram H and counter ent are updated for the corresponding coding symbol. In histogram H, R is added to the value in the y-axis corresponding symbol i, that is, R is added to hi in histogram H.
[0344] If ent > cntMAX, symbol i does not affect the histogram and counter.
[0345] After steps 1803 and 1804, step 1805 is performed. In step 1805, the encoder determines whether there are more symbols in the block to be encoded. If yes, the encoding process loops back to step 1802 to continue processing the next symbol; if no, encoding for the current block ends in step 1806.
[0346] After step 1806, in step 1807, the encoder determines if there are more blocks to be encoded. If yes, the process goes to step 1808; if no, encoding for the blocks ends.
[0347] In step 1808, the encoder again determines whether ent < cntMAX.
[0348] If ent < cntMAX, the encoding process loops back to step 1801, and the encoder starts to encode a next block.
[0349] If ent > cntMAX, the encoder performs step 1809. In step 1809, the encoder updates the probability model.
[0350] Step 1809 includes the following steps which is shown in FIG. 19.
[0351] The encoder starts updating the probability model in step 1809A.
[0352] In step 1809B to 1809D, for every symbol i form 1 to M:
[0353] Ci is calculated based on hi in histogram H. PM[Nmay be added to such that positiveness of Q is guaranteed. PMINis the integerized smallest probability which is available for the symbol.
[0354] hi is updated by rate?, where? is the histogram saving rate. If denominator of is power of 2 (e.g. / ? = |) it can be implemented using bit shifts without multiplications.
[0355] The counter ent is recalculate based on new / q.
[0356] After updating coding process it may apply with new CDF. Statistics may continue to collect into updated histogram and counter.
[0357] In some implementations, for example, in the procedure shown in FIGS. 18 and 19, the collection rate R may have different values, which may depend on actual need. In one embodiment, the collection rate R equals 1. Updating condition ent == entMAX sooner or later may be reached because of (cntMAX— ent') mod 1 = 0. In other embodiment, the collection rate R > 1, so implementation may modify updating condition to ent == cntMAX— (.cntMAX— ent ST RT) mod R^) where cntSTARTis the total sum of statistical values in histogram after updating a possibility (i.e. cntSTARTis the total sum of the historical statistical values) model or after initialization of the histogram. This implementation may add ((cntMAX— cntSTART) mod R^ to histogram before next updating. cntSTART is the value of ent after the latest model updating.cn^sTART may equal to the sum of histogram values (i.e. sum of the statistics in the histogram). After the latest model updating, statistics in the histogram may be scaled and served as historical statistics which may be used for the next model updating. cntSTARTmay be calculated as the sum of the historical statistics. In implementation where R is power of 2 these calculations may be performed using bitwise operations.
[0358] In some implementations, for example, in the procedure shown in FIGS. 18 and 19, the second parameter PMINmay have different values, which may depend on actual need. In one embodiment, entropy codec uses the integerized smallest probability PMIN= 1. In this case, the first threshold is set as cntMAX= PMAX-M* PMIN= PMAX- M, where PMAXis the integerized greatest probability. The updating model step to CDF elements (i.e. the step involving calculating Ci = CM + h, + PMIN) may be added 1 (since PMIN= 1) to guarantee positiveness of probabilities. In other embodiment, entropy codec uses scaled probabilities with PMIN> 1. Then implementation may use updating procedure similar to PMI = 1 but scale final CDF values during updating step. In this case, Cj may be calculated as q = c^ + hiXPMIN+PMINor ci=Ci— i + hi x (1 + PMiN). If PMIN = 2n, implementation may use bit shift instead of multiplications,thereby reducing the computational complexity. In the case where PMiN> 1, updated histogram values (i.e. historical histogram values) h[ = ht* / ? may be modified to guarantee hi mod PMiN== 0. After applying hi = hi * (statistics in the histogram are scaled by f), hi in the histogram may not be an integer multiple of PMIN- In this case, every htmay be subtracted by hi mod PMlNsuch that the subtracted statistic hi in the histogram may become an integer multiple °f P MIN-
[0359] In some implementations, CDF may not be fully used (not all values of the symbols are expected) since several probabilities of certain symbol(s) may be zero. Then implementation may set cntMAX— MAX ~ MIN *where K is number of used symbols (i.e. used value in the M-ary alphabet). For example, the symbol is from an M-ary alphabet and M possible values may be used to represent the symbols. In a case where probabilities T values among the M values equals to zero, these T values may be excluded from the M-ary alphabet. (M - T) of the M values will be used in the CDF. In this case, K = M -T.
[0360] In some implementations, statistics may be collected into the histogram until histogram is full. If the sum of the statistics reached ntMAX, no more statistics may be collected into the histogram. In some implementations, some statistics may be dropped or removed from the histogram element such that the statistics in the histogram may not be overflowed, and more new statistics may be collected into the histogram.
[0361] In some implementations, the histogram array is reduced by one element (i.e. statics corresponding to a certain value in the M-ary alphabet) to optimize memory usage because of value of ent equals to the sum of statistics in histogram H. In other words, statics corresponding to the certain value may be obtained by subtracting statics corresponding to other values (e.g. statics corresponding to (M-l) values) from the value of ent. In this case, some statistics may not be saved in the histogram anyway, thereby saving the memory usage.
[0362] The following are some example settings for 4-ary alphabet entropy coding (M = 4).
[0363] PMAX — 256, PMIN= 1, cntMAX= 256 — 4 = 252, R = 1, / ? = block is a portion of4x4 symbols from sequence, initial H = {0,0, 0,0}, ent = sum H) = 0. H and ent can have 8 bits representing values ranging from 0 to 255.
[0364] For each received symbol i:
[0365] hi+= 1, cnt+= 1 (because of R = 1).
[0366] So, statistics will be collected to H until ent == cntMAX.
[0367] For example, after block coding H = {200,40,7,5}, so ent == cntMAX== 252.
[0368] Then model will be updated outside a block:
[0369] For each symbol i from 1 to M:
[0370] Ci = Cj_x+ hi + 1 (when i == 1 let -i = 0);
[0371] hi = hi » 2, where “»” represents arithmetic right shift ( / ? = -, ht= ht» 2 is to4operate hi = - hi)
[0372] ent = sum(H).
[0373] After updating the probability model, DF = {201,242,250,256}, and the probabilities in the CDF will be used until next updating. H = {50,10,1,1}, so ent == 62 which is a new start point for statistics collection.
[0374] In some implementations, the compression efficiency may achieve -0.23% Bjontegaard delta rate (BD-RATE) YUV peak signal-to-noise ratio (YUV-PSNR) compared with constant probability tables approach, where BD-RATE YUV-PSNR refers to the use of PSNR as a video quality assessment metric in the YUV color space, with the BD-RATE method used to measure the performance difference of video encoders under the same visual quality.
[0375] The above describes operations of the encoder side and the following describes operations of the decoder side.
[0376] In some implementations, the decoder may start with an input bitstream and form decoded information or decoded frame as an output. The input bitstream may be generated by the encoder based on the method 1300.
[0377] Reference is now made to FIG. 20, which illustrates an example flowchart of a video decoding method in accordance with some implementations. The method 2000 may be performed by a decoder or a module, a circuit or a chip in the decoder, or a logical module or software that can implement all or some functions of the decoder. The decoder may be any decoder described in FIG. 1 A, FIG. IB, FIG. 3, FIG. 7A, or FIG. 7B. For example, the method 2000 is performed by a decoder and includes the following steps.
[0378] Step 2001, the decoder obtains a bitstream.
[0379] Step 2002, the decoder obtains S first symbols by decoding a first bit sequence in the bitstream based on a first probability model, where S is a positive integer.
[0380] The first symbols may include data or syntax elements. The data may be text or other type of data. The syntax element may be syntax element for video coding and may include one or more of: coefficient, motion vectors, mode information, quantization parameters, control information, context information. The first symbols may be M-ary symbols, and each symbol may take on one of M possible distinct values. In some cases, M may be a power of 2. In other cases, M may not be a power of 2. It is noted that the details of the first symbol may refer to the related description at the encoder side.
[0381] The first probability model is used for estimating a probability of a first symbol having a certain value. The details of the first probability model may refer to the related description at the encoder side.
[0382] Step 2003, the decoder obtains a first statistical value of each symbol in a set of symbols based on a number of occurrences of the each symbol in the S first symbols.
[0383] The first statistical value may reflect the number of occurrences of the each symbol, and may further used for estimating the value of future symbols. The set of symbols may include symbols having all possible values. The first statistical value may be represented by a histogram of symbols for M-ary alphabet. The details of the first statistical value and the set of symbols may refer to the related description at the encoder side.
[0384] Step 2004, the decoder obtains a second probability model by updating the first probability model based on the first statistical value of the each symbol in a case where a sum of the first statistical value of the each symbol is greater than or equal to a first threshold.
[0385] In this step, the decoder may update the first probability model to the second probability model. The decoder may update the first probability model after a sum of the first statistical value of the each symbol is greater than or equal to a first threshold, while the decoder may not update the first probability model if a sum of the first statistical value of the each symbol is less than the first threshold. In some implementations, the first threshold may be preconfigured.
[0386] Step 2005, the decoder obtains Q second symbols by decoding a second bit sequence in the bitstream based on the second probability model, where Q is a positive integer, and the S first symbols and the Q second symbols are used for reconstructing data.
[0387] The second sequence may include multiple second symbols, and the Q second symbols may be a part or all of the multiple second symbols. The details of the second sequence and the second symbol may refer to the related description at the encoder side.
[0388] The decoder may reconstruct the data or an image using the first symbols and second symbols.
[0389] In these implementations, the probability model may not be updated until the sum of the first statistical value of the each symbol reach a certain threshold. Therefore, the probability model may not be updated after decoding each symbol. Compared with solutions where the probability model is updated after decoding each symbol, in these implementations, the probability model may be updated less frequently, and computation and coding latency caused by updating the probability model may be effectively reduced and thus coding efficiency may be improved.
[0390] Moreover, since the probability model may not be updated after decoding each symbol, several symbols may be decoded using the same probability model (e.g. probability model havingthe same CDF). In some implementations, the decoder may decode several symbols in a bitstream in parallel. As such, the decoding of the symbols may consume less time, and the decoding efficiency may further be improved.
[0391] It is noted that the term “symbol” used in the encoder side may refer to a symbol to be encoded, while the term “symbol” used in the decoder side may refer to a decoded symbol.
[0392] In some implementations, the decoder may update the probability model upon the sum of the first statistical value of the each symbol is greater than or equal to a first threshold even if the decoding of the first sequence is not completed. In this case, the probability model may be updated based on a part of the first symbols in the first sequence. The remaining first symbols in the first sequence may be decoded using the updated probability model. As such, the remaining first symbols may be decoded using a more accurate probability model, thereby improving the efficiency of entropy decoding.
[0393] Alternatively, the decoder may update the probability model in the case where the sum of the first statistical value of the each symbol is greater than or equal to the first threshold and the decoding of the first sequence is completed. In this case, the probability model may be updated based on a part of the first symbols in the first sequence, and the remaining first symbols in the first sequence may be decoded using the original probability model. In this case, the remaining first symbols in the first sequence may be decoded at an earlier time, thereby reducing the decoding time latency.
[0394] For example, the updating the first probability model includes: determining one or more remaining first symbols of the first bit sequence excluding the S first symbols and updating the first probability model based on the first statistical value of the each value while decoding the one or more remaining first symbols of the first bit sequence based on the first probability model.
[0395] In some implementations, the first bit sequence is a first one in the bitstream, and the first statistical value of the each symbol equals to the number of occurrences of the each symbol in the S first symbols; or the first statistical value of the each symbol equals to an integer multiple of the number of occurrences of the each symbol in the S first symbols.
[0396] The first statistical value of the each symbol may equal to R times the number of occurrences of the each symbol in the S first symbols, where the parameter R may be called as collection rate, and R is a positive integer. The details of the collection rate may refer to the related description at the encoder side.
[0397] In some implementations, the first bit sequence is an Nthone in the bitstream, N is an integer greater than one, and the method 2000 further includes: obtaining a second statistical value of the each symbol, where the second statistical value is obtained based on a number of occurrencesof the each symbol in symbols of (N-1) bit sequences previous to the first bit sequence in the bitstream. The obtaining a first statistical value of each symbol in a set of symbols includes: obtaining the first statistical value of the each symbol in the set of symbols further based on the second statistical value of the each symbol.
[0398] In this case, the decoder obtains the first statistical value of each symbol in a set of symbols includes that the decoder obtains the first statistical value of the each symbol in the set of symbols further based on the second statistical value of the each symbol. The term “(N-1) sequences previous to the first sequence” may be imply put as “(N-1) sequences”.
[0399] In some implementations, the method 2000 further includes: obtaining a third statistical value of the each symbol based on a number of occurrences of the each symbol in the Q second symbols and a historical statistical value of the each symbol, where the historical statistical value of the each symbol is associated to the first statistical value of the each symbol. The details of the third statistical value may refer to the related description at the encoder side.
[0400] In a case where a second value obtained from the third statistical value of the each symbol is greater or equal to the first threshold, the decoder may obtain a third probability model by updating the second probability model based on the third statistical value of the each symbol.
[0401] In some implementations, the historical statistical value of the each symbol includes a product of a first parameter and the first statistical value of the each symbol. The first parameter may be called as histogram saving rate / ?, 0 < / ? < 1. The value of ft may be a constant or may be dynamically adjusted. The details of the first parameter and the histogram saving rate may refer to the related description at the encoder side.
[0402] In some implementations, the first probability model includes a first cumulative distribution function (CDF), and the updating the first probability model includes: obtaining a second cumulative distribution function by updating parameters in the first cumulative distribution function based on a second parameter and the first statistical value of the each symbol, where the second cumulative distribution function belongs to the second probability model, and the second parameter is a non-negative real number. The second parameter may be a non-negative integer which may be called as an integerized smallest probability. The details of the first CDF, the second CDF, second parameter may refer to the related description at the encoder side.
[0403] In some implementations, the parameters in the first cumulative distribution function include a cumulative probability of the each symbol, symbols in the set of symbols are arranged in an ascending order, and the updating parameters in the first cumulative distribution function includes one or more of: obtaining an updated cumulative probability of a first one in the set of symbols based on the second parameter and a first statistical value of the first one; or obtaining anupdated cumulative probability of an ithone in the set of symbols based on the second parameter, an updated cumulative probability of an (i-1)thone in the set of symbols, and a first statistical value of the ithone, where i is an integer greater than one. The details of obtaining the updated cumulative probability of the first one in the set of symbols and details of obtaining the updated cumulative probability of the ithone in the set of symbols may refer to the related description at the encoder side.
[0404] It is noted that example of updating the probability model described in the encoder side may also be applied to the decoder side. The decoder may update the probability model in the same way as the encoder, thereby ensuring that the encoded bitstream may be decoded successfully.
[0405] Reference is now made to FIG. 21, in a first implementation manner, the apparatus 2100 may be applied to the encoder described above and realize the above method implementations performed by the encoder. The apparatus 2100 may be implemented as the encoder or a module (for example, a chip or a circuit) in the encoder or at the side of the encoder.
[0406] In some embodiments, the apparatus 2100 includes the processing unit 2112. The processing unit 2112 is configured to: obtain S first symbols of a first sequence, where S is a positive integer; encode the S first symbols into a bitstream based on a first probability model; obtain a first statistical value of each symbol in a set of symbols based on a number of occurrences of the each symbol in the S first symbols; obtain a second probability model by updating the first probability model based on the first statistical value of the each symbol in a case where a sum of the first statistical value of the each symbol is greater than or equal to a first threshold; obtain Q second symbols of a second sequence, where Q is a positive integer; and encode the Q second symbols into the bitstream based on the second probability model.
[0407] The details of operations performed by the processing unit 2112 may refer to the related description of the method implementations performed by the encoder, which is not repeated herein.
[0408] In some implementations, the apparatus 2100 may further include a storage unit 2112 to store symbol sequences such as the first sequence and second sequence for encoding, or store other data during encoding such as the first statistical value of each symbol in a set of symbols, the second statistical value of each symbol, the third statistical value of each symbol, the first probability model, the second probability model, or the like. The symbol sequences stored in the storage unit 2112 may be obtained from another apparatus or generated locally. The storage unit 2112 may further store the bitstream.
[0409] In some implementations, the apparatus 2100 may further include a communication unit 2113 to obtain symbol sequences such as the first sequence for encoding. The communication unit2113 may obtain symbol sequences from another apparatus. The communication unit 2113 may further transmit the bitstream to another apparatus.
[0410] Reference is now made to FIG. 21 again, in a second implementation manner, the apparatus 2100 may be applied to the decoder described above and realize the above method implementations performed by the decoder. The apparatus 2100 may be implemented as the decoder or a module (for example, a chip or a circuit) in the decoder or at the side of the decoder.
[0411] In some embodiments, the apparatus 2100 includes the processing unit 2112. The processing unit 2112 is configured to: obtain a bitstream; obtain S first symbols by decoding a first bit sequence in the bitstream based on a first probability model, where S is a positive integer; obtain a first statistical value of each symbol in a set of symbols based on a number of occurrences of the each symbol in the S first symbols; obtain a second probability model by updating the first probability model based on the first statistical value of the each symbol in a case where a sum of the first statistical value of the each symbol is greater than or equal to a first threshold; and obtain Q second symbols by decoding a second bit sequence in the bitstream based on the second probability model, where Q is a positive integer, and the S first symbols and the Q second symbols are used for reconstructing data.
[0412] The details of operations performed by the processing unit 2112 may refer to the related description of the method implementations performed by the decoder, which is not repeated herein.
[0413] In some implementations, the apparatus 2100 may further include a storage unit 2112 to store the bitstream or store other data during decoding such as the first statistical value of each symbol in a set of symbols, the second statistical value of each symbol, the third statistical value of each symbol, the first probability model, the second probability model, or the like. The bitstream stored in the storage unit 2112 may be obtained from another apparatus or generated locally. The storage unit 2112 may store reconstructed data.
[0414] In some implementations, the apparatus 2100 may further include a communication unit 2113 to obtain the bitstream. The communication unit 2113 may obtain the bitstream from another apparatus. The communication unit 2113 may further transmit the reconstructed data to another apparatus.
[0415] Referring back to FIG. 9, in a third implementation manner, the video coding device 900 may be applied to the encoder and realize the above method embodiments performed by the encoder. The processor 930 executes computer executable instructions stored in the memory 960 for executing the above methods implemented by the encoder.
[0416] Referring back to FIG. 9 again, in a fourth implementation manner, the video coding device 900 may be applied to the decoder and realize the above method embodiments performed by thedecoder. The processor 930 executes computer executable instructions stored in the memory 960 for executing the above methods implemented by the decoder.
[0417] The present disclosure encompasses various implementations, including not only method implementations, but also other implementations such as apparatus implementations and implementations related to non-transitory computer readable storage media. Implementations may incorporate, individually or in combinations, the features disclosed herein.
[0418] Although this disclosure refers to illustrative implementations, this is not intended to be construed in a limiting sense. Various modifications and combinations of the illustrative implementations, as well as other implementations of the disclosure, will be apparent to persons skilled in the art upon reference to the description.
[0419] Features disclosed herein in the context of any particular implementations may also or instead be implemented in other implementations. Method implementations, for example, may also or instead be implemented in apparatus, system, and / or computer program product implementations. In addition, although implementations are described primarily in the context of methods and apparatus, other implementations are also contemplated, as instructions stored on one or more non-transitory computer-readable media, for example. Such media may store programming or instructions to perform any of various methods consistent with the present disclosure.
[0420] Some implementations of the present disclosure provide a computer-readable storage medium (e.g., a non-transitory computer-readable storage medium). The computer-readable storage medium has stored thereon program instructions that, when run on the encoder / decoder, cause the encoder / decoder to execute one or more steps of the method performed by the encoder / decoder as described in any one of the above implementations.
[0421] For example, the computer-readable storage medium includes, but is not limited to, a magnetic storage device (e.g., a hard disk, a floppy disk or a magnetic tape), an optical disk (e.g., a compact disk (CD), or a DVD), a smart card, and a flash memory device (e.g., an erasable programmable read-only memory (EPROM), a card, a stick or a key driver). Various computer-readable storage media described in the implementations of the present disclosure may represent one or more devices and / or other machine-readable storage media, which are used for storing information. The term “computer-readable storage medium” may include, but is not limited to, wireless channels and various other media capable of storing, containing and / or carrying instructions and / or data.
[0422] Some implementations of the present disclosure further provide a computer program product. The computer program product includes program instructions carried on a non-transitorycomputer-readable storage medium. When executed on the encoder / decoder, the computer program instructions cause the encoder / decoder to perform one or more steps of the method performed by the encoder / decoder as described in the above implementations.
[0423] Beneficial effects of the computer-readable storage medium and the computer program product are the same as the beneficial effects of the method performed by the encoder / decoder as described in some of the above implementations, and details will not be repeated herein.
[0424] The foregoing descriptions are merely specific implementations of the present disclosure, but the protection scope of the present disclosure is not limited thereto. Any changes or replacements within the technical scope of the present disclosure shall be included in the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure shall be subject to the protection scope of the claims.
[0425] In some aspects of the present disclosure, there is provided a computer program comprising instructions. The instructions, when executed by a processor, may cause the processor to implement a method of the present disclosure.
[0426] In some aspects of the present disclosure, there is provided an integrated circuit. The integrated circuit includes one or more logic circuits for executing the steps of the method of the present disclosure.
[0427] In some aspects of the present disclosure, there is provided an apparatus comprising means (e.g., at least one processor) to implement a method of the present disclosure. The apparatus may be device (that is, an encoder or a decoder) or a module or component in the device. The at least one processor may execute instructions stored in a computer-readable medium to implement the method.
[0428] The apparatus may be an encoder or a decoder. For example, the apparatus implemented may be an integrated circuit, which in some contexts may be known by other colloquial names, such as chip, or processor. In some implementations, one or more integrated circuits can be packaged into a system-on-chip, a system-in-package, or a multi-chip module. The apparatus may comprise one or more integrated circuits or include one or more integrated circuits and other discrete components.
[0429] It will be appreciated that any module, component, or device disclosed herein that executes instructions may include, or otherwise have access to, a non-transitory computer / processor readable storage medium or media for storage of information, such as computer / processor readable instructions, data structures, program modules and / or other data. A non-exhaustive list of examples of non-transitory computer / processor readable storage media includes magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, optical disks such ascompact disc read-only memory (CD-ROM), digital video discs or digital versatile discs (i.e., DVDs), Blu-ray Disc™, or other optical storage, volatile and non-volatile, removable and nonremovable media implemented in any method or technology, random-access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology. Any such non-transitory computer / processor storage media may be part of a device / apparatus or accessible or connectable thereto. Computer / processor readable / executable instructions to implement a method, an application or a module described herein may be stored or otherwise held by such non-transitory computer / processor readable storage media.
[0430] It may be noted that the message in the disclosure may be replaced with information, which may be carried in one single message, or be carried in more than one separate message.
[0431] The terms “apparatus” and “device” are used exchangeable.
[0432] The terms “first”, “second”, and “third” are used for descriptive purposes only, and are not to be construed as indicating or implying the relative importance or implicitly indicating the number of indicated technical features. Thus, a feature defined with “first”, “second” or “third” may explicitly or implicitly include one or more of the features.
[0433] In the present disclosure, the terms “a” or “an” are defined to mean “at least one”, that is, these terms do not exclude a plural number of items, unless stated otherwise.
[0434] In the present disclosure, terms such as “substantially”, “generally” and “about”, which modify a value, condition or characteristic of a feature of an example implementation, is understood to mean that the value, condition or characteristic is defined within tolerances that are acceptable for the proper operation of the example implementation for its intended application.
[0435] In the present disclosure, unless stated otherwise, the terms “connected” and “coupled”, and derivatives and variants thereof, refer herein to any structural or functional connection or coupling, either direct or indirect, between two or more elements. For example, the connection or coupling between the elements can be acoustical, mechanical, optical, electrical, thermal, logical, or any combinations thereof.
[0436] In the present disclosure, expressions such as “match”, “matching” and “matched”, including variants and derivatives thereof, are intended to refer herein to a condition in which two or more elements are either the same or within some predetermined tolerance of each other. That is, these terms are meant to encompass not only “exactly” or “identically” matching the two elements but also “substantially”, “approximately” or “subjectively” matching the two or more elements, as well as providing a higher or best match among a plurality of matching possibilities.
[0437] In the present disclosure, the expression “based on” is intended to mean “based at least partly on”, that is, this expression can mean “based solely on” or “based partially on”, and so may not be interpreted in a limited manner. More particularly, the expression “based on” may also be understood as meaning “depending on”, “representative of’, “indicative of’, “associated with” or similar expressions.
[0438] In the present disclosure, the terms “system” and “network” may be used interchangeably in different implementations of this disclosure. “At least one” means one or more, and “a plurality of’ means two or more. The term “and / or” describes an association relationship of associated objects, and indicates that three relationships may exist. For example, A and / or B may indicate the following three cases: Only A exists, both A and B exist, and only B exists, where A and B may be singular or plural. The character “ / ” indicates an “or” relationship between associated objects. “At least one of the following items (pieces)” or a similar expression thereof indicates any combination of these items, including a single item (piece) or any combination of a plurality of items (pieces). For example, “at least one of A, B, or C” includes: only A; only B; only C; A and B; A and C; B and C; or A, B, and C, and “at least one of A, B, and C” may also be understood as including: only A; only B; only C; A and B; A and C; B and C; or A, B, and C. In addition, unless otherwise specified, ordinal numbers such as “first” and “second” in implementations of this disclosure are used to distinguish between a plurality of objects, and are not used to limit a sequence, a time sequence, priorities, or importance of the plurality of objects.
[0439] A person skilled in the art may understand that implementations of this disclosure may be provided as a method, an apparatus (or system), computer-readable storage medium, or a computer program product. Therefore, this disclosure may use a form of a hardware-only implementation, a software-only implementation, or one or more implementations with a combination of software and hardware. Moreover, this disclosure may use a form of a computer program product that is implemented on one or more computer-usable storage media (including but not limited to a disk memory, an optical memory, and the like) that include computer-usable program code.
[0440] This disclosure is described with reference to the flowcharts and / or block diagrams of the method, the device (system), and the computer program product according to this disclosure. It is understood that computer program instructions may be used to implement each process and / or each block in the flowcharts and / or the block diagrams and a combination of a process and / or a block in the flowcharts and / or the block diagrams. The computer program instructions may be provided for a general-purpose computer, a dedicated computer, an embedded processor, or a processor of another programmable data processing device and enable a machine to execute the instructions. When executed by any computer or the processor of a programmable data processingdevice, the instructions cause the apparatus to implement specific functions as described in one or more procedures in the flowcharts and / or one or more blocks in the block diagrams. The computer program instructions may alternatively be stored in a computer-readable memory that can indicate a computer or another programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory generate an artifact that includes an instruction apparatus. The instruction apparatus implements a specific function in one or more procedures in the flowcharts and / or one or more blocks in the block diagrams.
[0441] The computer program instructions may alternatively be loaded onto a computer or another programmable data processing device, so that a series of operations and steps are performed on the computer or the another programmable device, so that computer-implemented processing is generated. Therefore, the instructions executed on the computer or on another programmable device provide steps for implementing specific functions as described in one or more procedures in the flowcharts and / or one or more blocks in the block diagrams.
[0442] It is clear that a person skilled in the art can make various modifications and variations to this disclosure without departing from the scope of this disclosure. This disclosure is intended to cover these modifications and variations of this disclosure provided that they fall within the scope of protection defined by the following claims and their equivalent technologies.
Claims
CLAIMS1. An entropy decoding method, comprising:obtaining a bitstream;obtaining S first symbols by decoding a first bit sequence in the bitstream based on a first probability model, wherein S is a positive integer;obtaining a first statistical value of each symbol in a set of symbols based on a number of occurrences of the each symbol in the S first symbols;obtaining a second probability model by updating the first probability model based on the first statistical value of the each symbol in a case where a sum of the first statistical value of the each symbol is greater than or equal to a first threshold; andobtaining Q second symbols by decoding a second bit sequence in the bitstream based on the second probability model, wherein Q is a positive integer, and the S first symbols and the Q second symbols are used for reconstructing data.
2. The method of claim 1, wherein the updating the first probability model comprises: determining one or more remaining first symbols of the first bit sequence excluding the S first symbols; andupdating the first probability model based on the first statistical value of the each value while decoding the one or more remaining first symbols of the first bit sequence based on the first probability model.
3. The method of claim 1 or 2, wherein the first bit sequence is a first one in the bitstream, and the first statistical value of the each symbol equals to the number of occurrences of the each symbol in the S first symbols; or the first statistical value of the each symbol equals to an integer multiple of the number of occurrences of the each symbol in the S first symbols.
4. The method of claim 1 or 2, wherein the first bit sequence is an Nthone in the bitstream, N is an integer greater than one, and the method further comprises:obtaining a second statistical value of the each symbol, wherein the second statistical value is obtained based on a number of occurrences of the each symbol in symbols of (N-1) bit sequences previous to the first bit sequence in the bitstream; andthe obtaining a first statistical value of each symbol in a set of symbols comprises:obtaining the first statistical value of the each symbol in the set of symbols further based on the second statistical value of the each symbol.
5. The method of any one of claims 1 to 4, further comprising:obtaining a third statistical value of the each symbol based on a number of occurrences of the each symbol in the Q second symbols and a historical statistical value of the each symbol, whereinthe historical statistical value of the each symbol is associated to the first statistical value of the each symbol; andobtaining a third probability model by updating the second probability model based on the third statistical value of the each symbol, in a case where a sum of the third statistical value of the each symbol is greater or equal to the first threshold.
6. The method of claim 5, wherein the historical statistical value of the each symbol comprises a product of a first parameter and the first statistical value of the each symbol.
7. The method of any one of claims 1 to 6, wherein the first probability model comprises a first cumulative distribution function (CDF), and the updating the first probability model comprises:obtaining a second cumulative distribution function by updating parameters in the first cumulative distribution function based on a second parameter and the first statistical value of the each symbol, wherein the second cumulative distribution function belongs to the second probability model, and the second parameter is a non-negative real number.
8. The method of claim 7, wherein the parameters in the first cumulative distribution function comprise a cumulative probability of the each symbol, symbols in the set of symbols are arranged in an ascending order, and the updating parameters in the first cumulative distribution function comprises one or more of:obtaining an updated cumulative probability of a first one in the set of symbols based on the second parameter and a first statistical value of the first one; orobtaining an updated cumulative probability of an ithone in the set of symbols based on the second parameter, an updated cumulative probability of an (i-1)thone in the set of symbols, and a first statistical value of the ithone, wherein i is an integer greater than one.
9. An entropy encoding method, comprising:obtaining S first symbols of a first sequence, wherein S is a positive integer;encoding the S first symbols into a bitstream based on a first probability model; obtaining a first statistical value of each symbol in a set of symbols based on a number of occurrences of the each symbol in the S first symbols;obtaining a second probability model by updating the first probability model based on the first statistical value of the each symbol in a case where a sum of the first statistical value of the each symbol is greater than or equal to a first threshold;obtaining Q second symbols of a second sequence, wherein Q is a positive integer; and encoding the Q second symbols into the bitstream based on the second probability model.
10. The method of claim 9, wherein the updating the first probability model comprises:determining one or more remaining first symbols of the first sequence excluding the S first symbols; andupdating the first probability model based on the first statistical value of the each value while encoding the one or more remaining first symbols of the first sequence based on the first probability model.
11. The method of claim 9 or 10, wherein the first sequence is a first one in a plurality of sequences, and the first statistical value of the each symbol equals to the number of occurrences of the each symbol in the S first symbols; or the first statistical value of the each symbol equals to an integer multiple of the number of occurrences of the each symbol in the S first symbols.
12. The method of claim 9 or 10, wherein the first sequence is an Nthone in the plurality of sequences, N is an integer greater than one, and the method further comprises:obtaining a second statistical value of the each symbol, wherein the second statistical value is obtained based on a number of occurrences of the each symbol in symbols of (N-1) sequences previous to the first sequence in the plurality of sequences; andthe obtaining a first statistical value of each symbol in a set of symbols comprises:obtaining the first statistical value of the each symbol in the set of symbols further based on the second statistical value of the each symbol.
13. The method of any one of claims 9 to 12, further comprising:obtaining a third statistical value of the each symbol based on a number of occurrences of the each symbol in the Q second symbols and a historical statistical value of the each symbol, wherein the historical statistical value of the each symbol is associated to the first statistical value of the each symbol; andobtaining a third probability model by updating the second probability model based on the third statistical value of the each symbol, in a case where a sum of the third statistical value of the each symbol is greater or equal to the first threshold.
14. The method of claim 13, wherein the historical statistical value of the each symbol comprises a product of a first parameter and the first statistical value of the each symbol.
15. The method of any one of claims 9 to 14, wherein the first probability model comprises a first cumulative distribution function (CDF), and the updating the first probability model comprises:obtaining a second cumulative distribution function by updating parameters in the first cumulative distribution function based on a second parameter and the first statistical value of the each symbol, wherein the second cumulative distribution function belongs to the second probability model, and the second parameter is a non-negative real number.
16. The method of claim 15, wherein the parameters in the first cumulative distribution function comprise a cumulative probability of the each symbol, symbols in the set of symbols are arranged in an ascending order, and the updating parameters in the first cumulative distribution function comprises one or more of:obtaining an updated cumulative probability of a first one in the set of symbols based on the second parameter and a first statistical value of the first one; orobtaining an updated cumulative probability of an ithone in the set of symbols based on the second parameter, an updated cumulative probability of an (i-1)thone in the set of symbols, and a first statistical value of the ithone, wherein i is an integer greater than one.
17. An apparatus for receiving or restoring a bitstream, wherein the bitstream is obtained by method of any one of claims 1 to 16.
18. An apparatus, configured to perform the method according to any one of claims 1 to 8, or any one of claims 9 to 15.
19. A computer-readable storage medium having instructions stored thereon which, when executed by an apparatus, cause the apparatus to perform the method of any one of claims 1 to 8, or any one of claims 9 to 15.
20. A computer program product storing instructions which, when executed, cause an apparatus to perform the method of any one claims 1 to 8, or any one of claims 9 to 15.