Patent Description:
This disclosure relates to video encoding and video decoding.

<NPL> discloses clipping to motion field storage bit depth to both sub-block motion vectors and control point motion vectors after the sub-block motion vector derivation in affine mode.

In general, this disclosure describes techniques for inter prediction in video codecs. More specifically, this disclosure describes methods and devices for performing techniques related to affine motion prediction, including constrained affine motion inheritance. With affine motion inheritance, a current block of video data may inherit two or more motion vectors that represent non-translational motion, such as zoom in or out, rotation, perspective motion, or other irregular motion types, from a neighboring block of video data.

<FIG> is a block diagram illustrating an example video encoding and decoding system <NUM> that may perform the techniques of this disclosure. The techniques of this disclosure are generally directed to coding (encoding and/or decoding) video data. In general, video data includes any data for processing a video. Thus, video data may include raw, uncoded video, encoded video, decoded (e.g., reconstructed) video, and video metadata, such as signaling data.

As shown in <FIG>, the system <NUM> includes a source device <NUM> that provides encoded video data to be decoded and displayed by a destination device <NUM>, in this example. In particular, the source device <NUM> provides the video data to the destination device <NUM> via a computer-readable medium <NUM>. The source device <NUM> and the destination device <NUM> may comprise any of a wide range of devices, including desktop computers, notebook (i.e., laptop) computers, tablet computers, set-top boxes, telephone handsets such smartphones, televisions, cameras, display devices, digital media players, video gaming consoles, video streaming device, or the like. In some cases, the source device <NUM> and the destination device <NUM> may be equipped for wireless communication, and thus may be referred to as wireless communication devices.

In the example of <FIG>, the source device <NUM> includes video source <NUM>, memory <NUM>, video encoder <NUM>, and output interface <NUM>. The destination device <NUM> includes input interface <NUM>, video decoder <NUM>, memory <NUM>, and display device <NUM>. In accordance with this disclosure, the video encoder <NUM> of the source device <NUM> and the video decoder <NUM> of the destination device <NUM> may be configured to apply the techniques for constrained affine motion inheritance. Thus, the source device <NUM> represents an example of a video encoding device, while the destination device <NUM> represents an example of a video decoding device. In other examples, a source device and a destination device may include other components or arrangements. For example, the source device <NUM> may receive video data from an external video source, such as an external camera. Likewise, the destination device <NUM> may interface with an external display device, rather than including an integrated display device.

The system <NUM> as shown in <FIG> is merely one example. In general, any digital video encoding and/or decoding device may perform techniques for constrained affine motion inheritance. The source device <NUM> and the destination device <NUM> are merely examples of such coding devices in which source device <NUM> generates coded video data for transmission to the destination device <NUM>. This disclosure refers to a "coding" device as a device that performs coding (encoding and/or decoding) of data. Thus, the video encoder <NUM> and the video decoder <NUM> represent examples of coding devices, in particular, a video encoder and a video decoder, respectively. In some examples, the source device <NUM> and the destination device <NUM> may operate in a substantially symmetrical manner such that each of the source device <NUM> and the destination device <NUM> include video encoding and decoding components. Hence, the system <NUM> may support one-way or two-way video transmission between the source device <NUM> and the destination device <NUM>, e.g., for video streaming, video playback, video broadcasting, or video telephony.

In general, the video source <NUM> represents a source of video data (i.e., raw, unencoded video data) and provides a sequential series of pictures (also referred to as "frames") of the video data to the video encoder <NUM>, which encodes data for the pictures. The video source <NUM> of the source device <NUM> may include a video capture device, such as a video camera, a video archive containing previously captured raw video, and/or a video feed interface to receive video from a video content provider. As a further alternative, the video source <NUM> may generate computer graphics-based data as the source video, or a combination of live video, archived video, and computer-generated video. In each case, the video encoder <NUM> encodes the captured, pre-captured, or computer-generated video data. The video encoder <NUM> may rearrange the pictures from the received order (sometimes referred to as "display order") into a coding order for coding. The video encoder <NUM> may generate a bitstream including encoded video data. The source device <NUM> may then output the encoded video data via output interface <NUM> onto computer-readable medium <NUM> for reception and/or retrieval by, e.g., input interface <NUM> of the destination device <NUM>.

Memory <NUM> of the source device <NUM> and memory <NUM> of the destination device <NUM> represent general purpose memories. In some example, the memory <NUM> and the memory <NUM> may store raw video data, e.g., raw video from the video source <NUM> and raw, decoded video data from the video decoder <NUM>. Additionally or alternatively, the memory <NUM> and the memory <NUM> may store software instructions executable by, e.g., the video encoder <NUM> and the video decoder <NUM>, respectively. Although shown separately from the video encoder <NUM> and the video decoder <NUM> in this example, it should be understood that the video encoder <NUM> and the video decoder <NUM> may also include internal memories for functionally similar or equivalent purposes. Furthermore, the memory <NUM> and the memory <NUM> may store encoded video data, e.g., output from the video encoder <NUM> and input to the video decoder <NUM>. In some examples, portions of the memory <NUM> and the memory <NUM> may be allocated as one or more video buffers, e.g., to store raw, decoded, and/or encoded video data.

Computer-readable medium <NUM> may represent any type of medium or device capable of transporting the encoded video data from the source device <NUM> to the destination device <NUM>. In one example, computer-readable medium <NUM> represents a communication medium to enable the source device <NUM> to transmit encoded video data directly to the destination device <NUM> in real-time, e.g., via a radio frequency network or computer-based network. Output interface <NUM> may modulate a transmission signal including the encoded video data, and input interface <NUM> may modulate the received transmission signal, according to a communication standard, such as a wireless communication protocol. The communication medium may comprise any wireless or wired communication medium, such as a radio frequency (RF) spectrum or one or more physical transmission lines. The communication medium may form part of a packet-based network, such as a local area network, a wide-area network, or a global network such as the Internet. The communication medium may include routers, switches, base stations, or any other equipment that may be useful to facilitate communication from the source device <NUM> to the destination device <NUM>.

In some examples, the source device <NUM> may output encoded data from the output interface <NUM> to storage device <NUM>. Similarly, the destination device <NUM> may access encoded data from the storage device <NUM> via the input interface <NUM>. The storage device <NUM> may include any of a variety of distributed or locally accessed data storage media such as a hard drive, Blu-ray discs, DVDs, CD-ROMs, flash memory, volatile or non-volatile memory, or any other suitable digital storage media for storing encoded video data.

In some examples, the source device <NUM> may output encoded video data to file server <NUM> or another intermediate storage device that may store the encoded video generated by the source device <NUM>. The destination device <NUM> may access stored video data from the file server <NUM> via streaming or download. The file server <NUM> may be any type of server device capable of storing encoded video data and transmitting that encoded video data to the destination device <NUM>. The file server <NUM> may represent a web server (e.g., for a website), a File Transfer Protocol (FTP) server, a content delivery network device, or a network attached storage (NAS) device. The destination device <NUM> may access encoded video data from the file server <NUM> through 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., DSL, cable modem, etc.), or a combination of both that is suitable for accessing encoded video data stored on the file server <NUM>. The file server <NUM> and the input interface <NUM> may be configured to operate according to a streaming transmission protocol, a download transmission protocol, or a combination thereof.

The output interface <NUM> and the input interface <NUM> may represent wireless transmitters/receiver, modems, wired networking components (e.g., Ethernet cards), wireless communication components that operate according to any of a variety of IEEE <NUM> standards, or other physical components. In examples where the output interface <NUM> and the input interface <NUM> comprise wireless components, the output interface <NUM> and the input interface <NUM> may be configured to transfer data, such as encoded video data, according to a cellular communication standard, such as <NUM>, <NUM>-LTE (Long-Term Evolution), LTE Advanced, <NUM>, or the like. In some examples where the output interface <NUM> comprises a wireless transmitter, the output interface <NUM> and the input interface <NUM> may be configured to transfer data, such as encoded video data, according to other wireless standards, such as an IEEE <NUM> specification, an IEEE <NUM> specification (e.g., ZigBee™), a Bluetooth™ standard, or the like. In some examples, the source device <NUM> and/or the destination device <NUM> may include respective system-on-a-chip (SoC) devices. For example, the source device <NUM> may include an SoC device to perform the functionality attributed to the video encoder <NUM> and/or the output interface <NUM>, and the destination device <NUM> may include an SoC device to perform the functionality attributed to the video decoder <NUM> and/or the input interface <NUM>.

