Rate-Distortion Optimized Quantization Using Parallelization of Deep Learning
By using a deep learning neural network to determine the probability set of transform coefficients, the problem of time-consuming and resource-intensive selection of quantization levels in video encoding in the existing technology is solved, and a more efficient quantization process and resource utilization are achieved.
Patent Information
- Application Number
- CN202180022319.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2020-10-14
- Filing Date
- 2021-03-23
- Publication Date
- 2025-09-23
- Estimated Expiration
- 2041-03-23
AI Technical Summary
Existing video coding technologies are time-consuming and resource-intensive in selecting a quantization level. In particular, the existing rate-distortion optimized quantization (RDOQ) technology is time-consuming and resource-intensive in the selection process. In the existing technology, the video coding technology is time-consuming and resource-intensive in the selection process.
A video encoding technology that uses a deep learning neural network to determine a probability set of transform coefficients, selects a quantized video encoder for use based on probability calculation, uses a method for scaling transform coefficients and scalar quantization, uses a deep learning neural network for encoder, determines a method using deep learning, uses a deep learning method, uses a deep learning neural network to determine a probability set of transform coefficients, and selects a quantization level based on the probability set.
It accelerates the quantization process, reduces resource consumption, and improves the efficiency of video encoding.
Smart Images

Figure CN115336266B_ABST
Abstract
Description
[0001] Priority claim
[0002] This application claims priority to U.S. Patent Application No. 17 / 070,589, filed on October 14, 2020, U.S. Provisional Patent Application No. 63 / 011,685, filed on April 17, 2020, and U.S. Provisional Patent Application No. 63 / 034,618, filed on June 4, 2020, and the entire contents of each of these applications are incorporated herein by reference. Technical Field
[0003] This disclosure relates to video encoding and video decoding. Background Art
[0004] Digital video capabilities can be incorporated into a wide variety 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 recorders, digital media players, video game devices, video game consoles, cellular or satellite wireless telephones, so-called "smart phones", video teleconferencing devices, video streaming devices, and the like. Digital video devices implement video coding techniques, such as those described in the standards specified by MPEG-2, MPEG-4, ITU-T H.263, ITU-T H.264 / MPEG-4 Part 10, Advanced Video Coding (AVC), ITU-T H.265 / High Efficiency Video Coding (HEVC), and extensions of these standards. By implementing these video coding techniques, video devices can transmit, receive, encode, decode, and / or store digital video information.
[0005] Video coding techniques include spatial (intra-frame) prediction and / or temporal (inter-frame) prediction to reduce or eliminate 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) can be divided into video blocks, which can also be referred to as coding tree units (CTUs), coding units (CUs), and / or coding 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 can use spatial prediction relative to reference samples in neighboring blocks in the same picture, or use temporal prediction relative to reference samples in other reference pictures. Pictures can be referred to as frames, and reference pictures can be referred to as reference frames. Summary of the Invention
[0006] In general, this disclosure describes techniques for performing parallelized rate-distortion optimized quantization using deep learning. As described herein, a video encoder applies a neural network that, for each transform coefficient of a block, determines a set of probabilities for the transform coefficient. The video encoder can then determine a quantization level for the transform coefficient based on the set of probabilities for the transform coefficient. The video encoder can signal the determined quantization level for the transform coefficient.
[0007] In one example, a method includes a method for encoding video data, the method comprising: determining scaled transform coefficients, wherein determining the scaled transform coefficients comprises: scaling the transform coefficients of a block of the video data according to a given quantization step; determining scalar quantized coefficients, wherein determining the scalar quantized coefficients comprises: applying scalar quantization to the scaled transform coefficients of the block; applying a neural network for determining a respective set of probabilities for each respective transform coefficient of the block, wherein: the respective set of probabilities for the respective transform coefficients comprises a respective probability value for each possible adjustment value of a plurality of possible adjustment values, and an input to the neural network comprises the scaled transform coefficients and the scalar quantized coefficients; determining a quantization level for a particular transform coefficient of the block based on the probability set for the particular transform coefficient; and signaling the determined quantization level for the particular transform coefficient in a bitstream comprising an encoded representation of the video data.
[0008] In another example, the present disclosure describes an apparatus for encoding video data, the apparatus comprising: a memory for storing the video data; and one or more processors implemented in circuitry, the one or more processors configured to: determine scaled transform coefficients, wherein determining the scaled transform coefficients comprises: scaling transform coefficients of a block of the video data according to a given quantization step; determine scalar quantized coefficients, wherein determining the scalar quantized coefficients comprises: applying scalar quantization to the scaled transform coefficients of the block; apply a neural network for determining a respective set of probabilities for each respective transform coefficient of the block, wherein: the respective set of probabilities for the respective transform coefficients comprises a respective probability value for each possible adjustment value of a plurality of possible adjustment values, and inputs to the neural network comprise the scaled transform coefficients and the scalar quantized coefficients; determine a quantization level for a particular transform coefficient of the block based on the set of probabilities for the particular transform coefficient; and signal the determined quantization level for the particular transform coefficient in a bitstream comprising an encoded representation of the video data.
[0009] In another example, the present disclosure describes an apparatus for encoding video data, the apparatus comprising: a unit for determining scaled transform coefficients, wherein determining the scaled transform coefficients comprises scaling the transform coefficients of a block of the video data according to a given quantization step; a unit for determining scalar quantized coefficients, wherein determining the scalar quantized coefficients comprises applying scalar quantization to the scaled transform coefficients of the block; a unit for applying a neural network for determining a respective set of probabilities for each respective transform coefficient of the block, wherein the respective set of probabilities for the respective transform coefficients comprises a respective probability value for each possible adjustment value of a plurality of possible adjustment values, and an input to the neural network comprises the scaled transform coefficients and the scalar quantized coefficients; a unit for determining a quantization level for a particular transform coefficient of the block based on the probability set for the particular transform coefficient; and a unit for signaling the determined quantization level for the particular transform coefficient in a bitstream comprising an encoded representation of the video data.
[0010] In another example, the present disclosure describes a computer-readable storage medium having instructions stored thereon that, when executed, cause one or more processors to perform the following operations: determine scaled transform coefficients, wherein determining the scaled transform coefficients includes scaling the transform coefficients of the block of video data according to a given quantization step; determine scalar quantized coefficients, wherein determining the scalar quantized coefficients includes applying scalar quantization to the scaled transform coefficients of the block; apply a neural network for determining a respective set of probabilities for each respective transform coefficient of the block, wherein the respective set of probabilities for the respective transform coefficients includes a respective probability value for each possible adjustment value of a plurality of possible adjustment values, and inputs to the neural network include the scaled transform coefficients and the scalar quantized coefficients; determine a quantization level for a particular transform coefficient of the block based on the probability set for the particular transform coefficient; and signal the determined quantization level for the particular transform coefficient in a bitstream including an encoded representation of the video data.
[0011] The details of one or more examples are set forth in the accompanying drawings and the description below. Other features, objects, and advantages will be apparent from the description and drawings, and from the claims. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] Figure 1 is a block diagram illustrating an exemplary video encoding and decoding system that may perform the techniques of this disclosure.
[0013] Figure 2is a conceptual diagram illustrating an exemplary general schematic diagram of a quantizer with a video encoder pipeline, which may be used for High Efficiency Video Coding (HEVC), Versatile Video Coding (VVC), and / or other video coding standards.
[0014] Figure 3 is a block diagram illustrating an example video encoder that may perform the techniques of this disclosure.
[0015] Figure 4 is a block diagram illustrating an example video decoder that may perform the techniques of this disclosure.
[0016] Figure 5A is a conceptual diagram illustrating an exemplary schematic diagram of a neural network-based rate-distortion optimized quantization pipeline.
[0017] Figure 5B is a conceptual diagram illustrating an exemplary schematic diagram of a neural network-based rate-distortion optimized quantization pipeline in which the sign of each transform coefficient is ignored during neural network inference.
[0018] Figure 6A is a conceptual diagram illustrating an exemplary fully convolutional neural network, according to one or more techniques of this disclosure.
[0019] Figure 6B is a conceptual diagram illustrating an exemplary fully convolutional neural network, according to one or more techniques of this disclosure.
[0020] Figure 7A is a conceptual diagram illustrating an exemplary schematic diagram of an autoregressive model (ARM) architecture with a conditioning layer, in accordance with one or more techniques of this disclosure.
[0021] Figure 7B is a conceptual diagram illustrating another exemplary schematic diagram of an ARM architecture with a regulation layer according to one or more techniques of this disclosure.
[0022] Figure 8 is a flowchart illustrating an example method for encoding a current block.
[0023] Figure 9 is a flow chart illustrating an example method for decoding a current block.
[0024] Figure 10 is a flowchart illustrating an example method of encoding video data, in accordance with one or more techniques of this disclosure. DETAILED DESCRIPTION
[0025] Rate-distortion optimized quantization (RDOQ) is a quantization technique in which a video encoder selects a quantization level for each transform coefficient of a block of video data. The video encoder can then signal the selected quantization level. The process of selecting a quantization level for a transform coefficient can involve testing different quantization levels for the transform coefficient to determine the quantization level that produces the optimal rate-distortion score for that transform coefficient. Performing such a search can be time-consuming and resource-intensive.
[0026] This disclosure describes techniques that can achieve results similar to RDOQ, but with greater efficiency and reduced resource consumption. As described herein, a video encoder may determine scaled transform coefficients. As part of determining the scaled transform coefficients, the video encoder may scale the transform coefficients of a block of video data according to a given quantization step. Furthermore, the video encoder may determine scalar-quantized coefficients. As part of determining the scalar-quantized coefficients, the video encoder may apply scalar quantization to the scaled transform coefficients of the block. Furthermore, the video encoder may apply a neural network that determines a corresponding probability set for each corresponding transform coefficient of the block. The corresponding probability set for the corresponding transform coefficient includes a corresponding probability value for each possible adjustment value of a plurality of possible adjustment values. Inputs to the neural network may include the scaled transform coefficients and the scalar-quantized coefficients. Furthermore, the video encoder may determine a quantization level for a particular transform coefficient of the block based on the probability set for the particular transform coefficient. The video encoder may signal the determined quantization level for the particular transform coefficient in a bitstream comprising an encoded representation of the video data. Performing RDOQ in this manner can speed up the quantization process and may consume fewer resources.
[0027] Figure 1 1 is a block diagram illustrating an exemplary video encoding and decoding system 100 that can perform the techniques of the present disclosure. The techniques of the present disclosure are generally directed to the decoding (encoding and / or decoding) of video data. Generally, video data includes any data used to process video. Thus, video data can include original, unencoded video, encoded video, decoded (e.g., reconstructed) video, and video metadata (e.g., signaling data).
[0028] like Figure 1As shown in , in this example, system 100 includes a source device 102 that provides encoded video data to be decoded and displayed by a destination device 116. Specifically, source device 102 provides the 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, mobile devices (e.g., laptops), tablet computers, telephone handsets (e.g., smartphones, cameras), broadcast receiver devices, set-top boxes, televisions, 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, therefore, may be referred to as wireless communication devices.
[0029] exist Figure 1 In the example of , source device 102 includes a video source 104, a memory 106, a video encoder 200, and an output interface 108. Destination device 116 includes an input interface 122, a video decoder 300, the memory 120, and a 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 techniques for parallelizing rate-distortion optimized quantization using deep learning. Thus, source device 102 represents an example of a video encoding device, while destination device 116 represents an example of a video decoding device. In other examples, the source device and destination device can include other components or arrangements. For example, source device 102 can receive video data from an external video source such as an external camera. Similarly, destination device 116 can interface with an external display device rather than including an integrated display device.
[0030] like Figure 1 The system 100 shown in is merely an example. In general, any digital video encoding and / or decoding device can implement techniques for parallelized rate-distortion optimized quantization using deep learning. The source device 102 and the destination device 116 are merely examples of such decoding devices, wherein the source device 102 generates encoded video data for transmission to the destination device 116. This disclosure refers to a "decoding" device as a device that performs decoding (encoding and / or decoding) of data. Thus, the video encoder 200 and the video decoder 300 represent examples of decoding devices (specifically, a video encoder and a video decoder, respectively). In some examples, the source device 102 and the destination device 116 can operate in a substantially symmetrical manner, such that each of the source device 102 and the destination device 116 includes video encoding and decoding components. Thus, the system 100 can support one-way or two-way video transmission between the source device 102 and the destination device 116, for example, for video streaming, video playback, video broadcasting, or video telephony.
[0031] Typically, video source 104 represents a source of video data (i.e., raw, unencoded video data) and provides a continuous sequence of pictures of the video data (also referred to as "frames") to video encoder 200, where video encoder 200 encodes the picture data. Video source 104 of source device 102 may include a video capture device (e.g., a camera), a video archive containing previously captured raw video, and / or a video feed interface for receiving video from a video content provider. As another alternative, video source 104 may generate computer graphics-based data as the source video, or a combination of real-time 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 the images from the order in which they were received (sometimes referred to as "display order") into a decoding order for decoding. Video encoder 200 may generate a bitstream including the 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 .
[0032] 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 and 120 can store raw video data, e.g., raw video from the video source 104 and raw decoded video data from the video decoder 300. Additionally or alternatively, the memories 106 and 120 can store software instructions executable by, for example, the video encoder 200 and the video decoder 300, respectively. Although the memories 106 and 120 are 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 to achieve functionally similar or equivalent purposes. Furthermore, the memories 106 and 120 can store encoded video data (e.g., data output from the video encoder 200 and input to the video decoder 300). In some examples, a portion of the memories 106 and 120 can be allocated as one or more video buffers, e.g., for storing raw, decoded, and / or encoded video data.
[0033] The computer-readable medium 110 can represent any type of medium or device capable of transmitting 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 for enabling the source device 102 to send the encoded video data directly to the destination device 116 in real time, for example, via a radio frequency network or a computer-based network. The output interface 108 can demodulate the transmission signal including the encoded video data according to a communication standard such as a wireless communication protocol, and the input interface 122 can demodulate the received transmission signal. The communication medium can include any wireless or wired communication medium, such as a radio frequency (RF) spectrum or one or more physical transmission lines. The communication medium can form part of a packet-based network such as a local area network, a wide area network, or a global network (e.g., the Internet). The communication medium can include routers, switches, base stations, or any other device that facilitates communication from the source device 102 to the destination device 116.
[0034] In some examples, source device 102 may output the encoded data from output interface 108 to storage device 112. Similarly, destination device 116 may access the encoded data from storage device 112 via input interface 122. Storage device 112 may include any of a variety of distributed or locally accessed data storage media (e.g., a hard drive, Blu-ray disc, DVD, CD-ROM, flash memory, volatile or non-volatile memory), or any other suitable digital storage media for storing encoded video data.
[0035] In some examples, source device 102 may output the encoded video data to a file server 114 or another intermediate storage device that may store the encoded video data generated by source device 102. Destination device 116 may access the stored video data from file server 114 via streaming or downloading. File server 114 may be any type of server device capable of storing and transmitting the encoded video data to destination device 116. File server 114 may represent a network server (e.g., for a website), a file transfer protocol (FTP) server, a content delivery network device, or a network attached storage (NAS) device. Destination device 116 may access the encoded video data from 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 digital subscriber line (DSL), a cable modem, etc.), or a combination thereof, suitable for accessing encoded video data stored on file server 114. File server 114 and input interface 122 may be configured to operate according to a streaming protocol, a download transfer protocol, or a combination thereof.
[0036] The output interface 108 and the input interface 122 may represent wireless transmitters / receivers, modems, wired network 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 the output interface 108 and the input interface 122 include wireless components, the output interface 108 and the input interface 122 may be configured to transmit 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 some examples where the output interface 108 includes a wireless transmitter, the output interface 108 and the input interface 122 may be configured to transmit data, such as encoded video data, according to other wireless standards (e.g., IEEE 802.11 specifications, IEEE 802.15 specifications (e.g., ZigBee 5G), etc.). TM ), Bluetooth TM Standards, etc.) to transmit 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 an SoC device to perform the functions attributed to video encoder 200 and / or output interface 108, while destination device 116 may include an SoC device to perform the functions attributed to video decoder 300 and / or input interface 122.
[0037] The techniques of the present disclosure may be applied to video encoding to support any of a variety of multimedia applications, such as over-the-air television broadcasting, cable television transmission, satellite television transmission, Internet streaming video transmission (e.g., 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.
[0038] The input interface 122 of the destination device 116 receives an encoded video bitstream from the computer-readable medium 110 (e.g., a communication medium, a storage device 112, a file server 114, etc.). The encoded video bitstream may include signaling information defined by the video encoder 200 and used by the video decoder 300, such as syntax elements with values describing the characteristics and processing of video blocks or other coding 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 liquid crystal display (LCD), a plasma display, an organic light emitting diode (OLED) display, or another type of display device.
[0039] Although not in Figure 1, but in some examples, the video encoder 200 and the video decoder 300 may be integrated with an audio encoder and / or an audio decoder, respectively, and may include appropriate MUX-DEMUX units or other hardware and / or software to process a multiplexed stream 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 (e.g., User Datagram Protocol (UDP)).
[0040] The video encoder 200 and the video decoder 300 can each be implemented as any of a variety of appropriate 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 these techniques are implemented in part in software, the device can store instructions for the software in an appropriate non-transitory computer-readable medium and use one or more processors to execute these instructions in hardware to perform the techniques 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 the corresponding device. The device including the video encoder 200 and / or the video decoder 300 may include an integrated circuit, a microprocessor, and / or a wireless communication device (e.g., a cellular phone).
[0041] The video encoder 200 and the video decoder 300 may operate in accordance with a video coding standard such as ITU-T H.265 (also known as High Efficiency Video Coding (HEVC)) or an extension thereof (e.g., a multi-view and / or scalable video coding extension). Alternatively, the video encoder 200 and the video decoder 300 may operate in accordance with other proprietary or industry standards such as ITU-T H.266 (also known as Versatile Video Coding (VVC)). Bross et al. describe recent drafts of the VVC standard in the Joint Video Experts Group (JVET) “Versatile Video Coding (Draft 8)” of ITU-T SG 16WP 3, and JVET-Q2001-vE of the 17th meeting of ISO / IEC JTC 1 / SC 29 / WG 11 in Brussels, Belgium, from January 7 to 17, 2020 (hereinafter referred to as “VVC Draft 8”). However, the technology of the present disclosure is not limited to any particular coding standard.
[0042] Typically, the video encoder 200 and the video decoder 300 can perform block-based encoding of a picture. The term "block" generally refers to a structure comprising data to be processed (e.g., an encoding, decoding, or other method used in the encoding and / or decoding process). For example, a block can include a two-dimensional matrix of samples of luma and / or chroma data. Typically, the video encoder 200 and the video decoder 300 can encode video data represented in a YUV (e.g., Y, Cb, Cr) format. That is, rather than decoding the red, green, and blue (RGB) data of the samples of a picture, the video encoder 200 and the video decoder 300 can decode the luma and chroma components, where the chroma components may include red and blue chroma components. In some examples, the video encoder 200 converts the received RGB formatted data into a YUV representation prior to encoding, and the video decoder 300 converts the YUV representation into an RGB format. Alternatively, pre-processing and post-processing units (not shown) can perform these conversions.
[0043] The present disclosure may generally refer to the decoding (e.g., encoding and decoding) of a picture, to include the process of encoding or decoding the data of the picture. Similarly, the present disclosure may refer to the decoding of blocks of a picture, to include the process of encoding or decoding the data of these blocks (e.g., prediction and / or residual coding). A coded video bitstream generally includes a series of values for syntax elements, where these syntax elements represent decoding decisions (e.g., decoding mode) and partitioning of the picture into blocks. Therefore, references to decoding a picture or block should generally be understood to refer to the decoded values of the syntax elements used to form the picture or block.
[0044] HEVC defines various blocks, including coding units (CUs), prediction units (PUs), and transform units (TUs). According to HEVC, a video decoder (e.g., video encoder 200) divides a coding tree unit (CTU) into CUs according to a quadtree structure. That is, the video decoder divides 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 child nodes may be referred to as a "leaf node," and the CU of such a leaf node may include one or more PUs and / or one or more TUs. The video decoder may further partition the PUs and TUs. For example, in HEVC, the residual quadtree (RQT) represents the partitioning of the TU. In HEVC, PU represents inter-frame prediction data, and TU represents residual data. An intra-predicted CU includes intra-frame prediction information (e.g., an intra-frame mode indication).
[0045] As another example, the video encoder 200 and the video decoder 300 can be configured to operate according to VVC. According to VVC, a video decoder (e.g., the video encoder 200) divides a picture into a plurality of coding tree units (CTUs). The video encoder 200 can divide 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 eliminates the concept of multiple partition types, such as the separation between CU, PU, and TU of HEVC. The QTBT structure includes two levels: a first level divided according to quadtree partitioning and a second level divided 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 the coding units (CUs).
[0046] 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) (also known as ternary tree (TT)) partitioning. A ternary tree or ternary tree partitioning is a partitioning that partitions a block into three sub-blocks. In some examples, a ternary tree or ternary tree partitioning partitions a block into three sub-blocks without partitioning the original block through the center. The partitioning types in MTT (e.g., QT, BT, and TT) can be symmetric or asymmetric.
[0047] In some examples, the video encoder 200 and the video decoder 300 may use a single QTBT or MTT structure to represent each of the luma and chroma components, while in other examples, the video encoder 200 and the video decoder 300 may use two or more QTBT 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).
[0048] The video encoder 200 and the video decoder 300 can be configured to use quadtree partitioning, QTBT partitioning, MTT partitioning, or other partitioning structures per HEVC. For ease of illustration, the technology of the present disclosure is described with respect to QTBT partitioning. However, it should be understood that the technology of the present disclosure can also be applied to video decoders configured to use quadtree partitioning or other types of partitioning.
[0049] In some examples, a CTU includes a coding tree block (CTB) of luma samples, two corresponding CTBs of chroma samples for a picture with three sample arrays, or a CTB of samples for a monochrome picture or a picture coded using three independent color planes and syntax structures for coding the samples. A CTB can be an NxN block of samples for some value of N, such that the partitioning of the constituent elements into CTBs is a partitioning. A constituent element is an array or a single sample from one of the three arrays (luma and two chroma) that make up a picture in 4:2:0, 4:2:2, or 4:4:4 color format, or a single sample from the array or arrays that make up a picture in monochrome format. In some examples, a coding block is an MxN block of samples for some values of M and N, such that the partitioning of the CTB into a coding block is a partitioning.
[0050] Blocks (e.g., CTUs or CUs) can be grouped in a picture in various ways. As an example, a brick can refer to a CTU row of a rectangular area within a particular tile in a picture. A tile can be a rectangular area of a CTU within a particular tile column and a particular tile row in a picture. A tile column refers to a rectangular area of a CTU with a height equal to the height of the picture and a width specified by a syntax element (e.g., such as given in a picture parameter set). A tile row refers to a rectangular area of a CTU with a height specified by a syntax element (e.g., such as given in a picture parameter set) and a width equal to the width of the picture.
[0051] In some examples, a tile can be divided into multiple bricks, each of which can include one or more CTU rows within the tile. A tile that is not divided into multiple bricks can also be called a brick. However, a brick that is a true subset of a tile cannot be called a tile.
[0052] Bricks in a picture can also be arranged into segments. A segment can be an integer number of bricks in a picture that can be contained exclusively in a single Network Abstraction Layer (NAL) unit. In some examples, a segment can include multiple complete tiles, or just a contiguous sequence of bricks from a tile.
[0053] This disclosure may use "NxN" and "N by N" interchangeably to refer to the sample size of a block (e.g., a CU or other video block) in the vertical and horizontal dimensions, for example, 16x16 samples or 16 by 16 samples. Typically, a 16x16 CU will have 16 samples in the vertical direction (y=16) and 16 samples in the horizontal direction (x=16). Likewise, an NxN 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 may be arranged in rows and columns. Furthermore, a CU does not necessarily have the same number of samples in the horizontal direction as in the vertical direction. For example, a CU may include NxM samples, where M is not necessarily equal to N.
[0054] The video encoder 200 encodes video data for a CU representing prediction and / or residual information and other information. The prediction information indicates how the CU will be predicted in order to form a prediction block for the CU. The residual information typically represents the sample-by-sample difference between the samples of the CU before encoding and the prediction block.
[0055] To predict a CU, the video encoder 200 may typically form a prediction block for the CU through inter-frame prediction or intra-frame prediction. Inter-frame prediction typically refers to predicting a CU from data of a previously encoded picture, while intra-frame prediction typically refers to predicting a CU from previously encoded data of the same picture. To perform inter-frame prediction, the video encoder 200 may use one or more motion vectors to generate a prediction block. The video encoder 200 may typically perform a motion search to identify a reference block that closely matches the CU, for example, in terms of the difference between the CU and a reference block. The video encoder 200 may calculate a difference metric using the sum of absolute differences (SAD), the sum of squared differences (SSD), the mean absolute difference (MAD), the mean squared difference (MSD), or other such difference calculations to determine whether the reference block closely matches the current CU. In some examples, the video encoder 200 may use unidirectional prediction or bidirectional prediction to predict the current CU.
[0056] Some examples of VVC also provide an affine motion compensation mode, which can be considered an inter-frame prediction mode. In affine motion compensation mode, the video encoder 200 can determine two or more motion vectors representing non-translational motion, such as reduction or enlargement, rotation, perspective motion, or other irregular motion types.
[0057] To perform intra prediction, the video encoder 200 can select an intra prediction mode to generate a prediction block. Some examples of VVC provide 67 intra prediction modes, including various directional modes as well as planar mode and DC mode. Typically, the video encoder 200 selects an intra prediction mode that describes the neighboring samples to the current block (e.g., the block of the CU) from which the samples of the current block are predicted. Assuming that the video encoder 200 decodes the CTU and CU in raster scan order (from left to right, from top to bottom), these samples can typically be above, above left, or to the left of the current block in the same picture as the current block.
[0058] The video encoder 200 encodes data indicating a prediction mode for the current block. For example, for inter-frame prediction mode, the video encoder 200 may encode data indicating which of various available inter-frame prediction modes to use, as well as motion information for the corresponding mode. For unidirectional or bidirectional inter-frame prediction, for example, the video encoder 200 may use Advanced Motion Vector Prediction (AMVP) or merge mode to encode motion vectors. The video encoder 200 may use a similar mode to encode motion vectors for affine motion compensation mode.
[0059] After a prediction, such as intra-frame prediction or inter-frame prediction, of a block, the video encoder 200 may calculate residual data for the block. The residual data (e.g., a residual block) represents the sample-by-sample difference between the 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 produce 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, such as a mode-dependent non-separable secondary transform (MDNSST), a signal-dependent transform, a Karhunen-Loeve transform (KLT), etc., after the first transform. After applying the one or more transforms, the video encoder 200 produces transform coefficients.
[0060] As described above, after performing any transforms to produce transform coefficients, the video encoder 200 can perform quantization of the transform coefficients. Quantization generally refers to the process of quantizing transform coefficients to potentially reduce the amount of data used to represent them, thereby providing further compression. By performing the quantization process, the video encoder 200 can reduce the bit depth associated with some or all of these transform coefficients. For example, during quantization, the video encoder 200 can round n-bit values to m-bit values, where n is greater than m. In some examples, to perform quantization, the video encoder 200 can perform a bitwise right shift of the value to be quantized.
[0061] After quantization, the video encoder 200 may scan the transform coefficients to produce a one-dimensional vector based on the two-dimensional matrix including the quantized transform coefficients. The scan may be designed to place transform coefficients with higher energy (and therefore lower frequency) at the front of the vector and transform coefficients with lower energy (and therefore higher frequency) at the back of the vector. In some examples, the video encoder 200 may 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 may perform adaptive scanning. After scanning the quantized transform coefficients to form a one-dimensional vector, the video encoder 200 may entropy encode the one-dimensional vector, for example, according to context-adaptive binary arithmetic coding (CABAC). The video encoder 200 may also entropy encode the values of syntax elements that describe metadata associated with the encoded video data for use by the video decoder 300 when decoding the video data.
[0062] To perform CABAC, the video encoder 200 may assign context within a context model to a symbol to be transmitted. For example, the context may relate to whether the symbol's neighboring values are zero. The probability determination may be based on the context assigned to the symbol.
[0063] The video encoder 200 may also generate syntax data (e.g., block-based syntax data, picture-based syntax data, and sequence-based syntax data) for the video decoder 300, for example, in a picture header, a block header, a slice header, or other syntax data (e.g., a sequence parameter set (SPS), a picture parameter set (PPS), or a video parameter set (VPS). The video decoder 300 may similarly decode such syntax data to determine how to decode the corresponding video data.
[0064] In this way, the video encoder 200 can generate a bitstream including the encoded video data, for example, syntax elements for describing the division of a picture into blocks (e.g., CUs), and prediction and / or residual information for these blocks. Ultimately, the video decoder 300 can receive the bitstream and decode the encoded video data.
[0065] In general, the video decoder 300 performs a process reciprocal to that performed by the video encoder 200 to decode the encoded video data of the bitstream. For example, the video decoder 300 may decode the values of the syntax elements of the bitstream using CABAC in a manner substantially similar to (albeit reciprocal to) the CABAC encoding process of the video encoder 200. The syntax elements may define partitioning information for dividing a picture into CTUs, and each CTU may be partitioned according to a corresponding partitioning structure (e.g., a QTBT structure) to define the CUs of the CTU. These syntax elements may further specify prediction and residual information for a block (e.g., a CU) of video data.
[0066] The residual information can be represented by, for example, quantized transform coefficients. The video decoder 300 can 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 can then combine the prediction block and the residual block (on a sample-by-sample basis) to reproduce the original block. The video decoder 300 can perform other processing, such as performing deblocking to reduce visual artifacts along block boundaries.
[0067] Figure 2 is a conceptual diagram illustrating an exemplary general schematic diagram of a quantizer with a video encoder pipeline and a video decoder pipeline, the quantizer being suitable for use in any of a variety of video coding processes (e.g., HEVC, VVC, and other video coding standards). Figure 2 As shown in the example of , video encoder 200 receives video frame (picture) 150. For each block of each video frame 150, video encoder 200 may generate a block 152 of residual data. Video encoder 200 may then apply a transform (e.g., a DCT transform) to block 152 to generate a transform coefficient block 154. Video encoder 200 may scan transform coefficients 154 (156). Quantizer 158 of video encoder 200 may quantize the scanned transform coefficients. Video encoder 200 may apply entropy coding (160) to syntax elements representing the quantized transform coefficients.
[0068] In addition, Figure 2In the example of , the video decoder 300 may apply entropy decoding (162) to the entropy coded syntax elements to determine quantized transform coefficients. A dequantizer 164 of the video decoder 300 may dequantize (i.e., inverse quantize) the quantized transform coefficients and apply an inverse scan 166 to determine inverse quantized transform coefficients 168. The video decoder 300 may apply an inverse transform (e.g., an inverse DCT) (169) to determine reconstructed transform coefficients 168. The video decoder 300 may then generate a reconstructed block 170 based on the reconstructed transform coefficients 168. The reconstructed block 170 may form a portion of a reconstructed frame in a set of reconstructed frames 172.
[0069] As described above, the video encoder 200 can perform quantization. Rate-distortion optimized quantization (RDOQ) is a form of quantization. RDOQ has played an important role in the decoding performance of recent video compression standards (e.g., H.264 / AVS, H.265 / HEVC, VP9, and AV1). In practice, since transform coefficients fill a large part of the encoded bitstream, this scheme significantly reduces the bitrate at the expense of an increase in allowable distortion. However, the goal of multivariable RDOQ optimization is prohibitively expensive to implement in hardware due to two limitations: first, too many clock cycles are required to find the optimal quantization level for each transform coefficient (TC) at encoding time; and second, the ordinary RDOQ algorithm is sequential in nature.
[0070] The present disclosure can address both of these limitations by using a neural network-based approach that infers quantization levels for multiple transform coefficients in a single forward pass and is also capable of parallelizing the inference for many blocks (i.e., inferring quantization levels for multiple blocks in parallel). The method of the present disclosure learns the rate-distortion tradeoff during offline supervised training. In some examples, the present disclosure is based solely on standard network operations running on any existing graphics processing unit (GPU) or neural processing unit (NPU). Therefore, in some examples, there is no need to reserve additional on-chip area for dedicated RDOQ circuitry.
[0071] According to the techniques of the present disclosure, a computing system such as a device can train one or more classes of neural networks (e.g., fully neural convolutional networks and autoregressive models) and can evaluate each neural network as a post-quantization step designed to improve quantization schemes (e.g., scalar quantization (SQ)). Scalar quantization can be used In some examples, scalar quantization can be used. , where x is the transform coefficient, s is the step size, and ∈ is the quantization offset parameter. In addition, the present disclosure describes a data collection algorithm for collecting high-quality labels. Both the fully convolutional model and the autoregressive model can be designed to have low computational cost. The present disclosure integrates the model into the HEVC reference model (HM) or a model for other video coding standards (e.g., Versatile Video Coding (VVC)).
[0072] According to the techniques of this disclosure, video encoder 200 may determine scaled transform coefficients. Determining the scaled transform coefficients may include scaling the transform coefficients of a block of video data according to a given quantization step. Additionally, video encoder 200 may determine scalar quantized coefficients. Determining the scalar quantized coefficients may include applying scalar quantization to the scaled transform coefficients of the block. Subsequently, video encoder 200 may apply a neural network, wherein the neural network determines a corresponding set of probabilities for each corresponding transform coefficient of the block. The corresponding set of probabilities for the corresponding transform coefficients includes a corresponding probability value for each possible adjustment value of a plurality of possible adjustment values. Inputs to the neural network include the scaled transform coefficients and the scalar quantized coefficients. Furthermore, video encoder 200 may determine a quantization level for a particular transform coefficient of the block based on the probability set for the particular transform coefficient. Video encoder 200 may signal the determined quantization level for the particular transform coefficient in a bitstream comprising an encoded representation of the video data.
[0073] The present disclosure generally relates to "signaling" certain information (e.g., syntax elements). The term "signaling" can generally refer to the communication of values for syntax elements and / or other data used to decode encoded video data. That is, the video encoder 200 can signal values for syntax elements in a bitstream. Generally, signaling refers to generating values in the bitstream. As described above, the source device 102 can transmit the bitstream to the destination device 116 in substantially real time or in non-real time, such as when storing syntax elements on the storage device 112 for later retrieval by the destination device 116.
[0074] Figure 3 is a block diagram illustrating an exemplary video encoder 200 that may perform the techniques of this disclosure. Figure 3 This is for explanatory purposes only and should not be considered limiting of the techniques broadly illustrated and described in this disclosure. For ease of illustration, this disclosure describes a video encoder 200 based on VVC (ITU-T H.266 under development) and HEVC (ITU-T H.265) techniques. However, video encoding devices configured to implement other video coding standards can perform the techniques of this disclosure.
[0075] exist Figure 3 In the example of FIG, 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 filtering unit 216, a decoded picture buffer (DPB) 218, and an entropy coding unit 220. In addition, in Figure 3 In the example of FIG, quantization unit 208 includes quantization unit 208 including neural network 211. Any or all of video data memory 230, mode selection unit 202, residual generation unit 204, transform processing unit 206, quantization unit 208, inverse quantization unit 210, inverse transform processing unit 212, reconstruction unit 214, filtering unit 216, DPB 218, entropy coding unit 220, quantization unit 208, and neural network 211 can be implemented in one or more processors or processing circuits. For example, the units of video encoder 200 can be implemented as one or more circuits or logic elements that are part of a hardware circuit or part of a processor, an ASIC, or an FPGA. In addition, video encoder 200 can include additional or alternative processors or processing circuits to perform these functions and other functions.
[0076] 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 the video data memory 230. DPB218 can act as a reference picture memory that stores reference video data for use when the video encoder 200 predicts subsequent video data. Video data memory 230 and DPB 218 can be formed by any of a variety of storage devices, such as dynamic random access memory (DRAM), which includes synchronous DRAM (SDRAM), magnetoresistive RAM (MRAM), resistive RAM (RRAM), or other types of storage devices. Video data memory 230 and DPB 218 can be provided by the same storage device or different storage devices. In various examples, video data memory 230 can be on-chip with other components of the video encoder 200, as shown, or off-chip relative to those components.
[0077] In this 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), nor should they be construed as limited to 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 that the video encoder 200 receives (e.g., video data of a current block to be encoded) for encoding. Figure 1 The memory 106 may also provide temporary storage for outputs from the various units of the video encoder 200 .
[0078] Shown Figure 3 The various units of the video encoder 200 are described 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 functions and are pre-set in the operations that can be performed. Programmable circuits refer to circuits that can be programmed to perform various tasks and provide flexible functions in the operations that can be performed. For example, a programmable circuit can execute software or firmware that causes the programmable circuit to operate in a manner defined by the instructions of the software or firmware. Fixed-function circuits can execute software instructions (e.g., for receiving parameters or outputting parameters), but the type of operation performed by the fixed-function circuit is generally immutable. In some examples, one or more of these units can be different circuit blocks (fixed-function or programmable), and in some examples, one or more of these units can be integrated circuits.
[0079] 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 instructions (eg, object code) for software that the video encoder 200 receives and executes, or another memory (not shown) in the video encoder 200 may store such instructions.
[0080] The video data memory 230 is configured to store received video data. The video encoder 200 can retrieve pictures 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 can be the original video data to be encoded.
[0081] 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 other functional units to perform video prediction according to other prediction modes. For 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.
[0082] The mode selection unit 202 typically coordinates multiple coding passes to test combinations of coding parameters and the resulting rate-distortion values for such combinations. Coding parameters may include: CTU to CU partitioning, prediction mode for a CU, transform type for a CU's residual data, quantization parameter for a CU's residual data, etc. The mode selection unit 202 may ultimately select a combination of coding parameters that has a better rate-distortion value than other tested combinations.
[0083] The video encoder 200 may divide the picture retrieved from the video data memory 230 into a series of CTUs and encapsulate one or more CTUs into a segment. The mode selection unit 202 may divide the CTUs of the picture according to a tree structure (e.g., the QTBT structure or quadtree structure of HEVC described above). As described above, the video encoder 200 may form one or more CUs by dividing the CTUs according to the tree structure. Such CUs may also be generally referred to as "video blocks" or "blocks."
[0084] Typically, mode select unit 202 also controls its components (e.g., motion estimation unit 222, motion compensation unit 224, and intra prediction unit 226) to generate a prediction block for the current block (e.g., the current CU, or, in HEVC, the overlapping portion of a PU and TU). For inter prediction of the current block, motion estimation unit 222 may 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 DPB 218). Specifically, motion estimation unit 222 may calculate values representing how similar potential reference blocks are to the current block, for example, based on sum of absolute differences (SAD), sum of squared differences (SSD), mean absolute difference (MAD), mean squared difference (MSD), and the like. Motion estimation unit 222 may typically perform these calculations using sample-by-sample differences between the current block and the reference block being considered. Motion estimation unit 222 may identify the reference block with the smallest value resulting from these calculations, indicating the reference block that most closely matches the current block.
[0085] 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 the current block in the current picture. Motion estimation unit 222 may then provide the motion vectors to motion compensation unit 224. For example, for unidirectional inter prediction, motion estimation unit 222 may provide a single motion vector, while for bidirectional inter prediction, motion estimation unit 222 may provide two motion vectors. Motion compensation unit 224 may then use the motion vectors to generate a prediction block. For example, 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, motion compensation unit 224 may interpolate the values for the prediction block based on one or more interpolation filters. Furthermore, for bidirectional inter prediction, motion compensation unit 224 may retrieve data for the two reference blocks identified by the corresponding motion vectors and combine the retrieved data, for example, by sample-by-sample averaging or weighted averaging.
[0086] As another example, for intra prediction or intra prediction decoding, 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 pad these calculated values along a defined direction on the current block to produce a prediction block. As another example, for DC mode, the intra prediction unit 226 can calculate the average of the samples adjacent to the current block and generate a prediction block to include this final average value for each sample of the prediction block.
[0087] Mode selection unit 202 provides the prediction block to residual generation unit 204. Residual generation unit 204 receives the original, unencoded version of the current block from video data memory 230 and the prediction block from mode selection unit 202. 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, residual generation unit 204 may also determine the difference between sample values in the residual block to generate the residual block using residual differential pulse code modulation (RDPCM). In some examples, residual generation unit 204 may be formed using one or more subtractor circuits that perform binary subtraction.
[0088] In the example where the mode selection unit 202 divides the CU into PUs, each PU can be associated with a luma prediction unit and a corresponding chroma prediction unit. The video encoder 200 and the video decoder 300 can support PUs of various sizes. As described above, the size of the CU can refer to the size of the luma coding block of the CU, and the size of the PU can refer to the size of the luma prediction unit of the PU. Assuming that the size of a particular CU is 2Nx2N, the video encoder 200 can support PU sizes of 2Nx2N or NxN for intra-frame prediction, and support symmetric PU sizes of 2Nx2N, 2NxN, Nx2N, NxN, etc. for inter-frame prediction. The video encoder 200 and the video decoder 300 can also support asymmetric partitioning of PU sizes of 2NxnU, 2NxnD, nLx2N, and nRx2N for inter-frame prediction.
[0089] In the example where mode select unit 202 does not further split a CU into PUs, each CU may be associated with a luma coding block and a corresponding chroma coding block. As described above, the size of a CU may refer to the size of the luma coding block of the CU. Video encoder 200 and video decoder 300 may support CU sizes of 2Nx2N, 2NxN, or Nx2N.
[0090] For other video coding techniques (e.g., intra-block copy mode coding, affine mode coding, and linear model (LM) mode coding, to name a few), the mode selection unit 202 generates a prediction block for the current block being encoded via various units associated with the coding technique. In some examples (e.g., palette mode coding), the mode selection unit 202 may not generate a prediction block, but instead generate syntax elements that indicate how to reconstruct the block based on the selected palette. In such a mode, the mode selection unit 202 may provide these syntax elements to the entropy coding unit 220 for encoding.
[0091] As described above, the residual generation unit 204 receives video data of 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.
[0092] 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 the transform coefficient block. For example, the transform processing unit 206 may apply a discrete cosine transform (DCT), a directional transform, a Karhunen-Loeve transform (KLT), or a conceptually similar transform to the residual block. In some examples, the transform processing unit 206 may perform multiple transforms (e.g., a primary transform and a secondary transform (e.g., a rotation transform)) on the residual block. In some examples, the transform processing unit 206 does not apply a transform to the residual block.
[0093] 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 based on 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 transform coefficient block associated with the current block by adjusting the QP value associated with the CU. Quantization may result in a loss of information, and thus, the precision of the quantized transform coefficients may be lower than the precision of the original transform coefficients generated by the transform processing unit 206.
[0094] According to one or more techniques of this disclosure, quantization unit 208 may determine scaled transform coefficients. Determining the scaled transform coefficients may include scaling the transform coefficients of the block of video data according to a given quantization step. Furthermore, quantization unit 208 may determine scalar quantized coefficients. Determining the scalar quantized coefficients may include applying scalar quantization to the scaled transform coefficients of the block. Furthermore, quantization unit 208 may apply a neural network to determine a corresponding set of probabilities for each corresponding transform coefficient of the block. The corresponding set of probabilities for the corresponding transform coefficients includes a corresponding probability value for each possible adjustment value of a plurality of possible adjustment values. Inputs to neural network 211 may include the scaled transform coefficients and the scalar quantized coefficients. Quantization unit 208 may determine a quantization level for a particular transform coefficient of the block based on the set of probabilities for the particular transform coefficient.
[0095] 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 based on the transform coefficient block. The reconstruction unit 214 may generate a reconstructed block corresponding to the current block (although possibly 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 in the prediction block generated by the mode selection unit 202 to generate a reconstructed block.
[0096] Filtering unit 216 may perform one or more filtering operations on the reconstructed blocks. For example, filtering unit 216 may perform a deblocking operation to reduce blocking artifacts along the edges of the CU. In some examples, the operations of filtering unit 216 may be skipped.
[0097] The video encoder 200 stores the reconstructed blocks in the DPB 218. For example, in instances where the operation of the filtering unit 216 is not required, the reconstruction unit 214 can store the reconstructed blocks in the DPB 218. In instances where the operation of the filtering unit 216 is required, the filtering unit 216 can store the filtered reconstructed blocks in the DPB 218. The motion estimation unit 222 and the motion compensation unit 224 can retrieve a reference picture from the DPB 218, which is formed by the reconstructed (and possibly filtered) blocks, to perform inter-frame prediction on subsequently encoded pictures. In addition, the intra-frame prediction unit 226 can use the reconstructed blocks in the DPB 218 of the current picture to perform intra-frame prediction on other blocks in the current picture.
[0098] In general, entropy coding unit 220 may entropy encode syntax elements received from other functional components of video encoder 200. For example, entropy coding unit 220 may entropy encode quantized transform coefficient blocks from quantization unit 208. As another example, entropy coding unit 220 may entropy encode prediction syntax elements (e.g., motion information for inter-frame prediction or intra-frame mode information for intra-frame prediction) from mode selection unit 202. Entropy coding unit 220 may perform one or more entropy encoding operations on syntax elements, another example of video data, to generate entropy-encoded data. For example, 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) encoding operation, an exponential Grunt coding operation, or another type of entropy encoding operation on the data. In some examples, entropy coding unit 220 may operate in a bypass mode in which entropy encoding of syntax elements is not performed.
[0099] 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.
[0100] The operations described above are described with respect to blocks. Such descriptions should be understood as operations for luma coding blocks and / or chroma coding blocks. As described above, in some examples, the luma coding blocks and chroma coding blocks are the luma and chroma components of a CU. In some examples, the luma coding blocks and chroma coding blocks are the luma and chroma components of a PU.
[0101] In some examples, the operations performed for luma coding blocks do not need to be repeated for chroma coding blocks. For example, the operations used to identify the motion vector (MV) and reference picture for the luma coding block do not need to be repeated to identify the MV and reference picture for the chroma blocks. Instead, the MV for the luma coding block can be scaled to determine the MV for the chroma blocks, and the reference picture can be the same. For another example, the intra prediction process can be the same for luma coding blocks and chroma coding blocks.
[0102] In this manner, the video encoder 200 represents an example of a device configured to encode video data, the device comprising a memory configured to store the video data, and one or more processing units implemented in circuitry and configured to: determine scaled transform coefficients, wherein determining the scaled transform coefficients comprises scaling the transform coefficients of a block of the video data according to a given quantization step; determine scalar quantized coefficients, wherein determining the scalar quantized coefficients comprises applying scalar quantization to the scaled transform coefficients of the block; apply a neural network, wherein the neural network determines, for each respective transform coefficient of the block, a respective set of probabilities, wherein the respective set of probabilities for the respective transform coefficients comprises a respective probability value for each possible adjustment value of a plurality of possible adjustment values, and an input to the neural network comprises the scaled transform coefficients and the scalar quantized coefficients; determine, based on the set of probabilities for a particular transform coefficient of the block, a quantization level for the particular transform coefficient; and signal the determined quantization level for the particular transform coefficient in a bitstream comprising an encoded representation of the video data.
[0103] Figure 4 is a block diagram illustrating an exemplary video decoder 300 that can perform the techniques of this disclosure. Figure 4 This is for explanatory purposes only and should not be considered limiting of the techniques broadly illustrated and described in this disclosure. For ease of illustration, this disclosure describes a video decoder 300 based on techniques of VVC (ITU-T H.266 under development) and HEVC (ITU-T H.265). However, the techniques of this disclosure may be performed by video coding devices configured to implement other video coding standards.
[0104] exist Figure 4In the example of FIG. 3 , 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 filtering unit 312, and a decoded picture buffer (DPB) 314. Any or all of CPB memory 320, entropy decoding unit 302, prediction processing unit 304, inverse quantization unit 306, inverse transform processing unit 308, reconstruction unit 310, filtering unit 312, and DPB 314 may be implemented in one or more processors or processing circuitry. For example, the units of video decoder 300 may be implemented as one or more circuits or logic elements that are part of a hardware circuit or part of a processor, an ASIC, or an FPGA. Furthermore, video decoder 300 may include additional or alternative processors or processing circuitry to perform these and other functions.
[0105] The prediction processing unit 304 includes a motion compensation unit 316 and an intra prediction unit 318. The prediction processing unit 304 may include other units for performing prediction according to other prediction modes. For example, the prediction processing unit 304 may include a palette unit, an intra-block copy unit (which may form part of the motion compensation unit 316), an affine unit, a linear model (LM) unit, and the like. In other examples, the video decoder 300 may include more, fewer, or different functional components.
[0106] CPB memory 320 may store video data (e.g., an encoded video bitstream) to be decoded by components of video decoder 300. For example, the video data may be encoded from computer readable medium 110 ( Figure 1 ) to obtain video data stored in CPB memory 320. CPB memory 320 may include a CPB that stores encoded video data (e.g., syntax elements) from an encoded video bitstream. Furthermore, CPB memory 320 may store video data other than syntax elements of encoded pictures, for example, temporary data representing outputs from various units of video decoder 300. DPB 314 typically stores decoded pictures, which video decoder 300 may output and / or use as reference video data when decoding subsequent data or pictures of the encoded video bitstream. CPB memory 320 and DPB 314 may be formed from any of a variety of memory devices, such as DRAM (including SDRAM, MRAM, RRAM, or other types of memory devices). CPB memory 320 and DPB 314 may be provided by the same memory device or different memory devices. In various examples, CPB memory 320 may be on-chip with other components of video decoder 300, or off-chip relative to those components.
[0107] Additionally or alternatively, in some examples, video decoder 300 may retrieve the video from memory 120 ( Figure 1 ) to retrieve the decoded video data from the CPB memory 320. That is, the memory 120 may store data as discussed above with reference to the CPB memory 320. Similarly, when some or all of the functions of the video decoder 300 are implemented using software executed by the processing circuitry of the video decoder 300, the memory 120 may store instructions to be executed by the video decoder 300.
[0108] Shown Figure 4 The various units are described to help understand the operations performed by the video decoder 300. These units can be implemented as fixed function circuits, programmable circuits, or a combination thereof. Figure 3 , fixed-function circuits refer to circuits that provide specific functions and are pre-set in the operations that can be performed. Programmable circuits refer to circuits that can be programmed to perform various tasks and provide flexible functions in the operations that can be performed. For example, a programmable circuit can execute software or firmware that causes the programmable circuit to operate in a manner defined by the instructions of the software or firmware. Fixed-function circuits can execute software instructions (for example, to receive parameters or output parameters), but the type of operations performed by the fixed-function circuits is generally immutable. In some examples, one or more of these units can be different circuit blocks (fixed-function or programmable), and in some examples, one or more of these units can be integrated circuits.
[0109] The video decoder 300 may include an ALU, an EFU, digital circuits, analog circuits, and / or a programmable core formed by programmable circuits. In an example where the operation of the video decoder 300 is performed by software executed on the programmable circuits, on-chip or off-chip memory may store instructions (e.g., object code) of the software received and executed by the video decoder 300.
[0110] The entropy decoding unit 302 may receive the encoded video data from the CPB and perform entropy decoding on the video data to reproduce syntax elements. The prediction processing unit 304, the inverse quantization unit 306, the inverse transform processing unit 308, the reconstruction unit 310, and the filtering unit 312 may generate decoded video data based on the syntax elements extracted from the bitstream.
[0111] 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").
[0112] The entropy decoding unit 302 may entropy decode syntax elements defining the quantized transform coefficients of the quantized transform coefficient block, as well as transform information such as a quantization parameter (QP) and / or a transform mode indication. The inverse quantization unit 306 may use the QP associated with the quantized transform coefficient block to determine a degree of quantization and, similarly, determine a degree of inverse quantization for the inverse quantization unit 306 to apply. For example, the inverse quantization unit 306 may 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 comprising the transform coefficients.
[0113] 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 Karhunen-Loeve transform (KLT), an inverse rotational transform, an inverse directional transform, or another inverse transform to the transform coefficient block.
[0114] In addition, prediction processing unit 304 generates a prediction block based on the prediction information syntax element entropy decoded by entropy decoding unit 302. For example, if the prediction information syntax element indicates that the current block is inter-predicted, motion compensation unit 316 may generate a prediction block. In this case, the prediction information syntax element may 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 current block in the current picture. Motion compensation unit 316 may generally generate a prediction block in the same manner as described for motion compensation unit 224 ( Figure 3 ) to perform inter-frame prediction processing in a manner substantially similar to that described herein.
[0115] As another example, if the prediction information syntax element indicates that the current block is intra-predicted, the intra-prediction unit 318 may generate a prediction block according to the intra-prediction mode indicated by the prediction information syntax element. Again, the intra-prediction unit 318 may generally generate a prediction block in the same manner as described with respect to the intra-prediction unit 226 ( Figure 3 The intra prediction unit 318 may retrieve data of neighboring samples of the current block from the DPB 314.
[0116] 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.
[0117] The filtering unit 312 may perform one or more filtering operations on the reconstructed block. For example, the filtering unit 312 may perform a deblocking operation to reduce blocking artifacts along the edges of the reconstructed block. The operations of the filtering unit 312 may not necessarily be performed in all examples.
[0118] The video decoder 300 may store the reconstructed block in the DPB 314. For example, in an example where the operation of the filtering unit 312 is not performed, the reconstruction unit 310 may store the reconstructed block in the DPB 314. In an example where the operation of the filtering unit 312 is performed, the filtering unit 312 may store the filtered reconstructed block 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-frame prediction and previously decoded pictures for subsequent motion compensation. In addition, the video decoder 300 may output a decoded picture (e.g., decoded video) from the DPB 314 for subsequent use in, for example, Figure 1 The display device 118 is displayed on a display device.
[0119] Quantization is part of the video decoding pipeline. In some cases, quantization is the only step in the decoding pipeline where information loss occurs. Currently, video decoding implementations may use greedy search methods or heuristic methods to make quantization decisions. Scalar quantization is used to determine initial quantization values, which can round coefficients by shifting and / or scaling and rounding to the nearest integer value. By perturbing these quantization values, a balance can be achieved between rate (the number of bits required to transmit the signal) and distortion (the loss in quality of the reconstructed signal). Given enough time, an exhaustive search can find the Pareto front of the optimal quantization values for some tradeoff parameter lambda. However, in practice, it may be infeasible to perform such a search online. The present disclosure proposes training a neural network (e.g., neural network 211) and outputting the quantization values produced by the exhaustive search.
[0120] Traditional RDOQ methods use search algorithms with high computational complexity. Due to frame rate constraints and limited on-chip area, these solutions may not be feasible for real-time video decoding on system-on-chip hardware. To determine the (e.g., local) optimal quantization level for a transform coefficient block, any search algorithm must try at least several different quantization levels for each pixel and select the optimal quantization level in real time. An open-source reference implementation of HEVC, called HM, implements a greedy RDOQ algorithm (e.g., see M. Karczewicz, Y. Yan, and I. Chong, “Rate-Distortion Optimized Quantization,” Video Coding Experts Group (VCEG) of ITU-TSG 16Q.6, VCG-AH21, 2008). The method described in this disclosure uses deep learning to learn a search algorithm via a neural network 211, so that a single forward pass of the neural network 211 can infer quantization levels for many transform coefficient blocks in parallel. This can accelerate RDOQ inference by leveraging the parallelization capabilities of the neural network, and the inference performance is faster than traditional methods. For a system on a chip (SoC) (or AI processor) with a dedicated neural processing unit, the implementation of the neural network 211 used by the video encoder 200 does not require any additional on-chip area. The neural network 211 can be trained offline in a supervised manner using a labeled dataset. The neural network 211 can be organized as an input X and a label Y, where when it sees input X, the neural network 211 is trained to predict Y. In the present disclosure, X includes scaled transform coefficients and corresponding scalar quantized transform coefficients. To collect the label Y, an RDOQ algorithm can be used to determine the RDOQ quantized transform coefficients, and Y is the difference between the scalar quantized transform coefficients and the RDOQ quantized transform coefficients.
[0121] A recent development in chip design is the integration of specialized components for neural network inference. By combining neural networks with or replacing domain-specific algorithms, neural processing units (NPUs) can eliminate the need for specialized hardware for different domains that traditionally exists on system-on-chip (SoCs). For example, the image signal processor (ISP) pipeline typically required for high-quality image processing is being completely replaced by neural networks (or has components that can be replaced by neural networks) (see E. Schwartz, R. Giryes, and A.M. Bronstein, “DeepISP: Towards a Learning End-to-End Image Processing Pipeline,” IEEE Transactions on Image Processing, vol. 28, no. 2, pp. 912–923, 2018). From a hardware design perspective, this is a trend because dedicated ISP hardware retains a significant area on the chip. In addition, resources used to optimize NPU power consumption now benefit not only the ISP pipeline, but also all other processing using the NPU.
[0122] Similarly, the latest video compression standard H.265, commonly referred to as HEVC, can be implemented in dedicated hardware (see G. J. Sullivan, J. Ohm, W. Han, and T. Wiegand, “An Overview of the High Efficiency Video Coding (HEVC) Standard,” IEEE Transactions on Circuits and Systems for Video Technology, vol. 22, no. 12, pp. 1649–1668, 2012). Previous work aims to replace or enhance components of the HEVC standard using deep learning, such as intra prediction mode decision (see T. Laude and J. Ostermann, “Deep learning-based intra prediction mode decision for HEVC,” in 2016 Picture Coding Symposium (PCS), IEEE, 2016, pp. 1-5), CU tree split decision (see M. Xu, T. Li, Z. Wang, X. Deng, R. Yang, and Z. Guan, “Reducing complexity in HEVC: A deep learning approach,” in IEEE Transactions on Image Processing, vol. 27, no. 10, pp. 5044–5059, 2018), residual prediction (see Z.-T. Zhang, C.-H, Yeh, L.-W. Kang, and M.-H. Lin, “Efficient CTU-based intra coding for HEVC based on deep learning,” in 2017 Asia Pacific Signal and Information Processing Association Annual Summit and Conference (APSIPA) 661-664), or even intra-frame rate control (see J.-H. Hu, W.-H. Peng, and C.-H. Chung, “Reinforcement Learning for Intra-Frame Rate Control in HEVC / H.265,” in 2018 IEEE International Symposium on Circuits and Systems (ISCAS), IEEE, 2018, pp. 1-5). When standards compliance is not a requirement, end-to-end learned video compression has been proposed as an alternative video decoding pipeline.
[0123] Rate-distortion optimized quantization (RDOQ) is a standards-compliant quantization process known to provide better bit rates than traditional scalar quantization (SQ) (see M. Karczewicz, Y. Ye, and I. Chong, "Rate-distortion optimized quantization," ITU-T Q, Vol. 6, 2008). RDOQ is a form of adaptive quantization in which statistical information about a block is used to determine its quantization level. The original RDOQ process proposes a brute-force search of all possible quantization levels for all coefficients, for example using the Viterbi algorithm. This brute-force search is computationally expensive and difficult to parallelize. Therefore, a brute-force search to find the optimal value may be a worst-case scenario.
[0124] For a given cost trade-off parameter λ, RDOQ can outperform SQ by trading off distortion against bitrate. In practice, the process sets a new quantization level for each transform coefficient by (e.g., approximately) solving the following discrete optimization problem:
[0125] q * =min q D+λR (1)
[0126] In Equation 1, R measures the bit rate, and λ is the Lagrange coefficient. D measures the distortion of the vector of quantized transform coefficients relative to the original vector of scaled transform coefficients.
[0127] In another example, the process determines the quantization level for each transform coefficient by (e.g., approximately) solving the following discrete problem:
[0128] q * =min q D(q,x)+λ·R(q) (1')
[0129] In equation (1'), D(q,x) is a distortion metric (e.g., mean square error) computed between the quantization level q and the scaled transform coefficients x, R(q) is the bit rate associated with encoding q with an entropy encoder, and
[0130] In a real-time encoding-decoding setting and in the presence of (e.g., hardware-imposed) frame rate constraints, these approaches may still be too expensive. Additionally, these approaches may be difficult to parallelize. Furthermore, parallelized versions may be difficult to implement in hardware and may require additional area on the chip for the RDOQ circuitry.
[0131] A promising approach to address both of these issues is to train neural networks to mimic the expensive RDOQ algorithm (e.g., see T.N. Canh, M. Xu, and B. Jeon, “Rate-Distortion Optimized Quantization: A Deep Learning Approach,” Proc. IEEE High Perform. Extreme Comput. Conf, 2018, pp. 1–4, hereafter referred to as “Canh”). This approach requires a trade-off between clock cycles and on-chip area versus multiply-accumulate (MAC) operations and energy consumption. Parallelization can be readily achieved (e.g., because most neural network inference hardware is designed to process batches of multiple data points, as inference hardware allows for passing batches of data as well as individual data points). However, Canh used an expensive Visual Geometry Group (VGG)-based semantic segmentation model with approximately 138 million parameters. See J. Long, E. Shelhamer, and T. Darrell, “Fully Convolutional Networks for Semantic Segmentation,” Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2015, pp. 3431–3440).
[0132] Figure 5A Schematic diagram of the RDOQ pipeline based on neural network is shown. Quantization unit 208 ( Figure 3 ) can be achieved Figure 5A The neural network-based RDOQ pipeline. Figure 5A In the example of , the neural network 211 takes as input the scaled transform coefficients 500 (scaled TC) and the corresponding scalar quantization levels 502 and predicts the additive residual for each transform coefficient. Figure 5A , the pipeline applies (e.g., adds) the network output (i.e., adjustment value 510) and the scalar quantized quantization level (quantized TC) 502 at adder 512 to produce an updated quantization level 514. The video encoder 200 (e.g., HM 16.20 or other encoder) applies a rate-distortion (RD) determination process 516 to determine a rate-distortion estimate 518. The rate-distortion estimate 518 estimates the effect of replacing the quantization level 502 with the updated quantization level 514. The video encoder 200 can calculate the rate-distortion estimate 518 by performing entropy encoding, generating a bit rate, and by calculating a peak signal-to-noise ratio of the original input video and the encoded video.
[0133] Figure 5B is an alternative exemplary schematic diagram of a neural network-based RDOQ pipeline in accordance with one or more techniques of this disclosure. Specifically, Figure 5B is a conceptual diagram illustrating an exemplary schematic diagram of a neural network-based RDOQ pipeline in which the sign of each transform coefficient is ignored during neural network inference. Figure 5BIn the example of , the neural network model takes as input the absolute value scaled transform coefficients (scaled TC) (550) and the quantized transform coefficients (quantized TC) (552). In addition, the video encoder 200 predicts an additive adjustment value (554) for each transform coefficient. To predict the additive adjustment value of the transform coefficient, the video encoder 200 may discard the sign of the transform coefficient (556). In other words, the video encoder 200 may determine the absolute value of the transform coefficient. The video encoder 200 may then apply a neural network (558) to determine the predicted additive adjustment value (554) for the transform coefficient. Figure 5B In the example of , a possible set of adjustment values is {-1, 0}. To obtain the final quantized transform coefficient (updated quantization level) (560), the video encoder 200 adds (562) the adjustment (554) to the absolute value of the quantized transform coefficient. The video encoder 200 inserts the sign (564) back through multiplication (566) to determine the final quantization level (568). The video encoder 200 can then use, for example, the method described above with reference to Figure 5A The described content (572) is used to obtain the rate-distortion estimate (570) of the final quantization level.
[0134] This disclosure extends Canh's work and makes at least the following contributions:
[0135] 1) Two neural architectures for RDOQ: a fully convolutional neural network and an autoregressive network. Compared to Canh’s work, these two architectures have significantly fewer parameters, which makes them potentially both faster and more memory efficient.
[0136] 2) A method for scaling the cross-entropy loss of each transform coefficient according to its empirical impact on the rate distortion of the entire block;
[0137] 3) A method to obtain high-quality training labels to train a neural network to mimic the expensive RDOQ algorithm;
[0138] 4) A method to limit the growth rate due to misclassification of transform coefficients whose corresponding scalar quantization has a quantization level of 0.
[0139] According to one or more techniques of this disclosure, a computing system (e.g., one or more of source device 102, destination device 116, or one or more other devices) trains a neural network to determine a quantization level for each transform coefficient in a given block, e.g., Figure 5A and Figure 5BAs shown in . The computing system can then use heuristic search to collect high-quality training labels. The computing system can then use these training labels as training targets. Thus, in some examples, the network is trained to mimic RDOQ / brute force residuals.
[0140] In some examples, the computing system can train two types of neural networks (i.e., a fully convolutional neural network (CNN) and an autoregressive model (ARM)) on the data. These neural networks can be integrated into a codec (e.g., HM or another codec implementation) to replace conventional RDOQ.
[0141] Frame rate limitations on hardware implementations of video encoders may prohibit the implementation of conventional RDOQ algorithms in hardware. As mentioned previously, such an implementation would require additional chip area reserved for the RDOQ circuitry. These obstacles can be overcome using deep learning approaches, where clock cycles and chip area can be traded off against multiply-accumulate (MAC) operations and energy consumption.
[0142] Let x be a scaled transform coefficient block of size N×N, where the block size N∈{4,8,16,32} corresponds to the block size allowed by HEVC. Let f RDOQ is to map block x to N×N quantization level q RDOQ RDOQ algorithm. In addition, let q SQ is the quantized quantization level obtained using the scalar quantization method.
[0143] Similar to Canh, the computational system can output how q should be SQ Each element of is adjusted to approximate q RDOQ , to train the network to imitate f RDOQ That is, given an input tuple (x,q) of unquantized scalar transform coefficients and their corresponding scalar quantized coefficients SQ ), the network will predict Δ such that Δ+q SQ =f RDOQ (x). In this way, the network performs refinement by converting content-agnostic quantization into improved content-aware quantization. In other words, given an existing quantization vector q SQ , returns a vector Δ such that
[0144] In some examples, the computing system outputs how q should be SQ Each element of is refined to train the network to imitate f RDOQ Specifically, given the unquantized transform coefficients x, the computing system trains the network to output an adjustment value Δ:
[0145]
[0146] In this way, the network quantizes the content-agnostic SQ Convert to improved content-aware quantization To perform refinement. In some examples, the network is used only to predict the residual quantization level and the search can be skipped. The network decision can be applied before the sign bit hiding step of the video decoding pipeline.
[0147] Since the performance of the network is limited by the quality of the labels, the present disclosure proposes to spend additional offline time to further refine the labels provided by RDOQ. The computing system uses a tree search method. First, the unquantized coefficients x are scaled so that the unquantized coefficients are within [0; 8]. For each unquantized scaled coefficient, one or more quantization options (e.g., round up or round down) can be used. An exemplary method includes a local greedy search that exhaustively searches for the lowest cost for each 4×4 coefficient group for a given coefficient order (e.g., raster scan order). In this context, the cost refers to the joint rate-distortion target (as described in Equation 1). This process can be repeated n times. passes Another example is a heuristic search based on the A* algorithm. The obtained quantization level is returned and saved for network training.
[0148] The computing system trains a neural network f on the generated data using supervised learning. For example, the computing system can train a neural network f on the data (X, Δ) generated by the RDOQ solution. The last layer of the network will have N×N×k outputs, where k is the number of possible quantization values. The output of the network can correspond to the unnormalized log probability of each adjustment value. The computing system trains the network to maximize the probability of selecting the quantization value given by the data, or equivalently for all quantization coefficients q i ∈q, minimizing the negative log-likelihood of the data:
[0149]
[0150] In some examples, the computing system trains the network to maximize the probability of selecting the quantized value given by the data, or equivalently for all quantized coefficients q i ∈q, minimizing the negative log-likelihood of the data:
[0151]
[0152] To avoid (infeasible) marginalization on the data distribution, mini-batch gradient descent is used.
[0153] Training a network based on examples of expert trajectories is often called imitation learning (see, for example, S. Schaal, “Is imitation learning a route to humanoid robots?”, Trends in Cognitive Sciences, vol. 3, no. 6, pp. 233-242, 1999) (or specifically, behavioral cloning). In practice, the performance of the network f is influenced by the performance of the expert (f FROQ ) performance limit. That is, the trained network will only be as good as the training labels provided. In this task, obtaining and providing the best labels (quantization levels) for our data can be computationally prohibitive. However, the quality of the training labels can be improved through offline search methods. At test time, the network is only used to predict the residual quantization level, and the search is skipped.
[0154] It is possible to discard the signs of the input variables during the forward pass of the neural network, e.g. Figure 5B As shown in (556) of . The video encoder 200 inserts the sign after adding the adjustment value. Because the sign is irrelevant to the quantization decision, discarding the sign can simplify the optimization problem and make the network (e.g., neural network 558) easier to train. All inputs to the network (e.g., neural network 558) can be normalized to be distributed according to a standard normal distribution by subtracting the empirical mean and scaling according to the empirical standard deviation that can be obtained from the training data set. Because the input data statistics can vary significantly between different QPs and prediction structures, a separate model can be trained for each pair of QPs and prediction structures.
[0155] In some examples, the computing system trains two types of neural networks: feedforward networks and / or autoregressive networks. In addition, in some examples, to simplify the learning task, the training objective can be set to be scalar quantized coefficients q SQ With the training target q RDOQ The difference between Δ and the clipping Δ is such that all training targets are in a finite set. In addition, in some examples, clipping can be used to limit the adjustment value to a subset of possible adjustment values. For example, to limit the adjustment value to the set {-1, 0; 1}, the following formula can be used:
[0156] Δ=min(max(q RDOQ -q SQ ,-1),1) (3)
[0157] The training set can consist of tuples of the form (X; Y), where X:=(x; q SQ ) or their variations, and in Figure 5A and Figure 5BThe inference process is described in
[15] . To reduce the number of possible training targets, values less than -1 and greater than +1 are deleted. In other examples, the training targets are located in {-1, 0}.
[0158] The computing system can train two types of neural architectures: feedforward fully convolutional models (FCNs) and autoregressive models (ARMs). Feedforward models are fast because they only require a single inference process to obtain predictions for all coefficients. In contrast, autoregressive models can make one-to-one predictions, which may make them slower than FCNs but allows for modeling of data with higher complexity. Figure 5B The inference process for these two types of networks is described in .
[0159] Fully Convolutional Neural Network: In some examples, the fully convolutional neural network f FCN The input of may include scaled transform coefficients x (eg, unquantized coefficients) and scalar quantization level q SQ (eg, a baseline quantization level for scalar quantization) or some transformation thereof, and simultaneously outputs the probabilities of all k possible adjustment values (eg, 2, 3 possible adjustment values) for each transform coefficient.
[0160] LogP(Δ|q,q SQ )∝f FCN (x,q SQ ) (4)
[0161] This approach is similar to the one in T.N. Canh, M. Xu, and B. Jeon, “Rate-Distortion Optimized Quantization: A Deep Learning Approach,” Proc. IEEE High Perform. Extreme Comput. Conf, 2018, pp. 1–4, which also uses a fully convolutional architecture. Compared to RDOQ, this approach has the advantage of eliminating the need for search and using a single neural network forward call to obtain the adjusted value, which can be easily executed on dedicated hardware already present on the chip.
[0162] Autoregressive Networks: A potential drawback of using a feed-forward network (e.g., a fully convolutional network) is that the joint decisions made by the feed-forward network for all coefficients simultaneously may limit the quality of the prediction. The reason for this is that the best decision for a single transform coefficient may depend on the decisions of all other transform coefficients. In addition, some decisions may be more important than others for the final cost because the distribution of quantized values is different at each position in the block. For this reason, this disclosure explores autoregressive neural networks that, for a given coefficient order (e.g., raster scan order), adjust their decision across all previous coefficients Δ <iThe output of the transform coefficient I is:
[0163] P(Δ|q,q SQ ,Δ <i )∝ARM(q,q SQ ,Δ <i ) (5)
[0164] Similar to the feedforward case, the joint negative log likelihood is minimized, which can be expressed as the product of conditions:
[0165]
[0166] Here, the conditioning of the first coefficient when i=1 is equal to In another example, the joint negative log-likelihood can be expressed as a product of conditions:
[0167]
[0168] In formula (6'), the first coefficient i=1 is based only on The original transform coefficients.
[0169] Autoregressive neural networks can be designed in a way that parallelizes inference (see Y. Bengio and S. Bengio, “Modeling High-Dimensional Discrete Data with Multilayer Neural Networks,” Advances in Neural Information Processing Systems, 2000, pp. 400–406, and H. Larochelle and I. Murray, “Neural Autoregressive Distribution Estimators,” Proceedings of the Fourteenth International Conference on Artificial Intelligence and Statistics, 2011, pp. 29–37), which use a scheme called teacher forcing for efficient training. Instead of predicting the output value one by one and filling in the previous prediction, The ground truth is given as a condition. In other words, instead of making predictions one by one (i.e., using predictions for all i ), but rather for all time steps, the ground truth Δ <i Provided to ARM to generate predictions in parallel As a result, video encoder 200 queries the network (e.g., neural network 558) only once during training.
[0170] However, at test time when no ground truth is available, obtaining full predictions The number of network queries required can be equal to the dimension of the block: N 2 When runtime efficiency is the primary consideration, this makes autoregressive neural networks a less attractive choice than feedforward networks. Recent work has alleviated this problem by exploiting the fact that conditional probabilities do not depend on all previous outputs (e.g., see AJ Wiggers and E. Hoogeboom, “Predictive Sampling with Predictive Autoregressive Models,” arXiv preprint arXiv:2002.09928, 2020). The techniques of the present disclosure can also take advantage of this approach because it allows exploiting data imbalances to potentially reduce sampling time.
[0171] As mentioned elsewhere in this disclosure, we explored two neural network architectures for our experiments: a fully convolutional neural network (FCN) and an autoregressive model (ARM) with global conditioning. In different examples, the number of layers, kernel size (for FCN), number of hidden units / channels per layer, activation function, learning rate, use of BatchNorm (e.g., see S. Ioffe and C. Szegedy, “Batch Normalization: Accelerating Deep Network Training by Reducing Internal Covariate Shift,” in Proceedings of the 32nd International Conference on Machine Learning - Volume 37, ser. ICML'15. JMLR.org, 2015, pp. 448-456) and Dropout (e.g., see N. Srivastava, G. Hinton, A. Krizhevsky, I. Sutskever, and R. Salakhutdinov, “Dropout: A Simple Method to Prevent Overfitting in Neural Networks,” in J. Mach. Learn. Res., vol. 15, no. 1, p. 1929-1958, Jan. 2014), and other aspects may vary.
[0172] The FCN architecture can include (or consist of) multiple 2D convolutional layers with fixed kernel size and channel depth. Each layer can be followed by a dropout layer or a BatchNorm layer and a ReLU nonlinearity with a predetermined dropout probability p. Zero padding can be used if necessary to ensure that the output height and width dimensions of each layer remain constant. The last convolutional layer can perform a 1×1 convolution and can have a channel depth equal to k (the number of possible adjustment values). In some examples, the channel depth is equal to 3 to output logits for each predicted class (in the order of -1, 0, and +1). In other examples, the channel depth is equal to 2 or other values.
[0173] Figure 6A is an exemplary fully convolutional network 600 according to one or more techniques of this disclosure. Figure 6A As shown in the example of , the input data 602 provided to the network 600 may include DCT coefficients of a square block. In some examples, the input data 602 includes scaled transform coefficients and quantized transform coefficients. The network 600 includes a first set of layers 604, a second set of layers 606, and a third set of layers 608. Each of the layer sets 604, 606, 608 includes a convolutional network in which neurons have a two-dimensional 3x3 receptive field (i.e., 3x3 Conv2D). The output of the convolutional network is processed by a two-dimensional batch normalization layer (Batchnorm2D) or a two-dimensional dropout layer (Dropout2D). The output of the Batchnorm2D layer or the dropout2D layer is processed by a rectified linear unit (ReLU) layer. The output of the layer set 608 is provided to a convolutional layer 610, in which each neuron has a two-dimensional 1x1 receptive field (i.e., 1x1 Conv2D). The network 600 also includes an output layer 612 that receives the output of the convolutional layer 610. In Figure 6A In the example of , the output layer 612 applies the logit function to the output of the convolutional layer 610 to generate a probability value (e.g., a log probability) of the potential adjustment value (which can be referred to as a residual in this context).
[0174] Figure 6B is another exemplary fully convolutional network 650 in accordance with one or more techniques of this disclosure. Figure 6B In the example of FIG, network 650 includes layer sets 652, 654, and 656. Similar to layer sets 604, 606, and 608 ( Figure 6A ), each of the layer sets 652, 654, and 656 includes a 3x3 Conv2D network, a batchnorm2D or dropout2D layer, and a ReLU layer. Figure 6B In the example of FIG, network 650 receives input data 658. Input data 658 may include scaled transform coefficients and quantized transform coefficients. In addition, network 650 includes a normalization layer 660 that normalizes input data 658, for example, by subtracting the empirical mean of the data set and dividing by the empirical standard deviation. Layer set 652 receives the normalized input data.
[0175] The network 650 also includes a convolutional layer 662, where each neuron has a two-dimensional 1x1 receptive field (i.e., 1x1Conv2D). The convolutional layer 662 processes the output of the layer set 656. The network 600 includes an output layer 664 that applies an argmax function to the output of the convolutional layer 662 to generate the output of the network 650.
[0176] Figure 7Ais a conceptual diagram illustrating an exemplary schematic diagram of an autoregressive model (ARM) architecture 700 with a conditioning layer, according to one or more techniques of the present disclosure. Figure 7A In the example of , the ARM architecture 700 includes (or consists of) two tracks: a conditioning layer 702 and an autoregressive layer 704. The conditioning layer 702 and the autoregressive layer 704 are connected by a gated fully connected layer 706. The autoregressive layer 704 takes as input a one-hot encoded adjustment Δ, where the one-hot encoded adjustment vector contains: the number 1 in the vector element corresponding to the adjustment decision of the RDOQ recorded in the dataset, and the number 0 for all other elements in the vector, while the conditioning layer 702 uses the same input as the convolutional neural network (CNN). Each strictly triangular layer is a linear layer that masks the weights in a way that preserves the autoregressive structure: the i-th output channel depends only on the input Δ <i . This imposes an order on the coefficients. In some examples, a raster scan order is used. However, in other examples, any scan order can be used. Each of the gate layers 706 can include (or consist of) a fully connected layer that outputs 2n channels. The first n channels are passed through a sigmoid, and the result is then multiplied by the last n channels.
[0177] As mentioned above, Figure 7A is a schematic diagram of an ARM with a conditioning layer 702. The first ARM layer can use causality through a strict triangular weight layer to ensure that the temporal dependency of consecutive residuals is not violated. Each ARM layer can receive global information about the block (e.g., quantization level for scalar quantization and scaled transform coefficients) from the conditioning network via a corresponding hidden layer. Each ARM layer and / or conditioning layer can be followed by a dropout layer with a predetermined dropout probability p or a BatchNorm layer and a ReLU nonlinearity.
[0178] exist Figure 7B Another exemplary ARM architecture 750 is shown in FIG. ARM architecture 750 is similar to ARM architecture 700 ( Figure 7A ), except that the second layer of each layer set uses dropout instead of batchnorm.
[0179] In addition to changing the architecture and hyperparameters of a neural network (e.g., neural network 558) during training, several variations on the training method can be used to potentially achieve stronger performance.
[0180] Different input transforms and input types can be considered. Examples include scalar quantized transform coefficients with and without offsets. For scalar quantized transform coefficients with offsets, the video encoder 200 can use scalar quantization with offset HM16.20 (i.e., HM-SQ). The scaled transform coefficient input can also be a variable input, where instead of the scaled transform coefficients obtained from HM16.20, an offset between the scaled transform coefficients and the quantized transform coefficients can be used, the offset being equal to the information lost due to quantization.
[0181] Adjustment Values: The number of output classes, k, determines the set of adjustment values. Because the goal of this disclosure is to reduce the bit rate per picture, any such set should contain at least {-1, 0}. Setting k = 2 limits the set of possible decisions that the model (e.g., neural network 558) can make. However, the adjustment value distribution may peak at 0, and the convenience of binary classification training may outweigh the limited decision-making power of the model.
[0182] Loss Scaling: When the video encoder 200 uses HM16.20 to obtain accurate rate estimates, it may not be possible to use stochastic gradient descent to train the network (e.g., neural network 558) to directly optimize rate distortion. This limitation may hinder the training of powerful models because the cross-entropy loss may not always be appropriate for rate distortion. This is due to the fact that cross-entropy penalizes all classification errors equally across all classes and transform coefficients. However, this symmetry does not exist in the rate-distortion function used in video decoding. Incorrectly outputting Δ as 0 instead of Δ as -1 has a different impact on the cost than a reverse classification error (i.e., Δ as -1 instead of Δ as 0). Similarly, a classification error in the upper left transform coefficient in a block (i.e., the DC transform coefficient) has a different impact on rate distortion than the same error in another transform coefficient. However, using cross-entropy as the loss function when training the network can penalize these classification errors equally.
[0183] To alleviate this limitation, a rate-distortion sensitivity map can be computed that scales the cross-entropy loss at each transform coefficient according to its empirical contribution to rate distortion relative to the other transform coefficients. The use of a rate-distortion sensitivity map can place greater emphasis on transform coefficients that have a larger impact on the rate distortion of a block. The map is computed by taking the sum of the absolute values of the rate-distortion changes caused by a single-sided shift (e.g., -1 or +1) of the quantized transform coefficients in the training set and dividing it by the sum of these values over all transform coefficients so that the sum is 1. During training, the cross-entropy value at each transform coefficient can be multiplied by the corresponding scalar value in the map.
[0184] Thus, in some examples, as part of training a neural network, a device (e.g., source device 102 or another device) can determine a cross-entropy loss of an output of the neural network (e.g., a determined quantization level for a particular transform coefficient). The device can then scale the cross-entropy loss of the neural network based on the rate-distortion sensitivity map. The device can train the neural network based on the scaled cross-entropy loss. For example, the device can perform a backpropagation algorithm using the scaled cross-entropy loss to update parameters of the neural network.
[0185] As mentioned previously, the distribution of adjusted values may be severely skewed. To facilitate training, class balancing can be used to increase the weight of less frequent classes relative to the dominant class 0. The value used for class balancing can be determined by grid search.
[0186] Zero Masking: To limit any potential increase in rate of prediction by a neural network (e.g., neural network 558), adjustments to transform coefficients with an HM-SQ level of zero can be discarded during training and / or inference. This can be accomplished by overwriting the output of the network for transform coefficients with an HM-SQ level of zero, maximizing the probability that the adjustment value is zero. The rate increase from changing 0 → + / - 1 may be too costly for any potential reduction in distortion caused by changing 0 → + / - 1.
[0187] In various examples, the video encoder 200 can use networks (e.g., neural network 558) with different numbers of layers, kernel sizes (for FCNs), activation functions, learning rates, and / or other features. In some examples, during training, the computing system can use BatchNorm (see S. Ioffe and C. Szegedy, "Batch Normalization: Accelerating Deep Network Training by Reducing Internal Covariate Shift," in Proceedings of the 32nd International Conference on Machine Learning - Volume 37, ser. ICML'15. JMLR.org, 2015, pp. 448-456) and Dropout (see, for example, N. Srivastava, G. Hinton, A. Krizhevsky, I. Sutskever, and R. Salakhutdinov, "Dropout: A Simple Method to Prevent Overfitting in Neural Networks," J. Mach. Learn. Res, vol. 15, no. 1, p. 1929-1958, Jan. 2014). In addition, the rate-distortion sensitivity map and class balance can be varied.
[0188] In both FCN and ARM, the input to the network (e.g., neural network 558) is the same and is described below. The network operates at the level of each block b. The input to the network is the quantization level q for b and the scalar transform coefficients SQ The quantization level q may be determined based on scalar quantization and, in some examples, other additional transforms (e.g., absolute value transforms) of the transform coefficients of block b. SQ The scalar transform coefficients may be determined by applying scalar quantization to the scaled transform coefficients, and in some examples by applying other additional transforms (eg, absolute value transforms) to the scaled transform coefficients.
[0189] Figure 8 is a flowchart illustrating an example method for encoding a current block. The current block may include a current CU. Although referring to the video encoder 200 ( Figure 1 and Figure 3 ) is described, but it should be understood that other devices may also be configured to perform the same Figure 8 Similar approach.
[0190] In this example, the video encoder 200 initially predicts a current block (350). For example, the video encoder 200 may form a prediction block for the current block. The video encoder 200 (e.g., the residual generation unit 204 of the video encoder 200) may then calculate a residual block for the current block (352). 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 the residual block and quantize the transform coefficients of the residual block (354). For example, in Figure 3 In the context of , the transform processing unit 206 may transform the residual block, and the quantization unit 208 may quantize the obtained transform coefficients. According to one or more techniques of this disclosure, the video encoder 200 (e.g., the quantization unit 208 of the video encoder 200) may use the deep learning techniques of this disclosure as part of quantizing the transform coefficients to perform RDOQ.
[0191] Then, in Figure 8 In the example of FIG. 3 , video encoder 200 may scan the quantized transform coefficients of the residual block ( 356 ). During or after the scanning, video encoder 200 (e.g., entropy coding unit 220 of video encoder 200 ) may entropy encode the transform coefficients ( 358 ). For example, video encoder 200 may encode the transform coefficients using CAVLC or CABAC. Video encoder 200 may then output entropy coded data for the block, e.g., in a bitstream ( 360 ).
[0192] Figure 9is a flow chart illustrating an example method for decoding a current block of video data. The current block may include a current CU. Although referring to the video decoder 300 ( Figure 1 and Figure 4 ) is described, but it should be understood that other devices may also be configured to perform the same Figure 9 Similar approach.
[0193] The video decoder 300 may receive entropy-encoded data for a current block, e.g., entropy-encoded prediction information and entropy-encoded data for transform coefficients of a residual block corresponding to the current block (370). The video decoder 300 (e.g., an entropy decoding unit 302 of the video decoder 300) may entropy decode the entropy-encoded data to determine prediction information for the current block and reproduce transform coefficients of the residual block (372). The video decoder 300 may predict the current block (374), e.g., using an intra-frame or inter-frame prediction mode as indicated by the prediction information for the current block, to calculate a prediction block for the current block. Figure 4 In the context of , prediction processing unit 304 of video decoder 300 may predict the current block (i.e., generate a prediction block for the current block). Video decoder 300 may then inverse scan (376) the reproduced transform coefficients to create a block of quantized transform coefficients. Video decoder 300 may then inverse quantize the transform coefficients and apply an inverse transform to the transform coefficients to produce a residual block (378). For example, in Figure 4 In the context of
[0045] , inverse quantization unit 306 may inverse quantize the transform coefficients, and inverse transform processing unit 308 may apply an inverse transform to the transform coefficients. According to one or more techniques of this disclosure, the transform coefficients may have been quantized using an RDOQ process. Video decoder 300 may ultimately decode the current block by combining the prediction block and the residual block (380).
[0194] Figure 10 is a flowchart illustrating an example method for encoding video data according to one or more techniques of this disclosure. Figure 1 and Figure 3 ) is described, but it should be understood that other devices may also be configured to perform the same Figure 10 Similar approach.
[0195] exist Figure 10 In the example of FIG. 1 , the quantization unit 208 determines scaled transform coefficients ( 1000 ). To determine the scaled transform coefficients, the quantization unit 208 may scale the transform coefficients of the block of video data according to a given quantization step.
[0196] In addition, Figure 10In the example of , the quantization unit 208 may determine scalar quantized coefficients (1002). To determine the scalar quantized coefficients, the quantization unit 208 may apply scalar quantization to the scaled transform coefficients of the block. For example, the quantization unit 208 may use the formula To determine the scaled transform, x is the scaled transform coefficient, s is the step size, and ∈ is the quantization offset parameter. In other words, to determine the scalar quantized coefficient, the quantization unit 208 may determine, for each scaled transform coefficient in the scaled transform coefficients, a scalar quantized coefficient corresponding to the scaled transform coefficient as an output of a floor function equal to a first value. The first value is equal to the second value plus the quantization offset parameter. The second value is equal to the scaled transform coefficient divided by the step size.
[0197] In other examples, the quantization offset parameter is not used. Thus, in such examples, to determine the scalar quantized coefficient, the quantization unit 208 may determine, for each scaled transform coefficient, the scalar quantized coefficient corresponding to the scaled transform coefficient as an output of a floor function equal to a first value, where the first value is equal to the scaled transform coefficient divided by the step size.
[0198] In addition, Figure 10 In an example, the quantization unit 208 applies the neural network 211 to determine a corresponding set of probabilities for each corresponding transform coefficient of the block (1004). The corresponding set of probabilities for the corresponding transform coefficient includes a corresponding probability value for each possible adjustment value of a plurality of possible adjustment values. In some examples, the plurality of possible adjustment values consists of {-1, 0}. In other examples, the plurality of possible adjustment values consists of {-1, 0, 1}. In some examples, the corresponding probability value for each possible adjustment value of the plurality of possible adjustment values is an unnormalized log probability of the possible adjustment value.
[0199] The inputs to the neural network include scaled transform coefficients and scalar quantized coefficients. In some examples, the neural network 211 is a fully convolutional neural network, e.g., as described elsewhere in this disclosure. In other examples, the neural network 211 is an autoregressive network, e.g., as described elsewhere in this disclosure.
[0200] As discussed elsewhere in this disclosure, a computing system (which may include video encoder 200) can train neural network 211. As part of training neural network 211, the computing system can use a heuristic search to collect training labels. The computing system can use these training labels as training targets during the training process for the neural network. In some examples, neural network 211 is trained to mimic a rate-distortion optimization algorithm that performs a brute-force search over all possible quantization levels for the transform coefficients of a block.
[0201] exist Figure 10 In the example of , the quantization unit 208 determines a quantization level for a particular transform coefficient of the block based on the probability set for the particular transform coefficient ( 1006 ). For example, the quantization unit 208 may determine a most probable adjustment value for the particular transform coefficient among a plurality of possible adjustment values based on the probability set for the particular transform coefficient. Additionally, in this example, the quantization unit 208 may determine an update value for the particular transform coefficient by adding the most probable adjustment value for the particular transform coefficient to the absolute value of the particular transform coefficient (e.g., as in ). Figure 5B 562 of ). Quantization unit 208 may then determine the quantization level for the particular transform coefficient by multiplying the update value for the particular transform coefficient by the sign value of the particular transform coefficient (e.g., as shown in FIG. 564 ). Figure 5B 566 of the .
[0202] In some examples, as part of determining the scalar quantized coefficients, quantization unit 208 may discard sign information for the scalar quantized coefficients and discard sign information for the scaled transform coefficients (e.g., as Figure 5B 556 of ). Furthermore, in such examples, as part of determining the quantization level for a particular transform coefficient, the quantization unit 208 may determine an adjustment value for the particular transform coefficient based on the set of probabilities for the particular transform coefficient. For example, the quantization unit 208 may determine the adjustment value as the adjustment value with the greatest probability. Figure 5B In the context of , the adjustment value may be one of the adjustment values 554. After discarding the sign information of the scaled transform coefficients, the quantization unit 208 may quantize the scaled transform coefficient by adding the scalar quantized coefficient corresponding to the particular transform coefficient to the adjustment value for the particular transform coefficient (e.g., Figure 5B ), to determine an updated quantization level for that particular transform coefficient (e.g., Figure 5B quantization unit 208 may then multiply the updated quantization level for a particular transform coefficient by the sign of the scalar quantized coefficient corresponding to the particular transform coefficient (e.g., Figure 5B 564) to determine the quantization level for that particular transform coefficient (e.g., Figure 5B 566 of the .
[0203] Video encoder 200 may signal the determined quantization level for the particular transform coefficient in a bitstream comprising an encoded representation of the video data (1008).Video encoder 200 may repeat steps 1006 and 1008 for each transform coefficient of the block.
[0204] The following is a non-limiting collection of examples that may be used in accordance with one or more techniques of this disclosure.
[0205] Example 1. A method of encoding video data, the method comprising: determining scaled transform coefficients, wherein determining the scaled transform coefficients comprises: scaling transform coefficients of a block of the video data according to a given quantization step; determining scalar quantized coefficients, wherein determining the scalar quantized coefficients comprises: applying scalar quantization to the scaled transform coefficients of the block; applying a neural network for determining a respective set of probabilities for each respective transform coefficient of the block, wherein the respective set of probabilities for the respective transform coefficients comprises a respective probability value for each possible adjustment value of a plurality of possible adjustment values, and an input to the neural network comprises the scaled transform coefficients and the scalar quantized coefficients; determining a quantization level for a particular transform coefficient of the block based on the set of probabilities for the particular transform coefficient; and signaling the determined quantization level for the particular transform coefficient in a bitstream comprising an encoded representation of the video data.
[0206] Example 2. The method of Example 1, wherein the neural network is a fully convolutional neural network.
[0207] Example 3. The method of Example 1, wherein the neural network is an autoregressive network.
[0208] Example 4. The method according to any one of Examples 2-3 further includes: using a heuristic search to collect training labels; and using the training labels as training targets during the training process for the neural network.
[0209] Example 5. The method of any one of Examples 1-4, wherein the plurality of possible adjustment values consists of {-1, 0}.
[0210] Example 6. The method of any of Examples 1-5, wherein the neural network is trained to emulate a rate-distortion optimization algorithm that performs a brute-force search over all possible quantization levels of the transform coefficients of the block.
[0211] Example 7. The method of any one of Examples 1-6, wherein determining the quantization level for the specific transform coefficient comprises: determining a most probable adjustment value for the specific transform coefficient from the plurality of possible adjustment values based on the probability set for the specific transform coefficient; determining an update value for the specific transform coefficient by adding the most probable adjustment value for the specific transform coefficient to an absolute value of the specific transform coefficient; and determining the quantization level for the specific transform coefficient by multiplying the update value for the specific transform coefficient by a sign value of the specific transform coefficient.
[0212] Example 8. The method of any of Examples 1-7, wherein the corresponding probability value for each possible adjustment value of the plurality of possible adjustment values is an unnormalized log probability for the possible adjustment value.
[0213] Example 9. The method of any one of Examples 1-8, wherein determining the scalar quantized coefficient comprises, for each of the scaled transform coefficients, determining the scalar quantized coefficient corresponding to the scaled transform coefficient as an output of a floor function equal to a first value, wherein: the first value is equal to a second value plus a quantization offset parameter, and the second value is equal to the scaled transform coefficient divided by a step size.
[0214] Example 10. The method of any one of Examples 1-8, wherein determining the scalar quantized coefficient comprises, for each of the scaled transform coefficients, determining the scalar quantized coefficient corresponding to the scaled transform coefficient as an output of a floor function equal to a first value, wherein the first value is equal to the scaled transform coefficient divided by a step size.
[0215] Example 11. The method of any one of Examples 1-10, wherein: determining the scalar quantized coefficient comprises: discarding sign information of the scalar quantized coefficient, the method further comprising discarding sign information of the scaled transform coefficient, and determining the quantization level for the specific transform coefficient comprises: determining an adjustment value for the specific transform coefficient based on the probability set for the specific transform coefficient; determining an updated quantization level for the specific transform coefficient by adding the scalar quantized coefficient corresponding to the specific transform coefficient to the adjustment value for the specific transform coefficient after discarding the sign information of the scaled transform coefficient; and determining the quantization level for the specific transform coefficient by multiplying the updated quantization level for the specific transform coefficient by the sign of the scalar quantized coefficient corresponding to the specific transform coefficient.
[0216] Example 12. An apparatus for encoding video data, the apparatus comprising: one or more means for performing the method of any of Examples 1-11.
[0217] Example 13. The apparatus of Example 12, wherein the one or more units include one or more processors implemented in circuitry.
[0218] Example 14. The apparatus of any one of Examples 12 and 13, further comprising a memory for storing the video data.
[0219] Example 15. The apparatus of any of Examples 12-14, further comprising a display configured to display the decoded video data.
[0220] Example 16. The device of any of Examples 12-15, wherein the device comprises one or more of a camera, a computer, a mobile device, a broadcast receiver device, or a set-top box.
[0221] Example 17. The device of any of Examples 12-16, wherein the device comprises a video decoder.
[0222] Example 18. The apparatus of any of Examples 12-17, wherein the apparatus comprises a video encoder.
[0223] Example 19. A computer-readable storage medium having instructions stored thereon that, when executed, cause one or more processors to perform the method of any of Examples 1-11.
[0224] It should be appreciated that, depending on the examples, certain actions or events of any of the techniques described herein may be performed in a different order, may be added, combined, or omitted entirely (e.g., not all described actions or events are required to implement the technique). Furthermore, in some examples, actions or events may be performed concurrently rather than sequentially, such as through multithreading, interrupt handling, or multiple processors.
[0225] In one or more examples, the functions described may be implemented using hardware, software, firmware, or any combination thereof. When implemented using software, the functions may be stored on a computer-readable medium or transmitted 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, where communication media includes any media that facilitates the transfer of a computer program from one place to another, such as according to a communication protocol. In this manner, computer-readable media may generally correspond to: (1) a non-transitory tangible computer-readable storage medium; or (2) a communication medium such as a signal or carrier waveform. Data storage media may be any available medium that can be accessed by one or more computers or one or more processors to obtain instructions, codes, and / or data structures for implementing the techniques described in this disclosure. A computer program product may include computer-readable media.
[0226] By way of example, but not limitation, such computer-readable storage media may include RAM, ROM, EEPROM, CD-ROM or other optical disk storage, magnetic disk storage or other magnetic storage devices, flash memory, or any other medium capable of storing desired program code in the form of instructions or data structures and capable of being accessed by a computer. In addition, any connection may be appropriately referred to as a computer-readable medium. For example, if instructions are transmitted from a website, server, or other remote source using a coaxial cable, fiber optic cable, twisted pair, digital subscriber line (DSL), or wireless technologies such as infrared, wireless, and microwave, then the coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, wireless, and microwave 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 waveforms, signals, or other temporary media, but rather are directed to non-temporary tangible storage media. As used herein, disks and optical disks include compact discs (CDs), laser discs, optical discs, digital versatile discs (DVDs), floppy disks, and Blu-ray discs, where disks typically reproduce data magnetically, while optical discs use lasers to reproduce data optically. The above combinations should also be included within the scope of protection of computer-readable media.
[0227] Instructions can be performed by one or more processors implemented using circuits 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. Therefore, as used herein, the terms "processor" and "processing circuitry" can refer to any of the aforementioned structures or any other structures suitable for implementing the techniques described herein. In addition, in some aspects, the functions described herein can be provided in dedicated hardware and / or software modules configured to implement encoding and decoding, or incorporated into a combined codec. In addition, these techniques can be fully implemented in one or more circuits or logic elements.
[0228] The techniques of the present disclosure can be implemented using a variety of devices or apparatuses, including using a wireless handheld device, an integrated circuit (IC), or a set of ICs (e.g., a chipset). Various components, modules, or units are described in this disclosure to emphasize the functional aspects of the apparatus configured to perform the disclosed techniques, but do not necessarily need to be implemented by different hardware units. Instead, as described above, the various units can be combined in a codec hardware unit, or provided by a collection of cooperating hardware units (which include one or more processors as described above) in combination with appropriate software and / or firmware.
[0229] Various examples are described. These and other examples are within the scope of protection of the following claims.
Claims
1. A method for encoding video data, the method comprising: determining scaled transform coefficients, wherein determining the scaled transform coefficients comprises: scaling the transform coefficients of the block of the video data according to a given quantization step; determining scalar quantized coefficients, wherein determining the scalar quantized coefficients comprises: applying scalar quantization to the scaled transform coefficients of the block of video data; applying a neural network for determining a respective set of probabilities for each respective transform coefficient of the block of video data, wherein: The respective set of probabilities for the respective transform coefficient comprises a respective probability value for each possible adjustment value of a plurality of possible adjustment values for the respective transform coefficient, and The input of the neural network includes the scaled transform coefficients and the scalar quantized coefficients; determining a quantization level for a particular transform coefficient among the corresponding transform coefficients for the block of video data based on the set of probabilities for the particular transform coefficient; and The determined quantization level for the particular transform coefficient is signaled in a bitstream comprising an encoded representation of the video data.
2. The method according to claim 1, wherein The neural network is a fully convolutional neural network.
3. The method according to claim 1, wherein The neural network is an autoregressive network.
4. The method according to claim 1, further comprising: Use heuristic search to collect training labels; as well as During the training process of the neural network, the training labels are used as training targets.
5. The method according to claim 1, wherein The plurality of possible adjustment values consists of {-1, 0}.
6. The method according to claim 1, wherein The neural network is trained to emulate a rate-distortion optimization algorithm that performs a brute-force search over all possible quantization levels of the transform coefficients of the block of video data.
7. The method according to claim 1, wherein Determining the quantization level for the particular transform coefficient comprises: determining a most probable adjustment value for the particular transform coefficient from among the plurality of possible adjustment values based on the set of probabilities for the particular transform coefficient; determining an update value for the particular transform coefficient by adding the most probable adjustment value for the particular transform coefficient to an absolute value of the particular transform coefficient; and The quantization level for the particular transform coefficient is determined by multiplying the update value for the particular transform coefficient by a sign value of the particular transform coefficient.
8. The method according to claim 1, wherein The corresponding probability value for each possible adjustment value of the plurality of possible adjustment values is an unnormalized log probability for the possible adjustment value.
9. The method according to claim 1, wherein Determining the scalar quantized coefficients includes performing the following operations for each of the scaled transform coefficients: A scalar quantized coefficient corresponding to the scaled transform coefficient is determined to be equal to an output of a floor function of a first value, wherein: The first value is equal to the second value plus a quantization offset parameter, and The second value is equal to the scaled transform coefficient divided by a step size.
10. The method according to claim 1, wherein Determining the scalar quantized coefficients includes performing the following operations for each of the scaled transform coefficients: A scalar quantized coefficient corresponding to the scaled transform coefficient is determined as an output of a floor function equal to a first value, wherein the first value is equal to the scaled transform coefficient divided by a step size.
11. The method according to claim 1 , wherein: Determining the scalar quantized coefficients includes discarding sign information of the scalar quantized coefficients, The method further comprises discarding sign information of the scaled transform coefficients, and Determining the quantization level for the particular transform coefficient comprises: determining an adjustment value for the particular transform coefficient based on the set of probabilities for the particular transform coefficient; determining an updated quantization level for the specific transform coefficient by adding a scalar quantized coefficient corresponding to the specific transform coefficient and the adjustment value for the specific transform coefficient after discarding the sign information of the scaled transform coefficient; and The updated quantization level for the particular transform coefficient is multiplied by a sign of the scalar quantized coefficient corresponding to the particular transform coefficient to determine the quantization level for the particular transform coefficient.
12. The method of claim 1, further comprising training the neural network, wherein: Training the neural network includes: determining a cross entropy loss for an output of the neural network; scaling the cross entropy loss of the neural network based on a rate-distortion sensitivity map; and The neural network is trained based on a scaled cross entropy loss.
13. A device for encoding video data, the device comprising: a memory for storing the video data; as well as One or more processors implemented in circuitry, the one or more processors configured to: determining scaled transform coefficients, wherein determining the scaled transform coefficients comprises: scaling the transform coefficients of the block of the video data according to a given quantization step; determining scalar quantized coefficients, wherein determining the scalar quantized coefficients comprises: applying scalar quantization to the scaled transform coefficients of the block of video data; applying a neural network for determining a respective set of probabilities for each respective transform coefficient of the block of video data, wherein: The respective set of probabilities for the respective transform coefficient comprises a respective probability value for each possible adjustment value of a plurality of possible adjustment values for the respective transform coefficient, and The input of the neural network includes the scaled transform coefficients and the scalar quantized coefficients; determining a quantization level for a particular transform coefficient among the corresponding transform coefficients for the block of video data based on the set of probabilities for the particular transform coefficient; and The determined quantization level for the particular transform coefficient is signaled in a bitstream comprising an encoded representation of the video data.
14. The apparatus according to claim 13, wherein The neural network is a fully convolutional neural network.
15. The apparatus according to claim 13, wherein The neural network is an autoregressive network.
16. The apparatus according to claim 13, wherein The one or more processors are further configured to: Use heuristic search to collect training labels; as well as During the training process of the neural network, the training labels are used as training targets.
17. The apparatus according to claim 13, wherein The plurality of possible adjustment values consists of {-1, 0}.
18. The apparatus according to claim 13, wherein The neural network is trained to emulate a rate-distortion optimization algorithm that performs a brute-force search over all possible quantization levels of the transform coefficients of the block of video data.
19. The apparatus according to claim 13, wherein The one or more processors are configured to cause the one or more processors to, as part of determining the quantization level for the particular transform coefficient: determining a most probable adjustment value for the particular transform coefficient from among the plurality of possible adjustment values based on the set of probabilities for the particular transform coefficient; determining an updated value for the particular transform coefficient by adding the most probable adjustment value for the particular transform coefficient to an absolute value of the particular transform coefficient; as well as The quantization level for the particular transform coefficient is determined by multiplying the update value for the particular transform coefficient by a sign value of the particular transform coefficient.
20. The apparatus of claim 13, wherein: The corresponding probability value for each possible adjustment value of the plurality of possible adjustment values is an unnormalized log probability for the possible adjustment value.
21. The apparatus according to claim 13, wherein The one or more processors are configured such that the one or more processors, as part of determining the scalar quantized coefficient, perform the following operations for each of the scaled transform coefficients: A scalar quantized coefficient corresponding to the scaled transform coefficient is determined to be equal to an output of a floor function of a first value, wherein: The first value is equal to the second value plus a quantization offset parameter, and The second value is equal to the scaled transform coefficient divided by a step size.
22. The apparatus of claim 13, wherein: The one or more processors are configured such that the one or more processors, as part of determining the scalar quantized coefficient, perform the following operations for each of the scaled transform coefficients: A scalar quantized coefficient corresponding to the scaled transform coefficient is determined as an output of a floor function equal to a first value, wherein the first value is equal to the scaled transform coefficient divided by a step size.
23. The apparatus of claim 13, wherein: The one or more processors are configured such that the one or more processors discard sign information of the scalar quantized coefficients as part of determining the scalar quantized coefficients, The one or more processors are further configured to discard sign information of the scaled transform coefficients, and The one or more processors are configured to cause the one or more processors to, as part of determining the quantization level for the particular transform coefficient: determining an adjustment value for the particular transform coefficient based on the set of probabilities for the particular transform coefficient; determining an updated quantization level for the specific transform coefficient by adding a scalar quantized coefficient corresponding to the specific transform coefficient and the adjustment value for the specific transform coefficient after discarding the sign information of the scaled transform coefficient; and The updated quantization level for the particular transform coefficient is multiplied by a sign of the scalar quantized coefficient corresponding to the particular transform coefficient to determine the quantization level for the particular transform coefficient.
24. The apparatus of claim 13, wherein: The device includes one or more of a camera, a computer, a mobile device, a broadcast receiver device, or a set-top box.
25. The apparatus of claim 13, wherein: The one or more processors are configured to: determining a cross entropy loss for an output of the neural network; scaling the cross entropy loss of the neural network based on a rate-distortion sensitivity map; as well as The neural network is trained based on a scaled cross entropy loss.
26. An apparatus for encoding video data, the apparatus comprising: means for determining scaled transform coefficients, wherein determining the scaled transform coefficients comprises: scaling the transform coefficients of the block of the video data according to a given quantization step; means for determining scalar quantized coefficients, wherein determining the scalar quantized coefficients comprises: applying scalar quantization to the scaled transform coefficients of the block of video data; means for applying a neural network, wherein the neural network determines, for each respective transform coefficient of the block of the video data, a respective set of probabilities, wherein: The respective set of probabilities for the respective transform coefficient comprises a respective probability value for each possible adjustment value of a plurality of possible adjustment values for the respective transform coefficient, and The input of the neural network includes the scaled transform coefficients and the scalar quantized coefficients; means for determining a quantization level for a particular one of the corresponding transform coefficients for the block of video data based on the set of probabilities for the particular transform coefficient; and Means for signaling, in a bitstream comprising an encoded representation of the video data, the determined quantization level for the particular transform coefficient.
27. A computer-readable storage medium having stored thereon instructions that, when executed, cause one or more processors to: Determine the scaled transform coefficients, where Determining the scaled transform coefficients includes: scaling the transform coefficients of the block of video data according to a given quantization step; determining scalar quantized coefficients, wherein determining the scalar quantized coefficients comprises: applying scalar quantization to the scaled transform coefficients of the block of video data; applying a neural network for determining a respective set of probabilities for each respective transform coefficient of the block of video data, wherein: The respective set of probabilities for the respective transform coefficient comprises a respective probability value for each possible adjustment value of a plurality of possible adjustment values for the respective transform coefficient, and The input of the neural network includes the scaled transform coefficients and the scalar quantized coefficients; determining a quantization level for a particular transform coefficient among the corresponding transform coefficients for the block of video data based on the set of probabilities for the particular transform coefficient; and The determined quantization level for the particular transform coefficient is signaled in a bitstream comprising an encoded representation of the video data.
Citation Information
Patent Citations
Method and device for scaling motion estimation
CN101765011A
Qp derivation and offset for adaptive color transform in video coding
CN106797465A