Patent ID: 12238279

DETAILED DESCRIPTION

FIG.1illustrates a block diagram of an example of a system in which various aspects and embodiments can be implemented. System100may be embodied as a device including the various components described below and is configured to perform one or more of the aspects described in this application. Examples of such devices, include, but are not limited to, various electronic devices such as personal computers, laptop computers, smartphones, tablet computers, digital multimedia set top boxes, digital television receivers, personal video recording systems, connected home appliances, and servers. Elements of system100, singly or in combination, may be embodied in a single integrated circuit, multiple ICs, and/or discrete components. For example, in at least one embodiment, the processing and encoder/decoder elements of system100are distributed across multiple ICs and/or discrete components. In various embodiments, the system100is communicatively coupled to other systems, or to other electronic devices, via, for example, a communications bus or through dedicated input and/or output ports. In various embodiments, the system100is configured to implement one or more of the aspects described in this application.

The system100includes at least one processor110configured to execute instructions loaded therein for implementing, for example, the various aspects described in this application. Processor110may include embedded memory, input output interface, and various other circuitries as known in the art. The system100includes at least one memory120(e.g., a volatile memory device, and/or a non-volatile memory device). System100includes a storage device140, which may include non-volatile memory and/or volatile memory, including, but not limited to, EEPROM, ROM, PROM, RAM, DRAM, SRAM, flash, magnetic disk drive, and/or optical disk drive. The storage device140may include an internal storage device, an attached storage device, and/or a network accessible storage device, as non-limiting examples.

System100includes an encoder/decoder module130configured, for example, to process data to provide an encoded video or decoded video, and the encoder/decoder module130may include its own processor and memory. The encoder/decoder module130represents module(s) that may be included in a device to perform the encoding and/or decoding functions. As is known, a device may include one or both of the encoding and decoding modules. Additionally, encoder/decoder module130may be implemented as a separate element of system100or may be incorporated within processor110as a combination of hardware and software as known to those skilled in the art.

Program code to be loaded onto processor110or encoder/decoder130to perform the various aspects described in this application may be stored in storage device140and subsequently loaded onto memory120for execution by processor110. In accordance with various embodiments, one or more of processor110, memory120, storage device140, and encoder/decoder module130may store one or more of various items during the performance of the processes described in this application. Such stored items may include, but are not limited to, the input video, the decoded video or portions of the decoded video, the bitstream, matrices, variables, and intermediate or final results from the processing of equations, formulas, operations, and operational logic.

In several embodiments, memory inside of the processor110and/or the encoder/decoder module130is used to store instructions and to provide working memory for processing that is needed during encoding or decoding. In other embodiments, however, a memory external to the processing device (for example, the processing device may be either the processor110or the encoder/decoder module130) is used for one or more of these functions. The external memory may be the memory120and/or the storage device140, for example, a dynamic volatile memory and/or a non-volatile flash memory. In several embodiments, an external non-volatile flash memory is used to store the operating system of a television. In at least one embodiment, a fast external dynamic volatile memory such as a RAM is used as working memory for video coding and decoding operations, such as for MPEG-2, HEVC, or VVC.

The input to the elements of system100may be provided through various input devices as indicated in block105. Such input devices include, but are not limited to, (i) an RF portion that receives an RF signal transmitted, for example, over the air by a broadcaster, (ii) a Composite input terminal, (iii) a USB input terminal, and/or (iv) an HDMI input terminal.

In various embodiments, the input devices of block105have associated respective input processing elements as known in the art. For example, the RF portion may be associated with elements suitable for (i) selecting a desired frequency (also referred to as selecting a signal, or band-limiting a signal to a band of frequencies), (ii) down converting the selected signal, (iii) band-limiting again to a narrower band of frequencies to select (for example) a signal frequency band which may be referred to as a channel in certain embodiments, (iv) demodulating the down converted and band-limited signal, (v) performing error correction, and (vi) demultiplexing to select the desired stream of data packets. The RF portion of various embodiments includes one or more elements to perform these functions, for example, frequency selectors, signal selectors, band-limiters, channel selectors, filters, downconverters, demodulators, error correctors, and demultiplexers. The RF portion may include a tuner that performs various of these functions, including, for example, down converting the received signal to a lower frequency (for example, an intermediate frequency or a near-baseband frequency) or to baseband. In one set-top box embodiment, the RF portion and its associated input processing element receives an RF signal transmitted over a wired (for example, cable) medium, and performs frequency selection by filtering, down converting, and filtering again to a desired frequency band. Various embodiments rearrange the order of the above-described (and other) elements, remove some of these elements, and/or add other elements performing similar or different functions. Adding elements may include inserting elements in between existing elements, for example, inserting amplifiers and an analog-to-digital converter. In various embodiments, the RF portion includes an antenna.

Additionally, the USB and/or HDMI terminals may include respective interface processors for connecting system100to other electronic devices across USB and/or HDMI connections. It is to be understood that various aspects of input processing, for example, Reed-Solomon error correction, may be implemented, for example, within a separate input processing IC or within processor110as necessary. Similarly, aspects of USB or HDMI interface processing may be implemented within separate interface ICs or within processor110as necessary. The demodulated, error corrected, and demultiplexed stream is provided to various processing elements, including, for example, processor110, and encoder/decoder130operating in combination with the memory and storage elements to process the datastream as necessary for presentation on an output device.

Various elements of system100may be provided within an integrated housing, Within the integrated housing, the various elements may be interconnected and transmit data therebetween using suitable connection arrangement115, for example, an internal bus as known in the art, including the I2C bus, wiring, and printed circuit boards.

The system100includes communication interface150that enables communication with other devices via communication channel190. The communication interface150may include, but is not limited to, a transceiver configured to transmit and to receive data over communication channel190. The communication interface150may include, but is not limited to, a modem or network card and the communication channel190may be implemented, for example, within a wired and/or a wireless medium.

