Method and apparatus for video coding using a palette mode
The use of a palette mode in video coding optimizes encoding efficiency by reducing the bits needed for palette entries, addressing the challenge of high-definition video data compression and maintaining image quality.
Patent Information
- Application Number
- JP2023204875
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Priority Date
- 2019-08-15
- Filing Date
- 2023-12-04
- Publication Date
- 2025-08-01
- Estimated Expiration
- 2040-04-24
AI Technical Summary
The exponential increase in video data with high-definition and ultra-high-definition formats poses a challenge for efficient encoding and decoding while maintaining image quality, as existing video compression standards struggle to optimize data efficiency.
A method and system for video coding using a palette mode, where pixel values are encoded using a palette table, allowing for efficient reconstruction of pixel values through palette-based coding, and enabling or disabling the palette mode for coding units based on syntax elements in the video bitstream.
Enhances encoding efficiency by reducing the bits required to signal palette entries, improving overall data compression and maintaining image quality during decoding.
Smart Images

Figure 0007717138000002 
Figure 0007717138000003 
Figure 0007717138000004
Abstract
Description
Technical Field
[0001] This application generally relates to the encoding and compression of video data, and more particularly, to a method and system for video coding using a palette mode.
Background Art
[0002] Digital video is supported by various electronic devices such as digital TVs, laptop or desktop computers, tablet computers, digital cameras, digital recording devices, digital media players, video game consoles, smartphones, video remote conferencing devices, video streaming devices, etc. The electronic devices implement video compression / decompression standards such as those defined by the MPEG-4, ITU-T H.263, ITU-T H.264 / MPEG-4, Part 10, Advanced Video Coding (AVC), High Efficiency Video Coding (HEVC), and Versatile Video Coding (VVC) standards to transmit, receive, encode, decode, and / or store digital video data. Video compression typically involves performing spatial (intra-frame) prediction and / or temporal (inter-frame) prediction to reduce or remove redundancy inherent in the video data. In block-based video coding, a video frame is divided into one or more slices, and each slice has a plurality of video blocks, which may also be referred to as coding tree units (CTUs). Each CTU may contain one coding unit (CU), or may be recursively divided into smaller CUs until a predetermined minimum CU size is reached. Each CU (also called a leaf CU) contains one or more transform units (TUs), and each CU also contains one or more prediction units (PUs). Each CU can be encoded in either intra, inter, or IBC mode. Video blocks in an intra-coded (I) slice of a video frame are encoded using spatial prediction with respect to reference samples in adjacent blocks within the same video frame. Video blocks in an inter-coded (P or B) slice of a video frame may use spatial prediction with respect to reference samples in adjacent blocks within the same video frame, or temporal prediction with respect to reference samples in other previous and / or subsequent reference video frames.
[0003] Spatial or temporal prediction based on previously encoded reference blocks, such as neighboring blocks, results in a prediction block for the current video block to be encoded. The process of finding the reference blocks may be achieved by a block-matching algorithm. Residual data representing the pixel difference between the current block to be encoded and the prediction block is referred to as a residual block or prediction error. An inter-encoded block is encoded according to a motion vector indicating a reference block in a reference frame forming the prediction block and the residual block. The process of determining the motion vector is typically referred to as motion estimation. An intra-encoded block is encoded according to an intra prediction mode and the residual block. For further compression, the residual block may be transformed from the pixel domain to a transform domain, such as the frequency domain, resulting in residual transform coefficients, which may then be quantized. The quantized transform coefficients, initially arranged in a two-dimensional array, are scanned to yield a one-dimensional vector of transform coefficients, which may then be entropy encoded into a video bitstream to achieve further compression.
[0004] The encoded video bitstream is then stored in a computer-readable storage medium (e.g., flash memory) so as to be accessed by another electronic device having digital video capabilities or transmitted directly to the electronic device, either wired or wirelessly. The electronic device then performs video restoration (the process opposite to the above-described video compression), for example, by parsing the encoded video bitstream to obtain syntax elements from the bitstream and reconstructing digital video data from the encoded video bitstream to its original form based at least in part on the syntax elements obtained from the bitstream, and rendering the reconstructed digital video data on a display of the electronic device.
[0005] As digital video quality increases from high definition to 4K×2K or even 8K×4K, the amount of video data to be encoded / decoded increases exponentially. This has always been a problem regarding how video data can be encoded / decoded more efficiently while maintaining the image quality of the decoded video data.
Summary of the Invention
Problems to be Solved by the Invention
[0006] This application describes an implementation related to the encoding and decoding of video data, and more particularly, a system and method for video encoding and decoding using a palette mode.
Means for Solving the Problems
[0007] According to a first aspect of the present application, a method for decoding video data includes receiving, from a video bitstream having a hierarchical structure, a first syntax element associated with a first level of the hierarchical structure; and determining, according to a determination that the palette mode is enabled for one or more coding units (CUs) below the first level in the video bitstream as indicated by the first syntax element, reconstructing pixel values of at least one of the one or more CUs according to a corresponding palette table from the video bitstream; and determining, according to a determination that the palette mode is disabled for one or more CUs as indicated by the first syntax element, reconstructing pixel values of any of the one or more CUs according to a non-palette method from the video bitstream.
[0008] According to a second aspect of the present application, an electronic device includes one or more processing units, a memory, and a plurality of programs stored in the memory. The programs cause the electronic device to execute the method for decoding video data described above when executed by the one or more processing units.
[0009] According to a third aspect of the present application, a non-transitory computer-readable storage medium stores a plurality of programs for execution by an electronic device having one or more processing units. When the programs are executed by the one or more processing units, the electronic device is caused to execute a method for decoding the video data described above.
[0010] According to a fourth aspect of the present application, a method for encoding video data includes generating a first syntax element associated with a first level of a hierarchical structure for inclusion in a video bitstream having the hierarchical structure, where the first syntax element indicates that the palette mode is enabled for one or more coding units (CUs) below the first level in the video bitstream, encoding the pixel values of one or more CUs each having a corresponding palette table and the first syntax element into the video bitstream, and outputting a video bitstream including the encoded one or more CUs and the first syntax element.
[0011] According to a fifth aspect of the present application, an electronic device includes one or more processing units, a memory, and a plurality of programs stored in the memory. When the programs are executed by the one or more processing units, the electronic device is caused to execute a method for encoding the video data described above.
[0012] According to a sixth aspect of the present application, a non-transitory computer-readable storage medium stores a plurality of programs for execution by an electronic device having one or more processing units. When the programs are executed by the one or more processing units, the electronic device is caused to execute a method for encoding the video data described above.
[0013] Included to provide further understanding of the implementation, the accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate the described implementations and, together with the description, serve to clarify the underlying principles. Like reference numerals refer to corresponding parts.
Brief Description of the Drawings
[0014]
Figure 1
Figure 2
Figure 3
Figure 4A
Figure 4B
Figure 4C
Figure 4D
Figure 4E
Figure 5
Figure 6
Figure 7
Best Mode for Carrying Out the Invention
[0015] Here, specific implementations are referred to in detail, and examples thereof are shown in the accompanying drawings. In the following detailed description, numerous non-limiting specific details are set forth in order to aid in understanding the subject matter presented herein. However, it will be apparent to those skilled 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 those skilled in the art that the subject matter presented herein may be implemented on many types of electronic devices having digital video capabilities.
[0016] FIG. 1 is a block diagram showing an exemplary system 10 for encoding and decoding video blocks in parallel according to some implementations of the present disclosure. As shown in FIG. 1, 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, for example, desktop or laptop computers, tablet computers, smartphones, set-top boxes, digital televisions, cameras, display devices, digital media players, video game consoles, video streaming devices, and the like. In some implementations, source device 12 and destination device 14 are equipped with wireless communication capabilities.
[0017] In some implementations, 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 transmit 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 transmitted 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 device that may be useful in facilitating communication from the source device 12 to the destination device 14.
[0018] In some other implementations, the encoded video data may be transmitted from the output interface 22 to the storage device 32. Thereafter, the encoded video data at 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 accessible data storage media such as a hard drive, a Blu-ray disk, a DVD, a CD-ROM, a flash memory, a volatile or non-volatile memory, or any other suitable digital storage medium for storing the 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 download. The file server may be any type of computer capable of storing the encoded video data and transmitting 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 including a wireless channel (e.g., Wi-Fi connection), a wired connection (e.g., DSL, cable modem, etc.), or a combination of both that is suitable for accessing the encoded video data stored at the file server. 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.
[0019] As shown in FIG. 1, 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 such as a video 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, when video source 18 is a video camera of a security monitoring system, source device 12 and destination device 14 may form a camera phone or a video phone. However, the implementations described in this application may generally be applicable to video coding and may be applied to wireless and / or wired applications.
[0020] Video that has been captured, previously captured, or generated by a computer may be encoded by video encoder 20. The encoded video data may be transmitted directly to destination device 14 via output interface 22 of source device 12. The encoded video data may further (or alternatively) be stored in storage device 32 for later access by destination device 14 or other devices for decoding and / or playback. Output interface 22 may further include a modem and / or a transmitter.
[0021] The destination device 14 includes an input interface 28, a video decoder 30, and a display device 34. The input interface 28 may include a receiver and / or a modem and receive encoded video data via the link 16. The encoded video data communicated via the link 16 or provided on the storage device 32 may include various syntax elements generated by the video encoder 20 for use by the video decoder 30 in decoding the video data. Such syntax elements may be included within the encoded video data transmitted on a communication medium, stored in a storage medium, or stored on a file server.
[0022] In some implementations, the destination device 14 may include a display device 34 that can be an integrated display device and an external display device configured to communicate with the destination device 14. The display device 34 may display the decoded video data to the user and may include any of various 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.
[0023] The video encoder 20 and the video decoder 30 may operate according to proprietary or industry standards such as VVC, HEVC, MPEG-4, Part 10, Advanced Video Coding (AVC), or extensions of such standards. It should be understood that the present application is not limited to a particular video encoding / decoding standard and may be applicable to other video encoding / decoding standards. It is generally assumed 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 assumed 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.
[0024] Video encoder 20 and video decoder 30 may each be implemented as any of a variety of suitable encoder circuits 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 partially in software, the electronic device may store instructions for the software in a suitable non-transitory computer-readable medium and execute those instructions in hardware using one or more processors to perform the video encoding / decoding operations disclosed in this disclosure. Each of video encoder 20 and video decoder 30 may be included in one or more encoders or decoders, any of which may be integrated as part of a combined encoder / decoder (CODEC) in their respective devices.
[0025] FIG. 2 is a block diagram showing an exemplary video encoder 20 according to some implementations described in this application. Video encoder 20 may perform intra and inter prediction encoding of video blocks within a video frame. Intra prediction encoding relies on spatial prediction to reduce or remove spatial redundancy in video data within a given video frame or picture. Inter prediction encoding relies on temporal prediction to reduce or remove temporal redundancy in video data within adjacent video frames or pictures of a video sequence.
[0026] As shown in FIG. 2, 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 conversion processing unit 52, a quantization unit 54, and an entropy encoding unit 56. The prediction processing unit 41 further includes a motion estimation unit 42, a motion compensation unit 44, a division unit 45, an intra prediction processing unit 46, and an intra block copy (BC) unit 48. In some implementations, the video encoder 20 also includes an inverse quantization unit 58, an inverse conversion processing unit 60, and an adder 62 for video block reconstruction. A deblocking filter (not shown) may be arranged between the adder 62 and the DPB 64 to filter the block boundaries to remove block distortion artifacts from the reconstructed video. In addition to the deblocking filter, a loop filter (not shown) may be used to filter the output of the adder 62. The video encoder 20 may take the form of fixed or programmable hardware units, or may be divided among one or more of the illustrated fixed or programmable hardware units.
[0027] The video data memory 40 may store video data 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 for use when encoding video data by the video encoder 20 (e.g., in an intra or inter prediction encoding mode). The video data memory 40 and the DPB 64 may be formed by any of various memory devices. In various examples, the video data memory 40 may be on the same chip as other components of the video encoder 20, or off-chip with respect to those components.
[0028] As shown in FIG. 2, after receiving the video data, the segmentation unit 45 in the prediction processing unit 41 segments the video data into video blocks. This segmentation may include segmenting the video frame into slices, tiles, or other larger coding units (CUs) according to a predefined segmentation 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 coding modes, such as one of a plurality of intra prediction coding modes or one of a plurality of inter prediction coding modes, for the current video block based on error results (e.g., coding rate and distortion level). The prediction processing unit 41 may provide the resulting intra- or inter-prediction-coded block to the adder 50 to generate a residual block and to the adder 62 to reconstruct the coded block for later use as part of a reference frame. The prediction processing unit 41 also provides syntax elements such as motion vectors, intra mode indicators, segmentation information, and other such syntax information to the entropy coding unit 56.
[0029] To select an appropriate intra prediction coding mode for the current video block, the intra prediction processing unit 46 in the prediction processing unit 41 may perform intra prediction coding of the current video block on one or more adjacent 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 in the prediction processing unit 41 perform inter prediction coding of the current video block on one or more prediction blocks in one or more reference frames to provide temporal prediction. The video encoder 20 may perform, for example, a plurality of coding paths to select an appropriate coding mode for each block of the video data. 84. A plurality of coding paths may be performed.
[0030] In some implementations, motion estimation unit 42 determines an inter prediction mode for the current video frame by generating a motion vector indicating the displacement of a prediction unit (PU) of a video block in the current video frame relative to a prediction block in a reference video frame according to a predetermined pattern within a sequence of video frames. Motion estimation performed by motion estimation unit 42 is a process of generating a motion vector that estimates the motion for a video block. The motion vector may indicate, for example, the displacement of the PU of a video block in the current video frame or picture relative to a prediction block in a reference frame (or other coding unit) for the current block being coded within the current frame (or other coding unit). The predetermined pattern may specify video frames in the sequence as P-frames or B-frames. Intra BC unit 48 may determine a vector, such as a block vector, for intra BC coding in a similar manner as the determination of the motion vector by motion estimation unit 42 for inter prediction, or may utilize motion estimation unit 42 to determine the block vector.
[0031] The prediction block is a block in the reference frame that is considered to closely match the PU of the video block to be coded with respect to the pixel difference that can be determined by sum of absolute differences (SAD), sum of squared differences (SSD), or other difference metrics. In some implementations, video encoder 20 may calculate values for sub-integer pixel positions of the reference frames stored in DPB 64. For example, video encoder 20 may interpolate values for quarter-pixel positions, eighth-pixel positions, or other fractional pixel positions of the reference frame. Accordingly, motion estimation unit 42 may perform motion search for full pixel positions and fractional pixel positions and output a motion vector with fractional pixel accuracy.
[0032] The motion estimation unit 42 calculates a motion vector for a prediction unit (PU) of a video block in an inter-predicted frame by comparing the position of a prediction block of a reference frame selected from the first reference frame list (list 0) or the second reference frame list (list 1), each of which identifies one or more reference frames stored in the DPB 64, with the position of the PU. The motion estimation unit 42 transmits the calculated motion vector to the motion compensation unit 44 and then to the entropy coding unit 56.
[0033] Motion compensation performed by the motion compensation unit 44 may involve fetching 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 identify the position of the prediction block indicated by the motion vector in one of the reference frame lists, obtain the prediction block from the DPB 64, and transfer 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 currently encoded video block. The pixel difference values forming the residual video block may include luminance or chrominance difference components or both. The motion compensation unit 44 may also generate syntax elements associated with the video blocks of the video frame for use by the video decoder 30 when decoding the video blocks of the video frame. The syntax elements may include, for example, syntax elements defining the motion vector used to identify the prediction block, any flag indicating the 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 shown separately for conceptual purposes.
[0034] In some implementations, the intra BC unit 48 may generate vectors and fetch prediction blocks in a manner similar to that described above in relation to the motion estimation unit 42 and the motion compensation unit 44, where the prediction blocks are in the same frame as the current block being encoded, and the vectors are referred to as block vectors as opposed to motion vectors. In particular, the intra BC unit 48 may determine the intra prediction mode to be used for encoding the current block. In some examples, the intra BC unit 48 may encode the current block using various intra prediction modes, for example, between separate encoding passes, and test their performance by rate distortion analysis. Next, the intra BC unit 48 may select an appropriate intra prediction mode to be used from among the various tested intra prediction modes and generate an intra mode indicator accordingly. For example, the intra BC unit 48 may calculate rate distortion values using rate distortion analysis for the various tested intra prediction modes and select the intra prediction mode having the best rate distortion characteristics among the test modes as the appropriate intra prediction mode to be used. Rate distortion analysis generally determines the amount of distortion (or error) between the encoded block and the original unencoded block that was encoded to create the encoded block, along with the bit rate (i.e., the number of bits) used to create the encoded block. The intra BC unit 48 may calculate the ratio from the distortion and rate for the various encoded blocks to determine which intra prediction mode exhibits the best rate distortion value for the block.
[0035] In other examples, the intra BC unit 48 may use all or part of the motion estimation unit 42 and the motion compensation unit 44 to perform such functions for intra BC prediction, according to the implementations described herein. In any case, for intra block copy, the predicted block may be a block that is considered to closely match the block to be coded, with respect to the pixel difference determined by the sum of absolute differences (SAD), the sum of squared differences (SSD), or other difference metrics, and the identification of the predicted block may include the calculation of values for sub-integer pixel positions.
[0036] Regardless of whether the predicted block is from the same frame by intra prediction or from different frames by inter prediction, the video encoder 20 may form a residual video block by subtracting the pixel values of the predicted block from the pixel values of the currently coded video block, thereby forming pixel difference values. The pixel difference values forming the residual video block may include differences in both the luminance and chrominance components.
[0037] As described above, the intra prediction processing unit 84 may intra-predict the current video block as an alternative to the inter prediction performed by the motion estimation unit 42 and the motion compensation unit 44, or the intra block copy prediction performed by the intra BC unit 48. In particular, the intra prediction processing unit 46 may determine the intra prediction mode to be used for encoding the current block. To do this, the intra prediction processing unit 46 may encode the current block using various intra prediction modes, for example, between separate encoding paths, and the intra prediction processing unit 46 (or in some examples, the mode selection unit) may select an appropriate intra prediction mode to be used from the tested intra prediction modes. The intra prediction processing unit 46 may provide information indicating the selected intra prediction mode for the block to the entropy encoding unit 56. The entropy encoding unit 56 may encode the information indicating the selected intra prediction mode in the bitstream.
[0038] After the prediction processing unit 41 determines a predicted block for the current video block via either inter prediction or intra prediction, the adder 50 forms a residual video block by subtracting the predicted 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 the transform processing unit 52. The 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.
[0039] The conversion processing unit 52 may transmit the resulting conversion coefficients to the quantization unit 54. The quantization unit 54 quantizes the conversion coefficients in order to further reduce the bit rate. The quantization process may reduce the bit depth associated with some or all of the coefficients. The quantization degree may be modified by adjusting the quantization parameter. In some examples, the quantization unit 54 may then perform a scan of the matrix including the quantized conversion coefficients. Alternatively, the entropy encoding unit 56 may perform this scan.
[0040] Following quantization, the entropy encoding unit 56 entropy-encodes the quantized conversion 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 transmitted to the video decoder 30 or archived in the storage device 32 for later transmission to or acquisition by the video decoder 30. The entropy encoding unit 56 may entropy-encode the motion vectors and other syntax elements for the currently encoded video frame.
[0041] The inverse quantization unit 58 and the inverse conversion processing unit 60 each apply inverse quantization and inverse conversion to reconstruct the residual video block in the pixel domain in order to generate a reference block for the prediction of other video blocks. As described above, the motion compensation unit 44 may generate a motion-compensated prediction block from one or more reference blocks of the frames stored in the DPB 64. The motion compensation unit 44 may apply one or more interpolation filters to the prediction block to calculate sub-pixel values for use in motion estimation.
[0042] The adder 62 adds the reconstructed residual block to the motion-compensated prediction block created by the motion compensation unit 44 in order to create a reference block for storage in the DPB 64. The reference block may then be used as a prediction block by the intra BC unit 48, the motion estimation unit 42, and the motion compensation unit 44 to inter-predict another video block in a subsequent video frame.
[0043] Figure 3 is a block diagram showing an exemplary video decoder 30 according to some implementations 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 further includes a motion compensation unit 82, an intra prediction processing unit 84, and an intra BC unit 85. The video decoder 30 may perform a decoding process generally opposite to the encoding process described above with respect to the video encoder 20 in relation to FIG. 2. For example, the motion compensation unit 82 may generate prediction data based on the motion vectors received from the entropy decoding unit 80, while the intra prediction unit 84 may generate prediction data based on the intra prediction mode indicator received from the entropy decoding unit 80.
[0044] In some examples, a unit of the video decoder 30 may be tasked with performing the implementation of the present application. Also, in some examples, the implementation of the present disclosure may be divided among one or more units of the video decoder 30. For example, the intra BC unit 85 may perform the implementation 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 prediction processing unit 84, and the entropy decoding unit 80. In some examples, the video decoder 30 may not include the intra BC unit 85, and the functions of the intra BC unit 85 may be performed by other components of the prediction processing unit 81, such as the motion compensation unit 82.
[0045] Video data memory 79 may store video data such as an encoded video bit stream that is decoded by other components of video decoder 30. The video data stored in video data memory 79 may be obtained, for example, from storage device 32, from a local video source such as a camera, via wired or wireless network communication of video data, or by accessing a physical data storage medium (e.g., a flash drive or a hard disk). Video data memory 79 may include an encoded picture buffer (CPB) that stores encoded video data from the encoded video bit stream. The decoded picture buffer (DPB) 92 of video decoder 30 stores reference video data for use when video decoder 30 decodes video data (e.g., in an intra or inter prediction encoding mode). Video data memory 79 and DPB 92 may be formed by any of various memory devices such as dynamic random access memory (DRAM) including synchronous DRAM (SDRAM), magnetoresistive RAM (MRAM), resistive random access memory (RRAM), or other types of memory devices. For illustrative purposes, video data memory 79 and DPB 92 are shown as two separate components of video decoder 30 in FIG. 3. However, it will be apparent to those skilled in the art that video data memory 79 and DPB 92 may be provided by the same memory device or by separate memory devices. In some examples, video data memory 79 may be on the same chip as other components of video decoder 30 or off-chip with respect to those components.
[0046] During the decoding process, video decoder 30 receives an encoded video bitstream representing video blocks of an encoded video frame and associated syntax elements. Video decoder 30 may receive syntax elements at the level of the video frame and / or at the level of the video block. Entropy decoding unit 80 of video decoder 30 entropy decodes the bitstream to generate quantized coefficients, motion vectors or intra prediction mode indicators, and other syntax elements. Entropy decoding unit 80 then transfers the motion vectors and other syntax elements to prediction processing unit 81.
[0047] When the video frame is encoded as an intra-predicted (I) frame or for an intra-encoded prediction block in another type of frame, intra prediction processing unit 84 of prediction processing unit 81 may generate prediction data for video blocks of the current video frame based on the signaled intra prediction mode and reference data from previously decoded blocks of the current frame.
[0048] When the video frame is encoded as an inter-predicted (i.e., B or P) frame, motion compensation unit 82 of prediction processing unit 81 creates one or more prediction blocks for video blocks of the current video frame based on the motion vectors and other syntax elements received from entropy decoding unit 80. Each of the prediction blocks may be created from a reference frame in one of the reference frame lists. Video decoder 30 may configure reference frame lists, list 0 and list 1, using default configuration techniques based on the reference frames stored in DPB 92.
[0049] In some examples, when a video block is encoded according to the intra BC mode described herein, the intra BC unit 85 of the prediction processing unit 81 creates a prediction block for the current video block based on the block vector and other syntax elements received from the entropy decoding unit 80. The prediction block may be within the reconstructed area of the same picture as the current video block defined by the video encoder 20.
[0050] The motion compensation unit 82 and / or the intra BC unit 85 determines prediction information for the video blocks of the current video frame by parsing the motion vectors and other syntax elements, and then creates a prediction block for the current decoded video block using the prediction information. For example, the motion compensation unit 82 determines, using some of the received syntax elements, the prediction mode (e.g., intra or inter prediction) used to encode the video blocks of the video frame, the inter prediction frame type (e.g., B or P), the configuration information for one or more of the reference frame lists for the frame, the motion vectors for each inter predicted video block of the frame, the inter prediction status for each inter predicted video block of the frame, and other information for decoding the video blocks in the current video frame.
[0051] Similarly, the intra BC unit 85 may determine, using some of the received syntax elements such as flags, that the current video block was predicted using the intra BC mode, the configuration information about which video blocks of the frame should be within the reconstructed area and stored in the DPB 92, the block vectors for each intra BC predicted video block of the frame, the intra BC prediction status for each intra BC predicted video block of the frame, and other information for decoding the video blocks in the current video frame.
[0052] The motion compensation unit 82 may also perform interpolation using an interpolation filter to calculate interpolated values for sub-integer pixels of the reference block, as used by the video encoder 20 during the encoding of the video block. In this case, the motion compensation unit 82 may determine the interpolation filter used by the video encoder 20 from the received syntax elements and create a prediction block using the interpolation filter.
[0053] The inverse quantization unit 86 inverse quantizes the quantized transform coefficients provided in the bitstream and entropy decoded by the entropy decoding unit 80 using the same quantization parameter calculated by the video encoder 20 for each video block in the video frame to determine the quantization degree. The inverse transform processing unit 88 applies an inverse transform, such as an inverse DCT, inverse integer transform, or conceptually similar inverse transform process, to the transform coefficients to reconstruct the residual block in the pixel domain.
[0054] After the motion compensation unit 82 or the intra BC unit 85 generates a prediction block for the current video block based on the vector and other syntax elements, the adder 90 adds the residual block from the inverse transform processing unit 88 and the corresponding prediction block generated by the motion compensation unit 82 and the intra BC unit 85 to reconstruct the decoded video block for the current video block. A loop filter (not shown) may be arranged between the adder 90 and the DPB 92 to further process the decoded video block. The decoded video block in a given frame is then stored in the DPB 92 that stores the reference frames used for subsequent motion compensation of the next video block. The DPB 92, or a memory device separate from the DPB 92, may store the decoded video for subsequent presentation on a display device such as the display device 34 of FIG. 1.
[0055] In a typical video coding process, a video sequence typically 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 luminance samples. SCb is a two-dimensional array of Cb chrominance samples. SCr is a two-dimensional array of Cr chrominance samples. In other cases, a frame may be monochromatic and thus include only one two-dimensional array of luminance samples.
[0056] As shown in FIG. 4A, video encoder 20 (or more specifically, partitioning unit 45) first generates an encoded representation of a frame by partitioning the frame into a set of coding tree units (CTUs). A video frame may include contiguous ordered integers of CTUs in a left-to-right, top-to-bottom raster scan order. Each CTU is the largest logical coding unit, and the width and height of the CTUs are signaled by video encoder 20 in the sequence parameter set such that all CTUs in the video sequence have the same size of either 128×128, 64×64, 32×32, and 16×16. However, it should be noted that the present application is not necessarily limited to a specific size. As shown in FIG. 4B, each CTU may include one coded tree block (CTB) of luminance samples, two corresponding coded tree blocks of chrominance samples, and syntax elements used to code the samples of the coded tree blocks. The syntax elements include characteristics of different types of units of the coded pixel blocks, including inter or intra prediction, intra prediction mode, motion vectors, and other parameters, and describe how the video sequence can be reconstructed in video decoder 30. In a monochromatic picture, or a picture having three separate color planes, a CTU may include a single coded tree block and syntax elements used to code the samples of the coded tree block. The coded tree block may be an N×N block of samples.
[0057] To achieve better performance, the video encoder 20 may recursively perform a quadtree partition, a ternary tree partition, a binary tree partition, or a combination of both on the coding tree blocks of the CTU, and divide the CTU into smaller coding units (CUs). As shown in FIG. 4C, first, a 64×64 CTU 400 is divided into four smaller CUs each having a block size of 32×32. Of the four smaller CUs, CU 410 and CU 420 are each divided into four CUs with a block size of 16×16. The two 16×16 CUs 430 and 440 are each further divided into four CUs with a block size of 8×8. FIG. 4D illustrates a quadtree data structure showing the final result of the partitioning process of the CTU 400 as shown in FIG. 4C, and each leaf node of the quadtree corresponds to one CU with a size ranging from 32×32 to 8×8. Similar to the CTU shown in FIG. 4B, each CU may include an encoding block (CB) of luminance samples and two corresponding encoding blocks of chrominance samples of a frame of the same size, and syntax elements used to encode the samples of the encoding block. In a monochrome picture, or a picture having three separate color planes, the CU may include a single encoding block and a syntax structure used to encode the samples of the encoding block. The quadtree partitioning shown in FIGS. 4C and 4D is for illustrative purposes only, and it should be noted that one CTU can be divided into CUs to adapt to various local characteristics based on quadtree / ternary tree / binary tree partitioning. In a multi-tree structure, one CTU can be partitioned by a quadtree structure, and each leaf CU of the quadtree can be further partitioned by binary tree and ternary tree structures. As shown in FIG. 4E, there are five partitioning types, namely quaternary partitioning, horizontal binary partitioning, vertical binary partitioning, horizontal ternary partitioning, and vertical ternary partitioning.
[0058] In some implementations, video encoder 20 may further divide the coded block of the CU into one or more M×N prediction blocks (PBs). A prediction block is a rectangular (square or non-square) block of samples to which the same inter or intra prediction is applied. The prediction unit (PU) of the CU may include a prediction block of luminance samples, two corresponding prediction blocks of chrominance samples, and syntax elements used to predict the prediction block. In a monochrome picture, or a picture having three separate color planes, the PU may include a single prediction block and a syntax structure used to predict the prediction block. Video encoder 20 may generate prediction luminance, Cb, and Cr blocks for the luminance, Cb, and Cr prediction blocks of each PU of the CU.
[0059] Video encoder 20 may generate a prediction block for a PU using intra prediction or inter prediction. When video encoder 20 generates a prediction block for a PU using intra prediction, video encoder 20 may generate the prediction block of the PU based on the decoded samples of the frame associated with the PU. When video encoder 20 generates a prediction block for a PU using inter prediction, video encoder 20 may generate the prediction block of the PU based on the decoded samples of one or more frames other than the frame associated with the PU.
[0060] After the video encoder 20 generates the predicted luma, Cb, and Cr blocks 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 encoded block such 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 the corresponding sample in the original luma encoded block of the CU. Similarly, the video encoder 20 may generate a Cb residual block and a Cr residual block for the CU such 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 the corresponding sample in the original Cb encoded block of the CU, and each sample in the Cr residual block of the CU indicates the difference between a Cr sample in one of the predicted Cr blocks of the CU and the corresponding sample in the original Cr encoded block of the CU.
[0061] Further, as illustrated in FIG. 4C, the video encoder 20 may decompose the luma, Cb, and Cr residual blocks of the CU into one or more luma, Cb, and Cr transform blocks using a quadtree partitioning. A transform block is a rectangular (square or non-square) block of samples to which the same transform is applied. A transform unit (TU) of the CU may include a transform block of luma samples, two corresponding transform blocks of chroma samples, and syntax elements used to transform the transform block samples. Thus, 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 having three separate color planes, the TU may include a single transform block and a syntax structure used to transform the samples of the transform block.
[0062] The video encoder 20 may apply one or more transforms to the luminance transform blocks of the TUs to generate luminance coefficient blocks for the TUs. The coefficient blocks may be two-dimensional arrays of transform coefficients. The transform coefficients may be scalar quantities. The video encoder 20 may apply one or more transforms to the Cb transform blocks of the TUs to generate Cb coefficient blocks for the TUs. The video encoder 20 may apply one or more transforms to the Cr transform blocks of the TUs to generate Cr coefficient blocks for the TUs.
[0063] After generating the coefficient blocks (e.g., luminance coefficient blocks, Cb coefficient blocks, or Cr coefficient blocks), the video encoder 20 may quantize the coefficient blocks. Quantization generally refers to the process by which the transform coefficients are quantized to provide further compression by reducing the amount of data used to represent the transform coefficients, if possible. After the video encoder 20 quantizes the coefficient blocks, the video encoder 20 may entropy encode the 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 bit sequence forming a representation of the encoded frames and associated data that is stored in the storage device 32 or transmitted to the destination device 14.
[0064] After receiving the bitstream generated by the video encoder 20, the video decoder 30 may parse the bitstream to obtain syntax elements from the bitstream. The video decoder 30 may reconstruct a frame of video data based at least in part on the syntax elements obtained from the bitstream. The process of reconstructing the video data is generally opposite to the encoding process performed by the video encoder 20. For example, the video decoder 30 may inverse-transform the coefficient block associated with the TU of the current CU to reconstruct the residual block associated with the TU of the current CU. The video decoder 30 may also reconstruct the encoded block of the current CU by adding the samples of the prediction block for the current CU's PU to the corresponding samples of the transform block of the current CU's TU. After reconstructing the encoded block for each CU of the frame, the video decoder 30 may reconstruct the frame.
[0065] As described above, video coding mainly uses two modes, namely intra-frame prediction (or intra prediction) and inter-frame prediction (or inter prediction), to achieve video compression. Palette-based coding is another coding method adopted by many video coding standards. In palette-based coding, which may be particularly suitable for encoding screen-generated content, a video coder (e.g., the video encoder 20 or the video decoder 30) forms a palette table of colors representing the video data of a given block. The palette table contains the most dominant (e.g., frequently used) pixel values in a given block. Pixel values that do not frequently appear in the video data of a given block are either not included in the palette table or are included in the palette table as an escape color.
[0066] Each entry in the palette table includes an index for the corresponding pixel value in the palette table. The palette index for samples in a block may be encoded to indicate which entry from the palette table should be used to predict or reconstruct which sample. This palette mode starts with a process that generates a palette predictor for the first block of a classification of a picture, slice, tile, or other such video block. As described below, palette predictors for subsequent video blocks are typically generated by updating previously used palette predictors. For purposes of illustration, it is assumed that the palette predictor is defined at the picture level. In other words, a picture may include a plurality of encoded blocks each having its own palette table, but there is one palette predictor for the entire picture.
[0067] To reduce the bits required to signal palette entries in the video bitstream, the video decoder may utilize a palette predictor to determine new palette entries in the palette table used to reconstruct the video block. For example, the palette predictor may include palette entries from a previously used palette table, or may be initialized with the most recently used palette table by including all entries of the most recently used palette table. In some implementations, the palette predictor may include fewer entries than all entries from the most recently used palette table, and at this time, some entries from other previously used palette tables may be incorporated. The palette predictor may have the same size as the palette table used to encode different blocks, or may be larger or smaller than the palette table used to encode different blocks. In one example, the palette predictor is implemented as a first-in first-out (FIFO) table that includes 64 palette entries.
[0068] To generate a palette table for a block of video data from a palette predictor, the video decoder may receive a 1-bit flag for each entry of the palette predictor from the encoded video bitstream. The 1-bit flag may have a first value (e.g., binary 1) indicating that the associated entry of the palette predictor should be included in the palette table, or a second value (e.g., binary 0) indicating that the associated entry of the palette predictor should not be included in the palette table. If the size of the palette predictor is larger than the palette table used for a block of video data, the video decoder may stop receiving further flags when the maximum size for the palette table is reached.
[0069] In some implementations, some entries in the palette table may be signaled directly in the encoded video bitstream instead of being determined using the palette predictor. For such entries, the video decoder may receive three separate m-bit values from the encoded video bitstream indicating pixel values for the luminance 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 a directly signaled palette entry, a palette entry derived from the palette predictor requires only a 1-bit flag. Thus, signaling some or all palette entries using the palette predictor can significantly reduce the number of bits required to signal new palette table entries, thereby improving the overall encoding efficiency of palette mode encoding.
[0070] In many cases, the palette predictor for a block is determined based on the palette table used to encode one or more previously encoded blocks. However, when encoding the first coding tree unit in a picture, slice, or tile, the palette table of previously encoded blocks may not be available. Therefore, the palette predictor cannot be generated using the entries of the previously used palette table. In such cases, a series of palette predictor initializers may be signaled in the sequence parameter set (SPS) and / or picture parameter set (PPS), which are values used to generate the palette predictor when the previously used palette table is not available. The SPS generally refers to the syntax structure of the syntax elements applied to a series of consecutive encoded video pictures called the coded video sequence (CVS), which is determined by the content of the syntax elements found in the PPS, which is referred to by the syntax elements found in each slice segment header. The PPS generally refers to the syntax structure of the syntax elements applied to one or more individual pictures within the CVS, which is determined by the syntax elements found in each slice segment header. Thus, the SPS is generally considered to be a higher-level syntax structure than the PPS, which means that the syntax elements included in the SPS generally change less frequently and apply to a larger portion of the video data compared to the syntax elements included in the PPS.
[0071] FIG. 5 is a block diagram illustrating an example of determining and using a palette table to encode video data in picture 500 according to some implementations of the present disclosure. Picture 500 includes a first block 510 associated with a first palette table 520 and a second block 530 associated with a second palette table 540. Since the second block 530 is to the right of the first block 510, the second palette table 540 may be determined based on the first palette table 520. A palette predictor 550 is associated with picture 500 and is used to collect zero or more palette entries from the first palette table 520 and to construct zero or more palette entries in the second palette table 540. The various blocks illustrated in FIG. 5 may correspond to CTUs, CUs, PUs, or TUs as described above, and it should be noted that the blocks are not limited to the block structure of any particular encoding standard and may conform to future block-based encoding standards.
[0072] Generally, a palette table contains a plurality of pixel values that are dominant and / or representative for a currently encoded block (e.g., block 510 or 530 in FIG. 5). In some examples, a video coder (e.g., video encoder 20 or video decoder 30) may encode a palette table separately for each color component of a block. For example, video encoder 20 may encode a palette table for the luminance component of a block, a separate palette table for the chrominance Cb component of the block, and yet another separate palette table for the chrominance Cr component of the block. In this case, the first palette table 520 and the second palette table 540 may each be a plurality of palette tables. In other examples, video encoder 20 may encode a single palette table for all color components of a block. In this case, the i-th entry in the palette table is a triple value (Yi, Cbi, Cri), where each value corresponds to one component of a pixel. Thus, the representations of the first palette table 520 and the second palette table 540 are merely examples and are not intended to be limiting.
[0073] As described herein, rather than directly encoding the actual pixel values of the first block 510, a video coder (such as video encoder 20 or video decoder 30) may encode the pixels of the first block 510 using index I1, ···, IN by using a palette-based coding method. For example, for each pixel in the first block 510, the video encoder 20 may encode the index value for that pixel, and the index value is associated with the pixel value in the first palette table 520. The video encoder 20 may encode the first palette table 520 and transmit it in the encoded video data bitstream for use by the video decoder 30 for palette-based decoding on the decoder side. Generally, one or more palette tables may be transmitted block by block or shared among different blocks. The video decoder 30 may obtain the index values from the video bitstream generated by the video encoder 20 and reconstruct the pixel values using the pixel values corresponding to the index values in the first palette table 520. In other words, for each respective index value for the block, the video decoder 30 may determine the entry in the first palette table 520. The video decoder 30 may then replace each index value in the block with the pixel value specified by the determined entry in the first palette table 520.
[0074] In some implementations, a video coder (e.g., video encoder 20 or video decoder 30) determines a second palette table 540 based at least in part on a palette predictor 550 associated with a picture 500. The palette predictor 550 may include some or all of the entries of a first palette table 520 and optionally may include entries from other palette tables. In some examples, the palette predictor 550 is implemented using a first-in first-out table, in which case, when an entry of the first palette table 520 is added to the palette predictor 550, the oldest entry currently in the palette predictor 550 is removed so as to keep the palette predictor 550 below its maximum size. In other examples, the palette predictor 550 may be updated and / or maintained using different techniques.
[0075] In one example, the video encoder 20 may encode a pred_palette_flag for each block (e.g., the second block 530) such that the palette table for the block indicates whether it is predicted from one or more other palette tables associated with one or more other blocks such as the adjacent block 510. For example, if the value of such a flag is the binary 1, the video decoder 30 may determine that the second palette table 540 for the second block 530 is predicted from one or more previously decoded palette tables, and thus that a new palette table for the second block 540 is not included in the video bitstream containing the pred_palette_flag. If such a flag is the binary 0, the video decoder 30 may determine that the second palette table 540 for the second block 530 is included in the video bitstream as a new palette table. In some examples, the pred_palette_flag may be encoded separately for different color components of the block (e.g., three flags, one for Y, one for Cb, and one for Cr for a video block in the YCbCr color space). In other examples, a single pred_palette_flag may be encoded for all color components of the block.
[0076] In the example above, the pred_palette_flag is signaled for each block such that all entries of the palette table for the current block are predicted. This means that the second palette table 540 is identical to the first palette table 520 and no additional information is signaled. In other examples, one or more syntax elements may be signaled for each entry. That is, for each entry of the previous palette table, a flag may be signaled to indicate whether that entry is present in the current palette table. If a palette entry is not predicted, the palette entry may be signaled explicitly. In other examples, these two methods may be combined.
[0077] When predicting the second palette table 540 according to the first palette table 520, the video encoder 20 and / or the video decoder 30 may identify the position of the block from which the predicted palette table is determined. The predicted palette table may be associated with one or more adjacent blocks of the currently encoded block, i.e., the second block 530. As illustrated in FIG. 5, when determining the predicted palette table for the second block 530, the video encoder 20 and / or the video decoder 30 may identify the position of the left adjacent block, i.e., the first block 510. In other examples, the video encoder 20 and / or the video decoder 30 may identify the position of one or more blocks at other positions relative to the second block 530, such as the upper block in the picture 500. In another example, the palette table for the last block in the scan order using the palette mode may be used as the predicted palette table for the second block 530.
[0078] Video encoder 20 and / or video decoder 30 may determine a block for palette prediction according to a predetermined order of block positions. For example, video encoder 20 and / or video decoder 30 may first identify the left adjacent block, i.e., the first block 510, for palette prediction. If the left adjacent block is not available for prediction (e.g., the left adjacent block is encoded in a mode other than a palette-based coding mode such as an intra prediction mode or an inter prediction mode, or is located at the leftmost edge of a picture or slice), video encoder 20 and / or video decoder 30 may identify the upper adjacent block in picture 500. Video encoder 20 and / or video decoder 30 may continue to search for available blocks according to the predetermined order of block positions until it identifies the position of a block having a palette table available for palette prediction. In some examples, video encoder 20 and / or video decoder 30 may apply one or more formulas, functions, rules, etc. to generate a predicted palette table based on the palette tables of one or a combination of a plurality of adjacent blocks (spatially or in scan order), and determine a predicted palette based on the reconstructed samples of the plurality of blocks and / or adjacent blocks. In one example, a predicted palette table including palette entries from one or more previously encoded adjacent blocks includes a plurality of entries N. In this case, video encoder 20 first transmits the predicted palette table, i.e., a binary vector V having the same size as size N, to video decoder 30. Each entry in the binary vector indicates whether the corresponding entry in the predicted palette table is reused or copied to the palette table for the current block. For example, V(i)=1 means that the i-th entry in the predicted palette table for an adjacent block, which may have a different index in the current block, is reused or copied to the palette table for the current block.
[0079] In yet other examples, video encoder 20 and / or video decoder 30 may construct a candidate list that includes a plurality of potential candidates for palette prediction. In such examples, video encoder 20 may encode an index into the candidate list such that the candidate blocks are indicated in the original list from which the current block used for palette prediction is selected. Video decoder 30 may similarly construct the candidate list, decode the index, and use the decoded index to select the palette of the corresponding block for use with the current block. In another example, the palette table of the candidate blocks indicated in the list may be used as a predicted palette table for prediction for each entry of the palette table for the current block.
[0080] In some implementations, one or more syntax elements may indicate whether the entire palette table, such as a second palette table 540, is predicted from a predicted palette (e.g., a first palette table 520 that may be composed of entries from one or more previously encoded blocks), or whether a particular entry of the second palette table 540 is predicted. For example, an initial syntax element may indicate whether all entries in the second palette table 540 are predicted. If the initial syntax element indicates that not all entries are predicted (e.g., a flag having a binary value of 0), one or more additional syntax elements may indicate which entries of the second palette table 540 are predicted from the predicted palette table.
[0081] In some implementations, the size of the palette table may be fixed, for example, with respect to the number of pixel values included in the palette table, or may be signaled using one or more syntax elements in the encoded bitstream.
[0082] In some implementations, video encoder 20 may encode the pixels of a block without exactly matching the pixel values in the palette table to the actual pixel values in the corresponding block of video data. For example, video encoder 20 and video decoder 30 may combine or combine (ie, quantize) different entries in the palette table if the pixel values of the entries are within a predetermined range of each other. In other words, if an existing pixel value within the error margin of the new pixel value already exists, the new pixel value is not added to the palette table, while the samples in the block corresponding to the new pixel value are encoded with the index of the existing pixel value. Note that this lossy encoding process does not affect the operation of video decoder 30, which can decode pixel values in the same way, regardless of whether a particular palette table is lossless or lossy.
[0083] In some implementations, video encoder 20 may select an entry in the palette table as a predicted pixel value for encoding the pixel values in a block. Next, video encoder 20 may determine the difference between the actual pixel value and the selected entry as a residual, and may encode the residual. Video encoder 20 may generate a residual block that includes residual values for the pixels in the block predicted by the entry in the palette table, and then apply a transform and quantization to the residual block (as described above in connection with FIG. 2). In this way, video encoder 20 may generate quantized residual transform coefficients. In another example, the residual block may be encoded without loss (without transform and quantization) or without transform. Video decoder 30 may inverse transform and inverse quantize the transform coefficients to reproduce the residual block, and then reconstruct the pixel values using the predicted palette entry value and the residual value for the pixel values.
[0084] In some implementations, video encoder 20 may determine an error threshold, referred to as a delta value, to construct a palette table. For example, if the actual pixel value for a position in a block results in an absolute difference between the actual pixel value and an existing pixel value entry in the palette table that is less than or equal to the delta value, video encoder 20 may send an index value to identify the corresponding index of the pixel value entry in the palette table for use in reconstructing the actual pixel value for that position. If the actual pixel value for a position in a block results in an absolute difference value between the actual pixel value and an existing pixel value entry in the palette table that is greater than the delta value, video encoder 20 may send the actual pixel value and add the actual pixel value as a new entry to the palette table. To construct the palette table, video decoder 30 may use the delta value signaled by the encoder, rely on a fixed or known delta value, or infer or derive the delta value.
[0085] As described above, video encoder 20 and / or video decoder 30 may use encoding modes including an intra prediction mode, an inter prediction mode, a lossless encoding palette mode, and a lossy encoding palette mode when encoding video data. Video encoder 20 and video decoder 30 may encode one or more syntax elements indicating whether palette-based coding is enabled. For example, in each block, video encoder 20 may encode a syntax element indicating whether the palette-based coding mode should be used for that block (e.g., a CU or PU). For example, this syntax element may be signaled in the encoded video bitstream at the block level (e.g., the CU level) and then received by video decoder 30 when the encoded video bitstream is decoded.
[0086] In some implementations, the above-described syntax elements may be transmitted at a level higher than the block level. For example, video encoder 20 may signal such syntax elements at the slice level, tile level, PPS level, or SPS level. In this case, a value equal to 1 indicates that all blocks below this level are encoded using the palette mode so that additional mode information such as, for example, the palette mode or other modes is not signaled at the block level. A value equal to 0 indicates that none of the blocks below this level are encoded using the palette mode.
[0087] In some implementations, enabling the palette mode for higher-level syntax elements does not mean that each block below this higher level must be encoded in the palette mode. Rather, syntax elements at another CU level or even TU level may also need to indicate, in this case as well, whether a CU or TU level block is to be encoded in the palette mode and, if so, whether the corresponding palette table is to be configured. In some implementations, a video coder (e.g., video encoder 20 and video decoder 30) selects a threshold (e.g., 32) for the number of samples within a block for the minimum block size such that the palette mode is not allowed for blocks with a block size less than the threshold. In this case, no signaling of any syntax elements is performed for such blocks. Note that the threshold for the minimum block size may be explicitly signaled in the bitstream or implicitly set as a default value that is adapted by both video encoder 20 and video decoder 30.
[0088] The pixel value at one position of a block may be the same as (or within the delta value of) the pixel values at other positions of the block. For example, it is common for adjacent pixel positions of a block to have the same pixel value or to be mappable to the same index value in a palette table. Thus, video encoder 20 may encode one or more syntax elements indicating a plurality of consecutive pixels or index values in a given scan order that have the same pixel value or index value. A sequence of pixels or index values with similar values may be referred to herein as a "run". For example, if two consecutive pixels or indexes in a given scan order have different values, the run is equal to 0. If two consecutive pixels or indexes in a given scan order have the same value, but the third pixel or index in the scan order has a different value, the run is equal to 1. For three consecutive indexes or pixels having the same value, the run is 2, and so on. Video decoder 30 may obtain a syntax element indicating a run from the encoded bitstream and use that data to determine the number of consecutive positions having the same pixel or index value.
[0089] FIG. 6 is a flowchart showing an exemplary process 600 in which a video encoder implements a technique for encoding video data using a palette-based method. For example, video encoder 20 is configured to encode a video bitstream using a palette mode, and the video bitstream is organized in a hierarchical structure. For example, as illustrated in FIGS. 4C and 4E, respectively, each picture in the video is divided into a plurality of CTUs, and each CTU is further divided into a plurality of CUs of different shapes and sizes. To implement the palette-based method, video encoder 20 generates (610) a first syntax element associated with a first level of the hierarchical structure for inclusion in the video stream. As described above, the first level associated with the first syntax element is selected to be a level higher than the CU level, for example, a tile, slice, or even picture level. The first syntax element may be stored as part of an SPS, PPS, tile group header, or slice header. If the first syntax element has a binary value of 1, this indicates that the palette mode is enabled for one or more coding units (CUs) below the first level in the video bitstream.
[0090] Next, the video encoder 20 encodes the pixel values and the first syntax element of one or more CUs into a video bitstream, and each CU has a corresponding palette table (630). For example, for each CU encoded into the video bitstream, the video encoder 20 generates a second syntax element associated with the CU (630-1). As described above, even if the first syntax element indicates that the palette mode is enabled for one or more CUs, this does not mean that each individual CU is necessarily encoded according to the palette table. Rather, it is the value of the second syntax element that determines whether the video block of a particular CU is encoded according to the palette mode. Assuming that the second syntax element has a binary value of 1 indicating that the palette mode is enabled for the CU, the video encoder 20 then constructs the palette table for the CU (630-3).
[0091] Various techniques for constructing a palette table are described above in connection with FIG. 5. For example, a palette predictor may be used to construct the palette table, and in some implementations, the palette predictor is a FIFO table that holds a set of palette entries that are most frequently used by the video data. Using the palette table, video encoder 20 then identifies samples in the video block of the CU and determines the pixel value of the sample and the palette index for the sample in the palette table (630-5). As described above, there are different possibilities for samples in the CU. First, there is an existing palette entry in the palette table corresponding to the sample in the CU. If so, the palette index of this existing palette entry is used to represent the sample in the video bitstream. Second, there is no existing palette entry that matches the pixel value of the sample. If so, video encoder 20 may add a new entry to the palette table and use the palette index of the new entry to represent the sample. In this case, the new entry may be used to represent other samples in the CU that have the same or similar (within a delta value) pixel values. In some implementations, video encoder 20 may encode the pixel value of the sample as an escape color entry in the palette table. In any case, video encoder 20 encodes the determined palette index corresponding to the sample into the video bitstream (630-7).
[0092] In some implementations, video encoder 20 may select, for a particular CU, a second syntax value of binary 0 indicating that the palette mode is disabled for the CU. In this case, video encoder 20 may select to encode the CU using another prediction mode, such as intra prediction or inter prediction, and may accordingly encode the corresponding syntax elements. In other words, that the first syntax element indicates that the palette mode is enabled may, in this case as well, allow a particular CU below the first level to select a non-palette mode. In contrast, when the first syntax element is set to binary 0 indicating that the palette mode is disabled at the first level, none of the CUs below the first level will be encoded using the palette mode, and thus the second syntax element or the palette table will not be encoded in the video bitstream.
[0093] Finally, video encoder 20 outputs (650), as shown in FIG. 1, an encoded video bitstream including one or more encoded CUs at the first level and the first syntax element as well as the second syntax element at the CU level to video decoder 30 or a storage device. In some implementations, the first level has an associated block size that is greater than or equal to a predetermined threshold associated with one or more CUs below the first level. For example, assume that an ancestor node having a size of 128 samples is divided into three CUs having sizes of 32, 64, and 32 samples, respectively. If the predetermined threshold used to determine the first level for sharing the palette mode is 64, the three CUs are three leaf nodes sharing the same palette mode. In some implementations, there is a lower limit (e.g., 32 samples) with respect to the predetermined threshold such that the palette mode is not enabled for blocks having 32 or fewer samples for encoding efficiency. In some implementations, the first syntax element and the second syntax are each 1-bit flags.
[0094] In some implementations, in palette mode, each CU is divided into a plurality of segments, where each segment contains a plurality of samples (e.g., M samples), and M is a positive number of 16 or 32. For each segment, the CABAC syntax parsing and / or encoding of palette-related syntax such as palette index values, palette index runs, and quantized colors is independent of that of other segments in the same CU. To achieve this, all dependencies of CABAC syntax parsing (e.g., context modeling) and decoding dependencies (e.g., copy-above mode) in palette mode are disabled across adjacent segments.
[0095] In some implementations, different methods may be used to divide a CU into a plurality of segments under palette mode, for example, based on a traverse scan order. That is, the first M samples along the scan order are grouped into segment 1, the next M samples along the scan order are grouped into segment 2, and so on. In another example, a CU may be divided into a plurality of segments based on a binary tree, ternary tree, or quadtree partitioning structure. Within each segment, again, a traverse scan order may be used for segment palette coding. For example, the number of index values for a segment is signaled first, followed by signaling of the actual palette index values for the entire segment using truncated binary coding. Both the index number and the palette index values are encoded in a bypass mode that groups both into bypass bins related to the index. Then the index run is signaled. Finally, the component escape values corresponding to the escape samples in the segment are grouped together and encoded in bypass mode.
[0096] As described above, different block size thresholds may be used to identify the shared palette nodes. In one embodiment, one fixed threshold is shared by both the encoder and the decoder without signal transmission. In another embodiment, it is proposed that one syntax element signals the shared palette threshold in the bitstream.
[0097] FIG. 7 is a flowchart showing an exemplary process for a video decoder 30 to implement a technique for decoding video data using a palette-based method according to some implementations of the present disclosure. For example, the video decoder 30 is configured to decode a video bitstream using a palette mode, and the video bitstream is organized in a hierarchical structure. For example, as illustrated in FIGS. 4C and 4E respectively, each picture in the video is divided into a plurality of CTUs, and each CTU is further divided into a plurality of CUs of different shapes and sizes. To implement the palette-based method, the video decoder 30 receives (710) a first syntax element associated with a first level of the hierarchical structure from the video bitstream. As described above, the first level associated with the first syntax element is selected to be a level higher than the CU level, for example, the tile, slice, or even picture level. The first syntax element is generated by the video encoder 20 and may be stored as part of the SPS, PPS, tile group header, or slice header. If the first syntax element has a binary value of 1, this indicates that the palette mode is enabled for one or more coding units (CUs) below the first level in the video bitstream.
[0098] Based on the value of the first syntax element 1, video decoder 30 reconstructs (730) the pixel values of at least one of one or more CUs according to the corresponding palette table. For example, for each CU encoded in the video bitstream, video decoder 30 receives (730-1) a second syntax element associated with the CU. As described above, even if the first syntax element indicates that the palette mode is enabled for one or more CUs, this does not mean that each individual CU is necessarily encoded according to the palette table. It is the value of the second syntax element that determines whether the video block of a particular CU is encoded according to the palette mode. Assuming that the second syntax element has a binary value of 1 indicating that the palette mode is enabled for the CU, video decoder 30 reconstructs (730-3) the palette table for each CU from the video bitstream.
[0099] Various techniques for constructing the palette table have been described above in connection with FIG. 5. For example, a palette predictor may be used to construct the palette table, and in some implementations, the palette predictor is a FIFO table that holds a set of the most frequently used palette entries by the video data. Using the palette table, video decoder 30 then identifies the samples in the video block of the CU, determines the palette index and then the pixel value for the sample in the palette table, and then reconstructs (730-5) the pixel value for the sample. As described above, the reconstruction of the pixel value may require inverse quantization and inverse transformation of the residual value for the sample, which is added to the pixel value from the palette table as the reconstructed pixel value of the sample. In some implementations, video decoder 30 may reconstruct the pixel value of the sample from the escape color entry in the palette table.
[0100] When the first syntax element has a value of 0 indicating that the palette mode is disabled for the CU, the video decoder 30 reconstructs (750) the pixel values of one or more CUs from the video bitstream according to a non-palette method. As described above, the video decoder 30 may reconstruct the CU using another mode, such as the intra prediction or inter prediction described above. Note that all features regarding the first and second syntax elements described above in connection with FIG. 6 apply to the palette-based decoding process described herein in connection with FIG. 7.
[0101] In some implementations, a cross-component linear model (CCLM) is used to generate a chroma palette prediction from a luma palette prediction. In one example, the CCLM may be calculated using adjacent luma and chroma samples. After the linear model is determined, a chroma palette prediction may be calculated based on the luma palette table of the same CU together with the linear model. In one example, the chroma palette prediction may be derived as follows. pred C (i,j)=α·rec L ’(i,j)+β where pred C (i,j) represents the predicted chroma palette in the CU, and rec L ’(i,j) represents the reconstructed luma palette sample of the same CU. The linear model parameters α and β are derived, and different derivation methods may be used. One exemplary method is the linear relationship between the luma values and chroma values from two samples in the luma palette table, namely the minimum luma sample A(x A ,y A ) and the maximum luma sample B(x B ,y B ). Here, (x A ,y A ) are the luma value and chroma value for sample A, and (x B ,y B) are the luminance value and the chroma value for sample B. The linear model parameters α and β are obtained according to the following equations.
[0102]
Equation
[0103] In some implementations, different contexts based on the shape of the current block are used to transmit signals in the traverse scan direction under the palette mode. Depending on the shape of the current block, different CABAC contexts may be selected, and thereby different CABAC probabilities will be used. Such contexts may also depend on the traverse scan direction of adjacent blocks.
[0104] In some implementations, depending on the shape of the current block, signal transmission in the traverse scan direction may be conditionally omitted. In this case, the video decoder 30 infers the traverse scan direction based on the shape of the current block. For example, if the block has an aspect ratio exceeding a certain threshold, its traverse scan direction is not transmitted under the palette mode but is inferred to be the same as the long side of the block. Alternatively, its traverse scan direction is transmitted as normal. In another example, if the block has an aspect ratio exceeding a certain threshold, its traverse scan direction is not transmitted under the palette mode. The video decoder 30 infers the traverse scan direction to be the same as the short side of the block. Alternatively, its traverse scan direction is transmitted as normal.
[0105] In one or more examples, the described functionality may be implemented in hardware, software, firmware, or any combination thereof. If implemented in software, the functionality may be stored on or transmitted via a computer-readable medium as one or more instructions or code and executed by a hardware-based processing unit. The computer-readable medium may include a tangible medium such as a data storage medium or a computer-readable storage medium corresponding to a communication medium that includes any medium that facilitates transfer of a computer program from one place to another, for example, according to a communication protocol. Thus, the computer-readable medium generally may correspond to (1) a non-transitory tangible computer-readable storage medium or (2) a communication medium such as a signal or carrier wave. The data storage medium may be any available medium that can be accessed by one or more computers or one or more processors to obtain instructions, code, and / or data structures for implementation of the implementations described in this application. A computer program product may include a computer-readable medium.
[0106] The terms used in the description of the implementations herein are for the purpose of describing particular implementations only and are not intended to limit the scope of the claims. When used in the description of the implementations and the appended claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms as well, unless the context clearly dictates otherwise. Also, the term “and / or” as used herein is to be understood to refer to and encompass any and all possible combinations of one or more of the associated listed items. Further, the terms “comprise” and / or “comprising” as used herein are to be understood to specify the presence of the stated features, elements, and / or components but do not preclude the presence or addition of one or more other features, elements, components, and / or groups thereof.
[0107] Also, terms such as first, second, etc. may be used in this specification to describe various elements, but it should be understood that these elements should not be limited by these terms. These terms are only used to distinguish one element from another. For example, unless departing from the scope of the implementation, the first electrode may also be referred to as the second electrode, and similarly, the second electrode may also be referred to as the first electrode. The first electrode and the second electrode are both electrodes, but they are not the same electrode.
[0108] The description of this application is presented for purposes 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 implementations will be apparent to those skilled in the art who benefit from the teachings presented in the foregoing description and the related drawings. The embodiments are selected and described in order to best clarify the principles of the invention, the practical applications, enable others skilled in the art to understand the invention for various implementations, and best utilize the fundamental principles and various implementations with various modifications to suit the particular applications contemplated. Accordingly, it should be understood that the scope of the claims should not be limited to the specific examples of the disclosed implementations, and that modifications and other implementations are intended to be included within the scope of the appended claims.
Claims
1. A method for encoding video data, comprising: when a block size of a current coding unit (CU) is larger than a predetermined threshold, generating a first syntax element associated with a first level of the hierarchical structure for inclusion in a video bitstream having a hierarchical structure, the first syntax element indicating that a palette mode is applied to one or more CUs at and below the first level in the video bitstream; encoding the current CU and the first syntax element to generate the video bitstream; and when the block size of the current CU is not larger than the predetermined threshold, the method includes that the first syntax element is not encoded in the video bitstream.
2. The method according to claim 1, wherein the predetermined threshold is 32 or more.
3. The method according to claim 1, wherein the predetermined threshold is larger than 16.
4. The method according to claim 1, wherein the first syntax element includes a 1-bit flag.
5. Encoding the current CU and the first syntax element to generate the video bitstream includes: generating a second syntax element associated with each of the one or more CUs for inclusion in the video bitstream; determining, according to a determination that the second syntax element indicates that the palette mode is applied to each of the respective CUs, constructing a palette table for each of the respective CUs; determining a palette index from the palette table for each sample in each of the respective CUs; and further encoding, in the video bitstream, the determined palette index corresponding to the sample, wherein the first syntax element is in one of a sequence parameter set (SPS), a picture parameter set (PPS), a tile group header, and a slice header. Each of the one or more CUs is divided into a plurality of segments based on a predetermined partition tree structure, and each segment has its own set of palette mode parameters including the total number of palette indexes and the corresponding set of palette indexes associated with the palette table at the first level. The method according to claim 1.
6. One or more processing units, a memory coupled to the one or more processing units, a plurality of programs stored in the memory that, when executed by the one or more processing units, cause the electronic device to execute the method according to any one of claims 1 to 5. An electronic device comprising:
7. A non-transitory computer-readable storage medium storing a plurality of programs for execution by an electronic device having one or more processing units, the plurality of programs being executed by the one or more processing units. When executed, cause the electronic device to execute the method according to any one of claims 1 to 5. A non-transitory computer-readable storage medium.
8. A computer program including computer-executable instructions for encoding a video signal, the instructions causing the processor to execute the method according to any one of claims 1 to 5 when executed by the processor. A computer program.
9. A method of transmitting a bitstream, generating a bitstream by executing the encoding method according to any one of claims 1 to 5, transmitting the bitstream, comprising: a method.