Simplified palette predictor update for video codecs
Through palette-based video encoding and decoding technology, the number of entries in the palette is dynamically adjusted, which solves the problem of inefficiency in traditional technology when processing screen generation content, and realizes efficient video encoding and decoding and resource utilization.
Patent Information
- Application Number
- CN202080065351.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2020-09-23
- Filing Date
- 2020-09-24
- Publication Date
- 2025-01-07
- Estimated Expiration
- 2040-09-24
AI Technical Summary
Existing video codec technology is inefficient when processing screen generated content, especially for computer-generated screen content. The traditional assumptions of continuous tone and spatial smoothing are not applicable, resulting in the inability of traditional codec technology to efficiently compress discrete tones and clear lines. Video data.
Using palette-based encoding and decoding technology, video data is encoded through palette mode, palette index compresses repeated pixel values, and dynamically adjusts the number of entries in the palette to reduce copy operations and improve system resources Utilization.
Improve the efficiency of video encoding and decoding, especially when processing content generated by the screen, reduces the size of the bitstream, reduces the consumption of system resources, and maintains visual quality.
Smart Images

Figure CN114402604B_ABST
Abstract
Description
[0001] This application claims priority to U.S. Application No. 17 / 029,767, filed on September 23, 2020, which claims the benefit of U.S. Provisional Application No. 62 / 905,105, filed on September 24, 2019, the entire contents of each of which are incorporated herein by reference. Technical Field
[0002] The present disclosure relates to video encoding and video decoding. Background Art
[0003] Digital video capabilities can be incorporated into a wide range of devices, including digital televisions, digital direct broadcast systems, wireless broadcast systems, personal digital assistants (PDAs), laptop or desktop computers, tablet computers, e-book readers, digital cameras, digital recording devices, digital media players, video game devices, video game consoles, cellular or satellite radio telephones, so-called "smart phones", video teleconferencing devices, video streaming devices, etc. Digital video devices implement video coding techniques, such as those described in the standards defined by the following: MPEG-2; MPEG-4; ITU-T H.263; ITU-T H.264 / MPEG-4 Part 10, Advanced Video Codec (AVC); ITU-T H.265 High Efficiency Video Codec (HEVC) and extensions of such standards. By implementing such video coding techniques, video devices can more efficiently send, receive, encode, decode and / or store digital video information.
[0004] Video coding techniques include spatial (intra-picture) prediction and / or temporal (inter-picture) prediction to reduce or remove redundancy inherent in video sequences. For block-based video coding, a video slice (e.g., a video picture or a portion of a video picture) may be partitioned into video blocks, which may also be referred to as codec tree units (CTUs), codec units (CUs), and / or codec nodes. Video blocks in an intra-coded (I) slice of a picture are encoded using spatial prediction relative to reference samples in neighboring blocks in the same picture. Video blocks in an inter-coded (P or B) slice of a picture may use spatial prediction relative to reference samples in neighboring blocks in the same picture, or temporal prediction relative to reference samples in other reference pictures. Pictures may be referred to as frames, and reference pictures may be referred to as reference frames. Summary of the invention
[0005] In general, the present disclosure describes techniques for palette mode encoding and decoding of video data. Performing palette mode encoding and decoding of video data may involve copying entries between palettes, such as copying entries from a first palette to a second palette. For example, a video codec may copy entries from a predictor palette to a palette for a current block of video data. In the case of a mobile or other battery-powered device, each copy operation may consume system resources, such as memory, processing power, and battery life. Thus, it may be desirable to reduce the number of copy operations performed. The number of copy operations may be positively correlated with the number of entries in the palette. Thus, reducing the number of entries in the palette may reduce the number of copy operations performed. However, reducing the maximum number of entries in the palette may reduce the efficiency of the palette mode encoding and decoding, which may not be desired.
[0006] According to one or more techniques of the present disclosure, a video codec can dynamically adjust the maximum number of entries that will be used for palette mode encoding and decoding. For example, based on a parameter of a first block of video data, the video codec can determine the number of entries that will be used for palette mode encoding and decoding of the current block. As a specific example, the video codec can limit the maximum number of entries to a first value (e.g., 16) based on a parameter having a first value, or limit the maximum number of entries to a second value (e.g., 32) based on a parameter having a second value. Therefore, in some examples, the second value is greater than the first value. In this way, the video codec can reduce the amount of system resources used for palette mode encoding and decoding. For example, the video codec can reduce the number of copy operations without excessively reducing the efficiency of palette mode encoding and decoding.
[0007] In one example, a device includes: a memory configured to store at least a portion of an encoded video bitstream; and one or more processors implemented in a circuit and configured to: determine, based on parameters of a first block of video data, a maximum number of entries to be used for palette mode encoding and decoding of a current block; generate a palette for the first block of video data based on the determined maximum number of entries and based on a palette predictor, the palette comprising one or more entries, each entry comprising a palette index associated with a color value; decode from the encoded video bitstream and for the first block of video data an index value for a sample of the first block that identifies an entry in the palette; and reconstruct the samples of the first block based on the index value.
[0008] In another example, a method includes: determining, based on parameters of a first block of video data, a maximum number of entries to be used for palette mode encoding and decoding of a current block; generating, based on the determined maximum number of entries and based on a palette predictor, a palette for the first block of video data, the palette comprising one or more entries, each entry comprising a palette index associated with a color value; identifying, from an encoded video bitstream and for the first block of video data, index values for samples of the first block that enter the entry in the palette; and reconstructing the samples of the first block based on the index values.
[0009] In another example, a device includes: a memory configured to store at least a portion of an encoded video bitstream; and one or more processors implemented in a circuit and configured to: determine, based on parameters of a first block of video data, a maximum number of entries to be used for palette mode encoding and decoding of a current block; generate, based on the determined maximum number of entries and based on a palette predictor, a palette for the first block of video data, the palette comprising one or more entries, each entry comprising a palette index associated with a color value; and an index value for a sample of the first block that identifies the entry in the palette encoded in the encoded video bitstream and for the first block of video data.
[0010] In another example, a method includes: determining, based on parameters of a first block of video data, a maximum number of entries to be used for palette mode encoding and decoding of a current block; generating, based on the determined maximum number of entries and based on a palette predictor, a palette for the first block of video data, the palette comprising one or more entries, each entry comprising a palette index associated with a color value; and an index value for a sample of the first block that identifies the entry in the palette encoded for the first block of video data in an encoded video bitstream.
[0011] In another example, a computer-readable storage medium stores instructions that, when executed, cause one or more processors of a video encoder to: determine, based on parameters of a first block of video data, a maximum number of entries to be used for palette mode encoding and decoding of a current block; generate, based on the determined maximum number of entries and based on a palette predictor, a palette for the first block of video data, the palette comprising one or more entries, each entry comprising a palette index associated with a color value; and an index value for a sample of the first block that identifies the entry in the palette in an encoded video bitstream and encoded for the first block of video data.
[0012] The details of one or more examples are set forth in the accompanying drawings and the description below.Other features, objects, and advantages of the disclosure will be apparent from the description and drawings, and from the claims. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] Figure 1 is a block diagram illustrating an example video encoding and decoding system that may perform the techniques of this disclosure.
[0014] Figure 2A and 2B is a conceptual diagram illustrating an example quadtree binary tree (QTBT) structure and a corresponding codec tree unit (CTU).
[0015] Figure 3 is a block diagram illustrating an example video encoder that may perform the techniques of this disclosure.
[0016] Figure 4 is a block diagram illustrating an example video decoder that may perform the techniques of this disclosure.
[0017] Figure 5 is a conceptual diagram illustrating an example of determining a color palette for encoding and decoding video data consistent with the techniques of this disclosure.
[0018] Figure 6 is a conceptual diagram illustrating an example of determining an index of a palette for a pixel block consistent with the techniques of this disclosure.
[0019] Figure 7 is a conceptual diagram illustrating an example codec using an index for horizontal and vertical traversal scans.
[0020] Figure 8 and 9 is a conceptual diagram illustrating updates to the palette table export and palette predictor.
[0021] Fig.10 is a conceptual diagram illustrating an example of predicting a palette predictor using only the first W×H entries in the palette predictor.
[0022] Fig.11 is a conceptual diagram illustrating an example of using only the first W×H entries in a palette predictor to predict a palette predictor in which population is limited to the first W×H elements.
[0023] Fig.12 is a flow chart illustrating an example method for decoding a current block of video data.
[0024] Fig.13 is a flow chart illustrating an example method for decoding a current block of video data.
[0025] Fig.14 is a flow chart illustrating an example method for encoding and decoding a block using palette mode compression, in accordance with one or more techniques of this disclosure. DETAILED DESCRIPTION
[0026] The present disclosure describes techniques for video encoding and compression. Specifically, the present disclosure describes techniques for palette-based encoding and decoding of video data. For example, the present disclosure describes techniques for encoding and decoding to support video content, particularly screen content utilizing palette encoding and decoding, such as techniques for improved palette construction, and techniques for signaling notification for palette encoding and decoding.
[0027] In traditional video codecs, images are assumed to be continuous-tone and spatially smooth. Based on these assumptions, various tools such as block-based transforms, filtering, etc. have been developed, and such tools have shown good performance for natural content videos.
[0028] However, in applications like remote desktop, collaborative work, and wireless display, computer-generated screen content may be the dominant content to be compressed. This type of content tends to have discrete tones and is characterized by sharp lines and high-contrast object boundaries. The assumptions of continuous tones and smoothness may no longer apply, and therefore traditional video codec techniques may not be an efficient way to compress video data.
[0029] Based on the characteristics of screen content video, as proposed in "Palette Mode for Screen Content Coding" by Guo et al. in the 13th Meeting of the Joint Collaboration Team on Video Coding (JCT-VC) of ITU-T SG 16WP 3 and ISO / IEC JTC 1 / SC29 / WG 11: Incheon, South Korea, April 18-26, 2013, document: JCTVC-M0323 (available at http: / / phenix.it-sudparis.eu / jct / doc_end_user / documents / 13_Incheon / wg11 / JCTVC-M0323-v3.zip) (hereinafter referred to as "JCTVC-M0323"), palette coding is introduced to improve screen content coding (SCC) efficiency. Specifically, based on the fact that in SCC, the colors within one CU are usually concentrated on several peaks, palette coding introduces a lookup table (i.e., a color palette) to compress repeated pixel values. Given a palette for a particular CU, pixels within the CU are mapped to palette indices. In the second stage, an efficient copy-from-left run-length method is proposed to effectively compress the repetitive pattern of index blocks. In some examples, the palette index codec mode can be generalized to both copy-from-left and copy-from-top with run-length codec. Note that in some examples, for palette codec, no transform process may be invoked to avoid blurring sharp edges, which may have a huge negative impact on the visual quality of screen content.
[0030] As described above, the present disclosure describes palette-based coding, which may be particularly suitable for screen-generated content coding. For example, assume that a particular region of video data has a relatively small number of colors. A video codec (video encoder or video decoder) may codec a so-called "palette" as a table of colors for representing video data for a particular region (e.g., a given block). Each pixel may be associated with an entry in the palette that represents the color of the pixel. For example, the video codec may codec an index that maps a pixel value to an appropriate value in the palette.
[0031] In the above example, the video encoder can encode a block of video data by determining a palette for the block, locating entries in the palette to represent the color value of each pixel, and encoding the palette with index values for the pixels that map the pixel values to the palette. The video decoder can obtain the palette for the block and the index values for the pixels of the block from the encoded bitstream. The video decoder can map the index values of the pixels to the entries of the palette to reconstruct the brightness and chrominance pixel values of the block.
[0032] The above examples are intended to provide an overall description of palette-based coding. In various examples, the techniques described in this disclosure may include techniques for various combinations of one or more of the following: signaling palette-based coding modes, sending palettes, predicting palettes, deriving palettes, and sending palette-based coding maps and other syntax elements. Such techniques can improve video coding efficiency, for example, requiring fewer bits to represent the content generated by the screen.
[0033] For example, according to aspects of the present disclosure, a video codec (video encoder or video decoder) may encode one or more syntax elements for each block encoded using a palette encoding mode. For example, the video codec may encode palette_mode_flag to indicate whether a palette-based encoding mode will be used to encode a particular block. In this example, the video encoder may encode palette_mode_flag as a value equal to one to specify that the block currently being encoded ("current block") is encoded using a palette mode. In this case, the video decoder may obtain palette_mode_flag from the encoded bitstream and apply a palette-based encoding mode to decode the block. In instances where there is more than one palette-based encoding mode available (e.g., there is more than one palette-based technique available for encoding and decoding), one or more syntax elements may indicate one of a plurality of different palette modes for a block.
[0034] In some instances, the video encoder may encode palette_mode_flag to a value equal to zero to specify that the current block is not encoded using a palette mode. In such cases, the video encoder may encode the block using any of a variety of inter-frame prediction, intra-frame prediction, or other codec modes. When palette_mode_flag is equal to zero, the video encoder may encode additional information (e.g., syntax elements) to indicate a specific mode for encoding the corresponding block. In some examples, as described below, the mode may be an HEVC codec mode. The use of palette_mode_flag is described for example purposes. In other examples, other syntax elements (such as multi-bit codes) may be used to indicate whether a palette-based codec mode will be used for one or more blocks, or to indicate which of multiple modes will be used.
[0035] When a palette-based codec mode is used, a palette may be sent by the encoder in the encoded video data bitstream for use by the decoder. The palette may be sent for each block, or may be shared among multiple blocks in a picture or slice. The palette may refer to a plurality of pixel values that are dominant and / or representative for a block, including, for example, a luma value and two chroma values.
[0036] In some examples, syntax elements such as a transposition flag may be encoded to indicate whether the transposition process is applied to the palette index of the current palette. If the transposition flag is zero, the palette index for the sample may be encoded with a horizontal traversal scan. Similarly, if the transposition flag is one, the palette index for the sample may be encoded with a vertical traversal scan. This may be thought of as: decoding the index value, assuming a horizontal traversal scan, and then transposing the block (row to column).
[0037] As mentioned above, palette codec is designed to handle clustered colors for screen content. Palette codec uses basic colors and index maps to represent input image blocks. A flag can be sent for each codec unit (CU) to signal whether the palette mode is used in the current CU. If the palette mode is used, the pixel values in the CU are represented by a small set of representative color values. This set is called a palette. For pixels with values close to the palette colors, the palette index is signaled. For pixels with values outside the palette, the pixel is marked with an escape symbol, and the quantized pixel value is signaled directly.
[0038] In order to decode a palette-encoded block, the decoder needs to decode the palette colors and indices. The palette colors are described by a palette table and encoded by the palette table codec tool. An escape flag is signaled for each CU to indicate whether the escape symbol is present in the current CU. If the escape symbol is present, the palette table is incremented by one and the last index is assigned to the escape mode. The palette indices of all pixels in the CU form a palette index map and are encoded by the palette index map codec tool.
[0039] To encode and decode the palette index map, the video codec may use horizontal and vertical traversal scans to encode and decode the index. Figure 7 is a conceptual diagram illustrating an example codec using an index for horizontal and vertical traversal scans.
[0040] Palette indices are encoded and decoded using two main palette sample modes: 'INDEX' and 'COPY_ABOVE'. Modes are signaled using flags, except when using the top row when horizontal scanning, the first column when vertical scanning, or when the previous mode was 'COPY_ABOVE'. In 'COPY_ABOVE' mode, the palette indices of samples in the row above are copied. In 'INDEX' mode, the palette indices are signaled explicitly. For both 'INDEX' and 'COPY_ABOVE' modes, a run value is signaled, which specifies the number of pixels encoded and decoded using the same mode.
[0041] The coding order for the index map can be as follows: First, the number of index values for the CU is signaled. This is followed by signaling of the actual index value for the entire CU using truncated binary codec. Both the number of indexes and the index values are encoded and decoded in bypass mode. This groups the index-related bypass bins together. The palette mode (INDEX or COPY_ABOVE) and the run are then signaled in an interleaved manner. Finally, the component run values corresponding to the run samples for the entire CU are grouped together and encoded and decoded in bypass mode. After signaling the index value, an additional syntax element (e.g., last_run_type_flag) can be signaled. This syntax element, together with the number of indices, can eliminate the need to signal the run value corresponding to the last run in the block.
[0042] At the 15th JVET meeting in Gothenburg, Sweden, palette mode was adopted in the Versatile Video Codec (VVC) for the YUV 4:4:4 format. The palette mode syntax is the same as in HEVC SCM (see, for example, R. Joshi, J. Xu, R. Cohen, S. Liu, Y. Ye, "Screen Content Coding Test Model 7 Encoder Description (SCM 7)", JCTVC-W1014, 2016; and R. Joshi, S. Liu, GJ Sullivan, Y.-K. Wang, J. Xu, Y. Ye, "HEVC Screen Content Coding Draft Text 6" in JCTVC-W1005, 2016), with modifications to the palette mode signaling notification and including separate palette modes for slices using dual trees for luma and chroma components (separate palette predictors / tables / syntax parsing for luma codec tree and chroma codec tree).
[0043] In palette mode, a video codec (e.g., video encoder 200 and / or video decoder 300 as described below, e.g., with reference to Figure 1 , 3 and 4) a flag (e.g., palette_mode_flag) for each CU that signals whether a palette mode is used in the current CU may be encoded and decoded. The maximum CU size allowed by palette mode is 64×64 (the maximum CU size in HEVC). If palette mode is utilized, the pixel values in the CU are represented by a small set of representative color values. This set may be referred to as a palette. The video codec may signal the palette index for pixels with values close to the palette colors. The video codec may utilize an escape symbol to indicate pixels with values outside the palette, and may directly signal the quantized pixel values.
[0044] To decode a palette-encoded block, the decoder can decode the palette colors and indices. The palette colors are described by a palette table and encoded by a palette table codec. The video codec can signal an escape flag for each CU to indicate whether an escape symbol is present in the current CU. If an escape symbol is present, the video codec can increase the palette table by one and assign the last index to the escape mode. The palette indices of all pixels in a CU form a palette index map and are encoded by a palette index map codec.
[0045] The video codec may maintain a palette predictor for encoding and decoding of a palette table. The video codec may periodically initialize the palette predictor. For example, the video codec may initialize the palette predictor at the beginning of each strip. In some examples, to initialize the palette predictor, the video codec may reset the palette predictor to 0. The video codec may signal a reuse flag for each entry in the palette predictor to indicate whether it is part of the current palette. In some examples, the video codec may encode and decode the reuse flag using zero run length encoding. The video codec may signal the number of new palette entries using a 0-order exponential Golomb code. The video codec may signal component values for new palette entries. After encoding the current CU, the video codec may update the palette predictor using the current palette. In some examples, the video codec may add entries from the previous palette predictor that are not reused in the current palette to the end of the new palette predictor until the maximum size allowed is reached. The addition of entries from a previous palette predictor may be referred to as palette filling.
[0046] Figure 1 1 is a block diagram illustrating an example video encoding and decoding system 100 that can perform the techniques of the present disclosure. The techniques of the present disclosure generally relate to encoding and decoding (encoding and / or decoding) video data. Generally, video data includes any data used to process video. Thus, the data may include original unencoded video, encoded video, decoded (e.g., reconstructed) video, and video metadata, such as signaling notification data.
[0047] like Figure 1 As shown, in this example, system 100 includes a source device 102 that provides encoded video data for decoding and display by a destination device 116. Specifically, source device 102 provides video data to destination device 116 via computer-readable medium 110. Source device 102 and destination device 116 may include any of a wide range of devices, including desktop computers, notebook (i.e., laptop) computers, tablet computers, set-top boxes, telephone handsets such as smart phones, televisions, cameras, display devices, digital media players, video game consoles, video streaming devices, etc. In some cases, source device 102 and destination device 116 may be equipped for wireless communication, and thus may be referred to as wireless communication devices.
[0048] exist Figure 1In the example of, source device 102 includes video source 104, memory 106, video encoder 200, and output interface 108. Destination device 116 includes input interface 122, video decoder 300, memory 120 and display device 118. According to the present disclosure, the video encoder 200 of source device 102 and the video decoder 300 of destination device 116 can be configured to apply the technology for palette mode encoding and decoding. Therefore, source device 102 represents an example of a video encoding device, and destination device 116 represents an example of a video decoding device. In other examples, source device and destination device may include other components or arrangements. For example, source device 102 may receive video data from an external video source such as an external camera. Similarly, destination device 116 may interface with an external display device instead of including an integrated display device.
[0049] like Figure 1 The system 100 shown is only an example. Generally, any digital video encoding and / or decoding device can perform the technology for palette mode encoding and decoding. The source device 102 and the destination device 116 are only examples of such codec devices, wherein the source device 102 generates encoded and decoded video data for transmission to the destination device 116. The present disclosure refers to a "codec" device as a device that performs the encoding and decoding (encoding and / or decoding) of data. Therefore, the video encoder 200 and the video decoder 300 represent examples of codec devices, specifically, examples of video encoders and video decoders, respectively. In some examples, the devices 102, 116 can operate in a substantially symmetrical manner so that each of the devices 102, 116 includes a video encoding and decoding component. Therefore, the system 100 can support one-way or two-way video transmission between video devices 102, 116, for example, for video streaming, video playback, video broadcasting or video telephony.
[0050] Typically, video source 104 represents the source of video data (i.e., original, unencoded video data) and provides a continuous series of pictures (also referred to as "frames") of video data to video encoder 200, which encodes the data for these pictures. Video source 104 of source device 102 may include a video capture device such as a video camera, a video archive containing previously captured original video, and / or a video feed interface for receiving video from a video content provider. As a further alternative, video source 104 may generate computer graphics-based data as source video, or a combination of live video, archived video, and computer-generated video. In each case, video encoder 200 encodes captured, pre-captured, or computer-generated video data. Video encoder 200 may rearrange pictures from a received order (sometimes referred to as "display order") into a codec order for encoding and decoding. Video encoder 200 may generate a bitstream comprising encoded video data. Source device 102 may then output the encoded video data onto computer-readable medium 110 via output interface 108 for receipt and / or retrieval by, for example, input interface 122 of destination device 116 .
[0051] The memory 106 of the source device 102 and the memory 120 of the destination device 116 represent general purpose memory. In some examples, the memories 106, 120 can store original video data, for example, original video from the video source 104 and original, decoded video data from the video decoder 300. Additionally or alternatively, the memories 106, 120 can store software instructions that can be executed by, for example, the video encoder 200 and the video decoder 300, respectively. Although shown separately from the video encoder 200 and the video decoder 300 in this example, it should be understood that the video encoder 200 and the video decoder 300 can also include internal memory for functionally similar or equivalent purposes. In addition, the memories 106, 120 can store, for example, encoded video data output from the video encoder 200 and input to the video decoder 300. In some examples, portions of the memories 106, 120 can be allocated as one or more video buffers, for example to store original, decoded and / or encoded video data.
[0052] The computer-readable medium 110 may represent any type of medium or device capable of transmitting the encoded video data from the source device 102 to the destination device 116. In one example, the computer-readable medium 110 represents a communication medium that enables the source device 102 to directly send the encoded video data to the destination device 116 in real time, for example, via a radio frequency network or a computer-based network. According to a communication standard such as a wireless communication protocol, the output interface 108 can modulate a transmission signal including the encoded video data, and the input interface 122 can modulate the received transmission signal. The communication medium may include any wireless or wired communication medium, such as a radio frequency (RF) spectrum or one or more physical transmission lines. The communication medium may form part of a packet-based network such as a local area network, a wide area network, or a global network such as the Internet. The communication medium may include a router, a switch, a base station, or any other equipment that may be useful to facilitate communication from the source device 102 to the destination device 116.
[0053] In some examples, source device 102 may output the encoded data from output interface 108 to storage device 116. Similarly, destination device 116 may access the encoded data from storage device 116 via input interface 122. Storage device 116 may include any of a variety of distributed or locally accessed data storage media, such as a hard drive, Blu-ray disc, DVD, CD-ROM, flash memory, volatile or non-volatile memory, or any other suitable digital storage medium for storing encoded video data.
[0054] In some examples, the source device 102 may output the encoded video data to the file server 114 or another intermediate storage device that may store the encoded video generated by the source device 102. The destination device 116 may access the stored video data from the file server 114 via streaming or downloading. The file server 114 may be any type of server device capable of storing the encoded video data and sending the encoded video data to the destination device 116. The file server 114 may represent a web server (e.g., for a website), a file transfer protocol (FTP) server, a content delivery network device, or a network attached storage (NAS) device. The destination device 116 may access the encoded video data from the file server 114 via any standard data connection including an Internet connection. This may include a wireless channel (e.g., a Wi-Fi connection), a wired connection (e.g., a DSL, a cable modem, etc.), or a combination of both suitable for accessing the encoded video data stored on the file server 114. The file server 114 and the input interface 122 may be configured to operate according to a streaming transmission protocol, a download transmission protocol, or a combination thereof.
[0055] Output interface 108 and input interface 122 may represent wireless transmitters / receivers, modems, wired networking components (e.g., Ethernet cards), wireless communication components that operate according to any of the various IEEE 802.11 standards, or other physical components. In examples where output interface 108 and input interface 122 include wireless components, output interface 108 and input interface 122 may be configured to communicate data, such as encoded video data, according to a cellular communication standard such as 4G, 4G-LTE (Long Term Evolution), LTE Advanced, 5G, etc. In certain examples where output interface 108 includes a wireless transmitter, output interface 108 and input interface 122 may be configured to communicate data, such as encoded video data, according to other wireless standards such as IEEE 802.11 specifications, IEEE 802.15 specifications (e.g., ZigBee TM ),Bluetooth TM Standards, etc.) to transfer data, such as encoded video data. In some examples, source device 102 and / or destination device 116 may include respective system-on-chip (SoC) devices. For example, source device 102 may include a SoC device for performing functionality attributed to video encoder 200 and / or output interface 108, while destination device 116 may include a SoC device for performing functionality attributed to video decoder 300 and / or input interface 122.
[0056] The techniques of the present disclosure may be applied to support video encoding and decoding for any of a variety of multimedia applications such as over-the-air television broadcasting, cable television transmission, satellite television transmission, Internet streaming video transmission such as Dynamic Adaptive Streaming over HTTP (DASH), digital video encoded onto a data storage medium, decoding of digital video stored on a data storage medium, or other applications.
[0057] The input interface 122 of the destination device 116 receives an encoded video bitstream from the computer-readable medium 110 (e.g., the storage device 112, the file server 114, etc.). The encoded video bitstream in the computer-readable medium 110 may include signaling information defined by the video encoder 200 and also used by the video decoder 300, such as syntax elements with values describing characteristics and / or processing of video blocks or other coded units (e.g., slices, pictures, groups of pictures, sequences, etc.). The display device 118 displays decoded pictures of the decoded video data to a user. The display device 118 may represent any of a variety of display devices, such as a cathode ray tube (CRT), a liquid crystal display (LCD), a plasma display, an organic light emitting diode (OLED) display, or another type of display device.
[0058] although Figure 12. Although not shown in the figure, in some examples, the video encoder 200 and the video decoder 300 may each be integrated with an audio encoder and / or an audio decoder, and may include appropriate MUX-DEMUX units or other hardware and / or software to process multiplexed streams including both audio and video in a common data stream. If applicable, the MUX-DEMUX unit may conform to the ITU H.223 multiplexer protocol or other protocols, such as the User Datagram Protocol (UDP).
[0059] The video encoder 200 and the video decoder 300 can each be implemented as any of a variety of suitable encoder and / or decoder 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 the technology is partially implemented in software, the device can store instructions for the software in a suitable non-transitory computer-readable medium, and use one or more processors to execute these instructions in hardware to perform the technology of the present disclosure. Each of the video encoder 200 and the video decoder 300 can be included in one or more encoders or decoders, any of which can be integrated as part of a combined encoder / decoder (CODEC) in a corresponding device. The device including the video encoder 200 and / or the video decoder 300 can include an integrated circuit, a microprocessor, and / or a wireless communication device, such as a cellular phone.
[0060] The video encoder 200 and the video decoder 300 may operate according to a video codec standard, such as ITU-T H.265, also known as High Efficiency Video Coding (HEVC), or an extension thereof, such as a multi-view and / or scalable video codec extension. Alternatively, the video encoder 200 and the video decoder 300 may operate according to other private or industrial standards, such as the Joint Exploration Test Model (JEM) or ITU-T H.266, also known as Versatile Video Coding (VVC). A recent draft of the VVC standard is described in the 15th meeting of the Joint Video Experts Group (JVET) of ITU-T SG 16WP 3 and ISO / IEC JTC 1 / SC 29 / WG 11: Gothenburg, SE, July 3-12, 2019, JVET-O2001-v14, Bross et al., “Versatile Video Coding (Draft 6)” (hereinafter referred to as “VVC Draft 6”). However, the techniques of this disclosure are not limited to any particular codec standard.
[0061] Typically, the video encoder 200 and the video decoder 300 can perform block-based encoding and decoding of pictures. The term "block" generally refers to a structure that includes data to be processed (e.g., encoded, decoded, or otherwise used in the encoding and / or decoding process). For example, a block may include a two-dimensional matrix of samples of luminance and / or chrominance data. Generally speaking, the video encoder 200 and the video decoder 300 can encode and decode video data represented in a YUV (e.g., Y, Cb, Cr) format. That is, the video encoder 200 and the video decoder 300 can encode and decode luminance and chrominance components instead of encoding and decoding red, green, and blue (RGB) data for samples of a picture, wherein the chrominance components may include both red-toned and blue-toned chrominance components. In some examples, the video encoder 200 converts the received RGB formatted data into a YUV representation before encoding, and the video decoder 300 converts the YUV representation into an RGB format. Alternatively, a pre-processing unit and a post-processing unit (not shown) can perform these conversions.
[0062] The present disclosure may generally refer to the encoding and decoding of a picture (e.g., encoding and decoding), which is intended to include the process of encoding or decoding data for a picture. Similarly, the present disclosure may refer to the encoding and decoding of a block of a picture as including the process of encoding or decoding data for the block, for example, prediction and / or residual encoding and decoding. The encoded video bitstream typically includes a series of values for syntax elements that represent encoding and decoding decisions (e.g., encoding and decoding modes) and the partitioning of the picture into blocks. Therefore, references to encoding and decoding a picture or a block should generally be understood as encoding and decoding the values of the syntax elements that form the picture or block.
[0063] HEVC defines various blocks, including codec units (CUs), prediction units (PUs), and transform units (TUs). According to HEVC, a video codec (such as video encoder 200) partitions a codec tree unit (CTU) into CUs according to a quadtree structure. That is, the video codec partitions the CTU and CU into four equal non-overlapping squares, and each node of the quadtree has zero or four child nodes. A node without a child node may be referred to as a "leaf node", and a CU of such a leaf node may include one or more PUs and / or one or more TUs. The video codec may further partition the PU and TU. For example, in HEVC, a residual quadtree (RQT) represents the partitioning of a TU. In HEVC, a PU represents inter-frame prediction data, and a TU represents residual data. An intra-predicted CU includes intra-frame prediction information, such as an intra-frame mode indication.
[0064] As another example, the video encoder 200 and the video decoder 300 may be configured to operate according to JEM or VVC. According to JEM or VVC, a video codec (such as the video encoder 200) partitions a picture into a plurality of codec tree units (CTUs). The video encoder may partition the CTU according to a tree structure such as a quadtree-binary tree (QTBT) structure or a multi-type tree (MTT) structure. The QTBT structure removes the concept of multiple partition types, such as the distinction between CU, PU, and TU of HEVC. The QTBT structure includes two levels: a first level partitioned according to quadtree partitioning, and a second level partitioned according to binary tree partitioning. The root node of the QTBT structure corresponds to the CTU. The leaf nodes of the binary tree correspond to codec units (CUs).
[0065] In the MTT partitioning structure, blocks can be partitioned using quadtree (QT) partitioning, binary tree (BT) partitioning, and one or more types of ternary tree (TT) partitioning. A ternary tree partitioning is a partitioning in which a block is partitioned into three sub-blocks. In some examples, the ternary tree partitioning divides the block into three sub-blocks instead of dividing the original block through the center. The partitioning types in MTT (e.g., QT, BT, and TT) can be symmetric or asymmetric.
[0066] In some examples, the video encoder 200 and the video decoder 300 may use a single QTBT structure or MTT structure to represent each of the luma component and the chroma component, while in other examples, the video encoder 200 and the video decoder 300 may use two or more QTBT structures or MTT structures, such as one QTBT / MTT structure for the luma component and another QTBT / MTT structure for the two chroma components (or two QTBT / MTT structures for corresponding chroma components).
[0067] The video encoder 200 and the video decoder 300 can be configured to use quadtree segmentation, QTBT segmentation, MTT segmentation, or other segmentation structures in accordance with HEVC. For the purpose of explanation, the description of the technology of the present disclosure is presented with respect to QTBT segmentation. However, it should be understood that the technology of the present disclosure can also be applied to a video codec configured to use quadtree segmentation or other types of segmentation.
[0068] This disclosure uses "N×N" and "N by N" interchangeably to refer to the sample dimensions of a block (such as a CU or other video block) in terms of vertical and horizontal dimensions, for example, 16×16 samples or 16 by 16 samples. Typically, a 16×16 CU will have 16 samples in the vertical direction (y=16) and 16 samples in the horizontal direction (x=16). Similarly, an N×N CU typically has N samples in the vertical direction and N samples in the horizontal direction, where N represents a non-negative integer value. The samples in a CU can be arranged in rows and columns. In addition, a CU does not necessarily need to have the same number of samples in the horizontal direction as in the vertical direction. For example, a CU may include N×M samples, where M is not necessarily equal to N.
[0069] The video encoder 200 encodes video data representing prediction and / or residual information and other information for a CU. The prediction information indicates how the CU will be predicted in order to form a prediction block for the CU. The residual information generally represents the sample-by-sample difference between the samples of the CU before encoding and the prediction block.
[0070] In order to predict a CU, the video encoder 200 can generally form a prediction block for the CU by inter-frame prediction or intra-frame prediction. Inter-frame prediction generally refers to predicting a CU based on data of a previously coded picture, while intra-frame prediction generally refers to predicting a CU based on previously coded data of the same picture. In order to perform inter-frame prediction, the video encoder 200 can use one or more motion vectors to generate a prediction block. The video encoder 200 can generally perform a motion search to identify a reference block that closely matches the CU, for example, based on the difference between the CU and the reference block. The video encoder 200 can use the sum of absolute differences (SAD), the sum of squared differences (SSD), the mean absolute difference (MAD), the mean square difference (MSD), or other such difference calculations to calculate a difference metric to determine whether the reference block closely matches the current CU. In some examples, the video encoder 200 can use unidirectional prediction or bidirectional prediction to predict the current CU.
[0071] Some examples of JEM and VVC also provide an affine motion compensation mode, which can be considered an inter-prediction mode. In the affine motion compensation mode, the video encoder 200 can determine two or more motion vectors representing non-translational motion such as: enlargement or reduction, rotation, perspective motion, or other irregular motion types.
[0072] To perform intra prediction, the video encoder 200 can select an intra prediction mode to generate a prediction block. Certain examples of JEM and VVC provide sixty-seven intra prediction modes, including various directional modes, as well as a plane mode and a DC mode. Typically, the video encoder 200 selects the following intra prediction modes: neighboring samples describing a current block (e.g., a block of a CU) to predict samples of the current block from it. Assuming that the video encoder 200 encodes and decodes CTUs and CUs in a raster scan order (from left to right, from top to bottom), such samples can typically be located above, above left, or to the left of the current block in the same picture as the current block.
[0073] The video encoder 200 encodes data representing the prediction mode for the current block. For example, for inter-frame prediction mode, the video encoder 200 can encode data representing which of the various available inter-frame prediction modes to use and the motion information for the corresponding mode. For example, for unidirectional or bidirectional inter-frame prediction, the video encoder 200 can encode the motion vector using advanced motion vector prediction (AMVP) or merge mode. For affine motion compensation mode, the video encoder 200 can use a similar mode to encode the motion vector.
[0074] After prediction of a block, such as intra-frame prediction or inter-frame prediction of a block, the video encoder 200 may calculate residual data for the block. Residual data such as a residual block represents the sample-by-sample difference between a block and a prediction block for the block formed using a corresponding prediction mode. The video encoder 200 may apply one or more transforms to the residual block to generate transformed data in a transform domain rather than a sample domain. For example, the video encoder 200 may apply a discrete cosine transform (DCT), an integer transform, a wavelet transform, or a conceptually similar transform to the residual video data. Additionally, the video encoder 200 may apply a secondary transform after the primary transform, such as a mode-dependent non-separable secondary transform (MDNSST), a signal-dependent transform, a Karhunen-Loeve transform (KLT), etc. The video encoder 200 generates transform coefficients after applying one or more transforms.
[0075] As described above, after any transform used to produce transform coefficients, the video encoder 200 can perform quantization of the transform coefficients. Quantization generally refers to a process in which transform coefficients are quantized to potentially reduce the amount of data used to represent the coefficients, thereby providing further compression. By performing the quantization process, the video encoder 200 can reduce the bit depth associated with some or all of the coefficients. For example, the video encoder 200 can round down an n-bit value to an m-bit value during quantization, where n is greater than m. In some examples, to perform quantization, the video encoder 200 can perform a bit-by-bit right shift of the value to be quantized.
[0076] After quantization, the video encoder 200 can scan the transform coefficients to produce a one-dimensional vector from a two-dimensional matrix including the quantized transform coefficients. The scan can be designed to place higher energy (and therefore lower frequency) coefficients at the front of the vector and lower energy (and therefore higher frequency) transform coefficients at the back of the vector. In some examples, the video encoder 200 can scan the quantized transform coefficients using a predefined scan order to produce a serialized vector, and then entropy encode the quantized transform coefficients of the vector. In other examples, the video encoder 200 can perform adaptive scanning. After scanning the quantized transform coefficients to form a one-dimensional vector, the video encoder 200 can entropy encode the one-dimensional vector, for example, according to context adaptive binary arithmetic coding (CABAC). The video encoder 200 can also entropy encode values for syntax elements that describe metadata associated with the encoded video data for use by the video decoder 300 when decoding the video data.
[0077] To perform CABAC, the video encoder 200 may assign context within a context model to a symbol to be sent. The context may relate to, for example, whether neighboring values of the symbol are zero values. The probability determination may be based on the context assigned to the symbol.
[0078] The video encoder 200 may further generate, for example, block-based syntax data, picture-based syntax data, and sequence-based syntax data, or other syntax data such as a sequence parameter set (SPS), a picture parameter set (PPS), or a video parameter set (VPS) to the video decoder 300, for example, in a picture header, a block header, a slice header. The video decoder 300 may also decode such syntax data to determine how to decode the corresponding video data.
[0079] In this way, the video encoder 200 can generate a bitstream that includes encoded video data, such as syntax elements describing the partitioning of a picture into blocks (e.g., CUs) and prediction and / or residual information for the blocks. Finally, the video decoder 300 can receive the bitstream and decode the encoded video data.
[0080] In general, the video decoder 300 performs a process that is the reverse of the process performed by the video encoder 200 to decode the encoded video data of the bitstream. For example, the video decoder 300 may decode values for syntax elements in the bitstream using CABAC in a manner that is reversed but substantially similar to the CABAC encoding process of the video encoder 200. The syntax elements may define partitioning information of a picture into CTUs, and partitioning of each CTU according to a corresponding partitioning structure such as a QTBT structure to define CUs of the CTU. The syntax elements may further define prediction and residual information for a block (e.g., CU) of video data.
[0081] The residual information may be represented by, for example, quantized transform coefficients. The video decoder 300 may inverse quantize and inverse transform the quantized transform coefficients of the block to reproduce a residual block for the block. The video decoder 300 uses the signaled prediction mode (intra-frame or inter-frame prediction) and related prediction information (e.g., motion information for inter-frame prediction) to form a prediction block for the block. The video decoder 300 may then combine the prediction block and the residual block (on a sample-by-sample basis) to reproduce the original block. The video decoder 300 may perform additional processing, such as performing a deblocking process to reduce visual artifacts along the boundaries of the blocks.
[0082] The present disclosure may generally involve "signaling" certain information, such as syntax elements. The term "signaling" may generally relate to the communication of values of syntax elements and / or other data used to decode encoded video data. That is, the video encoder 200 may signal values for syntax elements in a bitstream. Typically, signaling involves generating values in a bitstream. As described above, the source device 102 may transmit the bitstream to the destination device 116 substantially in real time or in non-real time, such as may occur when storing syntax elements to the storage device 112 for later retrieval by the destination device 116.
[0083] Figure 2A and 2B1 is a conceptual diagram illustrating an example quadtree binary tree (QTBT) structure 130, and a corresponding codec tree unit (CTU) 132. Solid lines represent quadtree splits, while dashed lines indicate binary tree splits. In each split (i.e., non-leaf) node of the binary tree, a flag is signaled to indicate which split type (i.e., horizontal or vertical) is used, where in this example, 0 indicates horizontal splitting and 1 indicates vertical splitting. For quadtree splitting, there is no need to indicate the split type because the quadtree node splits the block horizontally and vertically into 4 equally sized sub-blocks. Accordingly, the video encoder 200 can encode and the video decoder 300 can decode syntax elements (such as split information) for the region tree level (i.e., solid lines) of the QTBT structure 130 and syntax elements (such as split information) for the prediction tree level (i.e., dashed lines) of the QTBT structure 130. The video encoder 200 may encode and the video decoder 300 may decode video data such as prediction and transform data for the CU represented by the terminal leaf node of the QTBT structure 130 .
[0084] generally, Figure 2B The CTU 132 may be associated with parameters defining the size of blocks corresponding to nodes of the first and second levels in the QTBT structure 130. These parameters may include a CTU size (in terms of samples, indicating the size of the CTU 132), a minimum quadtree size (MinQTSize, indicating the minimum allowed quadtree leaf node size), a maximum binary tree size (MaxBTSize, indicating the maximum allowed binary tree root node size), a maximum binary tree depth (MaxBTDepth, indicating the maximum allowed binary tree depth), and a minimum binary tree size (MinBTSize, indicating the minimum allowed binary tree leaf node size).
[0085] The root node of the QTBT structure corresponding to the CTU can have four child nodes at the first level of the QTBT structure, each of which can be segmented according to the quadtree segmentation. That is, the nodes of the first level are leaf nodes (no child nodes) or have four child nodes. The example of the QTBT structure 130 represents such nodes as a parent node and a child node including a solid line for branching. If the node of the first level is not larger than the maximum allowed binary tree root node size (MaxBTSize), it can be further segmented by the corresponding binary tree. The binary tree splitting of a node can be iterated until the node obtained by the split reaches the minimum allowed binary tree leaf node size (MinBTSize) or the maximum allowed binary tree depth (MaxBTDepth). The example of the QTBT structure 130 represents such nodes as having a dotted line for branching. The binary tree leaf node is called a coding unit (CU), which is used for prediction (e.g., intra-picture or inter-picture prediction) and transformation without any further segmentation. As described above, a CU may also be referred to as a "video block" or "block".
[0086] In one example of a QTBT partitioning structure, the CTU size is set to 128×128 (luminance sample and two corresponding 64×64 chrominance samples), MinQTSize is set to 16×16, MaxBTSize is set to 64×64, MinBTSize (for both width and height) is set to 4, and MaxBTDepth is set to 4. Quadtree partitioning is first applied to the CTU to generate a quadtree leaf node. The quadtree leaf node can have a size from 16×16 (i.e., MinQTSize) to 128×128 (i.e., CTU size). If the leaf quadtree node is 128×128, it will not be further split by the binary tree because the size exceeds MaxBTSize (i.e., in this example, 64×64). Otherwise, the leaf quadtree node will be further split by the binary tree. Therefore, the quadtree leaf node is also the root node for the binary tree and has a binary tree depth of 0. When the binary tree depth reaches MaxBTDepth (4 in this example), no further splitting is allowed. When a binary tree node has a width equal to MinBTSize (4 in this example), this means that no further horizontal splitting is allowed. Similarly, a binary tree node with a height equal to MinBTSize means that no further vertical splitting is allowed for the binary tree node. As described above, the leaf nodes of the binary tree are called CUs and are further processed according to prediction and transformation without further segmentation.
[0087] Figure 3 is a block diagram illustrating an example video encoder 200 that may perform the techniques of this disclosure. Figure 3The present disclosure describes the video encoder 200 in the context of video codec standards such as the HEVC video codec standard and the developing H.266 video codec standard. However, the techniques of the present invention are not limited to these video codec standards and can be generally applied to video encoding and decoding.
[0088] exist Figure 3 In the example of , the video encoder 200 includes a video data memory 230, a mode selection unit 202, a residual generation unit 204, a transform processing unit 206, a quantization unit 208, an inverse quantization unit 210, an inverse transform processing unit 212, a reconstruction unit 214, a filter unit 216, a decoded picture buffer (DPB) 218, and an entropy coding unit 220. Any or all of the video data memory 230, the mode selection unit 202, the residual generation unit 204, the transform processing unit 206, the quantization unit 208, the inverse quantization unit 210, the inverse transform processing unit 212, the reconstruction unit 214, the filter unit 216, the DPB 218, and the entropy coding unit 220 may be implemented in one or more processors or processing circuits. In addition, the video encoder 200 may include additional or alternative processors or processing circuits to perform these and other functions.
[0089] The video data memory 230 may store video data to be encoded by the components of the video encoder 200. The video encoder 200 may receive video data from, for example, the video source 104 ( Figure 1 ) receives video data stored in video data memory 230. DPB 218 can act as a reference picture memory for storing reference video data used to predict subsequent video data by video encoder 200. Video data memory 230 and DPB 218 can be formed by any of various memory devices, such as dynamic random access memory (DRAM) (including synchronous DRAM (SDRAM)), magnetoresistive RAM (MRAM), resistive RAM (RRAM), or other types of memory devices. Video data memory 230 and DPB 218 can be provided by the same memory device or separate memory devices. In various examples, video data memory 230 can be located on-chip with other components of video encoder 200, as shown, or off-chip relative to those components.
[0090] In the present disclosure, references to the video data memory 230 should not be construed as limited to memory internal to the video encoder 200, unless specifically described as such, or memory external to the video encoder 200, unless specifically described as such. Rather, references to the video data memory 230 should be understood as reference memory that stores video data received by the video encoder 200 for encoding (e.g., video data for a current block to be encoded). Figure 1 The memory 106 may also provide temporary storage for outputs from the various units of the video encoder 200 .
[0091] Figure 3 Various units are illustrated to help understand the operations performed by the video encoder 200. These units can be implemented as fixed-function circuits, programmable circuits, or a combination thereof. Fixed-function circuits refer to circuits that provide specific functionality and are preset on operations that can be performed. Programmable circuits refer to circuits that can be programmed to perform various tasks and provide flexible functionality in the operations that can be performed. For example, a programmable circuit can execute software or firmware so that the programmable circuit operates in a manner defined by the instructions of the software or firmware. Fixed-function circuits can execute software instructions (e.g., to receive parameters or output parameters), but the type of operation performed by the fixed-function circuit is generally immutable. In some examples, one or more of the units may be different circuit blocks (fixed-function or programmable), and in some examples, one or more units may be integrated circuits.
[0092] The video encoder 200 may include an arithmetic logic unit (ALU), an elementary function unit (EFU), a digital circuit, an analog circuit, and / or a programmable core formed by a programmable circuit. In an example where the operation of the video encoder 200 is performed using software executed by a programmable circuit, the memory 106 ( Figure 1 ) may store object code for software received and executed by the video encoder 200, or another memory (not shown) within the video encoder 200 may store such instructions.
[0093] The video data memory 230 is configured to store received video data. The video encoder 200 may retrieve a picture of video data from the video data memory 230 and provide the video data to the residual generation unit 204 and the mode selection unit 202. The video data in the video data memory 230 may be original video data to be encoded.
[0094] The mode selection unit 202 includes a motion estimation unit 222, a motion compensation unit 224, and an intra prediction unit 226. The mode selection unit 202 may include additional functional units for performing video prediction according to other prediction modes. As an example, the mode selection unit 202 may include a palette unit, an intra block copy unit (which may be part of the motion estimation unit 222 and / or the motion compensation unit 224), an affine unit, a linear model (LM) unit, and the like.
[0095] The mode selection unit 202 typically coordinates multiple encoding passes to test combinations of encoding parameters and the resulting rate-distortion values for such combinations. The encoding parameters may include the partitioning of CTUs into CUs, the prediction mode for a CU, the transform type for the residual data of a CU, the quantization parameter for the residual data of a CU, etc. The mode selection unit 202 may ultimately select a combination of encoding parameters that has a better rate-distortion value than other tested combinations.
[0096] The video encoder 200 may partition a picture retrieved from the video data memory 230 into a series of CTUs and encapsulate one or more CTUs in a slice. The mode selection unit 202 may partition the CTUs of the picture according to a tree structure such as the QTBT structure or quadtree structure of HEVC described above. As described above, the video encoder 200 may form one or more CUs by partitioning the CTUs according to the tree structure. Such CUs may also be generally referred to as "video blocks" or "blocks".
[0097] Typically, the mode selection unit 202 also controls its components (e.g., the motion estimation unit 222, the motion compensation unit 224, and the intra prediction unit 226) to generate a prediction block for the current block (e.g., the current CU, or the overlapping portion of the PU and TU in HEVC). For inter-frame prediction of the current block, the motion estimation unit 222 can perform a motion search to identify one or more closely matching reference blocks in one or more reference pictures (e.g., one or more previously coded pictures stored in the DPB 218). Specifically, the motion estimation unit 222 can calculate a value indicating how similar the potential reference block is to the current block, for example, based on the sum of absolute differences (SAD), the sum of squared differences (SSD), the mean absolute difference (MAD), the mean squared difference (MSD), etc. The motion estimation unit 222 can generally perform these calculations using the sample-by-sample difference between the current block and the reference block under consideration. The motion estimation unit 222 can identify the reference block with the lowest value obtained from these calculations, indicating the reference block that most closely matches the current block.
[0098] The motion estimation unit 222 may form one or more motion vectors (MVs) that define the position of a reference block in a reference picture relative to a current block in a current picture. The motion estimation unit 222 may then provide the motion vectors to the motion compensation unit 224. For example, for unidirectional inter prediction, the motion estimation unit 222 may provide a single motion vector, and for bidirectional inter prediction, the motion estimation unit 222 may provide two motion vectors. The motion compensation unit 224 may then use the motion vectors to generate a prediction block. For example, the motion compensation unit 224 may use the motion vectors to retrieve data for the reference block. As another example, if the motion vectors have fractional sample precision, the motion compensation unit 224 may interpolate values for the prediction block according to one or more interpolation filters. In addition, for bidirectional inter prediction, the motion compensation unit 224 may retrieve data for two reference blocks identified by the corresponding motion vectors and combine the retrieved data, for example, by sample-by-sample averaging or weighted averaging.
[0099] As another example, for intra prediction or intra prediction codec, the intra prediction unit 226 can generate a prediction block based on samples adjacent to the current block. For example, for directional mode, the intra prediction unit 226 can generally mathematically combine the values of adjacent samples and fill these calculated values in a defined direction across the current block to produce a prediction block. As another example, for DC mode, the intra prediction unit 226 can calculate the average of adjacent samples for the current block and generate a prediction block so that for each sample of the prediction block, this resulting average is included.
[0100] The mode selection unit 202 provides the prediction block to the residual generation unit 204. The residual generation unit 204 receives the original uncoded version of the current block from the video data memory 230 and receives the prediction block from the mode selection unit 202. The residual generation unit 204 calculates the sample-by-sample difference between the current block and the prediction block. The resulting sample-by-sample difference defines a residual block for the current block. In some examples, the residual generation unit 204 may also determine the difference between the sample values in the residual block to generate the residual block using residual differential pulse code modulation (RDPCM). In some examples, the residual generation unit 204 may be formed using one or more subtractor circuits that perform binary subtraction.
[0101] In an example in which the mode selection unit 202 partitions the CU into PUs, each PU may be associated with a luma prediction unit and a corresponding chroma prediction unit. The video encoder 200 and the video decoder 300 may support PUs of various sizes. As described above, the size of the CU may refer to the size of the luma codec block of the CU, and the size of the PU may refer to the size of the luma prediction unit of the PU. Assuming that the size of a particular CU is 2N×2N, the video encoder 200 may support PUs of size 2N×2N or N×N for intra-frame prediction, and symmetric PUs of size 2N×2N, 2N×N, N×2N, N×N, or similar sizes for inter-frame prediction. The video encoder 200 and the video decoder 300 may also support asymmetric partitioning of PUs of size 2N×nU, 2N×nD, nL×2N, and nR×2N for inter-frame prediction.
[0102] In an example where the mode selection unit does not further partition the CU into PUs, each CU may be associated with a luma codec block and a corresponding chroma codec block. As described above, the size of a CU may refer to the size of the luma codec block of the CU. The video encoder 200 and the video decoder 300 may support CUs of size 2N×2N, 2N×N, or N×2N.
[0103] For other video codec techniques such as intra block copy mode codec, affine mode codec, and linear model (LM) mode codec, as several examples, the mode selection unit 202 generates a prediction block for the current block being encoded via a corresponding unit associated with the codec technique. In some examples, such as palette mode codec, the mode selection unit 202 may not generate a prediction block, but instead generate syntax elements indicating a manner for reconstructing the block based on the selected palette. In such modes, the mode selection unit 202 may provide these syntax elements to the entropy encoding unit 220 for encoding.
[0104] As described above, the residual generation unit 204 receives video data for a current block and a corresponding prediction block. The residual generation unit 204 then generates a residual block for the current block. To generate the residual block, the residual generation unit 204 calculates the sample-by-sample difference between the prediction block and the current block.
[0105] The transform processing unit 206 applies one or more transforms to the residual block to generate a block of transform coefficients (referred to herein as a "transform coefficient block"). The transform processing unit 206 may apply various transforms to the residual block to form a transform coefficient block. For example, the transform processing unit 206 may apply a discrete cosine transform (DCT), a directional transform, a Karnen-Loev transform (KLT), or a conceptually similar transform to the residual block. In some examples, the transform processing unit 206 may perform multiple transforms on the residual block, for example, a primary transform and a secondary transform, such as a rotation transform. In some examples, the transform processing unit 206 does not apply a transform to the residual block.
[0106] The quantization unit 208 may quantize the transform coefficients in the transform coefficient block to produce a quantized transform coefficient block. The quantization unit 208 may quantize the transform coefficients of the transform coefficient block according to a quantization parameter (QP) value associated with the current block. The video encoder 200 (e.g., via the mode selection unit 202) may adjust the degree of quantization applied to the coefficient block associated with the current block by adjusting the QP value associated with the CU. Quantization may introduce information loss, and therefore, the quantized transform coefficients may have lower precision than the original transform coefficients produced by the transform processing unit 206.
[0107] The inverse quantization unit 210 and the inverse transform processing unit 212 may apply inverse quantization and inverse transform, respectively, to the quantized transform coefficient block to reconstruct a residual block from the transform coefficient block. The reconstruction unit 214 may generate a reconstructed block corresponding to the current block (albeit potentially with some degree of distortion) based on the reconstructed residual block and the prediction block generated by the mode selection unit 202. For example, the reconstruction unit 214 may add samples of the reconstructed residual block to corresponding samples of the prediction block generated by the mode selection unit 202 to generate a reconstructed block.
[0108] Filter unit 216 may perform one or more filter operations on the reconstructed block. For example, filter unit 216 may perform a deblocking operation to reduce blockiness artifacts along the edges of the CU. In some examples, the operations of filter unit 216 may be skipped.
[0109] The video encoder 200 stores the reconstructed blocks in the DPB 218. For example, in examples where the operation of the filter unit 216 is not required, the reconstruction unit 214 can store the reconstructed blocks to the DPB 218. In examples where the operation of the filter unit 216 is required, the filter unit 216 can store the filtered reconstructed blocks to the DPB 218. The motion estimation unit 222 and the motion compensation unit 224 can retrieve a reference picture formed by the reconstructed (and possibly filtered) blocks from the DPB 218 to perform inter-frame prediction on blocks of subsequent encoded pictures. In addition, the intra-frame prediction unit 226 can use the reconstructed blocks of the current picture in the DPB 218 to perform intra-frame prediction on other blocks in the current picture.
[0110] In general, the entropy coding unit 220 may entropy encode syntax elements received from other functional components of the video encoder 200. For example, the entropy coding unit 220 may entropy encode a quantized transform coefficient block from the quantization unit 208. As another example, the entropy coding unit 220 may entropy encode a prediction syntax element (e.g., motion information for inter-frame prediction or intra-frame mode information for intra-frame prediction) from the mode selection unit 202. The entropy coding unit 220 may perform one or more entropy coding operations on syntax elements as another example of video data to generate entropy-encoded data. For example, the entropy coding unit 220 may perform a context-adaptive variable length coding (CAVLC) operation, a CABAC operation, a variable to variable (V2V) length coding operation, a syntax-based context-adaptive binary arithmetic coding (SBAC) operation, a probability interval partitioning entropy (PIPE) coding operation, an exponential-Golomb coding operation, or another type of entropy coding operation on the data. In some examples, the entropy coding unit 220 may operate in a bypass mode in which the syntax elements are not entropy encoded.
[0111] The video encoder 200 may output a bitstream including entropy-encoded syntax elements required for reconstructing blocks of a slice or picture. Specifically, the entropy encoding unit 220 may output a bitstream.
[0112] The operations described above are described with respect to blocks. Such descriptions should be understood as operations for luma codec blocks and / or chroma codec blocks. As described above, in some examples, the luma codec block and the chroma codec block are the luma and chroma components of a CU. In some examples, the luma codec block and the chroma codec block are the luma and chroma components of a PU.
[0113] In some examples, operations performed with respect to luma codec blocks need not be repeated for chroma codec blocks. As an example, operations for identifying motion vectors (MVs) and reference pictures for luma codec blocks need not be repeated for identifying MVs and reference pictures for chroma codec blocks. Specifically, the MVs for luma codec blocks may be scaled to determine MVs for chroma blocks, while the reference pictures may be the same. As another example, the intra prediction process may be the same for luma codec blocks and chroma codec blocks.
[0114] like Figure 3 As shown, the mode selection unit 202 may include a palette prediction unit 227, which may be configured to perform video compression using palette mode encoding. In order to encode and decode a current block of video data using palette mode encoding, the palette prediction unit 227 may generate a palette for the current block. The palette may include entries with color values corresponding to the most common colors in the current block (e.g., determined using a histogram). The palette prediction unit 227 may encode a representation of the palette and index values for samples of the current block that are mapped to the entries in the palette.
[0115] According to one or more techniques of the present disclosure, the palette prediction unit 227 can dynamically adjust the maximum number of entries to be used for palette mode encoding and decoding. For example, based on the parameters of the first block of video data, the palette prediction unit 227 can determine the number of entries to be used for palette mode encoding and decoding of the current block. As a specific example, the palette prediction unit 227 can limit the maximum number of entries to a first value (e.g., 16) based on a parameter having a first value, or limit the maximum number of entries to a second value (e.g., 32) different from the first value based on a parameter having a second value. Therefore, in some examples, the second value is greater than the first value. In other words, the palette prediction unit 227 can limit the maximum number of entries to 16 or 32. In this way, the palette prediction unit 227 can reduce the amount of system resources used for palette mode encoding and decoding.
[0116] Video encoder 200 represents an example of a device configured to encode video data, including a memory configured to store video data; and one or more processing units implemented in a circuit and configured to: determine, based on parameters of a first block of video data, a maximum number of entries to be used for palette mode encoding and decoding of a current block; generate, based on the determined maximum size and based on a palette predictor, a palette for the first block of video data, the palette comprising one or more entries, each entry comprising a palette index associated with a color value; decode from a decoded video bitstream and for the first block of video data, index values for samples of the first block that identify entries in the palette; and reconstruct samples of the first block based on the index values.
[0117] Figure 4 is a block diagram illustrating an example video decoder 300 that may perform the techniques of this disclosure. Figure 4 The above description is provided for the purpose of explanation and is not intended to limit the techniques extensively illustrated and described in the present disclosure. For the purpose of explanation, the video decoder 300 described in the present disclosure is described based on the techniques of JEM, VVC, and HEVC. However, the techniques of the present disclosure may be performed by video codec devices configured for other video codec standards.
[0118] exist Figure 4 In the example of , the video decoder 300 includes a coded picture buffer (CPB) memory 320, an entropy decoding unit 302, a prediction processing unit 304, an inverse quantization unit 306, an inverse transform processing unit 308, a reconstruction unit 310, a filter unit 312, and a decoded picture buffer (DPB) 314. Any or all of the CPB memory 320, the entropy decoding unit 302, the prediction processing unit 304, the inverse quantization unit 306, the inverse transform processing unit 308, the reconstruction unit 310, the filter unit 312, and the DPB 314 may be implemented in one or more processors or processing circuits. Moreover, the video decoder 300 may include additional or alternative processors or processing circuits to perform these and other functions.
[0119] The prediction processing unit 304 includes a motion compensation unit 316 and an intra prediction unit 318. The prediction processing unit 304 may include additional units for performing predictions according to other prediction modes. As an example, the prediction processing unit 304 may include a palette unit, an intra block copy unit (which may be part of the motion compensation unit 316), an affine unit, a linear model (LM) unit, etc. In other examples, the video decoder 300 may include more, fewer, or different functional components.
[0120] The CPB memory 320 may store video data, such as an encoded video bitstream, to be decoded by components of the video decoder 300. The video data stored in the CPB memory 320 may be, for example, received from the computer-readable medium 110 ( Figure 1 ) is obtained. The CPB memory 320 may include a CPB that stores encoded video data (e.g., syntax elements) from an encoded video bitstream. Similarly, the CPB memory 320 may store video data other than syntax elements of encoded and decoded pictures, such as temporary data representing outputs from various units of the video decoder 300. The DPB 314 typically stores decoded pictures, which the video decoder 300 may output and / or use as reference video data when decoding subsequent data or pictures of the encoded video bitstream. The CPB memory 320 and the DPB 314 may be formed by any of a variety of memory devices, such as dynamic random access memory (DRAM) (including synchronous DRAM (SDRAM)), magnetoresistive RAM (MRAM), resistive RAM (RRAM), or other types of memory devices. The CPB memory 320 and the DPB 314 may be provided by the same memory device or separate memory devices. In various examples, the CPB memory 320 may be located on-chip with other components of the video decoder 300, or off-chip relative to those components.
[0121] Additionally or alternatively, in some examples, video decoder 300 may retrieve the video from memory 120 ( Figure 1 ) to retrieve the encoded and decoded video data. That is, memory 120 may store data as discussed above in conjunction with CPB memory 320. Likewise, when some or all of the functionality of video decoder 300 is implemented in software executed by processing circuitry of video decoder 300, memory 120 may store instructions for execution by video decoder 300.
[0122] Figure 4 The various units shown in FIG. 3 are illustrated to aid in understanding the operations performed by the video decoder 300. These units may be implemented as fixed function circuits, programmable circuits, or a combination thereof. Figure 3Similarly, a fixed-function circuit refers to a circuit that provides a specific function and is preset on the operations that can be performed. A programmable circuit refers to a circuit that can be programmed to perform various tasks and provides flexible functionality in the operations that can be performed. For example, a programmable circuit can execute software or firmware so that the programmable circuit operates in a manner defined by the instructions of the software or firmware. A fixed-function circuit can execute software instructions (for example, to receive parameters or output parameters), but the type of operation performed by the fixed-function circuit is generally immutable. In some examples, one or more of the units may be different circuit blocks (fixed-function or programmable), and in some examples, one or more units may be integrated circuits.
[0123] The video decoder 300 may include an ALU, an EFU, a digital circuit, an analog circuit, and / or a programmable core formed by a programmable circuit. In an example where the operation of the video decoder 300 is performed by software executed on the programmable circuit, an on-chip or off-chip memory may store instructions (e.g., object code) of the software received and executed by the video decoder 300.
[0124] Entropy decoding unit 302 may receive encoded video data from the CPB and entropy decode the video data to reproduce syntax elements. Prediction processing unit 304, inverse quantization unit 306, inverse transform processing unit 308, reconstruction unit 310, and filter unit 312 may generate decoded video data based on syntax elements extracted from the bitstream.
[0125] Typically, the video decoder 300 reconstructs a picture on a block-by-block basis. The video decoder 300 may perform a reconstruction operation on each block individually (where the block currently being reconstructed, ie, decoded, may be referred to as a "current block").
[0126] The entropy decoding unit 302 may entropy decode syntax elements defining quantized transform coefficients of the quantized transform coefficient block and transform information such as a quantization parameter (QP) and / or (one or more) transform mode indications. The inverse quantization unit 306 may use the QP associated with the quantized transform coefficient block to determine a degree of quantization and, likewise, determine a degree of inverse quantization for the inverse quantization unit 306 to apply. The inverse quantization unit 306 may, for example, perform a bitwise left shift operation to inverse quantize the quantized transform coefficients. The inverse quantization unit 306 may thereby form a transform coefficient block including the transform coefficients.
[0127] After the inverse quantization unit 306 forms the transform coefficient block, the inverse transform processing unit 308 may apply one or more inverse transforms to the transform coefficient block to generate a residual block associated with the current block. For example, the inverse transform processing unit 308 may apply an inverse DCT, an inverse integer transform, an inverse Karnof-Loev transform (KLT), an inverse rotational transform, an inverse directional transform, or another inverse transform to the coefficient block.
[0128] In addition, prediction processing unit 304 generates a prediction block based on the prediction information syntax elements entropy decoded by entropy decoding unit 302. For example, if the prediction information syntax elements indicate that the current block is inter-predicted, motion compensation unit 316 can generate the prediction block. In this case, the prediction information syntax elements can indicate a reference picture in DPB 314 from which the reference block is retrieved, and a motion vector that identifies the position of the reference block in the reference picture relative to the position of the current block in the current picture. Motion compensation unit 316 can generally use the same syntax elements as those for motion compensation unit 224 ( Figure 3 ) and the inter-frame prediction process is performed in a manner basically similar to the described method.
[0129] As another example, if the prediction information syntax element indicates that the current block is intra-predicted, the intra-prediction unit 318 can generate a prediction block according to the intra-prediction mode indicated by the prediction information syntax element. Again, the intra-prediction unit 318 can generally be used with respect to the intra-prediction unit 226 ( Figure 3 ) and the like. The intra prediction unit 318 may retrieve data for neighboring samples of the current block from the DPB 314.
[0130] The reconstruction unit 310 may reconstruct the current block using the prediction block and the residual block. For example, the reconstruction unit 310 may add samples of the residual block to corresponding samples of the prediction block to reconstruct the current block.
[0131] The filter unit 312 may perform one or more filter operations on the reconstructed block. For example, the filter unit 312 may perform a deblocking operation to reduce blocking artifacts along the edges of the reconstructed block. The operations of the filter unit 312 need not be performed in all examples.
[0132] The video decoder 300 may store the reconstructed blocks in the DPB 314. As described above, the DPB 314 may provide reference information to the prediction processing unit 304, such as samples of the current picture for intra prediction and previously decoded pictures for subsequent motion compensation. In addition, the video decoder 300 may output decoded pictures from the DPB for use in, for example, Figure 1 Subsequent presentation on a display device such as display device 118.
[0133] like Figure 4 As shown, the prediction processing unit 304 may include a palette prediction unit 319, which may be configured to perform video compression using palette mode decoding. In order to decode a current block of video data using palette mode encoding, the palette prediction unit 319 may generate a palette for the current block. The palette may include entries with color values corresponding to the most commonly used colors in the current block (e.g., determined using a histogram). The palette prediction unit 319 may decode a representation of an index value for a sample of the current block that is mapped to an entry in the palette. The palette prediction unit 319 may reconstruct samples of the current block based on the index value (e.g., and any separately signaled escape samples).
[0134] According to one or more techniques of the present disclosure, the palette prediction unit 319 can dynamically adjust the maximum number of entries to be used for palette mode encoding and decoding. For example, based on the parameters of the first block of video data, the palette prediction unit 319 can determine the number of entries to be used for palette mode encoding and decoding of the current block. As a specific example, the palette prediction unit 319 can limit the maximum number of entries to a first value (e.g., 16) based on a parameter having a first value, or limit the maximum number of entries to a second value different from the first value (e.g., 32) based on a parameter having a second value. In other words, the palette prediction unit 319 can limit the maximum number of entries to 16 or 32. Therefore, in some examples, the second value is greater than the first value. In this way, the palette prediction unit 319 can reduce the amount of system resources used for palette mode encoding and decoding.
[0135] In this way, the video decoder 300 represents an example of a video decoding device, including a memory configured to store video data; and one or more processing units implemented in a circuit and configured to: determine, based on parameters of a first block of video data, a maximum number of entries to be used for palette mode encoding and decoding of a current block; generate, based on the determined maximum size and based on a palette predictor, a palette for the first block of video data, the palette comprising one or more entries, each entry comprising a palette index associated with a color value; decode from a decoded video bitstream and for the first block of video data, an index value for a sample of the first block that identifies an entry in the palette; and reconstruct the samples of the first block based on the index value.
[0136] Figure 5 is a conceptual diagram illustrating an example of determining a color palette for encoding and decoding video data consistent with the techniques of this disclosure. Figure 5The example includes a picture 1780 having a first codec unit (CU) 1800 associated with a first palette 1840 and a second CU 1880 associated with a second palette 1920. As described in more detail below and in accordance with the techniques of this disclosure, the second palette 1920 is based on the first palette 1840. The picture 1780 also includes a block 1960 encoded using an intra-prediction codec mode and a block 2000 encoded using an inter-prediction codec mode.
[0137] For the purpose of explanation, Figure 5 The technology is in the video encoder 200 ( Figure 1 and FIG. 2 ) and the video decoder 300 ( Figure 1 and Figure 4 ) and described with respect to the HEVC standard. However, it should be understood that the technology of the present disclosure is not limited in this manner and can be applied to other video codec processes and / or standards (e.g., VVC) by other video codec processors and / or devices.
[0138] Generally, a palette refers to a color palette for a CU that is currently being decoded (such as Figure 5 1880 in the example of CU 1840) plays a leading role and / or a plurality of representative pixel values. The first palette 1840 and the second palette 1920 are shown as including a plurality of palettes. In some examples, a video codec (such as the video encoder 200 or the video decoder 300) may encode and decode the palette separately for each color component of the CU. For example, the video encoder 200 may encode a palette for the luminance (Y) component of the CU, another palette for the chrominance (U) component of the CU, and another palette for the chrominance (V) component of the CU. In this example, the entries of the Y palette may represent the Y values of the pixels of the CU, the entries of the U palette may represent the U values of the pixels of the CU, and the entries of the V palette may represent the V values of the pixels of the CU. In another example, the video encoder 20 may encode a palette for the luminance (Y) component of the CU, and another palette for the two components (U, V) of the CU. In this example, entries of the Y palette may represent Y values for pixels of the CU, and entries of the UV palette may represent UV value pairs for pixels of the CU.
[0139] In other examples, the video encoder 200 may encode a single palette for all color components of the CU. In this example, the video encoder 200 may encode a palette having an i-th entry (including Yi, Ui, and Vi) as a ternary value. In this case, the palette includes a value for each of the components of the pixel. Accordingly, representing palettes 1840 and 1920 as a palette set having multiple separate palettes is merely an example and is not intended to be limiting.
[0140] exist Figure 5 In the example of , the first palette 1840 includes three entries 2020-2060, which have entry index values 1, entry index value 2, and entry index value 3, respectively. Entries 2020-2060 associate index values with pixel values including pixel value A, pixel value B, and pixel value C, respectively. As described herein, a video codec (such as video encoder 200 or video decoder 300) can use palette-based encoding and decoding to encode and decode pixels of a block using indexes 1-3 instead of encoding and decoding actual pixel values of the first CU 180. That is, for each pixel location of the first CU 1800, the video encoder 200 can encode an index value for the pixel, where the index value is associated with a pixel value in one or more of the first palette 1840. The video decoder 300 can obtain the index value from the bitstream and reconstruct the pixel value using the index value and one or more of the first palette 1840. Thus, the first palette 1840 is sent by the video encoder 200 in the encoded video data bitstream for use in palette-based decoding by the video decoder 300. In general, one or more palettes may be sent for each CU, or may be shared among different CUs.
[0141] The video encoder 200 and the video decoder 300 may determine the second palette 1920 based on the first palette 1840. For example, the video encoder 200 may encode a pred_palette_flag for each CU (including, for example, the second CU 1880) to indicate whether the palette for the CU is predicted based on one or more palettes associated with one or more other CUs, such as neighboring CUs (spatially or based on scan order) or the most frequent samples of causal neighbors. For example, when the value of such a flag is equal to one, the video decoder 300 may determine that the second palette 1920 for the second CU 1880 is predicted based on one or more palettes that have already been decoded, and therefore no new palette for the second CU 1880 is included in the bitstream containing the pred_palette_flag. When such a flag is equal to zero, the video decoder 300 may determine that the palette 1920 for the second CU 1880 is included in the bitstream as a new palette. In some examples, pred_palette_flag may be encoded and decoded separately for each different color component of a CU (e.g., for a CU in YUV video, three flags, one for Y, one for U, and one for V). In other examples, a single pred_palette_flag may be encoded and decoded for all color components of a CU.
[0142] In the above example, pred_palette_flag is signaled per CU to indicate whether any of the entries of the palette for the current block are predicted. In some examples, one or more syntax elements may be signaled on a per-entry basis. That is, a flag may be signaled for each entry of the palette predictor to indicate whether the entry is present in the current palette. As described above, if a palette entry is not predicted, the palette entry may be explicitly signaled.
[0143] When the second palette 1920 is determined relative to the first palette 1840 (e.g., pred_palette_flag is equal to one), the video encoder 200 and / or the video decoder 300 may locate one or more blocks from which a prediction palette (in this example, the first palette 1840) is determined. The prediction palette may be associated with one or more neighboring CUs (e.g., such as the most frequent samples of neighboring CUs (spatially or based on scan order) or causal neighbors) of the CU currently being encoded (i.e., the second CU 1880). The palettes of the one or more neighboring CUs may be associated with the predictor palette. In some examples, such as Figure 5 In the example shown in , when determining the prediction palette for the second CU 1880, the video encoder 200 and / or the video decoder 300 may locate the left neighboring CU, the first CU 1800. In other examples, the video encoder 200 and / or the video decoder 300 may locate one or more CUs in other locations relative to the second CU 1880, such as the upper CU, CU 1960.
[0144] The video encoder 200 and / or the video decoder 300 may determine a CU for palette prediction based on a hierarchy. For example, the video encoder 200 and / or the video decoder 300 may initially identify the left neighboring CU, the first CU 1800, as being used for palette prediction. If the left neighboring CU is not available for prediction (e.g., the left neighboring CU is encoded and decoded using a mode other than a palette-based encoding and decoding mode (such as an intra-frame prediction mode or an intra-frame prediction mode), or is located at the leftmost edge of a picture or a slice), the video encoder 200 and / or the video decoder 300 may identify the upper neighboring CU, CU 1960. The video encoder 200 and / or the video decoder 300 may continue searching for available CUs according to a predetermined order of positions until a CU with a palette that can be used for palette prediction is located. In some examples, the video encoder 200 and / or the video decoder 300 may determine a prediction palette based on reconstructed samples of multiple blocks and / or adjacent blocks.
[0145] Although Figure 5The example of the first palette 1840 as a prediction palette is illustrated as coming from a single CU, the first CU 1800, but in other examples, the video encoder 200 and / or the video decoder 300 may locate a palette for prediction from a combination of neighboring CUs. For example, the video encoder 200 and / or the video decoder may apply one or more formulas, functions, rules, etc. to generate a palette based on the palettes of one or a combination of multiple neighboring CUs.
[0146] In yet another example, the video encoder 200 and / or the video decoder 300 may construct a candidate list that includes multiple potential candidates for palette prediction. A pruning process may be applied to both the video encoder 200 and the video decoder 300 to remove duplicate candidates in the list. In such an example, the video encoder 200 may encode an index to the candidate list to indicate a candidate CU in the list from which the current CU (e.g., a duplicate palette) is selected for palette prediction. The video decoder 300 may construct the candidate list in the same manner, decode the index, and use the decoded index to select the palette of the corresponding CU for use with the current CU.
[0147] In an example for illustrative purposes, the video encoder 200 and the video decoder 300 may construct a candidate list that includes a CU located above the CU currently being encoded and a CU located to the left of the CU currently being encoded. In this example, the video encoder 200 may encode one or more syntax elements to indicate the candidate selection. For example, the video encoder 200 may encode a flag with a value of zero to indicate that the palette for the current CU is copied from the CU located to the left of the current CU. The video encoder 200 may encode a flag with a value of one to indicate that the palette for the current CU is copied from the CU located above the current CU. The video decoder 300 decodes the flag and selects the appropriate CU for palette prediction.
[0148] In yet another example, the video encoder 200 and / or the video decoder 300 determine the palette for the CU currently being encoded and decoded based on the frequency with which sample values included in one or more other palettes appear in one or more neighboring CUs. For example, the video encoder 200 and / or the video decoder 300 may track the colors associated with the most frequently used index values during encoding and decoding of a predetermined number of CUs. The video encoder 200 and / or the video decoder 300 may include the most frequently used colors in the palette for the CU currently being encoded and decoded.
[0149] In some examples, the video encoder 200 and / or the video decoder 300 may perform palette prediction on an entry-by-entry basis. For example, the video encoder 200 may encode one or more syntax elements (such as one or more flags) for each entry of the prediction palette, the one or more syntax elements indicating whether the corresponding prediction palette entry is reused in the current palette (e.g., whether the pixel value in the palette of another CU is reused by the current palette). In this example, when a given entry is a predicted value from a prediction palette (e.g., a corresponding entry of a palette associated with an adjacent CU), the video encoder 200 may encode a flag having a value equal to one. The video encoder 200 may encode a flag having a value equal to zero for a particular entry to indicate that the particular entry is not predicted based on the palette of another CU. In this example, the video encoder 200 may also encode additional data indicating the value of a non-predictive palette entry.
[0150] exist Figure 5 In the example of , the second palette 1920 includes four entries 2080-2140, which have entry index values 1, entry index value 2, entry index value 3, and entry index value 4, respectively. Entries 2080-2140 associate index values with pixel values including pixel value A, pixel value B, pixel value C, and pixel value D, respectively. The video encoder 200 and / or the video decoder 300 can use any of the above-mentioned techniques to locate the first CU 1800 for the purpose of palette prediction, and copy entries 1-3 of the first palette 184 to entries 1-3 of the second palette 1920 for encoding and decoding the second CU 1880. In this way, the video encoder 200 and / or the video decoder 300 can determine the second palette 192 based on the first palette 184. In addition, the video encoder 200 and / or the video decoder 300 can encode and decode data for entry 4 to be included in the second palette 1920. Such information may include the number of palette entries that were not predicted from the predictor palette and the pixel values corresponding to those palette entries.
[0151] In some examples, according to aspects of the present disclosure, one or more syntax elements may indicate whether a palette (such as second palette 1920) is completely based on a predicted palette (in Figure 5 The syntax elements may indicate whether all entries of the second palette 1920 are predicted or whether particular entries of the second palette 1920 are predicted (shown as the first palette 1840 in FIG. 1 , but which may be composed of entries from one or more blocks). For example, the initial syntax element may indicate whether all entries are predicted. If the initial syntax element indicates that not all entries are predicted (e.g., a flag with a value of 0), one or more additional syntax elements may indicate which entries of the second palette 1920 are predicted from the prediction palette.
[0152] Figure 6 is a conceptual diagram illustrating an example of determining an index for a palette for a pixel block consistent with the techniques of the present disclosure. Figure 6 Graph 2400 includes index values (values 1, 2, and 3) that relate the corresponding positions of pixels associated with the index values to entries of a palette 2440. The palette 2440 may be described in the same manner as described above with respect to Figure 5 The first palette 1840 and the second palette 1920 described are determined in a similar manner.
[0153] Again, for the purpose of explanation, Figure 6 The technology is in the video encoder 200 ( Figure 1 and Figure 3 ) and video decoder 300( Figure 1 and Figure 4 ) and described with respect to the HEVC video codec standard. However, it should be understood that the technology of the present disclosure is not limited in this manner and can be applied to other video codec processes and / or standards (e.g., VVC) by other video codec processors and / or devices.
[0154] Although Figure 2400 Figure 6 2400, it will be appreciated that in other examples, not all pixel locations may be associated with an index value relating the pixel value to an entry of palette 2440. That is, as described above, in some examples, if the pixel value is not included in palette 2440, video encoder 200 may encode an indication of the actual pixel value (or a quantized version thereof) for the location in diagram 2400 (and video decoder 300 may obtain the indication from the encoded bitstream).
[0155] In some examples, the video encoder 200 and the video decoder 300 may be configured to encode and decode an additional map that indicates which pixel locations are associated with index values. For example, assume that the (i, j) entry in the map corresponds to the (i, j) location of the CU. The video encoder 200 may encode one or more syntax elements for each entry of the map (i.e., each pixel location) that indicate whether the entry has an associated index value. For example, the video encoder 200 may encode a flag with a value of one to indicate that the pixel value at the (i, j) position in the CU is one of the values in the palette 2440. In such examples, the video encoder 200 may also encode a palette index (in Figure 6In the example shown as values 1-3) are encoded to indicate the pixel value in the palette and allow the video decoder to reconstruct the pixel value. In the case where the palette 2440 includes a single entry and an associated pixel value, the video encoder 200 can skip the signaling notification of the index value. The video encoder 200 can encode the flag to have a value of zero to indicate that the pixel value at the (i, j) position in the CU is not one of the values in the palette 2440. In this example, the video encoder 200 can also encode the indication of the pixel value for use by the video decoder 300 when reconstructing the pixel value. In some cases, the pixel value can be encoded and decoded in a lossy manner.
[0156] The value of a pixel in one location of a CU may provide an indication of the value of one or more other pixels in other locations of the CU. For example, the probability that adjacent pixel locations of a CU will have the same pixel value or may be mapped to the same index value may be relatively high (in the case of a lossy codec where more than one pixel value may be mapped to a single index value).
[0157] Accordingly, the video encoder 200 may encode one or more syntax elements indicating the number of consecutive pixels or index values having the same pixel value or index value in a given scan order. As described above, a string of pixels or index values of similar values may be referred to herein as a run. In an example for illustrative purposes, if two consecutive pixels or indexes in a given scan order have different values, the run is equal to zero. If two consecutive pixels or indexes in a given scan order have the same value, but the third pixel or index in the scan sequence has a different value, the run is equal to one. For three consecutive indexes or pixels with the same value, the run is two, and so on. The video decoder 300 may obtain a syntax element indicating a run from the encoded bitstream and use the data to determine the number of consecutive positions having the same pixel or index value.
[0158] The number of indices that can be included in a run may be affected by the scan order. For example, consider raster scanning rows 2660, 2680, and 2700 of Figure 2400. Assuming a horizontal, left-to-right scan direction (such as a raster scan order), row 2660 includes three index values "1", two index values "2", and three index values "3". Row 2680 includes five index values "1" and three index values "3". In this example, for row 2660, the video encoder 200 can encode a syntax element indicating that the first value of row 2660 (the leftmost value of the row) is 1 and the run is 2, followed by an index value of 2, a run of 1, and then an index value of 3, a run of 2. After the raster scan, the video encoder 200 can then encode and decode row 2680 starting from the leftmost value. For example, the video encoder 200 may encode a syntax element indicating that the first value of row 2680 is 1 and the run is 4, followed by an index value of 3 and a run of 2. The video encoder 200 may continue in the same manner at row 2700 .
[0159] Thus, in raster scan order, the first index of the current row may be scanned directly after the last index of the previous row.However, in some examples, it may not be desirable to scan the indexes in raster scan order. For example, it may not be desirable to scan the indexes in a raster scan order in the following situations: a first row of a block of video data (e.g., row 2660) includes a first pixel adjacent to a first edge of the block of video data (e.g., the leftmost pixel of row 2660, whose index value is 1) and a last pixel adjacent to a second edge of the block of video data (e.g., the rightmost pixel of row 2660, whose index value is 3), a second row of the block of video data (e.g., row 2680) includes a first pixel adjacent to the first edge of the block of video data (e.g., the leftmost pixel of row 2680, whose index value is 1) and a last pixel adjacent to the second edge of the block of video data (e.g., the rightmost pixel of row 2680, whose index value is 3), the last pixel of the first row is adjacent to the last pixel of the second row, and the first edge and the second edge are parallel, and the last pixel of the first row has the same index value as the last pixel of the second row, but has a different index value from the first pixel in the second row. This situation (i.e., where the index value of the last pixel in the first row is the same as the last pixel in the second row, but different from the first pixel in the second row) may occur more frequently in computer-generated screen content than in other types of video content.
[0160] In some examples, video encoder 200 can utilize a serpentine scan order (e.g., a traversal scan order) when encoding an index of a graph. For example, video encoder 200 can scan the last pixel of the second row directly after the last pixel of the first row. In this way, video encoder 200 can improve the efficiency of run-length encoding and decoding.
[0161] For example, as opposed to using a raster scan order, the video encoder 200 may use a serpentine scan order to encode and decode the values of the diagram 2400. In an example for illustrative purposes, consider rows 2660, 2680, and 2700 of the diagram 2400. Using a serpentine scan order, such as a serpentine scan order, the video encoder 200 may encode and decode the values of the diagram 2400, starting at the left position of row 2660, proceeding to the rightmost position of row 2660, moving down to the leftmost position of row 2680, continuing to the leftmost position of row 2680, and then moving down to the leftmost position of row 2700. For example, the video encoder 200 may encode one or more syntax elements indicating that the first position of row 2660 is one and that two consecutive entries of the next run in the scan direction are the same as the first position of row 2660.
[0162] The video encoder 200 may encode one or more syntax elements indicating that the next position of line 2660 (i.e., the fourth position from left to right) is two and the next consecutive entry in the scan direction is the same as the fourth position of line 2660. The video encoder 200 may encode one or more syntax elements indicating that the next position of line 2660 (i.e., the sixth position) is three and the five consecutive entries of the next run in the scan direction are the same as the sixth position of line 2660. The video encoder 200 may encode one or more syntax elements indicating that the next position of line 2680 in the scan direction (i.e., the fourth position of line 268 from right to left) is one and the nine consecutive entries of the next run in the scan direction are the same as the fourth position of line 2680.
[0163] In this way, by using a serpentine scan order, the video encoder 200 can encode longer length runs, which can improve codec efficiency. For example, using a raster scan, the final run length of line 2660 (for index value 3) is equal to 2. However, using a serpentine scan, the final run length of line 2660 extends to line 2680 and is equal to 5.
[0164] The video decoder 300 may receive the above syntax elements and reconstruct the lines 2660, 2680, and 2700. For example, the video decoder 300 may obtain data indicating the index value for the location of the picture 2400 currently being encoded and decoded from the encoded bitstream. The video decoder 300 may also obtain data indicating the number of consecutive locations having the same index value in the scanning order.
[0165] As mentioned above, the video codec may use horizontal and vertical traversal scanning (e.g., Figure 7 In some examples, the video codec may signal a syntax element (eg, palette_transpose_flag) that explicitly indicates the scan order.
[0166] There are two main palette sample modes that a video codec can use to encode and decode palette indices: "INDEX" and "COPY_ABOVE". The video codec can signal which mode is used. For example, a flag is used to signal the mode in addition to using the top row when using horizontal scanning, the first column when using vertical scanning, or when the previous mode was "COPY_ABOVE". In "COPY_ABOVE" mode, the palette index of the sample in the row above can be copied. In "INDEX" mode, the palette index is signaled explicitly. For both "INDEX" and "COPY_ABOVE" modes, a run value is signaled, which specifies the number of pixels encoded and decoded using the same mode.
[0167] The video codec can utilize a specific codec order for the index map. An example codec order for the index map is as follows: First, the number of index values for the CU can be signaled. This can be followed by signaling of the actual index value for the entire CU using truncated binary codec. Both the number of indexes and the index values can be encoded and decoded in bypass mode. This groups the index-related bypass bins together. The palette mode (INDEX or COPY_ABOVE) and the run are then signaled in an interlaced manner. Finally, the component run values corresponding to the run samples for the entire CU can be grouped together and encoded and decoded in bypass mode. After signaling the index value, an additional syntax element, last_run_type_flag, can be signaled. This syntax element, together with the number of indexes, can eliminate the need to signal the run value corresponding to the last run in the block.
[0168] As described above, the video codec may maintain a palette predictor (whose maximum size is equal to 63 in Virtual Test Model 6.0 (VTM6.0) of VVC) for encoding and decoding a palette table. After processing a palette codec unit (CU), the video codec may update the palette predictor using the palette table of the CU, which may include entries predicted according to the previous palette predictor and the newly signaled colors, and the predictor entries (from the previous palette predictor) that were not used to predict the palette table will be inserted at the end of the updated predictor until the maximum predictor size is reached. As described above, the latter process may be referred to as palette filling. Figure 8 and 9 is a conceptual diagram illustrating updates to the palette table export and palette predictor.
[0169] like Figure 8 As shown, the palette table 804 may be derived from the input palette predictor 802. For example, the video decoder may determine, for each corresponding entry of the input palette predictor 802, a binary flag indicating whether the corresponding entry is to be included in the palette table 802. Figure 8 In the example of , the video decoder can determine based on the flag that an entry with a diagonal fill (i.e., a hatch) is to be included in the palette table 802. The video decoder can also receive values for one or more new entries that are not included in the input palette predictor 802 to be included in the palette table 804. Figure 8 In the example of , the video decoder may receive values for each of the new colors 806 .
[0170] like Fig. 9 As shown, the input palette predictor 802 may be updated based on the palette table 804 to generate an updated palette predictor 902. For example, the video decoder may generate the updated palette predictor 902 by placing the entries of the palette table 804 at the beginning and then "filling" the palette predictor with entries from the input palette predictor 802 (in addition to those entries already included in the palette table 804) until the size of the updated palette predictor 902 reaches the maximum predictor size. Fig. 9 As shown, not all entries of the input palette predictor 802 may be included in the updated palette predictor 902 .
[0171] However, palette filling may take multiple cycles to complete because the video codec (e.g., encoder / decoder) may need to sequentially check whether each entry in the predictor is used to predict the palette table. After checking the predictor entry, filling the updated color entry will also be a sequential process. Since the maximum palette predictor size currently set in VVC's Virtual Test Model 6.0 (VTM6.0) is 63, and the predictor must be updated before the codec unit of the next palette codec is encoded / decoded, the palette predictor update process may be a complex and resource-intensive process for small blocks such as 4×4, 4×8, or 8×4, which may cause bottlenecks and introduce delays in the codec pipeline.
[0172] This disclosure describes several techniques for reducing the complexity of palette mode encoding and decoding (such as palette predictor updating). These techniques may be particularly beneficial for small decoding units.
[0173] According to the first technique of the present disclosure, a video codec may predict a palette predictor based on a restricted (eg, finite) set of entries. For example, the entries in the palette predictor that may be used to predict a palette table may be restricted.
[0174] In a first example of the first technique, for a codec unit (CU) of size W×H, the video codec may use only the first W×H entries in the palette predictor to predict the palette table in the CU. Fig.10 is a conceptual diagram illustrating an example of predicting a palette predictor using only the first W×H entries in the palette predictor. As a result, the number of predictor entries that the encoder or decoder needs to check for palette filling (regardless of whether the element is used for prediction) is reduced to W×H. For the predictor entries after the W×H′th position (entries with vertical stripe filling, i.e., Fig.10 ), since the entry is not used for prediction, the element can be copied directly until the maximum palette size is reached.
[0175] In a second example of the first technique, in addition to limiting the elements that can be used for prediction, the number of elements updated in the predictor is also limited. Fig.11 As shown, for a codec unit (CU) of size W×H, in addition to limiting the palette predictor used for prediction to only the first W×H entries in the palette predictor, the number of predictor elements allowed to be updated using palette padding is also limited to the first W×H elements, as in the first example of the first technique. After the W×H elements, the predictor remains the same as the previous one (e.g., the same as the previous predictor).
[0176] According to the second technology of the present disclosure, a video codec can limit the maximum size of a palette (such as a palette predictor). In a first example of the second technology, the video codec can dynamically limit the maximum size of the palette predictor to a smaller value, for example, 32 or 16 (smaller than the default value). In this way, the video codec can reduce the total cycle required to complete the palette predictor update. Likewise, in this way, the video codec can reduce the buffer size required to maintain the palette predictor. In a second example of the second technology, the video codec can limit the maximum size of the palette predictor to a smaller value for small decoding units. For example, for a block of size W×H that is less than a block size threshold (e.g., 63), the video codec can limit the maximum size of the updated palette predictor to W×H. For example, the video codec can selectively limit the maximum size of the palette predictor based on the block size.
[0177] According to the third technology of the present disclosure, for small decoding units, the video codec may omit or bypass the palette predictor padding. As a first example of the third technology, for a codec unit (CU) whose size is smaller than the maximum palette predictor size (currently 63 in VTM6.0) or for a CU whose size is smaller than the current palette predictor size, the video codec may not update the palette predictor. When the palette predictor is not updated before encoding and decoding the current CU, the video codec may use the same palette predictor as the previous CU. As a second example of the third technology, for a codec unit whose size is smaller than the maximum palette predictor size of the palette predictor (currently 63 in VTM6.0), the video codec may update the palette predictor to the palette table of the CU.
[0178] Fig.12 2 is a flowchart illustrating an example method for encoding a current block. The current block may include a current CU. Although with respect to the video encoder 200 ( Figure 1 and Figure 3 ), but it should be understood that other devices may be configured to perform the same Fig.12 A similar approach to the one used in this paper.
[0179] In this example, initially, the video encoder 200 predicts a current block (350). For example, the video encoder 200 may form a prediction block for the current block. The video encoder 200 may then calculate a residual block for the current block (352). In order to calculate the residual block, the video encoder 200 may calculate the difference between the original unencoded block and the prediction block for the current block. The video encoder 200 may then transform and quantize the coefficients of the residual block (354). Next, the video encoder 200 may scan the quantized transform coefficients of the residual block (356). During or after the scan, the video encoder 200 may entropy encode the coefficients (358). For example, the video encoder 200 may encode the coefficients using CAVLC or CABAC. The video encoder 200 may then output the entropy-encoded data of the block (360).
[0180] Fig.13 300 ( Figure 1 and Figure 4 ), but it should be understood that other devices may be configured to perform the same Fig.13 A similar approach to the one used in this paper.
[0181] The video decoder 300 may receive entropy-encoded data for a current block, such as entropy-encoded prediction information corresponding to the current block and entropy-encoded data for coefficients of a residual block (370). The video decoder 300 may entropy decode the entropy-encoded data to determine prediction information for the current block and reproduce coefficients of the residual block (372). The video decoder 300 may predict the current block (374), for example, using an intra-prediction or inter-prediction mode as indicated by the prediction information for the current block, to calculate a prediction block for the current block. The video decoder 300 may then inverse scan the reproduced coefficients (376) to create a quantized transform coefficient block. The video decoder 300 may then inverse quantize and inverse transform the coefficients to produce a residual block (378). The video decoder 300 may finally decode the current block by combining the prediction block and the residual block (380).
[0182] Fig.14 is a flowchart illustrating an example method for encoding and decoding a block using palette mode compression according to one or more techniques of this disclosure. Figure 1 and Figure 4 ), but it should be understood that other devices may be configured to perform the same Fig.14 For example, the video encoder 200 may perform Fig.14 method.
[0183] The video decoder 300 may determine a maximum number of entries to be used for palette mode encoding and decoding of the current block based on a parameter of a first block of video data (1402). For example, the palette prediction unit 319 of the video decoder 300 may determine whether to limit the maximum number of entries to 16 or 32 based on the value of the parameter. In some examples, the parameter may represent the size of the first block (e.g., as signaled by the encoder in the encoded bitstream). For example, the palette prediction unit 319 may limit the maximum number of entries to W×H, where W is the width of the first block and H is the height of the first block. Thus, in the case where the first block is 4×4, the palette prediction unit 319 may limit the maximum number of entries to 16. Similarly, in the case where the first block is 4×8, the palette prediction unit 319 may limit the maximum number of entries to 32. The determined maximum number of entries may be the maximum number of entries in a palette constructed for the first block, a palette predictor used to construct a palette, or any other palette used for encoding and decoding of the first block.
[0184] The video decoder 300 may generate a palette for a first block of video data based on the determined maximum number of entries and based on a palette predictor (1404). The generated palette may include one or more entries, each entry including a palette index associated with a color value. In order to generate the palette based on the determined maximum number of entries, the palette prediction unit 319 may limit the number of entries in the palette to the determined maximum number, or generate the palette according to a palette predictor including a number of entries limited to the determined maximum number. By limiting the number of entries in the palette to the determined maximum number, the palette may have a number of entries less than or equal to the determined maximum number. Similarly, in the case where the palette is generated according to a palette predictor including a number of entries limited to the determined maximum number, the palette predictor may have a number of entries less than or equal to the determined maximum number.
[0185] The video decoder 300 may decode from the encoded video bitstream and for the first block of video data, an index value for samples of the first block identifying an entry in the palette (1406). For example, the entropy decoding unit 302 may decode from the encoded video bitstream and provide an array of index values to the palette prediction unit 319.
[0186] Video decoder 300 may reconstruct samples of the first block based on the index values (1408). For example, palette prediction unit 319 may use the generated palette as a lookup table to convert the index values into color values for the corresponding samples (e.g., as described above with reference to Figure 5-7 discussed).
[0187] The video decoder 300 may update the input palette predictor based on the generated palette to generate an updated palette predictor. Figure 8-11 As discussed, the palette prediction unit 319 may generate an updated palette predictor. As an example, the palette prediction unit 319 may copy entries from the palette for the first block to the updated palette predictor; and copy entries from a restricted portion of the input palette predictor that are not included in the palette for the first block to the updated palette predictor and at a position after the entries from the palette for the first block. In this example, the palette prediction unit 319 may copy entries from a non-restricted portion of the input palette predictor to the updated palette predictor and at a position after the entries from the restricted portion of the input palette predictor until the maximum size of the updated palette predictor is reached. Copying entries from the restricted portion may include copying a limited number of entries from the restricted portion.
[0188] As another example, the palette prediction unit 319 may copy entries from the palette for the first block to the updated palette predictor; and fill the updated palette predictor with entries in the input palette predictor that are not included in the palette for the first block. In some examples, to fill the palette, the palette prediction unit 319 may fill the updated palette predictor in response to determining that the size of the first block is greater than a threshold size. Similarly, the palette prediction unit 319 may avoid filling the updated palette predictor in response to determining that the size of the first block is less than a threshold size.
[0189] The video decoder 300 may generate a palette for the second block of video data based on the updated palette predictor.For example, the video decoder 300 may copy one or more entries from the updated palette predictor to the palette for the second block of video data.
[0190] The following numbered examples may illustrate one or more aspects of the present disclosure:
[0191] Example 1. A method for encoding and decoding video data, the method comprising: obtaining an input palette predictor; generating a palette for a first block of video data based on the input palette predictor; updating the input palette predictor based on the generated palette to generate an updated palette predictor, wherein updating the input palette predictor comprises: copying entries from the palette for the first block to the updated palette predictor; and copying entries from a limited portion of the input palette predictor that are not included in the palette for the first block to the updated palette predictor and at a position after the entries from the palette for the first block; and generating a palette for a second block of video data based on the updated palette predictor.
[0192] Example 2. An example as in Example 1, wherein updating the input palette predictor further comprises: copying entries from the unrestricted portion of the input palette predictor to the updated palette predictor and at a position after entries from the restricted portion of the input palette predictor until a maximum size of the updated palette predictor is reached.
[0193] Example 3. The method of any of Examples 1 or 2, wherein the entries from the restricted portion include: copying a limited number of entries from the restricted portion.
[0194] Example 4. A method for encoding and decoding video data, the method comprising: obtaining an input palette predictor, wherein a size of the input palette predictor is limited to a value less than 63; generating a palette for a first block of video data based on the input palette predictor; updating the input palette predictor based on the generated palette to generate an updated palette predictor; and generating a palette for a second block of video data based on the updated palette predictor.
[0195] Example 5. The method of Example 4, wherein the value is 32.
[0196] Example 6. The method of Example 4, wherein the value is 16.
[0197] Example 7. The method of any of Examples 4-6, further comprising: limiting a size of an input palette predictor in response to determining that the size of the first block is less than a threshold block size.
[0198] Example 8. The method of Example 7, wherein limiting the size of the input palette predictor comprises limiting the size of the input palette predictor to a size equal to a length multiplied by a width of the first block.
[0199] Example 9. A method for encoding and decoding video data, the method comprising: obtaining an input palette predictor; generating a palette for a first block of video data based on the input palette predictor; updating the input palette predictor based on the generated palette to generate an updated palette predictor, wherein updating the input palette predictor comprises: copying entries from the palette for the first block to the updated palette predictor; and filling the updated palette predictor with entries in the input palette predictor that are not included in the palette for the first block; and generating a palette for a second block of video data based on the updated palette predictor.
[0200] Example 10. The method of Example 9, wherein populating the palette comprises populating the updated palette predictor in response to determining that the size of the first block is greater than a threshold size.
[0201] Example 11. The method of Example 10, further comprising not populating the updated palette predictor in response to determining that the size of the first block is less than a threshold size.
[0202] Example 12. A method comprising the method of any one of Examples 1-11.
[0203] Example 13. The method of any of Examples 1-12, wherein the first block is a first codec unit (CU) of the video data.
[0204] Example 14. The method of any of Examples 1-13, wherein encoding and decoding includes decoding.
[0205] Example 15. The method of any of Examples 1-14, wherein encoding and decoding includes encoding.
[0206] Example 16. A device for encoding and decoding video data, the device comprising one or more components for performing the method of any of Examples 1-15.
[0207] Example 17. The device of Example 16, wherein the one or more components include one or more processors implemented in a circuit.
[0208] Example 18. The apparatus of any of Examples 16 and 17, further comprising a memory for storing video data.
[0209] Example 19. The device of any of Examples 16-18, further comprising a display configured to display the decoded video data.
[0210] Example 20. The device of any of Examples 16-19, wherein the device comprises one or more of a camera, a computer, a mobile device, a broadcast receiver device, or a set-top box.
[0211] Example 21. The device of any of Examples 16-20, wherein the device comprises a video decoder.
[0212] Example 22. The device of any of Examples 16-21, wherein the device comprises a video encoder.
[0213] Example 23. A computer-readable storage medium having instructions stored thereon, which, when executed, cause one or more processors to perform the method of any of Examples 1-15.
[0214] It should be appreciated that, depending on the example, certain actions or events of any of the techniques described herein may be performed in a different sequence, may be added, combined, or omitted entirely (e.g., not all described actions or events are necessary for the practice of the techniques). Moreover, in some examples, actions or events may be performed concurrently, such as through multithreading, interrupt handling, or multiple processors, rather than sequentially.
[0215] In one or more examples, the described functions may be implemented in hardware, software, firmware, or any combination thereof. If implemented in software, the functions may be stored or sent as one or more instructions or codes on a computer-readable medium and executed by a hardware-based processing unit. Computer-readable media may include computer-readable storage media, which corresponds to tangible media such as data storage media; or communication media, including any media that facilitates the transfer of a computer program from one place to another, for example, according to a communication protocol. In this manner, computer-readable media may generally correspond to (1) non-transitory tangible computer-readable storage media or (2) communication media such as signals or carrier waves. Data storage media may be any available media that can be accessed by one or more computers or one or more processors to retrieve instructions, codes, and / or data structures for implementing the techniques described in the present disclosure. A computer program product may include a computer-readable medium.
[0216] As an example and not limitation, such computer-readable storage media may include RAM, ROM, EEPROM, CD-ROM or other optical disk storage, disk storage or other magnetic storage devices, flash memory, or any other medium that can be used to store the required program code in the form of instructions or data structures and can be accessed by a computer. Similarly, any connection is appropriately referred to as a computer-readable medium. For example, if a coaxial cable, optical fiber cable, twisted pair, digital subscriber line (DSL), or wireless technologies such as infrared, radio, microwaves are used to send instructions from a website, server or other remote source, then coaxial cable, optical fiber cable, twisted pair, DSL, or wireless technologies such as infrared, radio and microwaves are included in the definition of the medium. However, it should be understood that computer-readable storage media and data storage media do not include connections, carrier waves, signals or other transient media, but are directed to non-transient, tangible storage media. Disks and optical disks used herein include compact disks (CDs), laser disks, optical disks, digital versatile disks (DVDs), floppy disks and blue optical disks, wherein disks usually reproduce data magnetically, while optical disks reproduce data optically with lasers. The combination of the above items should also be included in the scope of computer-readable media.
[0217] Instructions may be executed by one or more processors such as one or more digital signal processors (DSPs), general-purpose microprocessors, application-specific integrated circuits (ASICs), field programmable gate arrays (FPGAs), or other equivalent integrated or discrete logic circuits. Accordingly, the terms "processor" and "processing circuitry" as used herein may refer to any of the aforementioned structures or any other structure suitable for implementing the techniques described herein. In addition, in some aspects, the functionality described herein may be provided within dedicated hardware and / or software modules configured for encoding and decoding, or incorporated into a combined codec. Similarly, the technology may be fully implemented in one or more circuits or logic elements.
[0218] The techniques of the present disclosure may be implemented in a variety of devices or apparatuses, including wireless handheld devices, integrated circuits (ICs) or IC sets (e.g., chipsets). Various components, modules, or units are described in the present disclosure to emphasize functional aspects of devices configured to perform the disclosed techniques, but do not necessarily need to be implemented by different hardware units. More specifically, as described above, the various units may be combined in a codec hardware unit or provided by a collection of interoperable hardware units including one or more processors as described above in combination with appropriate software and / or firmware.
[0219] Various examples have been described. These and other examples are within the scope of the following claims.
Claims
1. A device for decoding video data, the device comprising: a memory configured to store at least a portion of an encoded video bitstream; as well as One or more processors implemented in circuitry and configured to: Based on a parameter of a first block of video data, a maximum number of entries to be used for palette mode encoding and decoding of the current block is dynamically selected to be only 16 or 32, wherein to dynamically select the maximum number of entries, the one or more processors are configured to: selecting the maximum number of entries to be 16 in response to the parameter having a first value; and responsive to the parameter having a second value different than the first value, selecting the maximum number of entries to be thirty-two; generating a palette for the first block of video data based on the determined maximum number of entries and based on a palette predictor, the palette comprising one or more entries, each entry comprising a palette index associated with a color value; decoding, from the encoded video bitstream and for the first block of video data, an index value identifying an entry in the palette for samples of the first block; as well as Samples of the first block are reconstructed based on the index value.
2. The apparatus of claim 1 , wherein the one or more processors are further configured to: Get the input palette predictor, where To generate the color palette, the one or more processors are configured to generate the color palette based on the input palette predictor; updating the input palette predictor based on the generated palette to generate an updated palette predictor, wherein to update the input palette predictor, the one or more processors are configured to: copying entries from the palette for the first block to the updated palette predictor; and copying entries from a restricted portion of the input palette predictor that are not included in the palette for the first block to the updated palette predictor and at a location after the entry from the palette for the first block; and A palette for a second block of video data is generated based on the updated palette predictor.
3. The device of claim 2, wherein: To update the input palette predictor, the one or more processors are configured to: Entries from the unrestricted portion of the input palette predictor are copied to the updated palette predictor at locations after the entries from the restricted portion of the input palette predictor until a maximum size of the updated palette predictor is reached.
4. The device of claim 2, wherein: To copy the entry from the restricted portion, the one or more processors are configured to: A limited number of entries from the restricted portion are copied.
5. The apparatus of claim 1 , wherein the one or more processors are further configured to: Get the input palette predictor, where To generate the color palette, the one or more processors are configured to generate the color palette based on the input palette predictor; updating the input palette predictor based on the generated palette to generate an updated palette predictor, wherein to update the input palette predictor, the one or more processors are configured to: copying entries from the palette for the first block to the updated palette predictor; and populating the updated palette predictor with entries in the input palette predictor that are not included in the palette for the first block; and A palette for a second block of video data is generated based on the updated palette predictor.
6. The device of claim 5, wherein: To populate the palette, the one or more processors are configured to populate the updated palette predictor in response to determining that the size of the first block is greater than a threshold size.
7. The device of claim 6, wherein: To populate the palette, the one or more processors are configured to not populate the updated palette predictor in response to determining that the size of the first block is less than the threshold size.
8. The apparatus of claim 1, further comprising a display configured to output the reconstructed first block of video data.
9. A method for decoding video data, the method comprising: Based on parameters of a first block of video data, a maximum number of entries to be used for palette mode encoding and decoding of the current block is dynamically selected to be only 16 or 32, wherein dynamically selecting the maximum number of entries comprises: selecting the maximum number of entries to be 16 in response to the parameter having a first value; and responsive to the parameter having a second value different than the first value, selecting the maximum number of entries to be thirty-two; generating a palette for the first block of video data based on the determined maximum number of entries and based on a palette predictor, the palette comprising one or more entries, each entry comprising a palette index associated with a color value; decoding, from an encoded video bitstream and for the first block of video data, an index value for a sample of the first block identifying an entry in the palette; and Samples of the first block are reconstructed based on the index value.
10. The method of claim 9, further comprising: obtaining an input palette predictor, wherein generating the palette comprises generating the palette based on the input palette predictor; Updating the input palette predictor based on the generated palette to generate an updated palette predictor, wherein updating the input palette predictor comprises: copying entries from the palette for the first block to the updated palette predictor; and copying entries from a restricted portion of the input palette predictor that are not included in the palette for the first block to the updated palette predictor and at a location after the entry from the palette for the first block; and A palette for a second block of video data is generated based on the updated palette predictor.
11. The method of claim 10, wherein updating the input palette predictor further comprises: Entries from the unrestricted portion of the input palette predictor are copied to the updated palette predictor at locations after the entries from the restricted portion of the input palette predictor until a maximum size of the updated palette predictor is reached.
12. The method of claim 11, wherein copying the entry from the restricted portion comprises: A limited number of entries from the restricted portion are copied.
13. The method of claim 9, further comprising: obtaining an input palette predictor, wherein generating the palette comprises generating the palette based on the input palette predictor; Updating the input palette predictor based on the generated palette to generate an updated palette predictor, wherein updating the input palette predictor comprises: copying entries from the palette for the first block to the updated palette predictor; and populating the updated palette predictor with entries in the input palette predictor that are not included in the palette for the first block; and A palette for a second block of video data is generated based on the updated palette predictor.
14. The method of claim 13, wherein populating the palette comprises populating the updated palette predictor in response to determining that the size of the first block is greater than a threshold size.
15. The method of claim 14, further comprising not populating the updated palette predictor in response to determining that the size of the first block is less than the threshold size.
16. A device for encoding video data, the device comprising: a memory configured to store at least a portion of an encoded video bitstream; as well as One or more processors implemented in circuitry and configured to: Based on a parameter of a first block of video data, a maximum number of entries to be used for palette mode encoding and decoding of the current block is dynamically selected to be only 16 or 32, wherein to dynamically select the maximum number of entries, the one or more processors are configured to: selecting the maximum number of entries to be 16 in response to the parameter having a first value; and responsive to the parameter having a second value different than the first value, selecting the maximum number of entries to be thirty-two; generating a palette for the first block of video data based on the determined maximum number of entries and based on a palette predictor, the palette comprising one or more entries, each entry comprising a palette index associated with a color value; as well as An index value for a sample of the first block identifying an entry in the palette is encoded in the encoded video bitstream and for the first block of video data.
17. A method for encoding video data, the method comprising: Based on parameters of a first block of video data, a maximum number of entries to be used for palette mode encoding and decoding of the current block is dynamically selected to be only 16 or 32, wherein dynamically selecting the maximum number of entries comprises: selecting the maximum number of entries to be 16 in response to the parameter having a first value; and responsive to the parameter having a second value different than the first value, selecting the maximum number of entries to be thirty-two; generating a palette for the first block of video data based on the determined maximum number of entries and based on a palette predictor, the palette comprising one or more entries, each entry comprising a palette index associated with a color value; and An index value for a sample of the first block identifying an entry in the palette is encoded in an encoded video bitstream and for the first block of video data.
18. A computer-readable storage medium having stored thereon instructions which, when executed, cause one or more processors of a video decoder to: dynamically selecting a maximum number of entries to be used for palette mode encoding and decoding of a current block to be only 16 or 32 based on parameters of a first block of video data, wherein the instructions causing the one or more processors of the video decoder to dynamically select the maximum number of entries include instructions causing the one or more processors to: selecting the maximum number of entries to be 16 in response to the parameter having a first value; and responsive to the parameter having a second value different than the first value, selecting the maximum number of entries to be thirty-two; generating a palette for the first block of video data based on the determined maximum number of entries and based on a palette predictor, the palette comprising one or more entries, each entry comprising a palette index associated with a color value; decoding, from an encoded video bitstream and for the first block of video data, an index value identifying an entry in the palette for samples of the first block; as well as Samples of the first block are reconstructed based on the index value.
19. A computer-readable storage medium having stored thereon instructions which, when executed, cause one or more processors of a video encoder to: dynamically selecting a maximum number of entries to be used for palette mode encoding and decoding of a current block to be only 16 or 32 based on a parameter of a first block of video data, wherein the instructions causing the one or more processors of the video encoder to dynamically select the maximum number of entries include instructions causing the one or more processors to: selecting the maximum number of entries to be 16 in response to the parameter having a first value; and responsive to the parameter having a second value different than the first value, selecting the maximum number of entries to be thirty-two; generating a palette for the first block of video data based on the determined maximum number of entries and based on a palette predictor, the palette comprising one or more entries, each entry comprising a palette index associated with a color value; and An index value for a sample of the first block identifying an entry in the palette is encoded in an encoded video bitstream and for the first block of video data.
Citation Information
Patent Citations
Method and apparatus of encoding or decoding coding units of a video content in a palette coding mode using an adaptive palette predictor
EP3104607A1
Palette mode encoding and decoding design
US20160037164A1