Data is streamed to the system100, in various embodiments, using a Wi-Fi network such as IEEE 802.11. The Wi-Fi signal of these embodiments is received over the communications channel190and the communications interface150which are adapted for Wi-Fi communications. The communications channel190of these embodiments is typically connected to an access point or router that provides access to outside networks including the Internet for allowing streaming applications and other over-the-top communications. Other embodiments provide streamed data to the system100using a set-top box that delivers the data over the HDMI connection of the input block105. Still other embodiments provide streamed data to the system100using the RF connection of the input block105.

The system100may provide an output signal to various output devices, including a display165, speakers175, and other peripheral devices185. The other peripheral devices185include, in various examples of embodiments, one or more of a stand-alone DVR, a disk player, a stereo system, a lighting system, and other devices that provide a function based on the output of the system100. In various embodiments, control signals are communicated between the system100and the display165, speakers175, or other peripheral devices185using signaling such as AV.Link, CEC, or other communications protocols that enable device-to-device control with or without user intervention. The output devices may be communicatively coupled to system100via dedicated connections through respective interfaces160,170, and180. Alternatively, the output devices may be connected to system100using the communications channel190via the communications interface150. The display165and speakers175may be integrated in a single unit with the other components of system100in an electronic device, for example, a television. In various embodiments, the display interface160includes a display driver, for example, a timing controller (T Con) chip.

The display165and speaker175may alternatively be separate from one or more of the other components, for example, if the RF portion of input105is part of a separate set-top box. In various embodiments in which the display165and speakers175are external components, the output signal may be provided via dedicated output connections, including, for example, HDMI ports, USB ports, or COMP outputs.

FIG.2illustrates an example video encoder200, such as a High Efficiency Video Coding (HEVC) encoder.FIG.2may also illustrate an encoder in which improvements are made to the HEVC standard or an encoder employing technologies similar to HEVC, such as a VVC (Versatile Video Coding) encoder under development by JVET (Joint Video Exploration Team).

In the present application, the terms “reconstructed” and “decoded” may be used interchangeably, the terms “encoded” or “coded” may be used interchangeably, the terms “pixel” or “sample” may be used interchangeably, and the terms “image,” “picture” and “frame” may be used interchangeably. Usually, but not necessarily, the term “reconstructed” is used at the encoder side while “decoded” is used at the decoder side.

Before being encoded, the video sequence may go through pre-encoding processing (201), for example, applying a color transform to the input color picture (e.g., conversion from RGB 4:4:4 to YCbCr 4:2:0), or performing a remapping of the input picture components in order to get a signal distribution more resilient to compression (for instance using a histogram equalization of one of the color components). Metadata can be associated with the pre-processing, and attached to the bitstream.

In the encoder200, a picture is encoded by the encoder elements as described below. The picture to be encoded is partitioned (202) and processed in units of, for example, CUs. Each unit is encoded using, for example, either an intra or inter mode. When a unit is encoded in an intra mode, it performs intra prediction (260). In an inter mode, motion estimation (275) and compensation (270) are performed. The encoder decides (205) which one of the intra mode or inter mode to use for encoding the unit, and indicates the intra/inter decision by, for example, a prediction mode flag. Prediction residuals are calculated, for example, by subtracting (210) the predicted block from the original image block.

The prediction residuals are then transformed (225) and quantized (230). The quantized transform coefficients, as well as motion vectors and other syntax elements, are entropy coded (245) to output a bitstream. The encoder can skip the transform and apply quantization directly to the non-transformed residual signal. The encoder can bypass both transform and quantization, i.e., the residual is coded directly without the application of the transform or quantization processes.

The encoder decodes an encoded block to provide a reference for further predictions. The quantized transform coefficients are de-quantized (240) and inverse transformed (250) to decode prediction residuals. Combining (255) the decoded prediction residuals and the predicted block, an image block is reconstructed. In-loop filters (265) are applied to the reconstructed picture to perform, for example, deblocking/SAO (Sample Adaptive Offset) filtering to reduce encoding artifacts. The filtered image is stored at a reference picture buffer (280).

FIG.3illustrates a block diagram of an example video decoder300. In the decoder300, a bitstream is decoded by the decoder elements as described below. Video decoder300generally performs a decoding pass reciprocal to the encoding pass as described inFIG.2. The encoder200also generally performs video decoding as part of encoding video data.

In particular, the input of the decoder includes a video bitstream, which can be generated by video encoder200. The bitstream is first entropy decoded (330) to obtain transform coefficients, motion vectors, and other coded information. The picture partition information indicates how the picture is partitioned. The decoder may therefore divide (335) the picture according to the decoded picture partitioning information. The transform coefficients are de-quantized (340) and inverse transformed (350) to decode the prediction residuals. Combining (355) the decoded prediction residuals and the predicted block, an image block is reconstructed. The predicted block can be obtained (370) from intra prediction (360) or motion-compensated prediction (i.e., inter prediction) (375). In-loop filters (365) are applied to the reconstructed image. The filtered image is stored at a reference picture buffer (380).

The decoded picture can further go through post-decoding processing (385), for example, an inverse color transform (e.g. conversion from YCbCr 4:2:0 to RGB 4:4:4) or an inverse remapping performing the inverse of the remapping process performed in the pre-encoding processing (201). The post-decoding processing can use metadata derived in the pre-encoding processing and signaled in the bitstream.

Affine Mode

In HEVC, only the translational motion model is applied for motion-compensated prediction. To consider other types of motion, e.g., zoom in/out, rotation, perspective motions and other irregular motions, an affine motion-compensated prediction is applied in the VTM-3.0. The affine motion model in VVC is either 4-parameter or 6-parameter.