The input interface <NUM> of the destination device <NUM> may receive an encoded video bitstream from the computer-readable medium <NUM> (e.g., the storage device <NUM>, the file server <NUM>, or the like). The encoded video bitstream from the computer-readable medium <NUM> may include signaling information defined by the video encoder <NUM>, which is also used by the video decoder <NUM>, such as syntax elements having values that describe characteristics and/or processing of video blocks or other coded units (e.g., slices, pictures, groups of pictures, sequences, or the like). Display device <NUM> displays decoded pictures of the decoded video data to a user. The display device <NUM> may represent any of a variety of display devices such as a cathode ray tube (CRT), a liquid crystal display (LCD), a plasma display, an organic light emitting diode (OLED) display, or another type of display device.

Although not shown in <FIG>, in some examples, the video encoder <NUM> and the video decoder <NUM> may each be integrated with an audio encoder and/or audio decoder, and may include appropriate MUX-DEMUX units, or other hardware and/or software, to handle multiplexed streams including both audio and video in a common data stream.

The video encoder <NUM> and the video decoder <NUM> each may be implemented as any of a variety of suitable encoder and/or decoder circuitry, such as one or more microprocessors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field programmable gate arrays (FPGAs), discrete logic, software, hardware, firmware or any combinations thereof. Each of the video encoder <NUM> and the video decoder <NUM> may be included in one or more encoders or decoders, either of which may be integrated as part of a combined encoder/decoder (CODEC) in a respective device. A device including the video encoder <NUM> and/or the video decoder <NUM> may comprise an integrated circuit, a microprocessor, and/or a wireless communication device, such as a cellular telephone.

