Method and device for video encoding and decoding using palette mode
By adopting palette mode and adaptive binarization technology in video encoding and decoding, the problem of low encoding and decoding efficiency of high-resolution video data is solved, and more efficient encoding and decoding performance is achieved.
Patent Information
- Application Number
- CN202210791658.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2019-10-10
- Filing Date
- 2020-10-12
- Publication Date
- 2025-01-14
- Estimated Expiration
- 2040-10-12
AI Technical Summary
While maintaining the quality of video images, it is difficult to efficiently encode and decode high-resolution video data, especially in the high-definition to 8Kx4K range, resulting in an exponential increase in the data volume, affecting the encoding and decoding efficiency.
The video encoding and decoding method adopts the palette mode, selects the appropriate binarization process by determining the syntax elements at the encoding and decoding level, and dynamically adjusts the encoding process to optimize the encoding efficiency of the bitstream, including using the self-directed during the encoding and decoding process. Adaptable binary and context-adaptive binary arithmetic codec.
It improves the encoding and decoding efficiency of video data, reduces redundant information in the bitstream, and improves the encoding and decoding performance of high-resolution video data.
Smart Images

Figure CN116016936B_ABST
Abstract
Description
[0001] This application is a divisional application of a patent application with an application date of October 12, 2020, an invention name of “Method and device for video encoding and decoding using palette mode” and application number of 202080071603.4.
[0002] Related Applications
[0003] This application claims priority to U.S. Provisional Patent Application No. 62 / 913,623, filed on October 10, 2019, entitled “VIDEO CODING USING PALETTE MODE,” which is incorporated herein by reference in its entirety. Technical Field
[0004] The present application relates generally to video data encoding and compression, and in particular, to methods and systems for video encoding and decoding using palette modes. Background Art
[0005] Digital video is supported by various electronic devices, such as digital televisions, laptop or desktop computers, tablet computers, digital cameras, digital recording devices, digital media players, video game consoles, smart phones, video teleconferencing devices, video streaming devices, etc. Electronic devices transmit, receive, encode, decode, and / or store digital video data by implementing video compression / decompression standards such as those defined by MPEG-4, ITU-T H.263, ITU-T H.264 / MPEG-4 Part 10, Advanced Video Codec (AVC), High Efficiency Video Codec (HEVC), and Versatile Video Codec (VVC) standards. Video compression typically includes performing spatial (intra-frame) prediction and / or temporal (inter-frame) prediction to reduce or remove redundancy inherent in video data. For block-based video codecs, a video frame is partitioned into one or more strips, each strip having multiple video blocks, which may also be referred to as codec tree units (CTUs). Each CTU may contain a codec unit (CU) or may be recursively split into smaller CUs until a predefined minimum CU size is reached. Each CU (also called leaf-CU) contains one or more transform units (TUs), and each CU also contains one or more prediction units (PUs). Each CU can be coded and decoded in intra mode, inter mode, or IBC mode. Video blocks in an intra-coded (I) slice of a video frame are encoded using spatial prediction, which is performed with respect to reference samples in neighboring blocks within the same video frame. Video blocks in an inter-coded (P or B) slice of a video frame can use spatial prediction or temporal prediction, which is performed with respect to reference samples in neighboring blocks within the same video frame, and temporal prediction is performed with respect to reference samples in other previous and / or future reference video frames.
[0006] Based on spatial prediction or temporal prediction of previously encoded reference blocks (e.g., neighboring blocks), a prediction block for the current video block to be encoded is derived. The process of finding a reference block can be accomplished by a block matching algorithm. The residual data, which represents the pixel differences between the current block to be encoded and the prediction block, is called a residual block or prediction error. Inter-frame coding blocks are encoded based on motion vectors and residual blocks, and the motion vectors point to reference blocks in reference frames that form the prediction blocks. The process of determining motion vectors is generally referred to as motion estimation. Intra-frame coding blocks are encoded based on intra-frame prediction modes and residual blocks. For further compression, the residual block is transformed from the pixel domain to a transform domain, such as the frequency domain, to obtain residual transform coefficients, which can then be quantized. The quantized transform coefficients, initially arranged in a two-dimensional array, can be scanned to produce a one-dimensional vector of transform coefficients and then entropy encoded into the video bitstream to achieve even more compression.
[0007] The coded video bitstream is then stored in a computer-readable storage medium (e.g., flash memory) to be accessed by another electronic device with digital video capabilities, or directly sent to the electronic device by wire or wirelessly. The electronic device then performs video decompression (which is the reverse process of the video compression described above) in the following manner: for example, parsing the coded video bitstream to obtain syntax elements from the bitstream, and reconstructing digital video data from the coded video bitstream to its original format based at least in part on the syntax elements obtained from the bitstream, and the electronic device presents the reconstructed digital video data on a display of the electronic device.
[0008] As digital video quality changes from HD to 4Kx2K or even 8Kx4K, the amount of video data to be encoded / decoded increases exponentially. How to encode / decode video data more efficiently while maintaining the image quality of the decoded video data is an ongoing challenge. Summary of the invention
[0009] The present application describes embodiments related to encoding and decoding of video data, and more particularly, the embodiments relate to systems and methods for encoding and decoding of video using palette modes.
[0010] According to the first aspect of the present application, a method for encoding video data includes: at a first codec level, determining a first syntax element for a first group of palette mode codec units; if it is determined that the first syntax element has a first predefined value: selecting a first binarization process for the first group of palette mode codec units; using the first binarization process, encoding the first group of palette mode codec units into a bitstream; if it is determined that the first syntax element does not have the first predefined value: selecting a second binarization process for the first group of palette mode codec units, the second binarization process being different from the first binarization process; and, using the second binarization process, encoding the first group of palette mode codec units into a bitstream.
[0011] According to a second aspect of the present application, an electronic device includes one or more processing units, a memory coupled to the one or more processing units, and a plurality of programs stored in the memory. When the programs are executed by the one or more processing units, the electronic device performs the method for encoding video data as described above.
[0012] According to a third aspect of the present application, a non-transitory computer-readable storage medium stores bit streams for processing by an electronic device having one or more processing units. When the bit streams are processed by the one or more processing units, the electronic device executes the method for encoding video data as described above.
[0013] According to a fourth aspect of the present application, a computer program product comprises at least one instruction. When the at least one instruction is executed by at least one processor, the at least one processor executes the method for encoding video data as described above.
[0014] According to a fifth aspect of the present application, a non-transitory computer-readable storage medium stores a bit stream generated by the method for encoding video data as described above. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] The accompanying drawings, which are included to provide a further understanding of the embodiments and are incorporated in and constitute a part of the specification, illustrate the described embodiments and together with the description serve to explain the basic principles. Like reference numerals designate corresponding parts.
[0016] Figure 1 is a block diagram illustrating an exemplary video encoding and decoding system according to some embodiments of the present disclosure.
[0017] Figure 2 is a block diagram illustrating an exemplary video encoder according to some embodiments of the present disclosure.
[0018] Figure 3 is a block diagram illustrating an exemplary video decoder according to some embodiments of the present disclosure.
[0019] FIG. 4A to FIG. 4E is a block diagram illustrating how a frame is recursively partitioned into multiple video blocks of different sizes and shapes according to some embodiments of the present disclosure.
[0020] FIG. 5A to FIG. 5D is a block diagram illustrating an example of using a palette table for encoding and decoding video data according to some embodiments of the present disclosure.
[0021] Figure 6 is a flow chart illustrating an exemplary process by which a video decoder implements a technique for decoding video data encoded using a palette-based scheme using an adaptive binarization process according to some embodiments of the present disclosure.
[0022] Figure 7 is a block diagram illustrating an example Context Adaptive Binary Arithmetic Coding and Decoding (CABAC) engine according to some embodiments of the present disclosure. DETAILED DESCRIPTION
[0023] Reference will now be made in detail to specific embodiments, examples of which are illustrated in the accompanying drawings. In the following detailed description, numerous non-limiting specific details are set forth to aid in understanding the subject matter presented herein. However, it will be apparent to one of ordinary skill in the art that various alternatives may be used without departing from the scope of the claims, and that the subject matter may be practiced without these specific details. For example, it will be apparent to one of ordinary skill in the art that the subject matter presented herein may be implemented on many types of electronic devices having digital video capabilities.
[0024] Figure 1 is a block diagram illustrating an exemplary system 10 for encoding and decoding video blocks in parallel according to some embodiments of the present disclosure. Figure 1 As shown in , system 10 includes a source device 12 that generates and encodes video data to be later decoded by a destination device 14. Source device 12 and destination device 14 may include any of a variety of electronic devices, including a desktop or laptop computer, a tablet computer, a smart phone, a set-top box, a digital television, a camera, a display device, a digital media player, a video game console, a video streaming device, etc. In some implementations, source device 12 and destination device 14 are equipped with wireless communication capabilities.
[0025] In some embodiments, the destination device 14 may receive the encoded video data to be decoded via the link 16. The link 16 may include any type of communication medium or device capable of moving the encoded video data from the source device 12 to the destination device 14. In one example, the link 16 may include a communication medium that enables the source device 12 to directly send the encoded video data to the destination device 14 in real time. The encoded video data may be modulated according to a communication standard (such as a wireless communication protocol) and sent to the destination device 14. The communication medium may include any wireless or wired communication medium, such as a radio frequency (RF) spectrum or one or more physical transmission lines. The communication medium may form part of a packet-based network (such as a local area network, a wide area network, or a global network, such as the Internet). The communication medium may include a router, a switch, a base station, or any other equipment that may help facilitate communication from the source device 12 to the destination device 14.
[0026] In some other embodiments, the encoded video data may be sent from the output interface 22 to the storage device 32. Subsequently, the encoded video data in the storage device 32 may be accessed by the destination device 14 via the input interface 28. The storage device 32 may include any of a variety of distributed or locally accessed data storage media, such as a hard drive, a Blu-ray disc, a DVD, a CD-ROM, a flash memory, a volatile or non-volatile memory, or any other suitable digital storage medium for storing encoded video data. In a further example, the storage device 32 may correspond to a file server or another intermediate storage device that may hold the encoded video data generated by the source device 12. The destination device 14 may access the stored video data from the storage device 32 via streaming or downloading. The file server may be any type of computer capable of storing encoded video data and sending the encoded video data to the destination device 14. Exemplary file servers include a web server (e.g., for a website), an FTP server, a network attached storage (NAS) device, or a local disk drive. The destination device 14 may access the encoded video data through any standard data connection suitable for accessing the encoded video data stored on the file server, including a wireless channel (e.g., a Wi-Fi connection), a wired connection (e.g., DSL, cable modem, etc.), or a combination of both. The transmission of the encoded video data from the storage device 32 may be a streaming transmission, a download transmission, or a combination of both.
[0027] like Figure 1As shown in , source device 12 includes a video source 18, a video encoder 20, and an output interface 22. Video source 18 may include a source such as a video capture device (e.g., a camera), a video archive containing previously captured video, a video feed interface for receiving video from a video content provider, and / or a computer graphics system for generating computer graphics data as source video, or a combination of such sources. As an example, if video source 18 is a camera of a security surveillance system, source device 12 and destination device 14 may form a camera phone or a video phone. However, the embodiments described in the present application may be generally applicable to video encoding and decoding, and may be applied to wireless applications and / or wired applications.
[0028] Captured video, pre-captured video, or computer-generated video may be encoded by video encoder 20. Encoded video data may be sent directly to destination device 14 via output interface 22 of source device 12. Encoded video data may also (or alternatively) be stored on storage device 32 for later access by destination device 14 or other devices for decoding and / or playback. Output interface 22 may also include a modem and / or a transmitter.
[0029] Destination device 14 includes input interface 28, video decoder 30, and display device 34. Input interface 28 may include a receiver and / or a modem and receives encoded video data over link 16. The encoded video data transmitted over link 16 or provided on storage device 32 may include various syntax elements generated by video encoder 20 for use by video decoder 30 in decoding the video data. Such syntax elements may be included within the encoded video data sent over a communication medium, stored on a storage medium, or stored on a file server.
[0030] In some implementations, destination device 14 may include display device 34, which may be an integrated display device or an external display device configured to communicate with destination device 14. Display device 34 displays the decoded video data to a user and may include any of a variety of display devices, such as a liquid crystal display (LCD), a plasma display, an organic light emitting diode (OLED) display, or another type of display device.
[0031] The video encoder 20 and the video decoder 30 may operate according to a proprietary standard or an industry standard such as VVC, HEVC, MPEG-4 Part 10, Advanced Video Codec AVC, or an extension of such a standard. It should be understood that the present application is not limited to a specific video codec / decoding standard and may be applicable to other video codec / decoding standards. It is generally expected that the video encoder 20 of the source device 12 may be configured to encode video data according to any of these current or future standards. Similarly, it is also generally expected that the video decoder 30 of the destination device 14 may be configured to decode video data according to any of these current or future standards.
[0032] The video encoder 20 and the video decoder 30 may each be implemented as any of a variety of suitable encoder circuitry, such as one or more microprocessors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field programmable gate arrays (FPGAs), discrete logic, software, hardware, firmware, or any combination thereof. When implemented in part in software, the electronic device may store instructions for the software in a suitable non-transitory computer-readable medium and execute the instructions in hardware using one or more processors to perform the video encoding / decoding operations disclosed in the present disclosure. Each of the video encoder 20 and the video decoder 30 may be included in one or more encoders or decoders, either of which may be integrated as part of a combined encoder / decoder (CODEC) in a corresponding device.
[0033] Figure 2 is a block diagram illustrating an exemplary video encoder 20 according to some embodiments described in the present application. The video encoder 20 can perform intra-frame prediction codec and inter-frame prediction codec of video blocks within a video frame. Intra-frame prediction codec relies on spatial prediction to reduce or remove spatial redundancy in video data within a given video frame or picture. Inter-frame prediction codec relies on temporal prediction to reduce or remove temporal redundancy in video data within adjacent video frames or pictures of a video sequence.
[0034] like Figure 2As shown in , the video encoder 20 includes a video data memory 40, a prediction processing unit 41, a decoded picture buffer (DPB) 64, an adder 50, a transform processing unit 52, a quantization unit 54, and an entropy coding unit 56. The prediction processing unit 41 also includes a motion estimation unit 42, a motion compensation unit 44, a segmentation unit 45, an intra-frame prediction processing unit 46, and an intra-frame block copy (IBC) unit 48. In some embodiments, the video encoder 20 also includes an inverse quantization unit 58, an inverse transform processing unit 60, and an adder 62 for video block reconstruction. A deblocking filter (not shown) can be located between the adder 62 and the DPB 64 to filter the block boundaries to remove blocking artifacts from the reconstructed video. In addition to the deblocking filter, a loop filter (not shown) can also be used to filter the output of the adder 62. The video encoder 20 can take the form of a fixed hardware unit or a programmable hardware unit, or can be divided between one or more of the fixed hardware units or programmable hardware units described.
[0035] The video data memory 40 may store video data to be encoded by the components of the video encoder 20. The video data in the video data memory 40 may be obtained, for example, from the video source 18. The DPB 64 is a buffer that stores reference video data used by the video encoder 20 when encoding the video data (e.g., in an intra-frame or inter-frame prediction codec mode). The video data memory 40 and the DPB 64 may be formed by any of a variety of memory devices. In various examples, the video data memory 40 may be on-chip with other components of the video encoder 20, or off-chip relative to those components.
[0036] like Figure 2 As shown in , after receiving the video data, the segmentation unit 45 within the prediction processing unit 41 segments the video data into video blocks. The segmentation may also include segmenting the video frame into strips, tiles, or other larger codec units (CUs) according to a predefined splitting structure (such as a quadtree structure) associated with the video data. The video frame may be divided into a plurality of video blocks (or a set of video blocks referred to as tiles). The prediction processing unit 41 may select one of a plurality of possible prediction codec modes for the current video block based on error results (e.g., codec rate and distortion level), such as one of a plurality of intra-frame prediction codec modes or one of a plurality of inter-frame prediction codec modes. The prediction processing unit 41 may provide the obtained intra-frame or inter-frame prediction codec block to the adder 50 to generate a residual block, and to the adder 62 to reconstruct the encoded block for subsequent use as part of a reference frame. The prediction processing unit 41 also provides syntax elements such as motion vectors, intra-frame mode indicators, segmentation information, and other such syntax information to the entropy coding unit 56.
[0037] In order to select an appropriate intra-frame prediction codec mode for the current video block, the intra-frame prediction processing unit 46 within the prediction processing unit 41 may perform intra-frame prediction codec of the current video block relative to one or more neighboring blocks in the same frame as the current block to be coded to provide spatial prediction. The motion estimation unit 42 and the motion compensation unit 44 within the prediction processing unit 41 perform inter-frame prediction codec of the current video block relative to one or more prediction blocks in one or more reference frames to provide temporal prediction. The video encoder 20 may perform multiple codec passes, for example, to select an appropriate codec mode for each block of video data.
[0038] In some embodiments, motion estimation unit 42 determines the inter-prediction mode for the current video frame by generating a motion vector according to a predetermined pattern within a sequence of video frames, the motion vector indicating the displacement of a prediction unit (PU) of a video block within the current video frame relative to a prediction block within a reference video frame. Motion estimation performed by motion estimation unit 42 is the process of generating motion vectors, which estimate motion for video blocks. The motion vector may, for example, indicate the displacement of a PU of a video block within a current video frame or picture relative to a prediction block (or other coded unit) within a reference frame, the prediction block being relative to a current block (or other coded unit) coded within the current frame. The predetermined pattern may designate video frames in the sequence as P frames or B frames. IBC unit 48 may determine vectors (e.g., block vectors) for IBC coding in a manner similar to the manner in which motion vectors are determined by motion estimation unit 42 for inter-prediction, or may utilize motion estimation unit 42 to determine block vectors.
[0039] A prediction block is a block of a reference frame that is considered to closely match the PU of the video block to be encoded in terms of pixel difference, which can be determined by the sum of absolute difference (SAD), the sum of squared difference (SSD), or other difference metrics. In some embodiments, the video encoder 20 can calculate the values of sub-integer pixel positions of the reference frame stored in the DPB 64. For example, the video encoder 20 can interpolate the values of quarter-pixel positions, eighth-pixel positions, or other fractional pixel positions of the reference frame. Therefore, the motion estimation unit 42 can perform a motion search relative to the full pixel positions and the fractional pixel positions and output a motion vector with fractional pixel accuracy.
[0040] Motion estimation unit 42 calculates a motion vector for a PU of a video block in an inter-predicted codec frame by comparing the position of the PU with the position of a prediction block of a reference frame selected from a first reference frame list (list 0) or a second reference frame list (list 1), each of which identifies one or more reference frames stored in DPB 64. Motion estimation unit 42 sends the calculated motion vector to motion compensation unit 44 and then to entropy encoding unit 56.
[0041] The motion compensation performed by the motion compensation unit 44 may involve obtaining or generating a prediction block based on the motion vector determined by the motion estimation unit 42. Upon receiving the motion vector for the PU of the current video block, the motion compensation unit 44 may locate the prediction block pointed to by the motion vector in one of the reference frame lists, retrieve the prediction block from the DPB 64, and forward the prediction block to the adder 50. The adder 50 then forms a residual video block of pixel difference values by subtracting the pixel values of the prediction block provided by the motion compensation unit 44 from the pixel values of the current video block being encoded and decoded. The pixel difference values forming the residual video block may include a luminance difference component or a chrominance difference component or both. The motion compensation unit 44 may also generate syntax elements associated with the video block of the video frame for use by the video decoder 30 when decoding the video block of the video frame. The syntax elements may include, for example, syntax elements defining a motion vector for identifying the prediction block, any flag indicating a prediction mode, or any other syntax information described herein. Note that the motion estimation unit 42 and the motion compensation unit 44 may be highly integrated, but are described separately for conceptual purposes.
[0042] In some embodiments, the IBC unit 48 may generate a vector and obtain a prediction block in a manner similar to that described above in conjunction with the motion estimation unit 42 and the motion compensation unit 44, but the prediction block is located in the same frame as the current block being encoded and decoded, and the vector is referred to as a block vector rather than a motion vector. Specifically, the IBC unit 48 may determine an intra-prediction mode for encoding the current block. In some examples, the IBC unit 48 may, for example, use various intra-prediction modes to encode the current block during multiple separate encoding passes, and test their performance through rate-distortion analysis. Next, the IBC unit 48 may select an appropriate intra-prediction mode to use among the various tested intra-prediction modes, and generate an intra-mode indicator accordingly. For example, the IBC unit 48 may calculate rate-distortion values for the various tested intra-prediction modes using rate-distortion analysis, and select an intra-prediction mode with the best rate-distortion characteristics among the tested modes as the appropriate intra-prediction mode to be used. The rate-distortion analysis typically determines the amount of distortion (or error) between a coded block and the original uncoded block that was coded to produce the coded block, and the bit rate (i.e., the number of bits) used to produce the coded block. IBC unit 48 may calculate a ratio from the distortion and rate for the various coded blocks to determine which intra-prediction mode exhibits the best rate-distortion value for the block.
[0043] In other examples, IBC unit 48 may use, in whole or in part, motion estimation unit 42 and motion compensation unit 44 to perform such functions for IBC prediction according to embodiments described herein. In either case, for intra block copy, the prediction block may be a block that is considered to closely match the block to be coded in terms of pixel difference, which may be determined by the sum of absolute difference (SAD), sum of squared difference (SSD), or other difference metrics, and identification of the prediction block may include value calculations for sub-integer pixel positions.
[0044] Regardless of whether the prediction block is from the same frame according to intra-frame prediction or from different frames according to inter-frame prediction, video encoder 20 can form a residual video block by subtracting the pixel values of the prediction block from the pixel values of the current video block being decoded to form pixel difference values. The pixel difference values forming the residual video block may include both luma component differences and chroma component differences.
[0045] As an alternative to the inter-frame prediction performed by the motion estimation unit 42 and the motion compensation unit 44 or the intra-frame block copy prediction performed by the IBC unit 48 as described above, the intra-frame prediction processing unit 46 can perform intra-frame prediction on the current video block. Specifically, the intra-frame prediction processing unit 46 can determine the intra-frame prediction mode used to encode the current block. To this end, the intra-frame prediction processing unit 46 can use various intra-frame prediction modes to encode the current block, for example, during multiple separate encoding passes, and the intra-frame prediction processing unit 46 (or in some examples, the mode selection unit) can select the appropriate intra-frame prediction mode to be used from the tested intra-frame prediction modes. The intra-frame prediction processing unit 46 can provide information to the entropy coding unit 56, which indicates the intra-frame prediction mode selected for the block. The entropy coding unit 56 can encode the information indicating the selected intra-frame prediction mode in the bitstream.
[0046] After prediction processing unit 41 determines a prediction block for the current video block via inter-prediction or intra-prediction, adder 50 forms a residual video block by subtracting the prediction block from the current video block. The residual video data in the residual block may be included in one or more transform units (TUs) and provided to transform processing unit 52. Transform processing unit 52 transforms the residual video data into residual transform coefficients using a transform, such as a discrete cosine transform (DCT) or a conceptually similar transform.
[0047] The transform processing unit 52 may send the resulting transform coefficients to a quantization unit 54. The quantization unit 54 quantizes the transform coefficients to further reduce the bit rate. The quantization process may also reduce the bit depth associated with some or all coefficients. The degree of quantization may be modified by adjusting a quantization parameter. In some examples, the quantization unit 54 may then perform a scan of the matrix including the quantized transform coefficients. Alternatively, the entropy coding unit 56 may perform the scan.
[0048] After quantization, entropy coding unit 56 entropy encodes the quantized transform coefficients into a video bitstream using, for example, context adaptive variable length coding (CAVLC), context adaptive binary arithmetic coding (CABAC), syntax-based context adaptive binary arithmetic coding (SBAC), probability interval partitioning entropy (PIPE) coding, or another entropy coding method or technique. The encoded bitstream may then be sent to video decoder 30, or archived in storage device 32 for later transmission to or retrieval by video decoder 30. Entropy coding unit 56 may also entropy encode motion vectors and other syntax elements for the current video frame being encoded or decoded.
[0049] Inverse quantization unit 58 and inverse transform processing unit 60 apply inverse quantization and inverse transform, respectively, to reconstruct the residual video block in the pixel domain to generate a reference block for predicting other video blocks. As noted above, motion compensation unit 44 may generate a motion compensated prediction block from one or more reference blocks of a frame stored in DPB 64. Motion compensation unit 44 may also apply one or more interpolation filters to the prediction block to calculate sub-integer pixel values for use in motion estimation.
[0050] Adder 62 adds the reconstructed residual block to the motion compensated prediction block produced by motion compensation unit 44 to produce a reference block for storage in DPB 64. The reference block may then be used as a prediction block by IBC unit 48, motion estimation unit 42, and motion compensation unit 44 to inter-predict another video block in a subsequent video frame.
[0051] Figure 3 is a block diagram showing an exemplary video decoder 30 according to some embodiments of the present application. The video decoder 30 includes a video data memory 79, an entropy decoding unit 80, a prediction processing unit 81, an inverse quantization unit 86, an inverse transform processing unit 88, an adder 90, and a DPB 92. The prediction processing unit 81 also includes a motion compensation unit 82, an intra-frame prediction processing unit 84, and an IBC unit 85. The video decoder 30 can perform a decoding process, which is generally combined with the above Figure 2 The encoding process is reciprocal to that described with respect to video encoder 20. For example, motion compensation unit 82 may generate prediction data based on motion vectors received from entropy decoding unit 80, while intra-prediction unit 84 may generate prediction data based on intra-prediction mode indicators received from entropy decoding unit 80.
[0052] In some examples, units of the video decoder 30 may be tasked to perform embodiments of the present application. In addition, in some examples, embodiments of the present disclosure may be divided between one or more units of the video decoder 30. For example, the IBC unit 85 may perform embodiments of the present application alone or in combination with other units of the video decoder 30, such as the motion compensation unit 82, the intra-frame prediction processing unit 84, and the entropy decoding unit 80. In some examples, the video decoder 30 may not include the IBC unit 85, and the functions of the IBC unit 85 may be performed by other components of the prediction processing unit 81, such as the motion compensation unit 82.
[0053] The video data memory 79 may store video data, such as an encoded video bitstream, to be decoded by other components of the video decoder 30. The video data stored in the video data memory 79 may be obtained, for example, from the storage device 32, from a local video source (such as a camera), via a wired or wireless network communication of video data, or by accessing a physical data storage medium (e.g., a flash drive or hard disk). The video data memory 79 may include a codec picture buffer (CPB) that stores encoded video data from an encoded video bitstream. A decoded picture buffer (DPB) 92 of the video decoder 30 stores reference video data for use by the video decoder 30 when decoding video data (e.g., in intra-frame or inter-frame prediction codec modes). The video data memory 79 and the DPB 92 may be formed by any of a variety of memory devices, such as dynamic random access memory (DRAM) (including synchronous DRAM, SDRAM), magnetoresistive RAM (MRAM), resistive RAM (RRAM), or other types of memory devices. For purposes of illustration, the video data memory 79 and the DPB 92 are illustrative. Figure 3 92 are depicted as two different components of the video decoder 30. However, it will be clear to those skilled in the art that the video data memory 79 and the DPB 92 can be provided by the same memory device or separate memory devices. In some examples, the video data memory 79 can be located on the chip with other components of the video decoder 30, or off-chip relative to those components.
[0054] During the decoding process, the video decoder 30 receives an encoded video bitstream and associated syntax elements, the encoded video bitstream representing video blocks of an encoded video frame. The video decoder 30 may receive syntax elements at the video frame level and / or at the video block level. The entropy decoding unit 80 of the video decoder 30 entropy decodes the bitstream to generate quantized coefficients, motion vectors or intra-prediction mode indicators, and other syntax elements. The entropy decoding unit 80 then forwards the motion vectors and other syntax elements to the prediction processing unit 81.
[0055] When a video frame is encoded and decoded as an intra-frame prediction codec (I) frame or an intra-frame codec prediction block in other types of frames, the intra-frame prediction processing unit 84 of the prediction processing unit 81 can generate prediction data for a video block of the current video frame based on the intra-frame prediction mode sent by the signal and the reference data from the previously decoded block of the current frame.
[0056] When the video frame is encoded and decoded as an inter-frame prediction codec (i.e., B or P) frame, the motion compensation unit 82 of the prediction processing unit 81 generates one or more prediction blocks for the video block of the current video frame based on the motion vectors and other syntax elements received from the entropy decoding unit 80. Each prediction block in the prediction block can be generated from a reference frame in one of the reference frame lists. The video decoder 30 can construct the reference frame lists: List 0 and List 1 based on the reference frames stored in the DPB 92 using a default construction technique.
[0057] In some examples, when the video block is encoded and decoded according to the IBC mode described herein, IBC unit 85 of prediction processing unit 81 generates a prediction block for the current video block based on the block vector and other syntax elements received from entropy decoding unit 80. The prediction block may be located within a reconstructed region of the same picture as the current video block defined by video encoder 20.
[0058] The motion compensation unit 82 and / or the IBC unit 85 determine prediction information for a video block of the current video frame by parsing the motion vector and other syntax elements, and then use the prediction information to generate a prediction block for the current video block being decoded. For example, the motion compensation unit 82 uses some of the received syntax elements to determine a prediction mode (e.g., intra-frame prediction or inter-frame prediction) for encoding and decoding a video block of a video frame, an inter-frame prediction frame type (e.g., B or P), construction information for one or more reference frame lists for a frame, a motion vector for each inter-frame prediction encoded video block of a frame, an inter-frame prediction state for each inter-frame prediction encoded decoded video block of a frame, and other information for decoding a video block in the current video frame.
[0059] Similarly, IBC unit 85 may use some of the received syntax elements (e.g., flags) to determine whether the current video block is predicted using an IBC mode, construction information of which video blocks of the frame are within the reconstruction region and should be stored in DPB 92, block vectors for each IBC-predicted video block of the frame, IBC prediction states for each IBC-predicted video block of the frame, and other information for decoding video blocks in the current video frame.
[0060] Motion compensation unit 82 may also perform interpolation using interpolation filters as used by video encoder 20 during encoding of the video blocks to calculate interpolated values for sub-integer pixels of reference blocks. In this case, motion compensation unit 82 may determine the interpolation filters used by video encoder 20 from the received syntax elements and use these interpolation filters to produce the prediction blocks.
[0061] Inverse quantization unit 86 inverse quantizes the quantized transform coefficients provided in the bitstream and entropy decoded by entropy decoding unit 80 using the same quantization parameters calculated by video encoder 20 for each video block in the video frame to determine the degree of quantization. Inverse transform processing unit 88 applies an inverse transform, such as an inverse DCT, an inverse integer transform, or a conceptually similar inverse transform process, to the transform coefficients to reconstruct the residual block in the pixel domain.
[0062] After the motion compensation unit 82 or the IBC unit 85 generates a prediction block for the current video block based on the vector and other syntax elements, the adder 90 reconstructs the decoded video block for the current video block by summing the residual block from the inverse transform processing unit 88 and the corresponding prediction block generated by the motion compensation unit 82 and the IBC unit 85. A loop filter (not shown) may be located between the adder 90 and the DPB 92 to further process the decoded video block. The decoded video blocks in a given frame are then stored in the DPB 92, which stores reference frames for subsequent motion compensation of the next video block. The DPB 92 or a memory device separate from the DPB 92 may also store the decoded video for later display on a display device such as Figure 1 is presented on a display device 34).
[0063] In a typical video encoding and decoding process, a video sequence usually includes an ordered set of frames or pictures. Each frame may include three sample arrays, denoted as SL, SCb, and SCr. SL is a two-dimensional array of luma samples. SCb is a two-dimensional array of Cb chroma samples. SCr is a two-dimensional array of Cr chroma samples. In other cases, a frame may be monochrome and therefore only include a two-dimensional array of luma samples.
[0064] like Figure 4A As shown in , the video encoder 20 (or more specifically the segmentation unit 45) generates an encoded representation of the frame by first segmenting the frame into a set of codec tree units (CTUs). A video frame may include an integer number of CTUs sequentially ordered in a raster scan order from left to right and from top to bottom. Each CTU is the largest logical codec unit, and the width and height of the CTU are signaled by the video encoder 20 in a sequence parameter set so that all CTUs in a video sequence have the same size, namely one of 128×128, 64×64, 32×32, and 16×16. It should be noted, however, that the present application is not necessarily limited to a particular size. As Figure 4BAs shown in , each CTU may include one codec tree block (CTB) of luma samples, two corresponding codec tree blocks of chroma samples, and syntax elements for encoding and decoding samples of the codec tree blocks. The syntax elements describe the properties of different types of units of the encoded pixel blocks and how the video sequence can be reconstructed at the video decoder 30, including inter-frame prediction or intra-frame prediction, intra-frame prediction mode, motion vectors and other parameters. In a monochrome picture or a picture with three separate color planes, a CTU may include a single codec tree block and syntax elements for encoding and decoding samples of the codec tree block. The codec tree block may be an NxN block of samples.
[0065] To achieve better performance, the video encoder 20 may recursively perform tree partitioning, such as binary tree partitioning, ternary tree partitioning, quadtree partitioning, or a combination thereof, on the codec tree block of the CTU and divide the CTU into smaller codec units (CUs). Figure 4C As depicted in , a 64x64 CTU 400 is first divided into four smaller CUs, each of which has a block size of 32x32. Among the four smaller CUs, CU 410 and CU 420 are each divided into four 16x16 CUs by block size. Two 16x16 CUs 430 and CU 440 are each further divided into four 8x8 CUs by block size. Figure 4D Depicts a quadtree data structure, which shows Figure 4C The final result of the partitioning process of the CTU 400 depicted in FIG. 4 is that each leaf node of the quadtree corresponds to a CU of a corresponding size ranging from 32x32 to 8x8. Figure 4B In the CTU depicted in FIG, each CU may include a codec block (CB) of luma samples and two corresponding codec blocks of chroma samples of the same size frame, and syntax elements for encoding and decoding the samples of the codec block. In a monochrome picture or a picture with three separate color planes, a CU may include a single codec block and syntax structures for encoding and decoding the samples of the codec block. It should be noted that Figure 4C and Figure 4D The quadtree partitioning depicted in FIG is for illustration purposes only, and a CTU can be split into CUs based on quadtree / ternary / binary tree partitioning to accommodate different local characteristics. In the multi-type tree structure, a CTU is partitioned by a quadtree structure, and each quadtree leaf CU can be further partitioned by a binary and ternary tree structure. Figure 4E As shown in , there are five types of segmentation, namely, four-pronged segmentation, horizontal two-pronged segmentation, vertical two-pronged segmentation, horizontal three-pronged segmentation, and vertical three-pronged segmentation.
[0066] In some embodiments, the video encoder 20 may further partition the codec block of the CU into one or more MxN prediction blocks (PBs). A prediction block is a rectangular (square or non-square) block of samples to which the same prediction (inter or intra) is applied. The prediction unit (PU) of a CU may include a prediction block of luma samples, two corresponding prediction blocks of chroma samples, and syntax elements for predicting the prediction blocks. In a monochrome picture or a picture with three separate color planes, a PU may include a single prediction block and a syntax structure for predicting the prediction block. The video encoder 20 may generate predicted luma blocks, Cb blocks, and Cr blocks for the luma prediction blocks, Cb prediction blocks, and Cr prediction blocks of each PU of the CU.
[0067] Video encoder 20 may use intra prediction or inter prediction to generate a prediction block for a PU. If video encoder 20 uses intra prediction to generate a prediction block for a PU, video encoder 20 may generate the prediction block for the PU based on decoded samples of a frame associated with the PU. If video encoder 20 uses inter prediction to generate a prediction block for a PU, video encoder 20 may generate the prediction block for the PU based on decoded samples of one or more frames different from the frame associated with the PU.
[0068] After the video encoder 20 generates the predicted luma block, Cb block, and Cr block for one or more PUs of a CU, the video encoder 20 may generate a luma residual block for the CU by subtracting the predicted luma block of the CU from its original luma codec block, so that each sample in the luma residual block of the CU indicates the difference between a luma sample in one of the predicted luma blocks of the CU and a corresponding sample in the original luma codec block of the CU. Similarly, the video encoder 20 may generate a Cb residual block and a Cr residual block for the CU, respectively, so that each sample in the Cb residual block of the CU indicates the difference between a Cb sample in one of the predicted Cb blocks of the CU and a corresponding sample in the original Cb codec block of the CU, and each sample in the Cr residual block of the CU may indicate the difference between a Cr sample in one of the predicted Cr blocks of the CU and a corresponding sample in the original Cr codec block of the CU.
[0069] In addition, if Figure 4CAs shown in , the video encoder 20 can use quadtree partitioning to decompose the luma residual block, Cb residual block and Cr residual block of the CU into one or more luma transform blocks, Cb transform blocks and Cr transform blocks. A transform block is a rectangular (square or non-square) sample block to which the same transform is applied. The transform unit (TU) of the CU may include a transform block of luma samples, two corresponding transform blocks of chroma samples, and syntax elements for transforming the transform block samples. Therefore, each TU of the CU may be associated with a luma transform block, a Cb transform block and a Cr transform block. In some examples, the luma transform block associated with the TU may be a sub-block of the luma residual block of the CU. The Cb transform block may be a sub-block of the Cb residual block of the CU. The Cr transform block may be a sub-block of the Cr residual block of the CU. In a monochrome picture or a picture with three separate color planes, a TU may include a single transform block and a syntax structure for transforming the samples of the transform block.
[0070] The video encoder 20 may apply one or more transforms to the luma transform block of the TU to generate a luma coefficient block for the TU. The coefficient block may be a two-dimensional array of transform coefficients. The transform coefficient may be a scalar. The video encoder 20 may apply one or more transforms to the Cb transform block of the TU to generate a Cb coefficient block for the TU. The video encoder 20 may apply one or more transforms to the Cr transform block of the TU to generate a Cr coefficient block for the TU.
[0071] After generating a coefficient block (e.g., a luma coefficient block, a Cb coefficient block, or a Cr coefficient block), the video encoder 20 may quantize the coefficient block. Quantization generally refers to a process in which transform coefficients are quantized to potentially reduce the amount of data used to represent the transform coefficients, thereby providing further compression. After the video encoder 20 quantizes the coefficient block, the video encoder 20 may entropy encode syntax elements indicating the quantized transform coefficients. For example, the video encoder 20 may perform context-adaptive binary arithmetic coding (CABAC) on the syntax elements indicating the quantized transform coefficients. Finally, the video encoder 20 may output a bitstream including a sequence of bits forming a representation of a coded frame and associated data, the bitstream being stored in the storage device 32 or transmitted to the destination device 14.
[0072] After receiving the bitstream generated by the video encoder 20, the video decoder 30 can parse the bitstream to obtain syntax elements from the bitstream. The video decoder 30 can reconstruct a frame of video data based at least in part on the syntax elements obtained from the bitstream. The process of reconstructing video data is generally inverse to the encoding process performed by the video encoder 20. For example, the video decoder 30 can perform an inverse transform on a coefficient block associated with a TU of the current CU to reconstruct a residual block associated with the TU of the current CU. The video decoder 30 also reconstructs the codec block of the current CU by adding samples of the prediction block for the PU of the current CU to corresponding samples of the transform block of the TU of the current CU. After reconstructing the codec block for each CU of the frame, the video decoder 30 can reconstruct the frame.
[0073] As noted above, video codecs mainly use two modes to achieve video compression, namely, intra-frame prediction (or intra-frame prediction) and inter-frame prediction (or inter-frame prediction). Palette-based coding is another coding scheme that has been adopted by many video coding standards. In palette-based coding (which may be particularly suitable for screen-generated content coding), a video codec (e.g., video encoder 20 or video decoder 30) forms a palette table of colors that represents the video data of a given block. The palette table includes the most dominant (e.g., frequently used) pixel values in a given block. Pixel values that are not frequently represented in the video data of a given block are not included in the palette table, or are included in the palette table as escape colors.
[0074] Each entry in the palette table includes an index to the corresponding pixel value in the palette table. The palette index for the sample in the block can be encoded and decoded to indicate which entry from the palette table will be used to predict or reconstruct which sample. The palette mode begins with a process of generating palette prediction values for the first block of a picture, strip, tile, or other such video block grouping. As will be explained below, palette prediction values for subsequent video blocks are typically generated by updating previously used palette prediction values. For purposes of illustration, it is assumed that the palette prediction values are defined at the picture level. In other words, a picture may include multiple codec blocks, each with its own palette table, but there is only one palette prediction value for the entire picture.
[0075] In order to reduce the bits required to signal palette entries in a video bitstream, a video decoder can utilize a palette prediction value to determine a new palette entry in a palette table for reconstructing a video block. For example, the palette prediction value may include palette entries from a previously used palette table, or even be initialized with the most recently used palette table by including all entries of the most recently used palette table. In some embodiments, the palette prediction value may include less than all entries from the most recently used palette table, and then include some entries from other previously used palette tables. The palette prediction value may have the same size as the palette table used to encode and decode different blocks, or may be larger or smaller than the palette table used to encode and decode different blocks. In one example, the palette prediction value is implemented as a first-in-first-out (FIFO) table including 64 palette entries.
[0076] To generate a palette table for a block of video data from a palette prediction value, a video decoder may receive a 1-bit flag for each entry of a palette prediction value from an encoded video bitstream. The 1-bit flag may have a first value (e.g., binary 1) or a second value (e.g., binary 0), the first value indicating that the associated entry of the palette prediction value will be included in the palette table, and the second value indicating that the associated entry of the palette prediction value will not be included in the palette table. If the size of the palette prediction value is larger than the palette table for the block of video data, the video decoder may stop receiving more flags once a maximum size for the palette table is reached.
[0077] In some embodiments, some entries in a palette table can be directly signaled in an encoded video bitstream rather than being determined using palette prediction values. For such entries, a video decoder can receive three separate m-bit values from an encoded video bitstream, the three separate m-bit values indicating the pixel values of the luminance component and two chrominance components associated with the entry, where m represents the bit depth of the video data. Compared to the multiple m-bit values required for palette entries that are directly signaled, those palette entries derived from palette prediction values only require a 1-bit flag. Therefore, using palette prediction values to signal some or all palette entries can significantly reduce the number of bits required to signal new palette table entries, thereby improving the overall codec efficiency of palette mode codecs.
[0078] In many cases, the palette prediction value for a block is determined based on the palette table used to encode and decode one or more previously coded blocks. However, when encoding and decoding the first codec tree unit in a picture, slice, or tile, the palette table of the previously coded block may be unavailable. Therefore, the palette prediction value cannot be generated using the entries of the previously used palette table. In this case, a sequence of initialization values of the palette prediction value can be signaled in a sequence parameter set (SPS) and / or a picture parameter set (PPS), which are the values used to generate the palette prediction value when the previously used palette table is unavailable. SPS generally refers to the syntax structure of syntax elements applied to a series of consecutive coded video pictures, which is called a coded video sequence (CVS), and the CVS is determined by the content of the syntax elements found in the PPS referenced by the syntax elements found in each slice segment header. PPS generally refers to the syntax structure of syntax elements applied to one or more individual pictures within a CVS, which is determined by the syntax elements found in each slice segment header. Thus, the SPS is generally considered a higher-level syntax structure than the PPS, meaning that syntax elements included in the SPS generally change less frequently and apply to a larger portion of the video data than syntax elements included in the PPS.
[0079] FIG. 5A to FIG. 5B is a block diagram illustrating an example of using a palette table for encoding and decoding video data according to some embodiments of the present disclosure.
[0080] For palette (PLT) mode signaling, the palette mode is encoded and decoded as the prediction mode for the codec unit, that is, the prediction mode for the codec unit can be MODE_INTRA, MODE_INTER, MODE_IBC and MODE_PLT. If the palette mode is used, the pixel values in the CU are represented by a small group of representative color values. This group is called a palette. For pixels with values close to the palette colors, the palette index is sent with a signal. For pixels with values outside the palette, the pixels are represented using escape symbols and the quantized pixel values are directly sent with a signal.
[0081] To decode a palette mode encoded block, the decoder needs to decode the palette colors and indices from the bitstream. The palette colors are defined by the palette table and encoded by the palette table encoding and decoding syntax (e.g., palette_predictor_run, num_signaled_palette_entries, new_palette_entries). For each CU, the escape flag palette_escape_val_present_flag is signaled to indicate whether there is an escape symbol in the current CU. If there is an escape symbol, the palette table adds one more entry and assigns the last index to the escape mode. The palette indices of all pixels in the CU form a palette index map and are encoded by the palette index map encoding and decoding syntax (e.g., num_palette_indices_minus1, palette_idx_idc, copy_above_indices_for_final_run_flag, palette_transpose_flag, copy_above_palette_indices_flag, palette_run_prefix, palette_run_suffix). Figure 5A An example of palette mode encoding and decoding a CU is shown in Figure 1, where the palette size is 4. The first 3 samples in the CU are reconstructed using palette entries 2, 0, and 3 respectively. The "x" samples in the CU represent escape symbols. The CU level flag palette_escape_val_present_flag indicates whether there are any escape symbols in the CU. If there are escape symbols, the palette size is increased by 1 and the last index is used to indicate the escape symbol. Therefore, in Figure 5A , index 4 is assigned to the escape symbol.
[0082] For encoding and decoding of the palette table, a palette prediction value is maintained. The palette prediction value is initialized at the beginning of each stripe, where the palette prediction value is reset to 0. For each entry in the palette prediction value, a reuse flag is signaled to indicate whether it is part of the current palette. Figure 5BAs shown in , the reuse flag palette_predictor_run is sent. Thereafter, the number of new palette entries is signaled using a 0-order exponential Golomb code through the syntax num_signaled_palette_entries. Finally, the component values new_palette_entries[] for the new palette entries are signaled. After encoding and decoding the current CU, the palette prediction value is updated using the current palette, and the entries from the previous palette prediction value that are not reused in the current palette will be added to the end of the new palette prediction value until the maximum allowed size is reached.
[0083] To encode and decode a palette index map, such as Figure 5C The indices are encoded or decoded using horizontal or vertical traversal scan as shown in . The scan order is explicitly signaled in the bitstream using palette_transpose_flag.
[0084] Palette indices are encoded and decoded using two main palette sample modes: 'INDEX' and 'COPY_ABOVE'. In 'INDEX' mode, the palette index is explicitly signaled. In 'COPY_ABOVE' mode, the palette index of the sample in the row above is copied. For both 'INDEX' and 'COPY_ABOVE' modes, a run value is signaled that specifies the number of pixels encoded and decoded using the same mode. The mode is signaled using a flag, except for the top row when horizontal scanning is used, or the first column when vertical scanning is used, or when the previous mode was 'COPY_ABOVE'.
[0085] In some embodiments, the encoding and decoding order for the index mapping is as follows: first, the number of index values for the CU is signaled using the syntax num_palette_indices_minus1, followed by the actual index value for the entire CU using the syntax palette_idx_idc. Both the number of indexes and the index values are encoded and decoded in bypass mode. This groups the binary bits of the bypass encoding and decoding related to the index together. Then, the palette mode (INDEX or COPY_ABOVE) and the run length are signaled in an interleaved manner using the syntax copy_above_palette_indices_flag, palette_run_prefix, and palette_run_suffix. copy_above_palette_indices_flag is a flag for context encoding and decoding (only one binary bit), the codeword of palette_run_prefix is determined by the process described in Table 3 below, and the first 5 binary bits are context encoded and decoded. palette_run_suffix is encoded and decoded as a bypass binary bit. Finally, the component escape values corresponding to the escape samples for the entire CU are grouped together and encoded in bypass mode. An additional syntax element copy_above_indices_for_final_run_flag is signaled after the index values are signaled. This syntax element, combined with the number of indices, eliminates the need to signal the run value corresponding to the last run in the block.
[0086] In the VVC reference software (VTM), dual tree is enabled for I-slices, which separates the codec unit partitioning for luma and chroma components. As a result, the palette is applied separately to luma (Y component) and chroma (Cb component and Cr component). If dual tree is disabled, the palette will be applied jointly to Y component, Cb component, Cr component.
[0087] Table 1 Syntax of palette encoding and decoding
[0088]
[0089]
[0090]
[0091] Table 2 Semantics of palette encoding and decoding
[0092]
[0093]
[0094]
[0095]
[0096] Table 3 Binary codewords and CABAC context selection for grammar palette_run_prefix
[0097]
[0098]
[0099] At the 15th JVET meeting, row-based CG (document number JVET-O0120 and can be accessed at http: / / phenix.int-evry.fr / jvet / ) was proposed to simplify the buffer usage and syntax in the palette mode in VTM6.0. As a coefficient group (CG) used in transform coefficient encoding and decoding, a CU is divided into multiple row-based coefficient groups, each coefficient group consists of m samples, where the index run, palette index value and quantized color used for the escape mode are sequentially encoded / parsed for each CG. As a result, pixels in the row-based CG can be reconstructed after parsing syntax elements (e.g., index run, palette index value and escape quantization color for the CG), which greatly reduces the buffer requirements in the palette mode in VTM6.0, where the syntax elements for the entire CU must be parsed (and stored) before reconstruction.
[0100] In this application, if Figure 5D As shown in , based on the traversal scan mode, each CU of the palette mode is divided into multiple segments of m samples (in this test, m=8).
[0101] The coding order for palette run-length coding in each segment is as follows: For each pixel, a context codec bit run_copy_flag=0 is signaled, indicating that the pixel has the same mode as the previous pixel, that is, both the previous scanned pixel and the current pixel have run-length type COPY_ABOVE, or both the previous scanned pixel and the current pixel have run-length type INDEX and the same index value. Otherwise, run_copy_flag=1 is signaled.
[0102] If the current pixel and the previous pixel have different modes, a context-coded binary copy_above_palette_indices_flag is signaled, which indicates the run type of the pixel, that is, INDEX or COPY_ABOVE. In this case, if the sample is in the first row (horizontal traversal scan) or the first column (vertical traversal scan), the decoder does not have to parse the run type because the INDEX mode is used by default. The decoder also does not have to parse the run type if the previously parsed run type is COPY_ABOVE.
[0103] After palette run-length encoding and decoding of pixels in a segment, the index values (for INDEX mode) and the quantized escape colors are encoded into bypass bins and grouped separately from the encoding / parsing of context codec bins in order to improve the throughput within each line-based CG. Since the index values are now encoded / parsed after run-length encoding and decoding, the encoder does not have to signal the number of index values num_palette_indices_minus1 and the last run type copy_above_indices_for_final_run_flag. The syntax of the CG palette mode is shown in Table 4.
[0104] Table 4 Syntax of palette encoding and decoding
[0105]
[0106]
[0107]
[0108]
[0109]
[0110] Figure 6 600 is a flowchart illustrating an exemplary process according to some embodiments of the present disclosure, by which a video decoder uses an adaptive binarization process to implement a technique for decoding video data encoded using a palette-based scheme. In particular, the video decoder uses information included in a set of palette mode codec units (e.g., syntax elements included in a sequence parameter set (SPS), a slice header, etc.) to determine whether to use a first binarization process (e.g., fixed-length binarization) or a second binarization process (e.g., EGk binarization with a predefined k-order) to decode the set of palette mode codec units.
[0111] In the current VVC design, the binarization of escape samples in the palette mode codec unit is derived by calling a third-order Exp-Golomb binarization process. However, in some cases, when there are a large number of escape samples that are more evenly distributed over a wider range of pixel values rather than concentrated in a small range, using a different binarization process (e.g., a higher-order Exp-Golomb binarization process) may be more efficient because the total number of bits required to encode escape samples in a wider range using a higher-order Exp-Golomb binarization process may be lower than using a lower-order Exp-Golomb binarization process.
[0112] In some embodiments, these binarization processes can also be switched adaptively at different codec levels, such as sequence parameter sets (SPS), picture parameter sets (PPS), adaptive parameter sets (APS), slices and / or groups of codec blocks. In this case, the encoder has the flexibility to dynamically select the binarization process to signal the information in the bitstream. The decoder then calls the corresponding binarization process to decode the received bitstream. Binary codewords can be formed using different methods. Some exemplary methods are listed below:
[0113] 1. The same process used in current VVC to determine the codeword for abs_remainder is used, but always with a fixed rice parameter selected (eg, 1, 2, or 3).
[0114] 2. Fixed length binarization
[0115] 3. Truncated Rice Binarization
[0116] 4. Truncated Binary (TB) Binarization Process
[0117] 5. k-order Exp-Golomb binarization process (EGk)
[0118] 6. Limited k-order Exp-Golomb binarization
[0119] In some embodiments, a syntax element (e.g., a flag) in a sequence parameter set (SPS) is used to indicate whether a fixed length binarization process for escape samples is used. It should be noted that when the syntax element indicates that a fixed length binarization process is not used, any other binarization process (e.g., EGk) can be used to generate a binarization codeword for escape sample values. An example of a decoding process is shown below.
[0120] Table 5 Sequence parameter set RBSP syntax
[0121]
[0122] Specifically, sps_escape_fl_enabled_flag equal to 1 specifies that the fixed length binarization process can be used for escape samples. sps_escape_fl_enabled_flag equal to 0 specifies that the fixed length binarization process is not used for escape samples. When sps_escape_fl_enabled_flag is not present, it is inferred to be equal to 0.
[0123] In some embodiments, the input to the binarization process during encoding is the syntax element palette_escape_val and sps_escape_fl_enabled_flag. The output of the binarization process during encoding is the binarization of each syntax element. When sps_escape_fl_enabled_flag is equal to 1, the following applies:
[0124] –The variable bitDepth is derived as follows:
[0125] bitDepth=(cIdx==0)? BitDepth Y :BitDepth C
[0126] –The variable cMax is derived as follows:
[0127] cMax=bitDepth
[0128] The value of –palette_escape_val is specified by calling the fixed-length binarization process with the variable cMax as input.
[0129] Otherwise, the following applies:
[0130] The value of –palette_escape_val is specified by calling a k-th order Exp-Golomb binarization process, where k is set equal to 3.
[0131] In some embodiments, a syntax element (eg, a flag) in a picture parameter set (PPS) is used to indicate whether a fixed-length binarization process for escape samples is used. An example of a decoding process of the VVC draft is shown below.
[0132] Table 6 Picture parameter set RBSP syntax
[0133]
[0134] Specifically, pps_palette_enabled_flag equal to 1 specifies that pred_mode_plt_flag may be present in the codec unit syntax. pps_palette_enabled_flag equal to 0 specifies that pred_mode_plt_flag is not present in the codec unit syntax. When pps_palette_enabled_flag is not present, it is inferred to be equal to 0.
[0135] Specifically, pps_escape_fl_enabled_flag equal to 1 specifies that the fixed length binarization process can be used for escape samples. pps_escape_fl_enabled_flag equal to 0 specifies that the fixed length binarization process is not used for escape samples. When pps_escape_fl_enabled_flag is not present, it is inferred to be equal to 0.
[0136] In some embodiments, the input to the binarization process during encoding is the syntax element palette_escape_val, pps_escape_fl_enabled_flag and the color component index cIdx. The output of this process is the binarization of palette_escape_val. When pps_escape_fl_enabled_flag is equal to 1, the following applies:
[0137] –The variable bitDepth is derived as follows:
[0138] bitDepth=(cIdx==0)? BitDepth Y :BitDepth C
[0139] –The variable cMax is derived as follows:
[0140] cMax=bitDepth
[0141] The value of –palette_escape_val is specified by calling the fixed-length binarization process with the variable cMax as input.
[0142] Otherwise, the following applies:
[0143] The value of –palette_escape_val is specified by calling a k-th order Exp-Golomb binarization process, where k is set equal to 3.
[0144] In some embodiments, a syntax element (eg, a flag) in an adaptive parameter set (APS) is used to indicate whether to use a fixed length binarization process for escape samples. An example of a decoding process is shown below.
[0145] Table 7 Sequence parameter set RBSP syntax
[0146]
[0147] Specifically, adaptation_parameter_set_id provides an identifier for the APS referenced by other syntax elements. When aps_params_type is equal to ALF_APS or SCALING_APS, the value of adaptation_parameter_set_id shall be in the range of 0 to 7, including endpoint values. When aps_params_type is equal to LMCS_APS, the value of adaptation_parameter_set_id shall be in the range of 0 to 3, including endpoint values. When aps_params_type is equal to PLT_APS, the value of adaptation_parameter_set_id shall be in the range of 0 to 7, including endpoint values. aps_params_type specifies the type of APS parameters carried in the APS. When aps_params_type is equal to 1 (LMCS_APS), the value of adaptation_parameter_set_id shall be in the range of 0 to 3, including endpoint values.
[0148] Table 8 APS parameter type code and APS parameter type
[0149]
[0150] Table 9 Palette data syntax
[0151] plt_data(){ Descriptors plt_escape_fl_enabled_flag u(1) }
[0152] Specifically, plt_escape_fl_enabled_flag equal to 1 specifies that the fixed length binarization process can be used for escape samples. plt_escape_fl_enabled_flag equal to 0 specifies that the fixed length binarization process is not used for escape samples. When plt_escape_fl_enabled_flag is not present, it is inferred to be equal to 0.
[0153] The input to this binarization process during encoding includes the syntax element palette_escape_val, plt_escape_fl_enabled_flag and the color component index cIdx. The output of this process is the binarization of palette_escape_val. When plt_escape_fl_enabled_flag is equal to 1, the following applies:
[0154] –The variable bitDepth is derived as follows:
[0155] bitDepth=(cIdx==0)? BitDepth Y :BitDepth C
[0156] –The variable cMax is derived as follows:
[0157] cMax=bitDepth
[0158] The value of –palette_escape_val is specified by calling the fixed-length binarization process with the variable cMax as input.
[0159] Otherwise, the following applies:
[0160] The value of –palette_escape_val is specified by calling a k-th order Exp-Golomb binarization process, where k is set equal to 3.
[0161] In some embodiments, a syntax element (eg, a flag) in the codec block is used to indicate whether a fixed length binarization process for escape samples is used. In one example, this flag may be present if palette_escape_val_present_flag is equal to 1. An example of a decoding process is shown below.
[0162] Table 10 Fixed length binarization process
[0163]
[0164] Specifically, escape_fl_enabled_flag equal to 1 specifies that the fixed-length binarization process is used for escape samples. escape_fl_enabled_flag equal to 0 specifies that the fixed-length binarization process is not used for escape samples. When escape_fl_enabled_flag is not present, it is inferred to be equal to 0.
[0165] In order for a video decoder to perform adaptive binarization for escape samples of palette mode codec units, the video decoder first receives a first syntax element (e.g., sps_escape_fl_enabled_flag) associated with a first set of palette mode codec units from a bitstream at a first codec level (e.g., codec units of the same sequence, picture, slice, etc.) (610).
[0166] The video decoder then performs a decoding process based on the value of the first syntax element. If it is determined that the first syntax element has a first predefined value (e.g., sps_escape_fl_enabled_flag == 1) (620): the video decoder selects a first binarization process (e.g., fixed length binarization) for the first set of palette mode codec units (630), and decodes escape samples in the first set of palette mode codec units from the bitstream using the first binarization process (640).
[0167] On the other hand, if it is determined that the first syntax element does not have a first predefined value (e.g., sps_escape_fl_enabled_flag == 0) (650): the video decoder selects a second binarization process (e.g., an EGk binarization process) for the first group of palette mode codec units, the second binarization process is different from the first binarization process (660), and uses the second binarization process to decode escape samples in the first group of palette mode codec units from the bitstream (670).
[0168] In some embodiments, the first syntax element has a first predefined value (e.g., sps_escape_fl_enabled_flag==1), and the video decoder receives, at a second codec level (e.g., picture level), a second syntax element (e.g., pps_escape_fl_enalbed_flag) associated with a second set of palette mode codec units from a bitstream, the second set of palette mode codec units being a subset of the first set of palette mode codec units. If it is determined that the second syntax element has a second predefined value (e.g., sps_escape_fl_enabled_flag==0), the video decoder selects a second binarization process (e.g., EGk binarization process) for the second set of palette mode codec units, and decodes escape samples in the second set of palette mode codec units from the bitstream using the second binarization process.
[0169] Optionally, if the second syntax element (eg, pps_escape_fl_enabled_flag) associated with the second set of palette mode codec units at the second codec level is consistent with the first syntax element associated with the first set of palette mode codec units at the first codec level, then as described above in conjunction with Figure 6 As described, the video decoder performs a first binarization process on a second group of palette mode codec units.
[0170] In some embodiments, the first codec level is at least one level higher than the second codec level within a hierarchical structure associated with the video data.
[0171] In some embodiments, each of the first codec level and the second codec level is one selected from the group consisting of a sequence parameter set, a picture parameter set, an adaptation parameter set, a slice, a tile, a codec tree unit, and a codec unit.
[0172] In some embodiments, the first binarization process is a fixed-length binarization process, and the second binarization process is a k-th order Exp-Golomb binarization process.
[0173] In some embodiments, the k-th order Exp-Golomb binarization process is a 5-th order Exp-Golomb binarization process.
[0174] The video encoder may adopt the adaptive binarization process described above when encoding a bitstream. First, the video encoder selects a first syntax element for a first group of palette mode codec units at a first codec level. If it is determined that the first syntax element has a first predefined value, the video encoder selects a first binarization process for the first group of palette mode codec units, and then uses the first binarization process to encode escape samples in the first group of palette mode codec units into the bitstream. If it is determined that the first syntax element does not have the first predefined value, the video encoder selects a second binarization process for the first group of palette mode codec units, the second binarization process is different from the first binarization process, and uses the second binarization process to encode escape samples in the first group of palette mode codec units into the bitstream.
[0175] In some embodiments, when the first syntax element has a first predefined value: the video codec selects, at a second codec level, a second syntax element associated with a second set of palette mode codec units, the second set of palette mode codec units being a subset of the first set of palette mode codec units. If it is determined that the second syntax element has a second predefined value, the video codec selects a second binarization process for the second set of palette mode codec units; and the video codec encodes escape samples in the second set of palette mode codec units into a bitstream using the second binarization process.
[0176] In some embodiments, the second syntax element is selected based on rate-distortion analysis results of the second set of palette mode codec units.
[0177] In some embodiments, the first codec level is at least one level higher than the second codec level within a hierarchical structure associated with the video data.
[0178] In some embodiments, each of the first codec level and the second codec level is one selected from the group consisting of a sequence parameter set, a picture parameter set, an adaptation parameter set, a slice, a tile, a codec tree unit, and a codec unit.
[0179] In some embodiments, the first binarization process is a fixed-length binarization process, and the second binarization process is a k-th order Exp-Golomb binarization process.
[0180] In some embodiments, the k-th order Exp-Golomb binarization process is a 5-th order Exp-Golomb binarization process.
[0181] Figure 7 is a block diagram illustrating an exemplary context-adaptive binary arithmetic coding and decoding (CABAC) engine according to some embodiments of the present disclosure.
[0182] Context-Adaptive Binary Arithmetic Codec (CABAC) is a form of entropy coding used in many video codec standards (e.g., H.264 / MPEG-4 AVC, High Efficiency Video Codec (HEVC), and VVC). CABAC is based on arithmetic coding with some innovations and changes to adapt it to the needs of video codec standards. For example, CABAC encodes and decodes binary symbols, which maintains low complexity and allows probabilistic modeling of more frequently used bits of any symbol. The probability model is adaptively selected based on the local context, allowing better modeling of the probability because the codec modes are usually well correlated locally. Finally, CABAC uses multiplication-free range partitioning by using quantized probability ranges and probability states.
[0183] CABAC has multiple probability modes for different contexts. It first converts all non-binary symbols to binary. Then, for each binary digit (or bit), the codec selects which probability model to use and then uses information from nearby elements to optimize the probability estimate. Arithmetic coding and decoding is finally applied to compress the data.
[0184] Context modeling provides an estimate of the conditional probability of encoding and decoding symbols. With a suitable context model, a given inter-symbol redundancy can be exploited by switching between different probability models depending on the already encoded and decoded symbols near the current symbol to be encoded. Encoding and decoding a data symbol involves the following stages.
[0185] Binarization: CABAC uses binary arithmetic coding, which means that only binary decisions (1 or 0) are encoded. Symbols with non-binary values (e.g., transform coefficients or motion vectors) are "binarized" or converted to binary code before arithmetic coding. The process is similar to that of converting data symbols to variable-length codes, but the binary code is further encoded (by the arithmetic codec) before transmission. The stage is repeated for each binary digit (or "bit") of the binarized symbol.
[0186] Context model selection: A "context model" is a probability model for one or more bits of a binarized symbol. The model can be selected from a selection of available models based on the statistics of recently encoded or decoded data symbols. The context model stores the probability of each bit being "1" or "0".
[0187] Arithmetic Coding: The arithmetic codec encodes each binary bit according to the chosen probability model. Note that for each binary bit, there are only two sub-ranges (corresponding to "0" and "1").
[0188] Probability update: The selected context model is updated based on the actual codec value (eg, if the value of a binary bit is "1", the frequency count of "1" is increased).
[0189] By decomposing each non-binary syntax element value into a sequence of bins, the further processing of each bin value in CABAC depends on the associated codec mode decision, which can be selected as a normal mode or a bypass mode. The latter is selected for the following bins, which are assumed to be uniformly distributed, and therefore for these bins, the entire normal binary arithmetic coding (and decoding) process is simply bypassed. In the normal codec mode, each bin value is encoded by using a normal binary arithmetic codec engine, where the associated probability model is determined by a fixed selection based on the binary position or bin index (binIdx) in the binary representation of the syntax element type and the syntax element, or is adaptively selected from two or more probability models according to relevant side information (e.g., spatial neighbors, components, depth or size of CU / PU / TU, or position within TU). The choice of probability model is called context modeling. As an important design decision, the latter case is usually only applied to the most frequently observed bins, while other bins that are usually less frequently observed will be processed using a joint, usually zero-order probability model. In this way, CABAC enables selective adaptive probability modeling at the sub-symbol level and, therefore, provides an efficient tool to exploit inter-symbol redundancy with significantly reduced overall modeling or learning cost. Note that for both the fixed and adaptive cases, in principle, the switch from one probability model to another can occur between any two consecutive conventionally coded bins. In general, the design of the context model in CABAC reflects the goal of finding a good compromise between avoiding unnecessary modeling cost overhead and the conflicting goal of exploiting statistical correlations to a large extent.
[0190] The parameters of the probability models in CABAC are adaptive, which means that the adaptation of the model probabilities to the statistical variations of the source of bins is performed on a bin-by-bin basis, in a backward adaptive and synchronized manner, in both the encoder and the decoder; this process is called probability estimation. To this end, each probability model in CABAC can take one of 126 different states with an associated model probability value p ranging in the interval [0:01875; 0:98125]. The two parameters of each probability model are stored in the context memory as 7-bit entries: 6 bits for each of the 63 probability states, representing the model probability pLPS of the least probable symbol (LPS), and 1 bit for nMPS, the value of the most probable symbol (MPS).
[0191] In one or more examples, the functions described may be implemented in hardware, software, firmware, or any combination thereof. If implemented in software, the functions may be stored on or sent through a computer-readable medium as one or more instructions or codes and executed by a hardware-based processing unit. Computer-readable media may include computer-readable storage media or communication media, where computer-readable storage media corresponds to tangible media such as data storage media, and communication media includes any media that facilitates (e.g., according to a communication protocol) transferring a computer program from one place to another. In this manner, computer-readable media may generally correspond to (1) non-temporary tangible computer-readable storage media or (2) communication media such as signals or carrier waves. Data storage media may be any available media that can be accessed by one or more computers or one or more processors to retrieve instructions, codes, and / or data structures to implement the embodiments described in the present application. A computer program product may include a computer-readable medium.
[0192] The terms used in the description of the embodiments herein are only used for the purpose of describing specific embodiments and are not intended to limit the scope of the claims. As used in the description of the embodiments and the appended claims, the singular forms "a", "an" and "the" are also intended to include plural forms unless the context clearly indicates otherwise. It will also be understood that the terms "and / or" used herein refer to and cover any and all possible combinations of one or more associated listed items. It will be further understood that when used in this specification, the terms "include" and / or "comprise" specify the presence of stated features, elements and / or components, but do not exclude the presence or addition of one or more other features, elements, components and / or groups thereof.
[0193] It will also be understood that although the terms first, second, etc. may be used herein to describe various elements, these elements should not be limited by these terms. These terms are only used to distinguish one element from another element. For example, without departing from the scope of the embodiment, the first electrode may be referred to as the second electrode, and similarly, the second electrode may be referred to as the first electrode. Both the first electrode and the second electrode are electrodes, but they are not the same electrode.
[0194] The description of the present application is presented for the purpose of illustration and description, and is not intended to be exhaustive or limited to the invention in the disclosed form. Many modifications, variations, and alternative embodiments will be apparent to those of ordinary skill in the art with the benefit of the teachings presented in the foregoing description and the associated drawings. The embodiments are selected and described in order to best explain the principles of the invention, the practical application, and to enable other persons skilled in the art to understand the various embodiments of the invention and to best utilize the basic principles and various embodiments with various modifications suitable for the intended specific use. Therefore, it will be understood that the scope of the claims is not limited to the specific examples of the disclosed embodiments, and modifications and other embodiments are intended to be included within the scope of the appended claims.
Claims
1. A method for encoding video data, comprising: At a first codec level, determining a first syntax element for a first set of palette mode codec units, wherein the first syntax element indicates whether a current codec unit includes at least one escape codec sample; If it is determined that the first syntax element has a first predefined value: selecting a first binarization process for samples of said first set of palette mode codec units; encoding the samples of the first set of palette mode codec units into a bitstream using the first binarization process; If it is determined that the first syntax element does not have the first predefined value: selecting a second binarization process for samples of the first set of palette mode codec units, the second binarization process being different from the first binarization process, the second binarization process comprising a k-order Exp-Golomb binarization process, the k-order being higher than the third order; as well as The samples of the first set of palette mode codec units are encoded into the bitstream using the second binarization process.
2. The method according to claim 1, further comprising: When the first syntax element has the first predefined value: selecting, at a second codec level, a second syntax element associated with a second set of palette mode codec units, the second set of palette mode codec units being a subset of the first set of palette mode codec units; If it is determined that the second syntax element has a second predefined value: selecting said second binarization process for said samples of said second set of palette mode codec units; as well as The samples of the second set of palette mode codec units are encoded into the bitstream using the second binarization process.
3. The method according to claim 2, wherein the first binarization process and the second binarization process are used to encode escape samples in the first group of palette mode codec units and the second group of palette mode codec units.
4. The method of claim 2, wherein the first codec level is at least one level higher than the second codec level within a hierarchical structure associated with the video data.
5. The method of claim 2, wherein each of the first codec level and the second codec level is one selected from the group consisting of a sequence, a picture, an adaptation parameter set, a slice, a tile, a codec tree unit, and a codec unit. The method according to claim 1 , wherein the first binarization process is a fixed-length binarization process. The method according to claim 6 , wherein the k-order Exp-Golomb binarization process is a 5-order Exp-Golomb binarization process.
8. An electronic device comprising: one or more processing units; a memory coupled to the one or more processing units; as well as A plurality of programs stored in the memory, when the plurality of programs are executed by the one or more processing units, enable the electronic device to perform the method as claimed in any one of claims 1 to 7.
9. A method for storing a bit stream, comprising: Execute the encoding method according to any one of claims 1 to 7 to generate a bit stream; The bitstream is stored in a non-transitory computer-readable storage medium.
10. A computer program product comprising at least one instruction, which, when executed by at least one processor, causes the at least one processor to perform the method according to any one of claims 1 to 7.
11. A non-transitory computer-readable storage medium having stored thereon a bit stream generated by a computer program, wherein when the computer program is executed by a computer, the computer executes the method according to any one of claims 1 to 7.