The four-parameter affine motion model has the following parameters: two parameters for translation movement in horizontal and vertical directions, one parameter for zoom motion for both directions, and one parameter for rotation motion for both directions. Horizontal zoom parameter is equal to vertical zoom parameter. Horizontal rotation parameter is equal to vertical rotation parameter. The four-parameter affine motion model is coded in VTM using two motion vectors at two control point positions defined at top-left corner (810) and top-right corner (820) of current CU. As shown inFIG.5, the affine motion field of the block is described by two control point motion vectors (V0, V1). Based on the control point motion, the motion field (νx, νy) of one affine coded block is described as

vx=(v1⁢x-v0⁢x)w⁢x-(v1⁢y-v0⁢y)w⁢y+v0⁢x⁢vy=(v1⁢y-v0⁢y)w⁢x+(v1⁢x-v0⁢x)w⁢y+v0⁢y.Equation⁢1
where (v0x, v0y) is motion vector of the top-left corner control point (810), and (v1x, v1y) is motion vector of the top-right corner control point (820), and w is the width of CU. In VTM-3.0, the motion field of an affine coded CU is derived at the 4×4 block level, that is, (νx, νy) is derived for each of the 4×4 blocks within the current CU and applied to the corresponding 4×4 block.

The 6-parameter affine motion model has the following parameters: two parameters for translation movement in horizontal and vertical directions, one parameter for zoom motion and one parameter for rotation motion in horizontal direction, and one parameter for zoom motion and one parameter for rotation motion in vertical direction. The 6-parameter affine motion model is coded with three MVs at three control points. As shown inFIG.5, three control points for a 6-parameter affine coded CU are defined at top-left, top-right and bottom left corners (910,920,930) of a CU. The motion at top-left control point (910) is related to translation motion, and the motion at top-right control point (920) is related to rotation and zoom motion in horizontal direction, and the motion at bottom-left control point (930) is related to rotation and zoom motion in vertical direction. For the 6-parameter affine motion model, the rotation and zoom motion in the horizontal direction may not be same as those motion in the vertical direction. The motion vector of each sub-block (νx, νy) is derived using three MVs at control points as:

vx=v0⁢x+(v1⁢x-v0⁢x)*xw+(v2⁢x-v0⁢x)*yh⁢vy=v0⁢y+(v1⁢y-v0⁢y)*xw+(v2⁢y-v0⁢y)*yh.Equation⁢2
where (ν2x, ν2y) is the motion vector of the bottom-left control point (930), (x, y) is the center position of the sub-block, w and h are the width and height of the CU.
Temporal Optical Flow
Bi-Directional Optical Flow (BDOF)

Conventional bi-prediction in video coding is a simple combination of two temporal prediction blocks obtained from the reference pictures that are already reconstructed. However, due to the limitation of the block-based motion compensation (MC), there could be remaining small motion that can be observed between the samples of two prediction blocks, thus reducing the efficiency of motion-compensated prediction. To solve this problem, the bi-directional optical flow (BDOF) tool is included in VTM 3.0 (VVC Test Model 3.0, see B. Bross, J. Chen, S. Liu, “Versatile Video Coding (Draft 3),” 12th Meeting: Macao, CN, JVET-L1001, 3-12 Oct. 2018) to reduce the impact of such motion for every sample inside one block. BDOF, previously referred to as BIO, is used to refine the bi-prediction signal of a CU at the 4×4 sub-block level. The BDOF mode is based on the optical flow concept, which assumes that the motion of an object is smooth and its luminance is constant along the considered time interval. BDOF is sample-wise motion refinement, which is performed on top of block-wise motion compensation for bi-prediction. The sample-level motion refinement does not use signaling. In case of bi-prediction, the goal of BDOF is to refine motion for each sample assuming linear displacement in-between the two reference pictures and based on Hermite's interpolation of the optical flow as shown inFIG.6.

In VTM-3.0, BDOF is only applied to the luma component. BDOF is applied to a CU if the CU satisfies the following conditions:the CU's height is not 4, and the CU is not in size of 4×8.the CU is not coded using affine mode or the ATMVP (Alternative Temporal Motion Vector Prediction) merge mode.the CU is coded using “true” bi-prediction mode, i.e., one of the two reference pictures is prior to the current picture in display order and the other is after the current picture in display order.

Specifically, in the current BDOF design, the derivation of the refined motion vector for each sample in one block is based on the classical optical flow model, which describes the relation of motion velocity and the luminance change in spatial and temporal domain. Let I(k)(x, y) be the sample value at the coordinate (x, y) of the prediction block derived from the reference picture list k (k=0, 1), and ∂I(k)(x, y)/∂x and ∂I(k)(x, y)/∂y are the horizontal and vertical gradients of the sample. Given the optical flow model, the motion refinement (vx, vy) at (x, y) can be derived by

∂I(k)(x,y)∂t+vx·∂I(k)(x,y)∂x+vy·∂I(k)(x,y)∂y=0.Equation⁢3

InFIG.6, suppose there are a backward reference at temporal distance τ0and a forward reference at temporal distance τ1to the current picture, (MVx0, MVy0) and (MVx1, MVy1) indicate the block-level motion vectors that are used to generate the two prediction blocks I(0)and I(1)in the two reference pictures, respectively. Based on the optical flow model, for predicting the current block IBin the current picture, we have (assuming τ0=τ1=1):

IB(x,y)=I0(x,y)-vx·∂I(0)(x,y)∂x-vy·∂I(0)(x,y)∂y⁢IB(x,y)=I1(x,y)+vx·∂I(1)(x,y)∂x+vy·∂I(1)(x,y)∂y⁢IB(x,y)=(Equation⁢4)I0(x,y)+I1(x,y)2+vx·(∂I(1)(x,y)∂x-∂I(0)(x,y)∂x)+vy·(∂I(1)(x,y)∂y-∂I(0)(x,y)∂y)2.
where