The video encoder <NUM> and the video decoder <NUM> may operate according to a video coding standard, such as ITU-T H. <NUM>, also referred to as High Efficiency Video Coding (HEVC) or extensions thereto, such as the multi-view and/or scalable video coding extensions. Alternatively, the video encoder <NUM> and the video decoder <NUM> may operate according to other proprietary or industry standards, such as the Joint Exploration Test Model (JEM) or ITU-T H. <NUM>, also referred to as Versatile Video Coding (VVC). A recent draft of the VVC standard is described in <NPL>, JVET-L1001-v9 (hereinafter "VVC Draft <NUM>). The techniques of this disclosure, however, are not limited to any particular coding standard.

In general, the video encoder <NUM> and the video decoder <NUM> may perform block-based coding of pictures. In general, the video encoder <NUM> and the video decoder <NUM> may code video data represented in a YUV (e.g., Y, Cb, Cr) format. That is, rather than coding red, green, and blue (RGB) data for samples of a picture, the video encoder <NUM> and the video decoder <NUM> may code luminance and chrominance components, where the chrominance components may include both red hue and blue hue chrominance components. In some examples, the video encoder <NUM> converts received RGB formatted data to a YUV representation prior to encoding, and the video decoder <NUM> converts the YUV representation to the RGB format.

According to HEVC, a video coder (such as the video encoder <NUM>) partitions a coding tree unit (CTU) into CUs according to a quadtree structure.

As another example, the video encoder <NUM> and the video decoder <NUM> may be configured to operate according to JEM or VVC. According to JEM or VVC, a video coder (such as the video encoder <NUM>) partitions a picture into a CTUs. The video encoder <NUM> may partition a CTU according to a tree structure, such as a quadtree-binary tree (QTBT) structure or Multi-Type Tree (MTT) structure. The QTBT structure removes the concepts of multiple partition types, such as the separation between CUs, PUs, and TUs of HEVC. A QTBT structure includes two levels: a first level partitioned according to quadtree partitioning, and a second level partitioned according to binary tree partitioning. A root node of the QTBT structure corresponds to a CTU. Leaf nodes of the binary trees correspond to CUs.

In an MTT partitioning structure, blocks may be partitioned using a quadtree (QT) partition, a binary tree (BT) partition, and one or more types of triple tree (TT) partitions. A triple tree partition is a partition where a block is split into three sub-blocks. In some examples, a triple tree partition divides a block into three sub-blocks without dividing the original block through the center. The partitioning types in MTT (e.g., QT, BT, and TT), may be symmetrical or asymmetrical.

In some examples, the video encoder <NUM> and the video decoder <NUM> may use a single QTBT or MTT structure to represent each of the luminance and chrominance components, while in other examples, the video encoder <NUM> and the video decoder <NUM> may use two or more QTBT or MTT structures, such as one QTBT/MTT structure for the luminance component and another QTBT/MTT structure for both chrominance components (or two QTBT/MTT structures for respective chrominance components).

The video encoder <NUM> and the video decoder <NUM> may be configured to use quadtree partitioning per HEVC, QTBT partitioning, MTT partitioning, or other partitioning structures.

The video encoder <NUM> encodes video data for CUs representing prediction and/or residual information, and other information.

To predict a CU, the video encoder <NUM> may generally form a prediction block for the CU through inter-prediction or intra-prediction. To perform inter-prediction, the video encoder <NUM> may generate the prediction block using one or more motion vectors. The video encoder <NUM> may generally perform a motion search to identify a reference block that closely matches the CU, e.g., in terms of differences between the CU and the reference block. The video encoder <NUM> may calculate a difference metric using a sum of absolute difference (SAD), sum of squared differences (SSD), mean absolute difference (MAD), mean squared differences (MSD), or other such difference calculations to determine whether a reference block closely matches the current CU. In some examples, the video encoder <NUM> may predict the current CU using uni-directional prediction or bi-directional prediction.

Some examples of JEM and VVC also provide an affine motion compensation mode, which may be considered an inter-prediction mode. In affine motion compensation mode, the video encoder <NUM> may determine two or more motion vectors that represent non-translational motion, such as zoom in or out, rotation, perspective motion, or other irregular motion types.

To perform intra-prediction, the video encoder <NUM> may select an intra-prediction mode to generate the prediction block. Some examples of JEM and VVC provide sixty-seven intra-prediction modes, including various directional modes, as well as planar mode and DC mode. In general, the video encoder <NUM> selects an intra-prediction mode that describes neighboring samples to a current block (e.g., a block of a CU) from which to predict samples of the current block. Such samples may generally be above, above and to the left, or to the left of the current block in the same picture as the current block, assuming the video encoder <NUM> codes CTUs and CUs in raster scan order (left to right, top to bottom).

The video encoder <NUM> encodes data representing the prediction mode for a current block. For example, for inter-prediction modes, the video encoder <NUM> may encode data representing which of the various available inter-prediction modes is used, as well as motion information for the corresponding mode. For uni-directional or bi-directional inter-prediction, for example, the video encoder <NUM> may encode motion vectors using advanced motion vector prediction (AMVP) or merge mode. The video encoder <NUM> may use similar modes to encode motion vectors for affine motion compensation mode.

Following prediction, such as intra-prediction or inter-prediction of a block, the video encoder <NUM> may calculate residual data for the block. The video encoder <NUM> may apply one or more transforms to the residual block, to produce transformed data in a transform domain instead of the sample domain. For example, the video encoder <NUM> may apply a discrete cosine transform (DCT), an integer transform, a wavelet transform, or a conceptually similar transform to residual video data. Additionally, the video encoder <NUM> may apply a secondary transform following the first transform, such as a mode-dependent non-separable secondary transform (MDNSST), a signal dependent transform, a Karhunen-Loeve transform (KLT), or the like. The video encoder <NUM> produces transform coefficients following application of the one or more transforms.

As noted above, following any transforms to produce transform coefficients, the video encoder <NUM> may perform quantization of the transform coefficients. Quantization generally refers to a process in which transform coefficients are quantized to possibly reduce the amount of data used to represent the coefficients, providing further compression. By performing the quantization process, the video encoder <NUM> may reduce the bit depth associated with some or all of the coefficients. For example, the video encoder <NUM> may round an n-bit value down to an m-bit value during quantization, where n is greater than m. In some examples, to perform quantization, the video encoder <NUM> may perform a bitwise right-shift of the value to be quantized.

Following quantization, the video encoder <NUM> may scan the transform coefficients, producing a one-dimensional vector from the two-dimensional matrix including the quantized transform coefficients. The scan may be designed to place higher energy (and therefore lower frequency) coefficients at the front of the vector and to place lower energy (and therefore higher frequency) transform coefficients at the back of the vector. In some examples, the video encoder <NUM> may utilize a predefined scan order to scan the quantized transform coefficients to produce a serialized vector, and then entropy encode the quantized transform coefficients of the vector. In other examples, the video encoder <NUM> may perform an adaptive scan. After scanning the quantized transform coefficients to form the one-dimensional vector, the video encoder <NUM> may entropy encode the one-dimensional vector, e.g., according to context-adaptive binary arithmetic coding (CABAC). The video encoder <NUM> may also entropy encode values for syntax elements describing metadata associated with the encoded video data for use by the video decoder <NUM> in decoding the video data.

To perform CABAC, the video encoder <NUM> may assign a context within a context model to a symbol to be transmitted.

The video encoder <NUM> may further generate syntax data, such as block-based syntax data, picture-based syntax data, and sequence-based syntax data, to the video decoder <NUM>, e.g., in a picture header, a block header, a slice header, or other syntax data, such as a sequence parameter set (SPS), picture parameter set (PPS), or video parameter set (VPS). The video decoder <NUM> may likewise decode such syntax data to determine how to decode corresponding video data.

In this manner, the video encoder <NUM> may generate a bitstream including encoded video data, e.g., syntax elements describing partitioning of a picture into blocks (e.g., CUs) and prediction and/or residual information for the blocks. Ultimately, the video decoder <NUM> may receive the bitstream and decode the encoded video data.

In general, the video decoder <NUM> performs a reciprocal process to that performed by the video encoder <NUM> to decode the encoded video data of the bitstream. For example, the video decoder <NUM> may decode values for syntax elements of the bitstream using CABAC in a manner substantially similar to, albeit reciprocal to, the CABAC encoding process of the video encoder <NUM>. The syntax elements may define partitioning information of a picture into CTUs, and partitioning of each CTU according to a corresponding partition structure, such as a QTBT structure, to define CUs of the CTU. The syntax elements may further define prediction and residual information for blocks (e.g., CUs) of video data.

The video decoder <NUM> may inverse quantize and inverse transform the quantized transform coefficients of a block to reproduce a residual block for the block. The video decoder <NUM> uses a signaled prediction mode (intra- or inter-prediction) and related prediction information (e.g., motion information for inter-prediction) to form a prediction block for the block. The video decoder <NUM> may then combine the prediction block and the residual block (on a sample-by-sample basis) to reproduce the original block. The video decoder <NUM> may perform additional processing, such as performing a deblocking process to reduce visual artifacts along boundaries of the block.

In accordance with the techniques of this disclosure, as will be explained in more detail below, the video encoder <NUM> and the video decoder <NUM> may be configured to code a block of vide data using an affine coding mode and constrained affine motion inheritance. For example, the video encoder <NUM> and the video decoder <NUM> may be configured to determine delta motion vectors from control point motion vectors of a neighboring block of a current block of video data, clip the delta motion vectors to a predefined range, and code the current block of video data using the clipped delta motion vectors.

This disclosure may generally refer to "signaling" certain information, such as syntax elements. The term "signaling" may generally refer to the communication of values syntax elements and/or other data used to decode encoded video data. That is, the video encoder <NUM> may signal values for syntax elements in the bitstream. In general, signaling refers to generating a value in the bitstream. As noted above, the source device <NUM> may transport the bitstream to the destination device <NUM> substantially in real time, or not in real time, such as might occur when storing syntax elements to the storage device <NUM> for later retrieval by the destination device <NUM>.

<FIG> are conceptual diagram illustrating an example quadtree binary tree (QTBT) structure <NUM>, and a corresponding coding tree unit (CTU) <NUM>. The solid lines represent quadtree splitting, and dotted lines indicate binary tree splitting. In each split (i.e., non-leaf) node of the binary tree, one flag is signaled to indicate which splitting type (i.e., horizontal or vertical) is used, where <NUM> indicates horizontal splitting and <NUM> indicates vertical splitting in this example. For the quadtree splitting, there is no need to indicate the splitting type, since quadtree nodes split a block horizontally and vertically into <NUM> sub-blocks with equal size. Accordingly, the video encoder <NUM> may encode, and the video decoder <NUM> may decode, syntax elements (such as splitting information) for a region tree level of the QTBT structure <NUM> (i.e., the solid lines) and syntax elements (such as splitting information) for a prediction tree level of the QTBT structure <NUM> (i.e., the dashed lines). The video encoder <NUM> may encode, and the video decoder <NUM> may decode, video data, such as prediction and transform data, for CUs represented by terminal leaf nodes of the QTBT structure <NUM>.

In general, the CTU <NUM> of <FIG> may be associated with parameters defining sizes of blocks corresponding to nodes of the QTBT structure <NUM> at the first and second levels.

The example of the QTBT structure <NUM> represents such nodes as including the parent node and child nodes having solid lines for branches. If nodes of the first level are not larger than the maximum allowed binary tree root node size (MaxBTSize), they can be further partitioned by respective binary trees. The example of the QTBT structure <NUM> represents such nodes as having dashed lines for branches. The binary tree leaf node is referred to as a CU, which is used for prediction (e.g., intra-picture or inter-picture prediction) and transform, without any further partitioning.

In one example of the QTBT partitioning structure, the CTU size is set as 128x128 (luma samples and two corresponding 64x64 chroma samples), the MinQTSize is set as 16x16, the MaxBTSize is set as 64x64, the MinBTSize (for both width and height) is set as <NUM>, and the MaxBTDepth is set as <NUM>. The quadtree partitioning is applied to the CTU first to generate quad-tree leaf nodes. The quadtree leaf nodes may have a size from 16x16 (i.e., the MinQTSize) to 128x128 (i.e., the CTU size). If the leaf quadtree node is 128x128, it will not be further split by the binary tree, since the size exceeds the MaxBTSize (i.e., 64x64, in this example). Otherwise, the leaf quadtree node will be further partitioned by the binary tree. Therefore, the quadtree leaf node is also the root node for the binary tree and has the binary tree depth as <NUM>. When the binary tree depth reaches MaxBTDepth (<NUM>, in this example), no further splitting is permitted. When the binary tree node has width equal to MinBTSize (<NUM>, in this example), it implies no further horizontal splitting is permitted. Similarly, a binary tree node having a height equal to MinBTSize implies no further vertical splitting is permitted for that binary tree node. As noted above, leaf nodes of the binary tree are referred to as CUs, and are further processed according to prediction and transform without further partitioning.

<FIG> is a block diagram illustrating an example video encoder <NUM> that may perform the techniques of this disclosure. <FIG> is provided for purposes of explanation and should not be considered limiting of the techniques as broadly exemplified and described in this disclosure. For purposes of explanation, this disclosure describes the video encoder <NUM> in the context of video coding standards such as the HEVC video coding standard and the H. <NUM> video coding standard in development. However, the techniques of this disclosure are not limited to these video coding standards, and are applicable generally to video encoding and decoding.

In the example of <FIG>, the video encoder <NUM> includes video data memory <NUM>, mode selection unit <NUM>, residual generation unit <NUM>, transform processing unit <NUM>, quantization unit <NUM>, inverse quantization unit <NUM>, inverse transform processing unit <NUM>, reconstruction unit <NUM>, filter unit <NUM>, decoded picture buffer (DPB) <NUM>, and entropy encoding unit <NUM>. Any or all of the video data memory <NUM>, the mode selection unit <NUM>, the residual generation unit <NUM>, the transform processing unit <NUM>, the quantization unit <NUM>, the inverse quantization unit <NUM>, the inverse transform processing unit <NUM>, the reconstruction unit <NUM>, the filter unit <NUM>, the DPB <NUM>, and the entropy encoding unit <NUM> may be implemented in one or more processors or in processing circuitry. Moreover, the video encoder <NUM> may include additional or alternative processors or processing circuitry to perform these and other functions.

The video data memory <NUM> may store video data to be encoded by the components of the video encoder <NUM>. The video encoder <NUM> may receive the video data stored in the video data memory <NUM> from, for example, the video source <NUM> (<FIG>). The DPB <NUM> may act as a reference picture memory that stores reference video data for use in prediction of subsequent video data by the video encoder <NUM>. The video data memory <NUM> and the DPB <NUM> may be formed by any of a variety of memory devices, such as dynamic random access memory (DRAM), including synchronous DRAM (SDRAM), magnetoresistive RAM (MRAM), resistive RAM (RRAM), or other types of memory devices. The video data memory <NUM> and the DPB <NUM> may be provided by the same memory device or separate memory devices. In various examples, the video data memory <NUM> may be on-chip with other components of the video encoder <NUM>, as illustrated, or off-chip relative to those components.

In this disclosure, reference to the video data memory <NUM> should not be interpreted as being limited to memory internal to the video encoder <NUM>, unless specifically described as such, or memory external to the video encoder <NUM>, unless specifically described as such. Rather, reference to the video data memory <NUM> should be understood as reference memory that stores video data that the video encoder <NUM> receives for encoding (e.g., video data for a current block that is to be encoded). The memory <NUM> of <FIG> may also provide temporary storage of outputs from the various units of the video encoder <NUM>.

The various units of <FIG> are illustrated to assist with understanding the operations performed by the video encoder <NUM>. The units may be implemented as fixed-function circuits, programmable circuits, or a combination thereof. Fixed-function circuits refer to circuits that provide particular functionality, and are preset on the operations that can be performed. Programmable circuits refer to circuits that can programmed to perform various tasks, and provide flexible functionality in the operations that can be performed. For instance, programmable circuits may execute software or firmware that cause the programmable circuits to operate in the manner defined by instructions of the software or firmware. Fixed-function circuits may execute software instructions (e.g., to receive parameters or output parameters), but the types of operations that the fixed-function circuits perform are generally immutable. In some examples, the one or more of the units may be distinct circuit blocks (fixed-function or programmable), and in some examples, the one or more units may be integrated circuits.

The video encoder <NUM> may include arithmetic logic units (ALUs), elementary function units (EFUs), digital circuits, analog circuits, and/or programmable cores, formed from programmable circuits. In examples where the operations of the video encoder <NUM> are performed using software executed by the programmable circuits, memory <NUM> (<FIG>) may store the object code of the software that the video encoder <NUM> receives and executes, or another memory within the video encoder <NUM> (not shown) may store such instructions.

The video data memory <NUM> is configured to store received video data. The video encoder <NUM> may retrieve a picture of the video data from the video data memory <NUM> and provide the video data to residual generation unit <NUM> and mode selection unit <NUM>. Video data in the video data memory <NUM> may be raw video data that is to be encoded.

The mode selection unit <NUM> includes a motion estimation unit <NUM>, motion compensation unit <NUM>, and an intra-prediction unit <NUM>. The mode selection unit <NUM> may include additional functional units to perform video prediction in accordance with other prediction modes. As examples, the mode selection unit <NUM> may include a palette unit, an intra-block copy unit (which may be part of the motion estimation unit <NUM> and/or the motion compensation unit <NUM>), an affine unit (AU) <NUM>, a linear model (LM) unit, or the like.

The mode selection unit <NUM> generally coordinates multiple encoding passes to test combinations of encoding parameters and resulting rate-distortion values for such combinations. The mode selection unit <NUM> may ultimately select the combination of encoding parameters having rate-distortion values that are better than the other tested combinations.

The video encoder <NUM> may partition a picture retrieved from the video data memory <NUM> into a series of CTUs, and encapsulate one or more CTUs within a slice. The mode selection unit <NUM> may partition a CTU of the picture in accordance with a tree structure, such as the QTBT structure or the quad-tree structure of HEVC described above. As described above, the video encoder <NUM> may form one or more CUs from partitioning a CTU according to the tree structure. Such a CU may also be referred to generally as a "video block" or "block.

In general, the mode selection unit <NUM> also controls the components thereof (e.g., the motion estimation unit <NUM>, the motion compensation unit <NUM>, and the intra-prediction unit <NUM>) to generate a prediction block for a current block (e.g., a current CU, or in HEVC, the overlapping portion of a PU and a TU). For inter-prediction of a current block, the motion estimation unit <NUM> 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 the DPB <NUM>). In particular, the motion estimation unit <NUM> may calculate a value representative of how similar a potential reference block is to the current block, e.g., according to sum of absolute difference (SAD), sum of squared differences (SSD), mean absolute difference (MAD), mean squared differences (MSD), or the like. The motion estimation unit <NUM> may generally perform these calculations using sample-by-sample differences between the current block and the reference block being considered. The motion estimation unit <NUM> may identify a reference block having a lowest value resulting from these calculations, indicating a reference block that most closely matches the current block.