I0(x,y)+I1(x,y)2
is the regular bi-prediction, and the remaining offset is the BDOF adjustment which is calculated based on the motion refinement and the gradients.

Further, the motion refinement (vx, vy) at the sample location (x, y) is calculated by minimizing the difference Δ between the values of the samples after motion refinement compensation (i.e., A and B inFIG.6), as shown as:

Δ⁡(x,y)=I(1)(x,y)-I(0)(x,y)+vx(∂I(1)(x,y)∂x+∂I(0)(x,y)∂x)+vy(∂I(1)(x,y)∂y+∂I(0)(x,y)∂y).Equation5.

To ensure the regularity of the derived motion refinement, it is assumed that the motion refinement is consistent for the samples inside one 4×4 sub-block. For each 4×4 sub-block, a motion refinement (vxB, vyB) is calculated by minimizing the difference between the L0 and L1 prediction samples. The motion refinement is then used to adjust the bi-predicted sample values in the 4×4 sub-block. The following steps are applied in the BDOF process.

First, the horizontal and vertical gradients,

∂I(k)∂x⁢(i,j)⁢and⁢∂I(k)∂y⁢(i,j),
k=0,1, of the two prediction signals are computed by directly calculating the difference between two neighboring samples, i.e.,

The⁢horizontal⁢and⁢vertical⁢⁢gradients⁢of⁢the⁢two⁢prediction⁢signals⁢∂I(k)∂x⁢(i,j)=(I(k)(i+1,j)-I(k)(i-1,j))≫4⁢∂I(k)∂y⁢(i,j)=(I(k)(i,j+1)-I(k)(i,j-1))≫4.Equation⁢6
where I(k)(i,j) are the sample value at coordinate (i,j) of the prediction signal in list k, k=0,1.

Then, the auto- and cross-correlation of the gradients, S1, S2, S3, S5and S6, are calculated as
S1=Σ(i,j)∈Ωψx(i,j)·ψx(i,j),S3=Σ(i,j)∈Ωθ(i,j)·ψx(i,j)
S2=Σ(i,j)∈Ωψx(i,j)·ψy(i,j)
S5=Σ(i,j)∈Ωψy(i,j)·ψy(i,j)S6=Σ(i,j)∈Ωθ(i,j)·ψy(i,j)
Equation 7: The Auto- and Cross-Correlation of the Gradients.
where Ω is a 6×6 window surrounding the 4×4 sub-block, and

ψx(i,j)=(∂I(1)∂x⁢(i,j)+∂I(0)∂x⁢(i,j))≫na⁢ψy(i,j)=(∂I(1)∂y⁢(i,j)+∂I(0)∂y⁢(i,j))≫na⁢θ⁡(i,j)=(I(1)(i,j)≫nb)-(I(0)(i,j)≫nb)

The motion refinement (νxB, νyB) is then derived using the cross- and auto-correlation terms using the following:
vxB=S1>0?clip3(−th′BIO,th′BIO,−((S3·2nb−na)>>└log2S1┘)): 0
vyB=S5>0?clip3((−th′BIO,th′BIO,−((S6·2nb−na−((νxS2,m)<<nS2+vxS2,s)/2)>>└log2S5┘)):0
Equation 8: Derive the Motion Vector Refinement (vxB, vyB).
where

S2,m=S2≫nS2,S2,s=S2&⁢(2ns2-1),thBIO′=21⁢3-B⁢D,
and └·┘ is the floor function.

Based on the motion refinement and the gradients, the following adjustment is calculated for each sample in the 4×4 sub-block:

Δ⁢IB(x,y)=r⁢n⁢d⁡((vx⁢B(∂I(1)(x,y)∂x-∂I(0)(x,y)∂x))/2)+r⁢n⁢d⁡((vy⁢B(∂I(1)(x,y)∂y-∂I(0)(x,y)∂y))/2)
where rnd( ) is the rounding function to return the integral value that is nearest to the argument.
Equation 9: Adjustment with BDOF for Each Sample in the 4×4 Sub-Block.

Finally, the BDOF samples of the CU are calculated by adjusting the bi-prediction samples as follows:
IB(x,y)=(I0(x,y)+I1(x,y)+ΔIB(x,y)+ooffset)>>shift
where ooffsetand shift are used to normalize the final predictor to input bitdepth.
Equation 10: Adjust the Bi-Prediction Samples with BDOF.

In the above, the values of na, nband nS2are equal to 3, 6, and 12, respectively. These values are selected such that the multipliers in the BDOF process do not exceed 15-bit, and the maximum bit-width of the intermediate parameters in the BDOF process is kept within 32-bit.

In order to derive the gradient values, some prediction samples I(k)(i,j) in list k (k=0,1) outside of the current CU boundaries need to be generated. As depicted inFIG.7, BDOF in VTM-3.0 uses one extended row/column around the CU's boundaries. In order to control the computational complexity of generating the out-of-boundary prediction samples, a bilinear filter is used to generate prediction samples in the extended area (white positions), and the normal 8-tap motion compensation interpolation filter is used to generate prediction samples within the CU (gray positions). These extended sample values are used in gradient calculation only. For the remaining steps in the BDOF process, if any sample and gradient values outside of the CU boundaries are needed, they are padded (i.e., repeated) from their nearest neighbors.

Spatial Optical Flow

Prediction Refinement with Optical Flow (PROF)

Affine motion model parameters can be used to derive the motion vector of each pixel in a CU. While the complexity of generating pixel-based affine motion-compensated prediction is very high because memory access bandwidth requirement for this kind of sample-based MC is high, the current VVC adopted a sub-block based affine motion compensation method, where a CU is divided into 4×4 sub-blocks, each of which is assigned with a MV which is derived from the affine model parameters. The MV is a MV at the center of the sub-block. All pixels in the sub-block share the same sub-block MV. Sub-block based affine motion compensation is a tradeoff between coding efficiency and complexity.

In JVET-N0236 (see J. Luo, Y. He, “CE2-related: Prediction refinement with optical flow for affine mode”, 14th Meeting: Geneva, CH, JVET-N0236, 19-27 Mar. 2019), an optical flow based motion refinement has been proposed to correct the block-based affine motion compensation. In particular, to achieve a finer granularity of motion compensation, JVET-N0236 proposes a method to refine the sub-block-based affine motion-compensated prediction with optical flow, which uses the small motion difference between the sample-wise affine motion and the sub-block affine motion to derive the luminance refinement. After the sub-block-based affine motion compensation is performed, luma prediction sample is refined by adding a difference derived by the optical flow equation. PROF is described in the following four steps.

Step 1) The sub-block-based affine motion compensation is performed to generate sub-block prediction I(i, j).