The motion estimation unit <NUM> may form one or more motion vectors (MVs) that defines the positions of the reference blocks in the reference pictures relative to the position of the current block in a current picture. The motion estimation unit <NUM> may then provide the motion vectors to the motion compensation unit <NUM>. For example, for uni-directional inter-prediction, the motion estimation unit <NUM> may provide a single motion vector, whereas for bi-directional inter-prediction, the motion estimation unit <NUM> may provide two motion vectors. The motion compensation unit <NUM> may then generate a prediction block using the motion vectors. For example, the motion compensation unit <NUM> may retrieve data of the reference block using the motion vector. As another example, if the motion vector has fractional sample precision, the motion compensation unit <NUM> may interpolate values for the prediction block according to one or more interpolation filters. Moreover, for bi-directional inter-prediction, the motion compensation unit <NUM> may retrieve data for two reference blocks identified by respective motion vectors and combine the retrieved data, e.g., through sample-by-sample averaging or weighted averaging.

As another example, for intra-prediction, or intra-prediction coding, the intra-prediction unit <NUM> may generate the prediction block from samples neighboring the current block. For example, for directional modes, the intra-prediction unit <NUM> may generally mathematically combine values of neighboring samples and populate these calculated values in the defined direction across the current block to produce the prediction block. As another example, for DC mode, the intra-prediction unit <NUM> may calculate an average of the neighboring samples to the current block and generate the prediction block to include this resulting average for each sample of the prediction block.

The mode selection unit <NUM> provides the prediction block to the residual generation unit <NUM>. The residual generation unit <NUM> receives a raw, uncoded version of the current block from the video data memory <NUM> and the prediction block from the mode selection unit <NUM>. The residual generation unit <NUM> calculates sample-by-sample differences between the current block and the prediction block. The resulting sample-by-sample differences define a residual block for the current block. In some examples, the residual generation unit <NUM> may also determine differences between sample values in the residual block to generate a residual block using residual differential pulse code modulation (RDPCM). In some examples, the residual generation unit <NUM> may be formed using one or more subtractor circuits that perform binary subtraction.

In examples where the mode selection unit <NUM> partitions CUs into PUs, each PU may be associated with a luma prediction unit and corresponding chroma prediction units. The video encoder <NUM> and the video decoder <NUM> may support PUs having various sizes. Assuming that the size of a particular CU is 2Nx2N, the video encoder <NUM> may support PU sizes of 2Nx2N or NxN for intra prediction, and symmetric PU sizes of 2Nx2N, 2NxN, Nx2N, NxN, or similar for inter prediction. The video encoder <NUM> and the video decoder <NUM> may also support asymmetric partitioning for PU sizes of 2NxnU, 2NxnD, nLx2N, and nRx2N for inter prediction.

In examples where mode selection unit does not further partition a CU into PUs, each CU may be associated with a luma coding block and corresponding chroma coding blocks. As above, the size of a CU may refer to the size of the luma coding block of the CU. The video encoder <NUM> and the video decoder <NUM> may support CU sizes of 2Nx2N, 2NxN, or Nx2N.

For other video coding techniques such as an intra-block copy mode coding, an affine mode coding, and linear model (LM) mode coding, as few examples, mode selection unit <NUM>, via respective units associated with the coding techniques, generates a prediction block for the current block being encoded. For example, in the case of affine mode coding, the affine unit <NUM> may determine delta motion vectors from control point motion vectors (CPMVs) of a neighboring block of a current block of video data, scale the delta motion vectors and clip the delta motion vectors when generating a prediction block for the current block of video data being encoded. In some examples, such as palette mode coding, the mode selection unit <NUM> may not generate a prediction block, and instead generate syntax elements that indicate the manner in which to reconstruct the block based on a selected palette. In such modes, the mode selection unit <NUM> may provide these syntax elements to the entropy encoding unit <NUM> to be encoded.

As described above, the residual generation unit <NUM> receives the video data for the current block and the corresponding prediction block. The residual generation unit <NUM> then generates a residual block for the current block. To generate the residual block, the residual generation unit <NUM> calculates sample-by-sample differences between the prediction block and the current block.

The transform processing unit <NUM> 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 <NUM> may apply various transforms to a residual block to form the transform coefficient block. For example, the transform processing unit <NUM> may apply a discrete cosine transform (DCT), a directional transform, a Karhunen-Loeve transform (KLT), or a conceptually similar transform to a residual block. In some examples, the transform processing unit <NUM> may perform multiple transforms to a residual block, e.g., a primary transform and a secondary transform, such as a rotational transform. In some examples, the transform processing unit <NUM> does not apply transforms to a residual block.

Quantization unit <NUM> may quantize the transform coefficients in a transform coefficient block, to produce a quantized transform coefficient block. The quantization unit <NUM> may quantize transform coefficients of a transform coefficient block according to a quantization parameter (QP) value associated with the current block. The video encoder <NUM> (e.g., via the mode selection unit <NUM>) may adjust the degree of quantization applied to the coefficient blocks associated with the current block by adjusting the QP value associated with the CU. Quantization may introduce loss of information, and thus, quantized transform coefficients may have lower precision than the original transform coefficients produced by the transform processing unit <NUM>.

Reconstruction unit <NUM> may produce a reconstructed block corresponding to the current block (albeit potentially with some degree of distortion) based on the reconstructed residual block and a prediction block generated by the mode selection unit <NUM>. For example, the reconstruction unit <NUM> may add samples of the reconstructed residual block to corresponding samples from the prediction block generated by the mode selection unit <NUM> to produce the reconstructed block.

Filter unit <NUM> may perform one or more filter operations on reconstructed blocks. For example, the filter unit <NUM> may perform deblocking operations to reduce blockiness artifacts along edges of CUs. Operations of the filter unit <NUM> may be skipped, in some examples.

The video encoder <NUM> stores reconstructed blocks in the DPB <NUM>. For instance, in examples where operations of the filter unit <NUM> are not needed, the reconstruction unit <NUM> may store reconstructed blocks to the DPB <NUM>. In examples where operations of the filter unit <NUM> are needed, the filter unit <NUM> may store the filtered reconstructed blocks to the DPB <NUM>. The motion estimation unit <NUM> and the motion compensation unit <NUM> may retrieve a reference picture from the DPB <NUM>, formed from the reconstructed (and potentially filtered) blocks, to inter-predict blocks of subsequently encoded pictures. In addition, the intra-prediction unit <NUM> may use reconstructed blocks in the DPB <NUM> of a current picture to intra-predict other blocks in the current picture.

In general, the entropy encoding unit <NUM> may entropy encode syntax elements received from other functional components of the video encoder <NUM>. For example, the entropy encoding unit <NUM> may entropy encode quantized transform coefficient blocks from the quantization unit <NUM>. As another example, the entropy encoding unit <NUM> may entropy encode prediction syntax elements (e.g., motion information for inter-prediction or intra-mode information for intra-prediction) from the mode selection unit <NUM>. The entropy encoding unit <NUM> may perform one or more entropy encoding operations on the syntax elements, which are another example of video data, to generate entropy-encoded data. For example, the entropy encoding unit <NUM> may perform a context-adaptive variable length coding (CAVLC) operation, a CABAC operation, a variable-to-variable (V2V) length coding operation, a syntax-based context-adaptive binary arithmetic coding (SBAC) operation, a Probability Interval Partitioning Entropy (PIPE) coding operation, an Exponential-Golomb encoding operation, or another type of entropy encoding operation on the data. In some examples, the entropy encoding unit <NUM> may operate in bypass mode where syntax elements are not entropy encoded.

The video encoder <NUM> may output a bitstream that includes the entropy encoded syntax elements needed to reconstruct blocks of a slice or picture. For example, the entropy encoding unit <NUM> may output the bitstream.

In some examples, operations performed with respect to a luma coding block need not be repeated for the chroma coding blocks. As one example, operations to identify a MV and reference picture for a luma coding block need not be repeated for identifying a MV and reference picture for the chroma blocks. Rather, the MV for the luma coding block may be scaled to determine the MV for the chroma blocks, and the reference picture may be the same. As another example, the intra-prediction process may be the same for the luma coding blocks and the chroma coding blocks.

The video encoder <NUM> represents an example of a device configured to encode video data including a memory configured to store video data, and one or more processing units implemented in circuitry and configured to determine delta motion vectors from control point motion vectors of a neighboring block of a current block of video data, clip the delta motion vectors to a predefined range, and code the current block of video data using the clipped delta motion vectors.

<FIG> is a block diagram illustrating an example video decoder <NUM> that may perform the techniques of this disclosure. <FIG> is provided for purposes of explanation and is not limiting on the techniques as broadly exemplified and described in this disclosure. For purposes of explanation, the video decoder <NUM> is described according to the techniques of JEM, VVC, and HEVC. However, the techniques of this disclosure may be performed by video coding devices that are configured to other video coding standards.

In the example of <FIG>, the video decoder <NUM> includes coded picture buffer (CPB) memory <NUM>, entropy decoding unit <NUM>, prediction processing unit <NUM>, inverse quantization unit <NUM>, inverse transform processing unit <NUM>, reconstruction unit <NUM>, filter unit <NUM>, and decoded picture buffer (DPB) <NUM>. Any or all of the CPB memory <NUM>, the entropy decoding unit <NUM>, the prediction processing unit <NUM>, the inverse quantization unit <NUM>, the inverse transform processing unit <NUM>, the reconstruction unit <NUM>, the filter unit <NUM>, and the DPB <NUM> may be implemented in one or more processors or in processing circuitry. Moreover, the video decoder <NUM> may include additional or alternative processors or processing circuitry to perform these and other functions.

The prediction processing unit <NUM> includes motion compensation unit <NUM> and intra-prediction unit <NUM>. The prediction processing unit <NUM> may include addition units to perform prediction in accordance with other prediction modes. As examples, the prediction processing unit <NUM> may include a palette unit, an intra-block copy unit (which may form part of motion compensation unit <NUM>), an affine unit (AU) <NUM>, a linear model (LM) unit, or the like. In other examples, the video decoder <NUM> may include more, fewer, or different functional components.

The CPB memory <NUM> may store video data, such as an encoded video bitstream, to be decoded by the components of the video decoder <NUM>. The video data stored in the CPB memory <NUM> may be obtained, for example, from computer-readable medium <NUM> (<FIG>). The CPB memory <NUM> may include a CPB that stores encoded video data (e.g., syntax elements) from an encoded video bitstream. Also, the CPB memory <NUM> may store video data other than syntax elements of a coded picture, such as temporary data representing outputs from the various units of the video decoder <NUM>. The DPB <NUM> generally stores decoded pictures, which the video decoder <NUM> may output and/or use as reference video data when decoding subsequent data or pictures of the encoded video bitstream. The CPB memory <NUM> and the DPB <NUM> may be formed by any of a variety of memory devices, such as dynamic random access memory (DRAM), including synchronous DRAM (SDRAM), magnetoresistive RAM (MRAM), resistive RAM (RRAM), or other types of memory devices. The CPB memory <NUM> and the DPB <NUM> may be provided by the same memory device or separate memory devices. In various examples, the CPB memory <NUM> may be on-chip with other components of the video decoder <NUM>, or off-chip relative to those components.

Additionally or alternatively, in some examples, the video decoder <NUM> may retrieve coded video data from the memory <NUM> (<FIG>). That is, the memory <NUM> may store data as discussed above with the CPB memory <NUM>. Likewise, the memory <NUM> may store instructions to be executed by the video decoder <NUM>, when some or all of the functionality of the video decoder <NUM> is implemented in software to executed by processing circuitry of the video decoder <NUM>.

The various units shown in <FIG> are illustrated to assist with understanding the operations performed by the video decoder <NUM>. The units may be implemented as fixed-function circuits, programmable circuits, or a combination thereof. Similar to <FIG>, fixed-function circuits refer to circuits that provide particular functionality, and are preset on the operations that can be performed. Programmable circuits refer to circuits that can programmed to perform various tasks, and provide flexible functionality in the operations that can be performed. For instance, programmable circuits may execute software or firmware that cause the programmable circuits to operate in the manner defined by instructions of the software or firmware. Fixed-function circuits may execute software instructions (e.g., to receive parameters or output parameters), but the types of operations that the fixed-function circuits perform are generally immutable. In some examples, the one or more of the units may be distinct circuit blocks (fixed-function or programmable), and in some examples, the one or more units may be integrated circuits.

The video decoder <NUM> may include ALUs, EFUs, digital circuits, analog circuits, and/or programmable cores formed from programmable circuits. In examples where the operations of the video decoder <NUM> are performed by software executing on the programmable circuits, on-chip or off-chip memory may store instructions (e.g., object code) of the software that the video decoder <NUM> receives and executes.

The entropy decoding unit <NUM> may receive encoded video data from the CPB and entropy decode the video data to reproduce syntax elements. The prediction processing unit <NUM>, the inverse quantization unit <NUM>, the inverse transform processing unit <NUM>, the reconstruction unit <NUM>, and the filter unit <NUM> may generate decoded video data based on the syntax elements extracted from the bitstream.

In general, the video decoder <NUM> reconstructs a picture on a block-by-block basis. The video decoder <NUM> may perform a reconstruction operation on each block individually (where the block currently being reconstructed, i.e., decoded, may be referred to as a "current block").