Step 2) The spatial gradients

∂I∂x⁢(i,j)⁢and⁢∂I∂y⁢(i,j)
of the sub-block prediction are calculated at each sample location using a 3-tap filter [−1, 0, 1].

The⁢horizontal⁢and⁢vertical⁢⁢gradients⁢of⁢the⁢sub-block⁢prediction⁢signal⁢∂I∂x⁢(i,j)=I⁡(i+1,j)-I⁡(i-1,j)⁢∂I∂y⁢(i,j)=I⁡(i,j+1)-I⁡(i,j-1).Equation⁢11

The sub-block prediction is extended by one pixel on each side for the gradient calculation. To reduce the memory bandwidth and complexity, the pixels on the extended borders are copied from the nearest integer pixel position in the reference picture. Therefore, additional interpolation for a padding region is avoided.

Step 3) The luma prediction refinement is calculated by the optical flow equation.

Adjustment⁢with⁢⁢PROF⁢for⁢each⁢sample⁢⁢in⁢the⁢4×4⁢sunb-block⁢Δ⁢IP(x,y)=∂I∂x⁢(x,y)*Δ⁢vx⁢P(x,y)+∂I∂y⁢(x,y)*Δ⁢vy⁢P(x,y).Equation⁢12
where the ΔvP(x, y) is the difference between pixel MV computed for sample location (x, y), denoted by v(x, y), and the sub-block MV (νSB) of the sub-block to which pixel (x, y) belongs, as shown inFIG.8.

Since the affine model parameters and the pixel location relative to the sub-block center do not change from sub-block to sub-block, ΔvP(x, y) can be calculated for the first sub-block, and reused for other sub-blocks in the same CU. Let x and y be the horizontal and vertical offset from the pixel location to the center of the sub-block, ΔvP(x, y) can be derived by the following equation:

Derive⁢the⁢motion⁢vector⁢refinement⁢(Δνx⁢P,Δνy⁢P)⁢{Δ⁢vx⁢P(x,y)=c*x+d*yΔ⁢vy⁢P(x,y)=e*x+f*y.Equation⁢13

For a 4-parameter affine model,

{c=f=v1⁢x-v0⁢xwe=-d=v1⁢y-v0⁢yw

For a 6-parameter affine model,

{c=v1⁢x-v0⁢xwd=v2⁢x-v0⁢xhe=v1⁢y-v0⁢ywf=v2⁢y-v0⁢yh
where (v0x, v0y), (v1x, v1y), (v2x, v2y) are the top-left, top-right and bottom-left control point motion vectors, w and h are the width and height of the CU.

Step 4) Finally, the luma prediction refinement is added to the sub-block prediction I(i, j). The final prediction IP(x, y) is generated as the following equation:
IP(x,y)=I(x,y)+ΔIP(x,y).

In one embodiment, the present application proposes to apply BDOF for the motion compensation of a bi-direction affine coded CU by using the same spatial gradients derivation rule as PROF. The present application also proposes to combine these two optical flow based motion refinements, PROF and BDOF, to correct the block-based affine motion compensation. In case that the calculation of the spatial gradients

∂I∂x⁢(i,j)⁢and⁢∂I∂y⁢(i,j)
is performed for both PROF and BDOF, some simplifications of the prediction refinement derivation process might be achieved. A general bi-prediction refinement in affine mode with optical flow is also proposed.
Activate BDOF for Affine and Modify the Derivation of Spatial Gradients

As mentioned above, for BDOF in VTM-3.0, the sub-block prediction is extended by one pixel each side for the spatial gradient calculation of the prediction signals. Therefore, an extended sub-block (a 6×6 window including the 4×4 sub-block and the padding samples) is used as depicted inFIG.7. Because only one single motion vector is applied for a non-affine CU in each reference picture list, the generation of the padding region (i.e., extended borders) can be performed once for the prediction block corresponding to the whole CU. Therefore, the BDOF uses one extended row/column around the CU's boundaries. These out-of-boundary prediction samples are generated by the bilinear filter.

If different MVs are applied for each 4×4 sub-block, then the generation of the padding region should be performed for each sub-block prediction separately. Several computations of deriving the out-of-boundary prediction and the corresponding memory storages are needed, which is not good for controlling the computational complexity. Thus, in VTM-3.0, BDOF is not applied to a CU coded using the affine mode.

To reduce the memory bandwidth and complexity, when PROF generates the padding region, the pixels on the extended borders are copied from the nearest integer pixel position in the reference picture. Therefore, additional interpolation for the padding region is avoided.

In one embodiment, the present application proposes to apply BDOF for the motion compensation of an affine coded CU, and to derive the spatial gradients of the prediction signals with the same padding region generation rule as PROF, which uses the nearest integer pixels as shown inFIG.9. When padding a block of prediction signals with prediction samples at integer sample positions, each sample in the padding region is generated by copying the nearest integer sample in the prediction block. When the prediction signals are at fractional sample positions, a new block with integer sample positions is used where each integer sample position in the new block is closest to a corresponding sample in the prediction block. As shown inFIG.9, the integer samples (960) used to generate extended prediction samples (970) are closest to the fractional-sample positions (950).

Mathematically, let x and y be the corresponding horizontal and vertical sample positions in the reference picture in 1/16-sample unit, which are represented at 1<<BitsFrac(BitsFrac=4) accuracy, the nearest integer sample positions xintand yintfor padding region can be derived by the following equation:
xint=(x>>BitsFrac)+((x&15)>>(BitsFrac−1))−1
xint=Clip3(0,picW−1,xint)
yint=(y>>BitsFrac)+((y&15)>>(BitsFrac−1))−1
yint=Clip3(0,picH−1,yint)
Equation 14: Derive the Nearest Integer Sample Position for Padding.
where the value of BitsFracequals to 4, picW and picH indicates the width and height of the reference picture, respectively.
Apply BDOF for Motion Compensation of a Bi-Direction Affine Coded CU After PROF

In this embodiment, BDOF is applied for the motion compensation of a bi-direction affine coded CU after performing PROF. As shown inFIG.10, for a bi-prediction CU, the prediction signals can be computed (1020,1025) for both reference picture lists. After PROF (1030,1035) is performed for a CU with affine mode, BDOF can be applied (1040) for this affine coded CU after PROF to further refine the prediction signals.

In particular, for a CU using bi-prediction signals, PROF is applied (1030,1035) to refine the sub-block based affine motion-compensated prediction signals I0from reference 0 (1020) and I1from reference 1 (1025). The process of PROF is the same as before without extra modification. The luma prediction refinements ΔIP0and ΔIP1of I0and I1are calculated by the optical flow equation with their corresponding horizontal and vertical spatial gradients

∂I0∂x,∂I0∂y,∂I1∂x⁢and⁢∂I1∂y,
and the MV difference between the pixel MV and the sub-block MV derived by the affine model.

Prediction⁢refinements⁢with⁢PROF⁢for⁢each⁢reference⁢list⁢Δ⁢IP⁢0(x,y)=∂I0∂x⁢(x,y)*Δ⁢vx⁢P⁢0(x,y)+∂I0∂y⁢(x,y)*Δ⁢vy⁢P⁢0(x,y)⁢Δ⁢IP⁢1(x,y)=∂I1∂x⁢(x,y)*Δ⁢vx⁢P⁢1(x,y)+∂I1∂y⁢(x,y)*Δ⁢vy⁢P⁢1(x,y).Equation⁢15

The corrected luma prediction signals with PROF, IP0and IP1, are generated by adding the prediction refinements ΔIP0and ΔIP1to the prediction signals separately:
IP0(x,y)=I0(x,y)+ΔIP0(x,y)
IP1(x,y)=I1(x,y)+ΔIP1(x,y)
Equation 16: Adjust the Prediction Samples with PROF for Each Reference List.

After obtaining the corrected prediction signals from the two reference picture lists, the BDOF process is performed (1040) on IP0and IP1.

In one example, the classical BDOF as mentioned before is applied. To be noted, the input prediction signals are not the original prediction signals I0and I1, but the corrected prediction signals with PROF IP0and IP1. Therefore, the corresponding horizontal and vertical spatial gradients are

∂IP⁢0∂x,∂IP⁢0∂y,∂IP⁢1∂x⁢and⁢∂IP⁢1∂y.
Based on the motion refinement and the spatial gradients, the prediction refinement with BDOF ΔIBcan be roughly represented by:

Prediction⁢refinement⁢with⁢BDOF⁢after⁢PROF⁢Δ⁢IB(x,y)=(∂IP⁢1∂x⁢(x,y)-∂IP⁢0∂x⁢(x,y))*Δ⁢vx⁢B⁢(x,y)+(∂IP⁢1∂y⁢(x,y)-∂IP⁢0∂y⁢(x,y))*Δ⁢vy⁢B(x,y)2Equation⁢17

In this case, the final prediction IBis generated as the following:

Adjust⁢the⁢bi-prediction⁢samples⁢with⁢BDOF⁢after⁢PROF⁢IB(x,y)=IP⁢0(x,y)+IP⁢1(x,y)2+Δ⁢IB⁢(x,y)Equation⁢18

In another example, the original prediction signals I0and I1are used to derive the related spatial gradients and motion refinement for BDOF. The advantage is that the spatial gradients

∂I0∂x,∂I0∂y,∂I1∂x⁢and⁢∂I1∂y
have already been generated by PROF, and can be re-used for BDOF without adding extra complexity of calculation and memory storage.
Simplification of the Prediction Refinement when Combining PROF and BDOF

In the above example, if PROF has already been performed for a CU with the affine mode, then the spatial gradients

∂I0∂x,∂I0∂y,∂I1∂x⁢and⁢∂I1∂y
of the prediction signals can be re-used directly for the subsequent BDOF process. Hence, there are some overlapping calculations to derive the prediction refinements and the final corrected prediction signals when PROF and BDOF are combined. In one embodiment, some further simplifications of the prediction derivation process are proposed.

As proposed in one above example, the spatial gradients

∂I0∂x,∂I0∂y,∂I1∂x⁢and⁢∂I1∂y
obtained in steps1030and1035inFIG.10are re-used directly for the BDOF process in step1040. Therefore, based on these spatial gradients from PROF, the prediction refinement ΔIBcan be generated by:

Prediction⁢refinement⁢for⁢BDOF⁢re-using⁢the⁢spatial⁢gradients⁢from⁢PROF⁢Δ⁢IB(x,y)=(∂I1∂x⁢(x,y)-∂I0∂x⁢(x,y))*Δ⁢vx⁢B⁢(x,y)+(∂I1∂y⁢(x,y)-∂I0∂y⁢(x,y))*Δ⁢vy⁢B(x,y)2Equation⁢19

In this case, the generation of final prediction IBcan be simplified as the following:

Simplification⁢of⁢adjusting⁢the⁢bi-prediction⁢samples⁢with⁢the⁢combination⁢of⁢BDOF⁢and⁢PROF⁢IB(x,y)=IP⁢0(x,y)+IP⁢1(x,y)2+Δ⁢IB(x,y)=I0(x,y)+Δ⁢IP⁢0(x,y)+I1(x,y)+Δ⁢IP⁢1(x,y)2+(∂I1∂x⁢(x,y)-∂I0∂x⁢(x,y))*Δ⁢vx⁢B⁢(x,y)+(∂I1∂y⁢(x,y)-∂I0∂y⁢(x,y))*Δ⁢vy⁢B(x,y)2=(I0⁢(x,y)+I1⁢(x,y)+∂I0∂x⁢(x,y)*Δ⁢vx⁢0⁢(x,y)+∂I1∂x⁢(x,y)*Δ⁢vx⁢1(x,y)+∂I0∂y⁢(x,y)*Δ⁢vy⁢0(x,y)+∂I1∂y⁢(x,y)*Δ⁢vy⁢1⁢(x,y))/2.Equation⁢20
where:
Δvx0(x,y)=ΔvxP0(x,y)−ΔvxB(x,y)
Δvx1(x,y)=ΔvxP1(x,y)+ΔvxB(x,y)
Δvy0(x,y)=ΔvyP0(x,y)−ΔvyB(x,y)
Δvy1(x,y)=ΔvyP1(x,y)+ΔvyB(x,y)

Therefore, this simplification of the combination of PROF and BDOF can further change the prediction refinement derivation and the final prediction correction process, as illustrated inFIG.11.

After obtaining the motion-compensated prediction signals I0from reference 0 and I1from reference 1 separately as in step1110and step1115, the horizontal and vertical spatial gradients

∂I0∂x,∂I0∂y,∂I1∂x⁢and⁢∂I1∂y
are derived using I0and I1in step1120and step1125.

Then the motions refinements of PROF and BDOF are generated based on these spatial gradients in steps1130,1135and1140using Equation 15 and Equation 19. The combined motion refinements for PROF and BDOF (Δvx0, Δvy0, Δvx1, Δvy1) are derived (1150) for the following process. The steps to calculate the prediction refinements with PROF ΔIP0and ΔIP1, and the corresponding corrected prediction signals IP0and IP1are skipped in this embodiment. Instead, the final prediction IBusing the combined refinements of PROF and BDOF is derived directly in step1160with Equation 20.

Advantageously, these simplifications can reduce several overlapped calculations, and reduce the memory accesses.

Bi-Prediction Refinement in Affine Mode

In the above, BDOF based on the temporal optical flow model and PROF based on the spatial optical flow model can be combined. More generally, in one embodiment, the present application proposes a bi-prediction refinement in affine based on the spatial and temporal optical flow models, which describe the relation of motion velocity and the luminance change in spatial and temporal domain respectively. To achieve a finer granularity of sub-block based affine motion compensation, luma prediction sample is refined by adding a difference derived by the optical flow equation. The proposed bi-prediction refinement in affine is shown inFIG.12and described in the following.

Firstly, the sub-block-based affine motion compensations are performed in two reference picture lists to generate sub-block predictions I0and I1in step1210and step1215. In step1220and step1225, the horizontal and vertical spatial gradients,

∂I0∂x,∂I0∂y,∂I1∂x⁢and⁢∂I1∂y
of the two sub-block prediction signals are then derived, for example, by directly calculating the difference between two neighboring samples as described before. The sub-block prediction is extended by one pixel on each side for the gradient calculation, for example, the pixels on the extended borders are copied from the nearest integer pixel position in the reference picture.

Subsequently, the motion refinements from the two reference pictures lists, (Δvx0, Δvy0) and (Δvx1, Δvy1) are calculated in step1230. Based on the motion refinements and the gradients, the bi-prediction refinement ΔI is calculated for each sample in the 4×4 sub-block as shown in step1240:

Generate⁢the⁢bi-prediction⁢refinement⁢Δ⁢I⁡(x,y)=∂I0∂x⁢(x,y)*Δ⁢vx⁢0(x,y)+∂I1∂x⁢(x,y)*Δ⁢vx⁢1(x,y)+∂I0∂y⁢(x,y)*Δ⁢vy⁢0(x,y)+∂I1∂y⁢(x,y)*Δ⁢vy⁢1(x,y).Equation⁢21

Finally, the luma prediction refinement is added to the sub-block predictions to generate (1250) the final prediction as the following:

Prediction⁢with⁢the⁢proposed⁢bi-prediction⁢refinement⁢in⁢affine⁢I=I0+I12+Δ⁢I.Equation⁢22

Advantageously, this proposed bi-prediction refinement uses the temporal and spatial optical flow models to achieve sample-wise correction of affine prediction samples. Furthermore, considering the refinements from bi-direction gives an even finer affine prediction.

Various methods are described herein, and each of the methods comprises one or more steps or actions for achieving the described method. Unless a specific order of steps or actions is required for proper operation of the method, the order and/or use of specific steps and/or actions may be modified or combined. Additionally, terms such as “first”, “second”, etc. may be used in various embodiments to modify an element, component, step, operation, etc., for example, a “first decoding” and a “second decoding”. Use of such terms does not imply an ordering to the modified operations unless specifically required. So, in this example, the first decoding need not be performed before the second decoding, and may occur, for example, before, during, or in an overlapping time period with the second decoding.

Various methods and other aspects described in this application can be used to modify modules, for example, the motion compensation modules (270,375), of a video encoder200and decoder300as shown inFIG.2andFIG.3. Moreover, the present aspects are not limited to VVC or HEVC, and can be applied, for example, to other standards and recommendations, and extensions of any such standards and recommendations. Unless indicated otherwise, or technically precluded, the aspects described in this application can be used individually or in combination.

Various numeric values are used in the present application. The specific values are for example purposes and the aspects described are not limited to these specific values.

Various implementations involve decoding. “Decoding,” as used in this application, may encompass all or part of the processes performed, for example, on a received encoded sequence in order to produce a final output suitable for display. In various embodiments, such processes include one or more of the processes typically performed by a decoder, for example, entropy decoding, inverse quantization, inverse transformation, and differential decoding. Whether the phrase “decoding process” is intended to refer specifically to a subset of operations or generally to the broader decoding process will be clear based on the context of the specific descriptions and is believed to be well understood by those skilled in the art.

Various implementations involve encoding. In an analogous way to the above discussion about “decoding”, “encoding” as used in this application may encompass all or part of the processes performed, for example, on an input video sequence in order to produce an encoded bitstream.

The implementations and aspects described herein may be implemented in, for example, a method or a process, an apparatus, a software program, a data stream, or a signal. Even if only discussed in the context of a single form of implementation (for example, discussed only as a method), the implementation of features discussed may also be implemented in other forms (for example, an apparatus or program). An apparatus may be implemented in, for example, appropriate hardware, software, and firmware. The methods may be implemented in, for example, an apparatus, for example, a processor, which refers to processing devices in general, including, for example, a computer, a microprocessor, an integrated circuit, or a programmable logic device. Processors also include communication devices, for example, computers, cell phones, portable/personal digital assistants (“PDAs”), and other devices that facilitate communication of information between end-users.

Reference to “one embodiment” or “an embodiment” or “one implementation” or “an implementation”, as well as other variations thereof, means that a particular feature, structure, characteristic, and so forth described in connection with the embodiment is included in at least one embodiment. Thus, the appearances of the phrase “in one embodiment” or “in an embodiment” or “in one implementation” or “in an implementation”, as well any other variations, appearing in various places throughout this application are not necessarily all referring to the same embodiment.

Additionally, this application may refer to “determining” various pieces of information. Determining the information may include one or more of, for example, estimating the information, calculating the information, predicting the information, or retrieving the information from memory.

Further, this application may refer to “accessing” various pieces of information. Accessing the information may include one or more of, for example, receiving the information, retrieving the information (for example, from memory), storing the information, moving the information, copying the information, calculating the information, determining the information, predicting the information, or estimating the information.

Additionally, this application may refer to “receiving” various pieces of information. Receiving is, as with “accessing”, intended to be a broad term. Receiving the information may include one or more of, for example, accessing the information, or retrieving the information (for example, from memory). Further, “receiving” is typically involved, in one way or another, during operations, for example, storing the information, processing the information, transmitting the information, moving the information, copying the information, erasing the information, calculating the information, determining the information, predicting the information, or estimating the information.

It is to be appreciated that the use of any of the following “/”, “and/or”, and “at least one of”, for example, in the cases of “A/B”, “A and/or B” and “at least one of A and B”, is intended to encompass the selection of the first listed option (A) only, or the selection of the second listed option (B) only, or the selection of both options (A and B). As a further example, in the cases of “A, B, and/or C” and “at least one of A, B, and C”, such phrasing is intended to encompass the selection of the first listed option (A) only, or the selection of the second listed option (B) only, or the selection of the third listed option (C) only, or the selection of the first and the second listed options (A and B) only, or the selection of the first and third listed options (A and C) only, or the selection of the second and third listed options (B and C) only, or the selection of all three options (A and B and C). This may be extended, as is clear to one of ordinary skill in this and related arts, for as many items as are listed.

Also, as used herein, the word “signal” refers to, among other things, indicating something to a corresponding decoder. For example, in certain embodiments the encoder signals a quantization matrix for de-quantization. In this way, in an embodiment the same parameter is used at both the encoder side and the decoder side. Thus, for example, an encoder can transmit (explicit signaling) a particular parameter to the decoder so that the decoder can use the same particular parameter. Conversely, if the decoder already has the particular parameter as well as others, then signaling can be used without transmitting (implicit signaling) to simply allow the decoder to know and select the particular parameter. By avoiding transmission of any actual functions, a bit savings is realized in various embodiments. It is to be appreciated that signaling can be accomplished in a variety of ways. For example, one or more syntax elements, flags, and so forth are used to signal information to a corresponding decoder in various embodiments. While the preceding relates to the verb form of the word “signal”, the word “signal” can also be used herein as a noun.

As will be evident to one of ordinary skill in the art, implementations may produce a variety of signals formatted to carry information that may be, for example, stored or transmitted. The information may include, for example, instructions for performing a method, or data produced by one of the described implementations. For example, a signal may be formatted to carry the bitstream of a described embodiment. Such a signal may be formatted, for example, as an electromagnetic wave (for example, using a radio frequency portion of spectrum) or as a baseband signal. The formatting may include, for example, encoding a data stream and modulating a carrier with the encoded data stream. The information that the signal carries may be, for example, analog or digital information. The signal may be transmitted over a variety of different wired or wireless links, as is known. The signal may be stored on a processor-readable medium.