The entropy decoding unit <NUM> may entropy decode syntax elements defining quantized transform coefficients of a quantized transform coefficient block, as well as transform information, such as a quantization parameter (QP) and/or transform mode indication(s). The inverse quantization unit <NUM> may use the QP associated with the quantized transform coefficient block to determine a degree of quantization and, likewise, a degree of inverse quantization for the inverse quantization unit <NUM> to apply. The inverse quantization unit <NUM> may, for example, perform a bitwise left-shift operation to inverse quantize the quantized transform coefficients. The inverse quantization unit <NUM> may thereby form a transform coefficient block including transform coefficients.

After the inverse quantization unit <NUM> forms the transform coefficient block, the inverse transform processing unit <NUM> 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 <NUM> 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 coefficient block.

Furthermore, the prediction processing unit <NUM> generates a prediction block according to prediction information syntax elements, including prediction information syntax elements that were entropy decoded by the entropy decoding unit <NUM>. For example, if the prediction information syntax elements indicate that the current block is inter-predicted, the motion compensation unit <NUM> may generate the prediction block. In this case, the prediction information syntax elements may indicate a reference picture in the DPB <NUM> from which to retrieve a reference block, as well as a motion vector identifying a location of the reference block in the reference picture relative to the location of the current block in the current picture. The motion compensation unit <NUM> may generally perform the inter-prediction process in a manner that is substantially similar to that described with respect to the motion compensation unit <NUM> (<FIG>).

As another example, if the prediction information syntax elements indicate that the current block is intra-predicted, the intra-prediction unit <NUM> may generate the prediction block according to an intra-prediction mode indicated by the prediction information syntax elements. Again, the intra-prediction unit <NUM> may generally perform the intra-prediction process in a manner that is substantially similar to that described with respect to the intra-prediction unit <NUM> (<FIG>). The intra-prediction unit <NUM> may retrieve data of neighboring samples to the current block from the DPB <NUM>.

In another example, if the prediction information syntax elements indicate that the current block is affine predicted, the affine unit <NUM> may generate the prediction block according to affine mode. The affine unit <NUM> may determine delta motion vectors from CPMVs of a neighboring block of a current block of video data, scale the delta motion vectors and clip the delta motion vectors when generating a prediction block for the current block of video data being encoded.

The reconstruction unit <NUM> may reconstruct the current block using the prediction block and the residual block. For example, the reconstruction unit <NUM> may add samples of the residual block to corresponding samples of the prediction block to reconstruct the current block.

The filter unit <NUM> may perform one or more filter operations on reconstructed blocks. For example, the filter unit <NUM> may perform deblocking operations to reduce blockiness artifacts along edges of the reconstructed blocks. Operations of the filter unit <NUM> are not necessarily performed in all examples.

The video decoder <NUM> may store the reconstructed blocks in the DPB <NUM>. As discussed above, the DPB <NUM> may provide reference information, such as samples of a current picture for intra-prediction and previously decoded pictures for subsequent motion compensation, to the prediction processing unit <NUM>. Moreover, the video decoder <NUM> may output decoded pictures from DPB for subsequent presentation on a display device, such as the display device <NUM> of <FIG>.

In this manner, the video decoder <NUM> represents an example of a video decoding device including a memory configured to store video data, and one or more processing units implemented in circuitry and configured to determine delta motion vectors from control point motion vectors of neighboring blocks of a current block of video data, clip the delta motion vectors to a predefined range, and code the current block of video data using the clipped delta motion vectors.

<FIG> is a conceptual diagram illustrating control points for a <NUM>-parameter affine motion model. One model of motion prediction is an affine model. A six-parameter affine motion model may be described as: <MAT> where (vx,vy) is the motion vector at the coordinate (x,y), and a, b, c, d, e, and f are the six parameters. The affine motion model for a block may also be described by the three motion vectors (MVs) v<NUM> = (v<NUM>x,v<NUM>y), v<NUM> = (v<NUM>x,v<NUM>y), and v<NUM> = (v<NUM>x,v<NUM>y) at three corners of the block <NUM> (sometimes referred to as control point motion vectors), as shown in <FIG>. As shown in <FIG>, v<NUM> is at the top-left corner of the block <NUM>, v<NUM> is at the top-right corner of the block <NUM>, and v<NUM> is at the bottom-left corner of the block <NUM>. The motion field is then described as <MAT> where w and h are the width and height of the block.

A simplified <NUM>-parameter affine model may be described as: <MAT>.

Similarly, the simplified <NUM>-parameter affine model for a block can be described by two MVs v<NUM> = (v<NUM>x,v<NUM>y) and v<NUM> = (v<NUM>x,v<NUM>y) at two corners of the block. The motion field may be described as: <MAT> where w and h are the width and height of the block.

<FIG> is a conceptual diagram illustrating another example of control point motion vectors (e.g., v<NUM>, v<NUM>, v<NUM>, v<NUM>) for block <NUM> for an affine motion model. In the following, the MV vi is referred to as a CPMV.

CPMVs are not necessarily the same as in <FIG> or in <FIG>. Other CPMVs selections may also be used. For a <NUM>-parameter affine model, the control point pairs can be selected from any two of the CPMVs {v<NUM>, v<NUM>, v<NUM>, v<NUM>}, as shown in <FIG>. For a <NUM>-parameter affine model, the control point set can be selected from any three of CPMVs. Given the selected CPMVs, the other MV can be calculated by the derived affine motion model.

The affine motion model may also be represented by an anchor MV v<NUM> at coordinate (x<NUM>,y<NUM>), a horizontal delta MV ∇vh and a vertical delta MV ∇vv. The MV v at the coordinate (x,y) can be calculated as v = v<NUM> + x * ∇vh + y * ∇vv.

A CPMV representation can be converted to the representation with delta MVs. For example, v<NUM> is the same as the top-left CPMV, ∇vh = (v<NUM> - v<NUM>)/w, ∇vv = (v<NUM> - v<NUM>)/h.

Note that the operations described above are vector operations. The addition, division, and multiplication operations are applied element wise.

As in the normal motion vector prediction techniques in HEVC, affine motion predictors can be derived from the affine motion vectors or normal motion vectors of the neighboring coded blocks. Example types of affine motion predictors include inherited affine motion vector predictors and constructed affine motion vector predictors.

When obtaining an inherited affine motion vector predictor (MVP), the video encoder <NUM> and the video decoder <NUM> may be configured to use the affine motion of a neighboring coded block to derive the predicted CPMVs of current block. This process operates under the assumption that the current block shares the same affine motion model as the neighboring coded block. In this context, the neighboring coded block is referred to as a candidate block. The candidate block may be selected from different spatial or temporal neighboring locations. An example is shown in <FIG>. The affine motion vectors of the neighboring candidate block A <NUM> in <FIG> (represented as the motion vectors at the control-points) are: v<NUM> = (v<NUM>x,voy), v<NUM> = (v1x,v<NUM>y), v<NUM> = (v<NUM>x,v<NUM>y), the size of candidate block A <NUM> is (w, h), and the coordinates of control points of the neighboring candidate block A <NUM> are (x0, y0), (x1, y1), and (x2, y2). The predicted affine motion vectors <MAT> at the control points of the current block <NUM> can be derived by replacing (x,y) in equation (<NUM>) with the coordinate difference between the control points of current block <NUM> and the top-left control point of neighboring candidate block A <NUM>, such that: <MAT> <MAT> <MAT> wherein (x0', y0'), (x1', y1'), and (x2', y2') are the coordinates of control-points in current block. If represented as delta MVs, <MAT> <MAT> <MAT>.

Similarly, if the neighboring candidate block's affine model is <NUM>-parameter affine model, then the equation (<NUM>) is applied. If the affine model for the current block is <NUM>-parameter affine model, then equation (<NUM>) can be ignored.

<FIG> is a conceptual diagram illustrating example candidate blocks. In one example, the candidate block can be located at locations A0, B0, B1, A1, B2, as shown in <FIG>.

A constructed affine motion vector predictor is derived by predicting the motion vectors at the control points of the current block as the normal motion vector prediction. In other words, the video encoder <NUM> or the video decoder <NUM> may derive the constrained affine motion vector predictor in a similar manner to the manner the video encoder <NUM> or the video decoder <NUM> would derive an affine motion vector predictor. For example, as shown in <FIG>, the motion vector v<NUM> at the top-left control point can be predicted by the motion vector at B2, B3 or A3, the motion vector v<NUM> at the top-right control point can be predicted by the motion vector at B0 or B1, and the motion vector v<NUM> at the left-bottom control point can be predicted by the motion vector at A0 or A1.

In accordance with one example of this disclosure, the video encoder <NUM> and the video decoder <NUM> may be configured to clip the value of delta MVs <MAT> and <MAT> to some predefined range when used for affine motion inheritance (e.g., in equations (<NUM>), (<NUM>) and (<NUM>)). For example, the predefined range may be from -<NUM>k to <NUM>k, where k is an integer value. For example, k may be <NUM> for <NUM> bit representation of the delta MVs or <NUM> for <NUM> bit representation of the delta MVs. In other examples, the base unit may be irrelevant to the range. For example, one unit could be <NUM>/<NUM>, <NUM>/<NUM>, <NUM>/<NUM>, or <NUM>/<NUM> samples. In another example, the predefined range may be a fixed unit of <NUM>/<NUM>, <NUM>/<NUM>, <NUM>/<NUM>, or <NUM>/<NUM> samples, and based on the precision (also referred to as resolution) of the delta MVs, the predefined range may be scaled. For example, if the base unit for the range is <NUM>/<NUM>, but the precision of the delta MVs is <NUM>/<NUM>, then the range may be scaled up by <NUM>. By clipping the value of the delta MVs, the delta MVs may be stored using fewer bits, resulting in the reduction of the amount of memory needed for storing delta MVs. Therefore, in some implementations, the video encoder <NUM> and the video decoder <NUM> may be configured to store the delta MVs with a certain number of bits. Typically, the number of bits is less than that of storing the original MV. For example, testing has shown that BD-rate performance of the reduction in bits is around <NUM>%. The average bit rate for the same quality of video may increase by around <NUM>%. In the following, the <NUM>-parameter affine motion is assumed. However, clipping for <NUM>-parameter affine motion may be similarly applied. In other words, the video encoder <NUM> and the video decoder <NUM> may clip delta motion vectors for the <NUM>-parameter affine motion model and/or the <NUM>-parameter affine motion model. Also, the distance between v<NUM> and v<NUM>, v<NUM> and v<NUM> are assumed to be w and h. However, the techniques of this disclosure can also be applied if the distances between the MVs are different values.

In view of the foregoing, in one example of the disclosure, the video encoder <NUM> and the video decoder <NUM> may be configured to determine delta motion vectors from control point motion vectors of a neighboring block of a current block of video data, clip the delta motion vectors to a predefined range, and code the current block of video data using the clipped delta motion vectors.

In one example, the video encoder <NUM> and the video decoder <NUM> may be configured to clip the values of the delta motion vectors v<NUM>x - v<NUM>x,v<NUM>y - v<NUM>y,v<NUM>x - v<NUM>x,v<NUM>y - v<NUM>y to the predefined range.

In another example, the video encoder <NUM> and the video decoder <NUM> may be configured to clip scaled values of the delta motion vectors v<NUM>x - v<NUM>x,v<NUM>y - v<NUM>y,v<NUM>x - v<NUM>x,v<NUM>y - v<NUM>y to the predefined range. For example, the scaled values are: <MAT>. S can be <NUM>, <NUM> or other predefined values. S may also be determined by the resolution of the delta MV. For example, if the anchor MV resolution (or precision) is different than the delta resolution (or precision), the delta MV resolution may be scaled. As such, in this example, the video encoder <NUM> and the video decoder <NUM> may be configured to scale the delta motion vectors prior to clipping, wherein the scaling is based on a scaling factor S. For example, the video encoder <NUM> and the video decoder <NUM> may include means for scaling the delta motion vectors.

In another example, the video encoder <NUM> and the video decoder <NUM> may be configured clip the values of <MAT> to the predefined range. In this example, the video encoder <NUM> and the video decoder <NUM> may be configured to scale the delta motion vectors prior to clipping, wherein the scaling is based on a width or a height of a corresponding neighboring block.

In another example, the video encoder <NUM> and the video decoder <NUM> may be configured to clip the scaled values of <MAT> to the predefined range. For example, the scaled values are: <MAT> , wherein N is predefined. In one example, N is the maximum size of a block. In another example, N is determined by w and h. In still another embodiment N is determined by the resolution of the MV. In still another example, N is the maximum size of a block divided by k, wherein k is an integer constant such as <NUM>, <NUM> or other integer numbers. The scaling may also be implemented by left shifting if N is power of <NUM>. In one example, N is <NUM>. Then, the multiply by N can be replaced by << <NUM>, where << is a bitwise left shift. Note that the values in equation (<NUM>), (<NUM>) and (<NUM>) are all scaled by N if scaled values are used. The values of vix', viy' can be obtained by scaling down by N.

As such, in the foregoing example, the video encoder <NUM> and the video decoder <NUM> may be configured to scale the delta motion vectors prior to clipping, wherein the scaling is based on a width or a height of a corresponding neighboring block and a scaling factor N. N may be a function of a width and/or a height of a neighboring block, a resolution of an MV or a maximum size of a block.

In one example, the range for clipping is determined such that the clipped value can be represented in certain number of bits. In one example, the range is (-<NUM>B-<NUM>, <NUM>B-<NUM>-<NUM>), wherein B is the number of bits to represent the clipped value. B can be <NUM>, <NUM> or other integer numbers. B can be a predefined fixed value or signaled from the video encoder <NUM> to the video decoder <NUM>.

In one example implementation to the VVC standard, the derivation process for luma affine control point motion vectors from a neighboring block as described in <NPL>, JVET-M1001 is modified as follows. Additions to JVET-M1001 are shown between <ADD> and </ADD>. Deletions from JVET-M1001 are shown between <DELETE> and </DELETE>.

Output of this process are the luma affine control point vectors cpMvLX[ cpIdx ] with cpIdx = <NUM>. numCpMv - <NUM> and X being <NUM> or <NUM>.

The variable isCTUboundary is derived as follows:.

The variables log2NbW and log2NbH are derived as follows: <MAT> <MAT>.

The variables mvScaleHor, mvScaleVer, dHorX and dVerX are derived as follows:.

The variables dHorY and dVerY are derived as follows:.

The luma affine control point motion vectors cpMvLX[ cpIdx ] with cpIdx = <NUM>. numCpMv - <NUM> and X being <NUM> or <NUM> are derived as follows:.

In another implementation to the VVC standard, the derivation process for luma affine control point motion vectors from a neighboring block in JVET-M1001 is modified as follows:.

In another example of this disclosure, affine motion inheritance from the above-left neighboring coded block (B2 in <FIG>) is prohibited. In other words, in this example, the video encoder <NUM> and the video decoder <NUM> may not use affine motion inheritance from the above-left neighboring coded block. Let (xCurr, yCurr) be the coordinate of the top-left pixel of the current block, then affine motion inheritance is prohibited if the x component of the neighboring block's coordinate is less than xCurr and the y component of the coordinate is less than yCurr. Therefore, affine motion inheritance can only be from the left or above neighboring coded blocks. In this way, the buffer size can be saved by <NUM>/<NUM> in the memory-optimized implementation (e.g., as described in <NPL>).

Note that the techniques of this disclosure can also be applied to normal motion vector prediction, wherein motion vector predictor from above-left neighboring coded block is prohibited.

<FIG> is a flow diagram illustrating techniques of the present disclosure. The video encoder <NUM> (e.g., the affine unit <NUM>) or the video decoder <NUM> (e.g., the affine unit <NUM>) may determine delta motion vectors from CPMVs of a neighboring block of a current block of video data (<NUM>). For example, the video encoder <NUM> or the video decoder <NUM> may determine a CPMV representation for the affine motion model and may convert the CPMV representation into a representation with delta MVs. For example, v<NUM> is the same as the top-left CPMV, ∇vh = (v<NUM> - v<NUM>)/w, ∇vv = (v<NUM> - v<NUM>)/h.

In some examples, the neighboring blocks do not include an above-left neighboring block relative to the current block. In other examples, the neighboring blocks include an above neighboring block and a left neighboring block. In some examples, the neighboring blocks include only an above neighboring block and a left neighboring block.

In some examples, the video encoder <NUM> (e.g., the affine unit <NUM>) or the video decoder <NUM> (e.g., the affine unit <NUM>) may scale the delta motion vectors (<NUM>). In other examples, the video encoder <NUM> or the video decoder <NUM> may not scale the delta motion vectors and proceed directly to box <NUM>. For example, the video encoder <NUM> (e.g., the affine unit <NUM>) or the video decoder <NUM> (e.g., the affine unit <NUM>) may scale the delta motion vectors based on a scaling factor S. Scaling factor S may be a predefined value or may be determined based on a resolution of the MV. In other examples, the video encoder <NUM> (e.g., the affine unit <NUM>) or the video decoder <NUM> (e.g., the affine unit <NUM>) may scale the delta motion vectors based on a width or a height of a corresponding neighboring block. In some examples, the video encoder <NUM> (e.g., the affine unit <NUM>) or the video decoder <NUM> (e.g., the affine unit <NUM>) may scale the delta motion vectors based on a width or a height of a corresponding neighboring block and a scaling factor N. In some examples, the scaling factor N may be a function of a width and/or a height of a neighboring block, a resolution of a motion vector, or a maximum size of a block.

The video encoder <NUM> (e.g., the affine unit <NUM>) or the video decoder <NUM> (e.g., the affine unit <NUM>) may clip the delta motion vectors (or the scaled delta motion vectors) to within a predefined range (<NUM>). For example, the video encoder <NUM> (e.g., the affine unit <NUM>) or the video decoder <NUM> (e.g., the affine unit <NUM>) may clip the delta motion vectors to a given number of bits B, such as an integer number. In some examples, the number of bits may be a predetermined fixed value. In other examples, the video encoder <NUM> may determine the number of bits and signal the number of bits to the video decoder <NUM>.

The video encoder <NUM> or the video decoder <NUM> may code the current block using the clipped delta motion vectors. For example, the video encoder <NUM> may form a prediction block for the current block using the clipped delta MVs and encode the current block using the prediction block. The video decoder <NUM> may form the prediction block for the current block using the clipped delta MVs and decode the current block using the prediction block.

<FIG> is a flowchart illustrating an example method for encoding a current block. The current block may comprise a current CU. Although described with respect to the video encoder <NUM> (<FIG> and <FIG>), it should be understood that other devices may be configured to perform a method similar to that of <FIG>.

In this example, the video encoder <NUM> initially predicts the current block (<NUM>). For example, the video encoder <NUM> may form a prediction block for the current block. In forming the prediction block using an affine prediction mode, the video encoder <NUM> may determine delta motion vectors from control point motion vectors of a neighboring block of the current block. In some examples, the video encoder <NUM> may scale the delta motion vectors as discussed above. In other examples, the video encoder <NUM> may not scale the delta motion vectors. The video encoder <NUM> may clip the delta motion vectors (or the scaled delta motion vectors) to within a predefined range.

The video encoder <NUM> may then calculate a residual block for the current block (<NUM>). To calculate the residual block, the video encoder <NUM> may calculate a difference between the original, uncoded block and the prediction block for the current block. The video encoder <NUM> may then transform and quantize coefficients of the residual block (<NUM>). Next, the video encoder <NUM> may scan the quantized transform coefficients of the residual block (<NUM>). During the scan, or following the scan, the video encoder <NUM> may entropy encode the coefficients (<NUM>). For example, the video encoder <NUM> may encode the coefficients using CAVLC or CABAC. The video encoder <NUM> may then output the entropy coded data of the block (<NUM>).

<FIG> is a flowchart illustrating an example method for decoding a current block of video data. The current block may comprise a current CU. Although described with respect to the video decoder <NUM> (<FIG> and <FIG>), it should be understood that other devices may be configured to perform a method similar to that of <FIG>.

The video decoder <NUM> may receive entropy coded data for the current block, such as entropy coded prediction information and entropy coded data for coefficients of a residual block corresponding to the current block (<NUM>). The video decoder <NUM> may entropy decode the entropy coded data to determine prediction information for the current block and to reproduce coefficients of the residual block (<NUM>). The video decoder <NUM> may predict the current block (<NUM>), e.g., using an intra- or inter-prediction mode as indicated by the prediction information for the current block, to calculate a prediction block for the current block. For an affine prediction mode, in forming the prediction block, the video decoder <NUM> may determine delta motion vectors from control point motion vectors of a neighboring block of the current block. In some examples, the video decoder <NUM> may scale the delta motion vectors as discussed above. In other examples, the video decoder <NUM> may not scale the delta motion vectors. The video decoder <NUM> may clip the delta motion vectors (or the scaled delta motion vectors) to within a predefined range.

The video decoder <NUM> may then inverse scan the reproduced coefficients (<NUM>), to create a block of quantized transform coefficients. The video decoder <NUM> may then inverse quantize and inverse transform the coefficients to produce a residual block (<NUM>). The video decoder <NUM> may ultimately decode the current block by combining the prediction block and the residual block (<NUM>).

Various examples of this disclosure include the examples that follow.

Example <NUM>. A method of coding video data, the method comprising determining delta motion vectors from control point motion vectors of neighboring blocks of a current block, clipping the delta motion vectors to a predefined range, and coding the current block of video data using the clipped delta motion vectors.

Example <NUM>. The method of example <NUM>, further comprising scaling the delta motion vectors prior to clipping.

Example <NUM>. The method of example <NUM>, wherein scaling the delta motion vectors prior to clipping comprises scaling the delta motion vectors prior to clipping, wherein the scaling is based on a scaling factor S.

Example <NUM>. The method of example <NUM>, wherein scaling the delta motion vectors prior to clipping comprises scaling the delta motion vectors prior to clipping, wherein the scaling is based on a width or a height of a corresponding neighboring block.

Example <NUM>. The method of example <NUM>, wherein scaling the delta motion vectors prior to clipping comprises scaling the delta motion vectors prior to clipping, wherein the scaling is based on a width or a height of a corresponding neighboring block and a scaling factor N.

Example <NUM>. The method of example <NUM>, wherein N is a function of a width and/or a height of a neighboring block, a resolution of a motion vector, or a maximum size of a block.

Example <NUM>. The method of example <NUM>, wherein the neighboring blocks do not include an above-left neighboring block relative to the current block.

Example <NUM>. The method of example <NUM>, wherein the neighboring blocks include an above neighboring block and a left neighboring block.

Example <NUM>. The method of example <NUM>, wherein the neighboring blocks include only an above neighboring block and a left neighboring block.

Example <NUM>. The method of any combination of examples <NUM>-<NUM>.

Example <NUM>. The method of any of examples <NUM>-<NUM>, wherein coding comprises decoding.

Example <NUM>. The method of any of examples <NUM>-<NUM>, wherein coding comprises encoding.

Example <NUM>. A device for coding video data, the device comprising one or more means for performing the method of any of examples <NUM>-<NUM>.

Example <NUM>. The device of example <NUM>, wherein the one or more means comprise one or more processors implemented in circuitry.

Example <NUM>. The device of any of examples <NUM> and <NUM>, further comprising a memory to store the video data.

Example <NUM>. The device of any of examples <NUM>-<NUM>, further comprising a display configured to display decoded video data.

Example <NUM>. The device of any of examples <NUM>-<NUM>, wherein the device comprises one or more of a camera, a computer, a mobile device, a broadcast receiver device, or a set-top box.

Example <NUM>. The device of any of examples <NUM>-<NUM> wherein the device comprises a video decoder.

Example <NUM>. The device of any of examples <NUM>-<NUM>, wherein the device comprises a video encoder.

Example <NUM>. A computer-readable storage medium having stored thereon instructions that, when executed, cause one or more processors to perform the method of any of examples <NUM>-<NUM>.

Instructions may be executed by one or more processors, such as one or more digital signal processors (DSPs), general purpose microprocessors, application specific integrated circuits (ASICs), field programmable gate arrays (FPGAs), or other equivalent integrated or discrete logic circuitry. Accordingly, the terms "processor" and "processing circuity," as used herein may refer to any of the foregoing structures or any other structure suitable for implementation of the techniques described herein.

Claim 1:
A device for coding video data using an affine motion model described by three control point motion vectors at three corners of a block of video data, the device comprising:
a memory configured to store a current block (<NUM>) of video data; and
one or more processors implemented in circuitry coupled to the memory, the one or more processors configured to:
determine delta motion vectors from control point motion vectors of a neighboring block (<NUM>) of the current block (<NUM>) of video data, wherein to determine the delta motion vectors, the one or more processors are configured to determine a horizontal delta motion vector based on a difference between a second control point motion vector at the top-right corner of the neighboring block (<NUM>) and a first control point motion vector at the top-left corner of the neighboring block (<NUM>) and determine a vertical delta motion vector based on a difference between a third control point motion vector at the bottom-left corner and the first control point motion vector of the neighboring block (<NUM>); and
clip the delta motion vectors to a predefined range; and
code the current block (<NUM>) of video data using the clipped delta motion vectors for deriving control point motion vectors for the current block.