Bidirectional optical flow sub-block refinement of affine modeled blocks

By employing decoder-side motion vector derivation technology and affine model prediction mode in video encoding, the problems of block artifacts and encoding distortion are solved, thereby improving the accuracy and quality of video decoding.

CN121368892APending Publication Date: 2026-01-20QUALCOMM INC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202480041574.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2024-06-26
Filing Date
2024-06-27
Publication Date
2026-01-20

AI Technical Summary

Technical Problem

Existing video coding techniques have room for improvement in terms of block artifacts and coding distortion, especially when using affine motion prediction and temporal motion vector prediction, it is difficult to improve the accuracy of predicted blocks.

Method used

Decoder-side motion vector derivation techniques, such as template matching, bilateral matching, decoder-side motion vector refinement, and bidirectional optical flow (BDOF), are employed in conjunction with affine model prediction modes to improve prediction accuracy by refining the prediction of video blocks.

Benefits of technology

By refining the prediction blocks, the rate-distortion tradeoff in encoding video data is improved, thereby enhancing the quality of video decoding.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121368892A_ABST
    Figure CN121368892A_ABST
Patent Text Reader

Abstract

A video decoder determines a current block of width (WCB) * height (HCB) in size to decode in an affine prediction mode; predicting each sub-block of the first plurality of sub-blocks using an affine motion model to determine an initial prediction block, each sub-block having a size of width (WSB) * height (HSB), and WSB being less than WCB and HSB being less than HCC; applying a bi-directional optical flow process to a first sub-block and a second sub-block of the second plurality of sub-blocks to determine a first refinement prediction sub-block and a second refinement prediction sub-block, each sub-block having a size of width (WSBIPB) * height (HSBIPB), WSBIPB being less than or equal to WCB and less than or equal to WSB, and HSBIPB being less than or equal to HCC and less than or equal to HSB; and determining a refined prediction block based on the first refined sub-block and the second refined sub-block.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application claims priority to U.S. Patent Application No. 18 / 754,788, filed June 26, 2024, and U.S. Provisional Patent Application No. 63 / 511,118, filed June 29, 2023, the entire contents of each of which are incorporated herein by reference. U.S. Patent Application No. 18 / 754,788, filed June 26, 2024, claims the benefit of U.S. Provisional Patent Application No. 63 / 511,118, filed June 29, 2023. TECHNICAL FIELD

[0002] The present disclosure relates to video encoding and video decoding. BACKGROUND

[0003] Digital video capabilities can be incorporated into a wide range of devices, including digital televisions, digital direct broadcast systems, wireless broadcast systems, personal digital assistants (PDAs), laptop or desktop computers, tablet computers, e-book readers, digital cameras, digital recording devices, digital media players, video gaming devices, video game consoles, cellular or satellite radio telephones, so-called “smart phones,” video teleconferencing devices, video streaming devices, and the like. Digital video devices implement video coding techniques, such as those described in the standards defined by MPEG-2, MPEG-4, ITU-T H.263, ITU-T H.264 / MPEG-4, Part 10, Advanced Video Coding (AVC), ITU-T H.265 / High Efficiency Video Coding (HEVC), ITU-T H.266 / Versatile Video Coding (VVC), and extensions of such standards, as well as proprietary video codecs / formats such as AOMedia Video 1 (AV1) developed by the Alliance for Open Media. By implementing such video coding techniques, video devices can more efficiently send, receive, encode, decode, and / or store digital video information.

[0004] Video coding techniques include spatial (intra-picture) prediction and / or temporal (inter-picture) prediction to reduce or remove redundancy inherent in video sequences. For block-based video coding, a video slice (e.g., a video picture or a portion of a video picture) can be partitioned into video blocks, which can also be referred to as coding tree units (CTUs), coding units (CUs), and / or coding nodes. Video blocks in an intra-coded (I) slice of a picture are encoded using spatial prediction relative to other video blocks in the same picture. Video blocks in an inter-coded (P or B) slice of a picture can use either spatial or temporal prediction relative to other video blocks in the same picture or other reference pictures. SUMMARY

[0005] The techniques of this disclosure relate to decoder-side motion vector derivation techniques (e.g., template matching, bilateral matching, decoder-side motion vector refinement, bi-directional optical flow (BDOF)) and affine model prediction modes. In particular, this disclosure describes techniques that can enable BDOF to be used on blocks that are predicted using affine motion prediction as well as blocks that are predicted using motion vectors based on temporal motion vector prediction (TMVP), which can improve the accuracy of the predicted blocks, which in turn can result in improved rate-distortion tradeoffs when encoding video data.

[0006] According to examples of the disclosure, a method of decoding video data includes determining that a current block of video data is coded in an affine prediction mode, wherein the current block has a size of width (W CB ) x height (H CB ); predicting individual sub-blocks of a first plurality of sub-blocks using an affine motion model associated with the affine prediction mode to determine an initial prediction block for the current block, wherein individual sub-blocks of the first plurality of sub-blocks have a size of width (W SB ) x height (H SB ), where W SB is less than W CB and H SB is less than H CB ; applying a bi-directional optical flow process to a first sub-block of a second plurality of sub-blocks to determine a first refined prediction sub-block, wherein individual sub-blocks of the second plurality of sub-blocks have a size of width (W SBIPB ) x height (H SBIPB ), where W SBIPB is less than or equal to W CB and less than or equal to W SB , and H SBIPB is less than or equal to H CB and less than or equal to H SB ; applying the bi-directional optical flow process to a second sub-block of the second plurality of sub-blocks to determine a second refined prediction sub-block; determining a refined prediction block based on the first refined sub-block and the second refined sub-block; and determining a decoded version of the current block based on the refined prediction block.

[0007] According to examples of the disclosure, an apparatus for decoding encoded video data includes a memory configured to store video data; one or more processors implemented in circuitry and configured to determine that a current block of video data is coded in an affine prediction mode, wherein the current block has a size of width (W CB ) x height (H CB ); predict individual sub-blocks of a first plurality of sub-blocks using an affine motion model associated with the affine prediction mode to determine an initial prediction block for the current block, wherein individual sub-blocks of the first plurality of sub-blocks have a size of width (WSB ) x height (H SB ) of the current block, where W SB is less than W CB and H SB is less than H CB ; applying a bi-directional optical flow process to a first sub-block of the second plurality of sub-blocks to determine a first refined prediction sub-block, where each sub-block of the second plurality of sub-blocks has a size of width (W SBIPB ) x height (H SBIPB ), where W SBIPB is less than or equal to W CB and less than or equal to W SB , and H SBIPB is less than or equal to H CB and less than or equal to H SB ; applying the bi-directional optical flow process to a second sub-block of the second plurality of sub-blocks to determine a second refined prediction sub-block; determining a refined prediction block based on the first refined sub-block and the second refined sub-block; and determining a decoded version of the current block based on the refined prediction block.

[0008] A computer-readable storage medium storing instructions that, when executed by one or more processors, cause the one or more processors to: determine that a current block of video data is coded in an affine prediction mode, where the current block has a size of width (W CB ) x height (H CB ); predict each sub-block of a first plurality of sub-blocks using an affine motion model associated with the affine prediction mode to determine an initial prediction block for the current block, where each sub-block of the first plurality of sub-blocks has a size of width (W SB ) x height (H SB ), where W SB is less than W CB and H SB is less than H CB ; apply a bi-directional optical flow process to a first sub-block of a second plurality of sub-blocks to determine a first refined prediction sub-block, where each sub-block of the second plurality of sub-blocks has a size of width (W SBIPB ) x height (H SBIPB ), where W SBIPB is less than or equal to W CB and less than or equal to W SB , and H SBIPB is less than or equal to H CB and less than or equal to H SB ; apply the bi-directional optical flow process to a second sub-block of the second plurality of sub-blocks to determine a second refined prediction sub-block; determine a refined prediction block based on the first refined sub-block and the second refined sub-block; and determine a decoded version of the current block based on the refined prediction block.

[0009] According to examples of the disclosure, a method of decoding video data includes determining that a current block of video data is coded in an affine prediction mode, wherein the current block has a size of width (W CB ) x height (H CB ); determining a motion vector for the current block based on a temporal motion vector predictor candidate; determining an initial prediction block for the current block using the motion vector; applying a bi-directional optical flow process to a first sub-block of a plurality of sub-blocks of the initial prediction block to determine a first refined prediction sub-block, wherein each sub-block of the plurality of sub-blocks has a size of width (W SBIPB ) x height (H SBIPB ), wherein W SBIPB is less than or equal to W CB and H SBIPB is less than or equal to H CB ; applying the bi-directional optical flow process to a second sub-block of the plurality of sub-blocks to determine a second refined prediction sub-block; determining a refined prediction block based on the first refined sub-block and the second refined sub-block; and determining a decoded version of the current block based on the refined prediction block.

[0010] The details of one or more examples are set forth in the accompanying drawings and the description below. Other features, objects, and advantages will be apparent from the description, drawings, and claims. BRIEF DESCRIPTION OF DRAWINGS

[0011] Figure 1 is a block diagram illustrating an example video encoding and decoding system that can perform the techniques of this disclosure.

[0012] Figure 2A is a conceptual diagram illustrating a spatial neighboring motion vector candidate for merge mode.

[0013] Figure 2B is a conceptual diagram illustrating a spatial neighboring motion vector candidate for advanced motion vector prediction (AMVP) mode.

[0014] Figure 3A shows an example temporal motion vector predictor (TMVP) candidate for a block.

[0015] Figure 3B shows an example motion vector scaling process.

[0016] Figure 4 is an illustration of an example template matching process.

[0017] Figure 5 and Figure 6 shows an example bilateral matching process.

[0018] Figure 7 shows an example search pattern for bilateral matching.

[0019] Figure 8 An example of decoder-side motion vector refinement is shown.

[0020] Figure 9 An example of extended coding unit (CU) regions used in bi-directional optical flow (BDOF) is shown.

[0021] Figure 10 An example of control point motion vector inheritance is shown.

[0022] Figure 11 An example of a position of a candidate location for constructed affine merge mode is shown.

[0023] Figure 12 An example of searching non-adjacent affine CUs and using motion information to derive non-refined candidates is shown.

[0024] Figure 13 An example of sub-block motion information used to derive refined candidates is shown.

[0025] Figure 14 is a flowchart illustrating an AMVP merge mode for non-LDC pictures.

[0026] Figure 15 is a block diagram illustrating an example video encoder that can perform the techniques of this disclosure.

[0027] Figure 16 is a block diagram illustrating an example video decoder that can perform the techniques of this disclosure.

[0028] Figure 17 is a flowchart illustrating an example method for encoding a current block according to the techniques of this disclosure.

[0029] Figure 18 is a flowchart illustrating an example method for decoding a current block according to the techniques of this disclosure.

[0030] Figure 19 is a flowchart illustrating an example method for decoding a current block according to the techniques of this disclosure. DETAILED DESCRIPTION

[0031] Video coding (e.g., video encoding and / or video decoding) often involves predicting a block of video data from already coded blocks of video data in the same picture (e.g., intra prediction) or from already coded blocks of video data in different pictures (e.g., inter prediction). In some cases, a video encoder also computes residual data by comparing a predicted block to an original block. Thus, the residual data represents the difference between the predicted block and the original block. To reduce the number of bits needed to signal the residual data, the video encoder transforms and quantizes the residual data and signals the transformed and quantized residual data in an encoded bitstream. The compression achieved by the transform and quantization process can be lossy, meaning that the transform and quantization process can introduce distortion in the decoded video data.

[0032] A video decoder decodes the residual data and adds it to the predicted block to produce a reconstructed video block that more closely matches the original video block than the separate predicted block. Due to the loss introduced by the transform and quantization of the residual data, the first reconstructed block can have distortion or artifacts. One common type of artifact or distortion is referred to as blocking artifacts, in which the boundaries of blocks used to code the video data are visible.

[0033] To further improve the quality of the decoded video, the video decoder can perform one or more filtering operations on the reconstructed video block. Examples of these filtering operations include a deblocking filter, a sample adaptive offset (SAO) filter, and an adaptive loop filter (ALF). Parameters for these filtering operations can be determined by the video encoder and explicitly signaled in the encoded video bitstream, or can be implicitly determined by the video decoder without needing to be explicitly signaled in the encoded video bitstream.

[0034] The techniques of this disclosure relate to decoder-side motion vector derivation techniques (e.g., template matching, bilateral matching, decoder-side motion vector refinement, bi-directional optical flow (BDOF)) and affine model prediction modes. In particular, this disclosure describes techniques that can enable BDOF to be used on blocks that are predicted using affine motion prediction as well as blocks that are predicted using motion vectors based on temporal motion vector prediction (TMVP), which can improve the accuracy of the predicted blocks, which in turn can result in improved rate-distortion tradeoffs when encoding video data.

[0035] For ease of explanation, this disclosure can describe some techniques as being performed by a video decoder. However, unless stated to the contrary, it can be assumed that such same techniques or reciprocal techniques can also be performed by a video encoder.

[0036] Figure 1is a block diagram illustrating an example video encoding and decoding system 100 that can perform the techniques of this disclosure. The techniques of this disclosure generally relate to coding (encoding and / or decoding) video data. In general, video data includes any data for processing video. Thus, video data can include uncoded raw video, coded video, decoded (e.g., reconstructed) video, and video metadata, such as signaling data.

[0037] As Figure 1 shown, in this example, system 100 includes a source device 102 that provides encoded video data to be decoded and displayed by a destination device 116. In particular, source device 102 provides the video data to destination device 116 via a computer-readable medium 110. Source device 102 and destination device 116 can be or can include any of a wide variety of devices, including desktop computers, notebook (i.e., laptop) computers, mobile devices, tablet computers, set-top boxes, handheld phones such as smartphones, televisions, cameras, display devices, digital media players, video gaming consoles, video streaming devices, broadcast receiver devices, and the like. In some cases, source device 102 and destination device 116 can be equipped for wireless communication, and thus can be referred to as wireless communication devices.

[0038] In Figure 1 the example of FIG. 1, source device 102 includes a video source 104, a memory 106, a video encoder 200, and an output interface 108. Destination device 116 includes an input interface 122, a video decoder 300, a memory 120, and a display device 118. In accordance with this disclosure, video encoder 200 of source device 102 and video decoder 300 of destination device 116 can be configured to apply decoder-side motion vector derivation techniques (e.g., BDOF). Thus, source device 102 represents an example of a video encoding device, while destination device 116 represents an example of a video decoding device. In other examples, a source device and a destination device can include other components or arrangements. For example, source device 102 can receive video data from an external video source, such as an external camera. Likewise, destination device 116 can interface with an external display device, rather than include an integrated display device.

[0039] As Figure 1The illustrated system 100 is merely one example. In general, any digital video encoding and / or decoding device can perform techniques for decoder-side motion vector derivation, such as BDOF. Source device 102 and destination device 116 are merely examples of such coding devices in which source device 102 generates coded video data for transmission to destination device 116. This disclosure refers to a "coding" device as a device that performs coding (e.g., encoding and / or decoding) of data. Thus, video encoder 200 and video decoder 300 represent examples of coding devices, in particular, a video encoder and a video decoder, respectively. In some examples, source device 102 and destination device 116 can operate in a substantially symmetrical manner such that each of source device 102 and destination device 116 includes video encoding and decoding components. Hence, system 100 can support one-way or two-way video transmission between source device 102 and destination device 116, e.g., for video streaming, video playback, video broadcasting, or video telephony.

[0040] In general, video source 104 represents a source of video data (i.e., uncoded, raw video data) and provides a sequential series of pictures (also referred to as "frames") of the video data to video encoder 200, which encodes data for the pictures. Video source 104 of source device 102 can 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, video source 104 can generate computer graphics-based data as the source video, or a combination of live video, archived video, and computer-generated video. In each case, video encoder 200 encodes the captured, pre-captured, or computer-generated video data. Video encoder 200 can rearrange the pictures from the received order (sometimes referred to as "display order") into the coding order for coding. Video encoder 200 can generate a bitstream including encoded video data. Source device 102 can then output the encoded video data via output interface 108 onto computer-readable medium 110 for reception and / or retrieval by, e.g., input interface 122 of destination device 116.

[0041] Memory 106 of source device 102 and memory 120 of destination device 116 represent general storage memory. In some examples, memories 106, 120 can store raw video data, e.g., raw video from video source 104 and raw decoded video data from video decoder 300. Additionally or alternatively, memories 106, 120 can store software instructions capable of being executed by, e.g., video encoder 200 and video decoder 300, respectively. Although memories 106 and 120 are shown separately from video encoder 200 and video decoder 300 in this example, it should be understood that video encoder 200 and video decoder 300 can also include internal memories for similar or equivalent purposes. Furthermore, memories 106, 120 can store encoded video data, e.g., output from video encoder 200 and input to video decoder 300. In some examples, portions of memories 106, 120 can be allocated as one or more video buffers, e.g., to store raw decoded and / or encoded video data.

[0042] Computer-readable medium 110 can represent any type of medium or device capable of transporting encoded video data from source device 102 to destination device 116. In one example, computer-readable medium 110 represents a communication medium to enable source device 102 to transmit encoded video data directly to destination device 116 in real-time, e.g., via a radio frequency network or computer-based network. Output interface 108 can modulate a transmission signal including the encoded video data, and input interface 122 can demodulate received transmission signals, according to a communication standard, such as a wireless communication protocol. Communication media can include any wireless or wired communication medium, such as a radio frequency (RF) spectrum or one or more physical transmission lines. The communication media can 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 media can include routers, switches, base stations, or any other equipment that can be useful to facilitate communication from source device 102 to destination device 116.

[0043] In some examples, source device 102 can output encoded data from output interface 108 to storage device 112. Similarly, destination device 116 can access encoded data from storage device 112 via input interface 122. Storage device 112 can 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.

[0044] In some examples, source device 102 can output coded video data to a file server 114 or another intermediate storage device from which destination device 116 can access the stored video data. Destination device 116 can access the stored video data from file server 114 via streaming or download.

[0045] File server 114 can be any type of server device capable of storing encoded video data and transmitting that encoded video data to destination device 116. File server 114 can represent a web server (e.g., for a website), a server configured to provide file delivery protocol services (such as the File Delivery Protocol (FTP) or the File Delivery over Unidirectional Transport (FLUTE) protocol), a content delivery network (CDN) device, a hypertext transfer protocol (HTTP) server, a multimedia broadcast multicast service (MBMS) or enhanced MBMS (eMBMS) server, and / or a network attached storage (NAS) device. File server 114 can additionally or alternatively implement one or more HTTP streaming protocols, such as Dynamic Adaptive Streaming over HTTP (DASH), HTTP Live Streaming (HLS), Real Time Streaming Protocol (RTSP), HTTP Dynamic Streaming, and the like.

[0046] Destination device 116 can access encoded video data from file server 114 through any standard data connection, including an Internet connection. This can include a wireless channel (e.g., a Wi-Fi connection), a wired connection (e.g., digital subscriber line (DSL), a cable modem, etc.), or a combination of both that is suitable for accessing encoded video data stored on file server 114. Input interface 122 can be configured to operate according to any one or more of various protocols discussed above for retrieving or receiving media data from file server 114 or other such protocols for retrieving media data.

[0047] Output interface 108 and input interface 122 can represent wireless transmitters / receivers, modems, wired networking components (e.g., Ethernet cards), wireless communication components operating according to any of a variety of IEEE 802.11 standards, or other physical components. In examples where output interface 108 and input interface 122 comprise wireless components, output interface 108 and input interface 122 can be configured to transfer data, such as encoded video data, according to a cellular communication standard, such as 4G, 4G-LTE (Long-Term Evolution), LTE Advanced, 5G, or the like. In some examples where output interface 108 comprises a wireless transmitter, output interface 108 and input interface 122 can be configured to transfer data, such as encoded video data, according to other wireless standards, such as an IEEE 802.11 specification, an IEEE 802.15 specification (e.g., ZigBee), a Bluetooth standard, or the like. In some examples, output interface 108 and input interface 122 can be configured to transfer data, such as encoded video data, according to a physical connection standard, such as an XHCI or EHCI standard, a USB standard (e.g., USB 2.0), or the like.™ Bluetooth ™ standards, etc. to communicate data such as encoded video data. In some examples, source device 102 and / or destination device 116 can include respective system on a chip (SoC) devices. For example, source device 102 can include SoC devices to perform functionalities belonging to video encoder 200 and / or output interface 108, and destination device 116 can include SoC devices to perform functionalities belonging to video decoder 300 and / or input interface 122.

[0048] The techniques of this disclosure can be applied to video coding in support of any of a variety of multimedia applications, such as over-the-air television broadcasts, cable television transmissions, satellite television transmissions, Internet streaming video transmissions, digital video that is encoded onto a data storage medium, decoding of digital video stored on a data storage medium, or other applications.

[0049] Input interface 122 of destination device 116 receives an encoded video bitstream from computer-readable medium 110 (e.g., a communication medium, storage device 112, file server 114, or the like). The encoded video bitstream can include signaling information defined by video encoder 200 and also used by video decoder 300, such as syntax elements having values

[0050] Although the following examples are described in the context of encoding and decoding video data according to HEVC, the examples described herein can be applicable to video coding in general, including the coding of other video coding standards, such as ITU-T Figure 1Although not shown, in some examples, video encoder 200 and video decoder 300 can each be integrated with an audio encoder and / or audio decoder (e.g., an audio CODEC), and can 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. Example audio CODECs can include AAC, AC-3, AC-4, ALAC, ALS, AMBE, AMR, AMR-WB (G.722.2), AMR-WB+, aptx (various versions), ATRAC, BroadVoice (BV16, BV32), CELT, Enhanced AC-3 (E-AC-3), EVS, FLAC, G.711, G.722, G.722.1, G.722.2 (AMR-WB), G.723.1, G.726, G.728, G.729, G.729.1, GSM-FR, HE-AAC, iLBC, iSAC, LA Lyra, Monkey's Audio, MP1, MP2 (MPEG-1, 2 Audio Layer II), MP3, Musepack, Nellymoser Asao, OptimFROG, Opus, Sac, Satin, SBC, SILK, Siren 7, Speex, SVOPC, True Audio (TTA), TwinVQ, USAC, Vorbis (Ogg), WavPack, and Windows Media Audio.

[0051] Video encoder 200 and video decoder 300 each can be implemented as any of a variety of suitable encoder and / or decoder circuitry, including 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. When the techniques are implemented partially in software, a device can store instructions for the software in a suitable, non- transitory computer-readable medium and execute the instructions in hardware using one or more processors to perform the techniques of this disclosure. Each of video encoder 200 and video decoder 300 can be included in one or more encoders or decoders, either of which can be integrated as part of a combined encoder / decoder (CODEC) in a respective device. A device including video encoder 200 and / or video decoder 300 can implement video encoder 200 and / or video decoder 300 in a processing circuit, such as an integrated circuit and / or a microprocessor. Such a device can be a wireless communication device, such as a cellular phone or any of the other types of devices described herein.

[0052] Video encoder 200 and video decoder 300 can operate according to video coding standards, such as ITU-T H.265, also referred to as HEVC, or extensions thereto, such as multi-view and / or scalable video coding extensions. Alternatively, video encoder 200 and video decoder 300 can operate according to other proprietary or industry standards, such as ITU-T H.266, also referred to as VVC. In other examples, video encoder 200 and video decoder 300 can operate according to proprietary video codecs / formats, such as AOMedia Video 1 (AV1), extensions to AV1, and / or subsequent versions of AV1 (e.g., AV2). In other examples, video encoder 200 and video decoder 300 can operate according to other proprietary formats or industry standards. The techniques of this disclosure, however, are not limited to any particular coding standard or format. Generally, video encoder 200 and video decoder 300 can be configured to perform the techniques of this disclosure in connection with any video coding technique that uses decoder-side motion vector derivation.

[0053] Generally, video encoder 200 and video decoder 300 can perform block-based coding of pictures. The term “block” generally refers to a structure containing data to be processed (e.g., encoded, decoded, or otherwise used) during encoding and / or decoding. For example, a block can include a two-dimensional matrix of samples of luma and / or chroma data. In general, video encoder 200 and video decoder 300 can 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, video encoder 200 and video decoder 300 can code luminance components and chrominance components, where the chrominance components can include both red hue chrominance components and blue hue chrominance components. In some examples, video encoder 200 converts received RGB format data to a YUV representation prior to encoding, and video decoder 300 converts the YUV representation to the RGB format. Alternatively, pre- and post-processing units (not shown) can perform these conversions.

[0054] This disclosure can generally relate to coding (e.g., encoding and decoding) of pictures to include processes of encoding or decoding data of pictures. Similarly, this disclosure can relate to coding of blocks of pictures to include processes of encoding or decoding (e.g., prediction and / or residual coding) data for blocks. A coded video bitstream generally includes a series of values for syntax elements representing coding decisions (e.g., coding modes) as well as partitioning of pictures into blocks. Accordingly, references to coding of pictures or blocks generally should be understood to refer to coding values of syntax elements forming the pictures or blocks.

[0055] HEVC defines various blocks, including coding units (CUs), prediction units (PUs), and transform units (TUs). According to HEVC, a video coder (such as video encoder 200) partitions a coding tree unit (CTU) into CUs according to a quad tree structure. That is, the video coder partitions a CTU and CUs into four equal, non overlapping squares, and each node of the quad tree has either zero or four child nodes. Nodes with zero child nodes can be referred to as“leaf nodes,” and CUs of such leaf nodes can include one or more PUs and / or one or more TUs. The video coder can further partition PUs and TUs. For example, in HEVC, a residual quad tree (RQT) represents partitioning of TUs. In HEVC, PUs represent inter prediction data, while TUs represent residual data. Intra predicted CUs include intra prediction information, such as an intra mode indication.

[0056] As another example, video encoder 200 and video decoder 300 can be configured to operate according to VVC. According to VVC, a video coder (such as video encoder 200) partitions a picture into CTUs. Video encoder 200 can partition a CTU according to a tree structure, such as a quad-tree 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. The QTBT structure includes two levels: a first level partitioned according to quad tree partitioning, and a second level partitioned according to binary tree partitioning. The root node of the QTBT structure corresponds to a CTU. Leaf nodes of the binary tree correspond to CUs.

[0057] In the MTT partition structure, blocks can be partitioned using quad tree (QT) partitioning, binary tree (BT) partitioning, and one or more types of ternary tree (TT) (also referred to as tri-tree (TT)) partitioning. A ternary tree or tri-tree partitioning is a partitioning in which a block is split into three sub-blocks. In some examples, a ternary tree or tri-tree partitioning divides a block into three sub-blocks without dividing the original block through a center. The partition types (e.g., QT, BT, and TT) in the MTT can be symmetric or asymmetric.

[0058] When operating according to the AV1 codec, video encoder 200 and video decoder 300 can be configured to code video data in units of blocks. In AV1, the largest coding block that can be processed is referred to as a superblock. In AV1, a superblock can be 128x128 luma samples or 64x64 luma samples. However, in subsequent video coding formats (e.g., AV2), superblocks can be defined by different (e.g., larger) luma sample sizes. In some examples, a superblock is the top level of a block quad tree. Video encoder 200 can further partition a superblock into smaller coding blocks. Video encoder 200 can partition superblocks and other coding blocks into smaller blocks using square or non-square partitions. Non-square blocks can include N / 2xN blocks, NxN / 2 blocks, N / 4xN blocks, and NxN / 4 blocks. Video encoder 200 and video decoder 300 can perform separate prediction and transform processing for each coding block.

[0059] AV1 also defines tiles of video data. A tile is a rectangular array of superblocks that can be coded independently of other tiles. That is, video encoder 200 and video decoder 300 can encode and decode coding blocks within a tile without using video data from other tiles. However, video encoder 200 and video decoder 300 can perform filtering across tile boundaries. The size of a tile can be uniform or non-uniform. Tile-based coding can enable parallel processing and / or multi-threading of encoder and decoder implementations.

[0060] In some examples, video encoder 200 and video decoder 300 can use a single QTBT or MTT structure to represent each of luma and chroma components, while in other examples, video encoder 200 and video decoder 300 can use two or more QTBT or MTT structures, such as one QTBT / MTT structure for luma components and another QTBT / MTT structure for two chroma components (or two QTBT / MTT structures for respective chroma components).

[0061] Video encoder 200 and video decoder 300 can be configured to use quad tree partitioning, QTBT partitioning, MTT partitioning, superblock partitioning, or other partition structures.

[0062] In some examples, a CTU includes a coding tree block (CTB) of luma samples, two corresponding CTBs of chroma samples of a picture having three sample arrays, or a monochrome picture or a CTB of samples of a picture coded using three separate color planes and syntax structures for coding samples. A CTB can be an NxN block of samples for some value of N such that one partitioning is to divide components into CTBs. A component is an array or a single sample from one of the three arrays (luma and two chroma) that make up a 4:2:0, 4:2:2, or 4:4:4 color format picture, or an array or a single sample of an array that makes up a monochrome format picture. In some examples, a coding block is an MxN block of samples for some values of M and N such that one partitioning is to divide a CTB into coding blocks.

[0063] Blocks (e.g., CTUs or CUs) can be grouped in pictures in various ways. As one example, a tile can refer to a rectangular region of CTU rows within a particular tile in a picture. A tile column can refer to a rectangular region of CTUs within a particular tile column and a particular tile row in a picture. A tile row can refer to a rectangular region of CTUs having a height equal to a height of the picture and a width specified by a syntax element (e.g., such as in a picture parameter set) and a tile column can refer to a rectangular region of CTUs having a width equal to a width of the picture and a height specified by a syntax element (e.g., such as in a picture parameter set).

[0064] In some examples, a tile can be divided into multiple bricks, each of which can include one or more CTU rows within the tile. A tile that is not divided into multiple bricks can also be referred to as a brick. However, a brick that is a true subset of a tile can not be referred to as a tile. Bricks in a picture can also be arranged in slices. A slice can be an integer number of tiles of a picture, which can be uniquely contained in a single network abstraction layer (NAL) unit. In some examples, a slice includes multiple complete tiles or only a contiguous sequence of complete bricks of a single tile.

[0065] The present disclosure can use “NxN” and “N by N” interchangeably to refer to the sample dimensions of a block (such as a CU or other video block) in the vertical and horizontal dimensions, e.g., 16x16 samples or 16 by 16 samples. In general, a 16x16 CU will have 16 samples in the vertical direction (y = 16) and 16 samples in the horizontal direction (x = 16). Likewise, an NxN CU generally has N samples in the vertical direction and N samples in the horizontal direction, where N represents a nonnegative integer value. The samples in a CU can be arranged in rows and columns. Moreover, a CU need not necessarily have the same number of samples in the horizontal direction as in the vertical direction. For example, a CU can comprise N x M samples, where M is not necessarily equal to N.

[0066] Video encoder 200 encodes video data representing prediction and / or residual information for a CU, as well as other information. Prediction information indicates how to predict the CU in order to form a prediction block for the CU. Residual information generally represents sample-by-sample differences between the CU prior to encoding and the prediction block.

[0067] To predict a CU, video encoder 200 generally forms a prediction block for the CU through inter prediction or intra prediction. Inter prediction generally refers to predicting the CU from data of a previously coded picture, whereas intra prediction generally refers to predicting the CU from previously coded data of the same picture. To perform inter prediction, video encoder 200 can use one or more motion vectors to generate the prediction block. Video encoder 200 can generally perform a motion search to identify a reference block that closely matches the CU, e.g., according to a difference between the CU and the reference block. Video encoder 200 can calculate the difference metric using a sum of absolute difference (SAD), sum of squared difference (SSD), mean absolute difference (MAD), mean squared difference (MSD), or other such difference calculations to determine whether a reference block closely matches the current CU. In some examples, video encoder 200 can use uni -prediction or bi-prediction to predict the current CU.

[0068] Some examples of VVC also provide an affine motion compensation mode, which can be considered an inter prediction mode. Under the affine motion compensation mode, video encoder 200 can determine two or more motion vectors that represent non-translational motion, such as scaling or zooming, rotation, perspective motion, or other irregular types of motion.

[0069] To perform intra prediction, video encoder 200 can select an intra prediction mode to generate the prediction block. Some examples of VVC provide sixty-seven intra prediction modes, including various directional modes, as well as a planar mode and a DC mode. Generally, video encoder 200 selects an intra prediction mode that describes neighboring samples of the current block (e.g., of a CU) from which to predict samples of the current block. Such samples can generally be located above, above and to the left, or to the left of the current block in the same picture, assuming video encoder 200 is coding CTUs and CUs in a raster scan order (left-to-right, top-to-bottom).

[0070] Video encoder 200 encodes data representing the prediction mode of the current block. For example, for inter prediction modes, video encoder 200 can encode data indicating which of various available inter prediction modes to use, as well as motion information for the corresponding mode. For example, for uni - or bi-prediction, video encoder 200 can encode motion vectors using advanced motion vector prediction (AMVP) or merge mode. Video encoder 200 can use similar modes to encode motion vectors for the affine motion compensation mode.

[0071] AV1 includes two general techniques for encoding and decoding blocks of video data. The two general techniques are intra prediction (e.g., intra prediction or spatial prediction) and inter prediction (e.g., inter prediction or temporal prediction). In the context of AV1, when using an intra prediction mode to predict a block of a current frame of video data, video encoder 200 and video decoder 300 do not use video data from other frames of the video data. For most intra prediction modes, video encoder 200 encodes the block of the current frame based on differences between sample values in the current block and prediction values generated from reference samples in the same frame. Video encoder 200 determines the prediction values generated from the reference samples based on the intra prediction mode.

[0072] Following prediction, such as intra prediction or inter prediction of a block, video encoder 200 can calculate residual data for the block. The residual data, such as a residual block, represents sample-by-sample differences between the block and a prediction block formed using the corresponding prediction mode. Video encoder 200 can apply one or more transforms to the residual block to produce transform data in a transform domain rather than in the sample domain. For example, video encoder 200 can apply a discrete cosine transform (DCT), an integer transform, a wavelet transform, or a conceptually similar transform. In addition, video encoder 200 can 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. Video encoder 200 produces transform coefficients following application of the one or more transforms.

[0073] As noted above, following any transforms that produce transform coefficients, video encoder 200 can 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 transform coefficients, providing further compression. By performing the quantization process, video encoder 200 can reduce the bit depth of some or all of the transform coefficients. For example, video encoder 200 can round the bit values of the transform coefficients down during quantization. n to m bit values, where n is greater than m In some examples, to perform quantization, video encoder 200 can perform a bit- wise right shift on the values to be quantized.

[0074] After quantization, video encoder 200 can scan the transform coefficients, producing a one-dimensional vector from the two-dimensional matrix comprising the quantized transform coefficients. The scan can be designed to place higher energy (and hence less frequent) transform coefficients earlier in the vector and lower energy (and hence more frequent) transform coefficients later in the vector. In some examples, video encoder 200 can utilize a pre-defined 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, video encoder 200 can perform an adaptive scan. After scanning the quantized transform coefficients to form a one-dimensional vector, video encoder 200 can entropy encode the one-dimensional vector, e.g., according to context adaptive binary arithmetic coding (CABAC). Video encoder 200 can also entropy encode values for syntax elements that describe metadata associated with encoded video data used by video decoder 300 when decoding the video data.

[0075] To perform CABAC, video encoder 200 can assign a context within a context model to a symbol to be transmitted. The context can relate to, for example, whether neighboring values of the symbol are zero-valued or not. The probability determination can be based on the context assigned to the symbol.

[0076] Video encoder 200 can further generate syntax data, such as block-based, picture-based, and sequence-based syntax data, or other syntax data such as a sequence parameter set (SPS), picture parameter set (PPS), or video parameter set (VPS), to video decoder 300, e.g., in picture headers, block headers, slice headers. Video decoder 300 can likewise decode such syntax data to determine how to decode corresponding video data.

[0077] In this way, video encoder 200 can generate a bitstream including encoded video data, e.g., syntax elements that describe partitioning of a picture into blocks (e.g., CUs) and prediction and / or residual information for the blocks. Ultimately, video decoder 300 can receive the bitstream and decode the encoded video data.

[0078] In general, video decoder 300 performs a reciprocal process to that performed by video encoder 200 to decode the encoded video data of the bitstream. For example, video decoder 300 can decode values for syntax elements of the bitstream using CABAC in substantially a reciprocal manner, although in reverse order, to the CABAC encoding process of video encoder 200. The syntax elements can define partitioning information for partitioning a picture into CTUs, and partitioning each CTU according to a corresponding partition structure such as a QTBT structure to define CUs of the CTU. The syntax elements can further define prediction and residual information for blocks (e.g., CUs) of video data.

[0079] The residual information can be represented by, for example, quantized transform coefficients. Video decoder 300 can inverse quantize and inverse transform the quantized transform coefficients of a block to reproduce a residual block for the block. Video decoder 300 forms a prediction block for the block using the signaled prediction mode (intra prediction or inter prediction) and related prediction information (e.g., motion information for inter prediction). Video decoder 300 can then combine the prediction block and the residual block (on a sample-by-sample basis) to reproduce the original block. Video decoder 300 can perform additional processing such as performing a deblocking process to reduce visual artifacts along boundaries of the blocks.

[0080] This disclosure can generally relate to "signaling" certain information, such as syntax elements. The term "signaling" can generally refer to the communication of values for syntax elements and / or other data used for decoding encoded video data. That is, video encoder 200 can signal values for syntax elements in a bitstream. Generally, signaling refers to generating values in a bitstream. As noted above, source device 102 can transmit the bitstream to destination device 116 in real time or not in real time, such as can occur when syntax elements are stored to storage device 112 for later retrieval by destination device 116.

[0081] As introduced above, video encoder 200 and video decoder 300 can be configured to perform motion vector prediction. In HEVC, there are two inter prediction modes for a prediction unit (PU), referred to as merge (skip is considered a special case of merge) and AMVP modes. In both AMVP and merge modes, video encoder 200 and video decoder 300 maintain a motion vector predictor list of multiple motion vector predictors. The motion vector(s) for the current PU and the reference index in merge mode are derived by selecting one candidate from the motion vector predictor list.

[0082] In implementations of HEVC, the motion vector predictor list contains up to five merge mode candidates and two AMVP mode candidates. A merge candidate can contain a set of motion information, such as a motion vector corresponding to both reference picture lists (list 0 and list 1) and a reference index. By receiving a merge candidate identified by a merge index, video decoder 300 determines the reference picture and the associated motion vector for the prediction of the current block. On the other hand, in AMVP mode, for each potential prediction direction from either list 0 or list 1, video decoder 300 receives a motion vector predictor (MVP) index of the motion vector predictor list because an AMVP candidate contains only a motion vector. Video decoder 300 additionally receives a motion vector difference (MVD) and a reference index to explicitly identify the reference picture. In AMVP mode, the predicted motion vector can be further refined.

[0083] Candidates for both modes are derived similarly from the same spatial and temporal neighboring blocks. In HEVC, video encoder 200 and video decoder 300 can derive spatial motion vector candidates from neighboring blocks for a particular PU (PUO), as shown in Figure 2A and Figure 2B Although the techniques for generating candidates from blocks are different for merge and AMVP modes.

[0084] Figure 2A is a conceptual diagram illustrating spatial neighboring candidates for the merge mode of block 140. Figure 2B is a conceptual diagram illustrating spatial neighboring candidates for the AMVP mode of block 142. In the merge mode, video encoder 200 and video decoder 300 can derive up to four spatial motion vector candidates in the order shown in Figure 2A The order is as follows: left block (0, Al), top block (1, Bl), top-right block (2, B0), bottom-left block (3, A0), and top-left (4, B2) block.

[0085] In the AMVP mode, video encoder 200 and video decoder 300 can divide the neighboring blocks into two groups: a left group including blocks 0 and 1, and an upper group including blocks 2, 3, and 4, as shown in Figure 2B For each group, the potential candidates in the neighboring blocks that refer to the same reference picture as indicated by the signaled reference index have the highest priority to be selected to form the final candidate for that group. All neighboring blocks can not contain motion vectors pointing to the same reference picture. Therefore, if no such candidate can be found, video encoder 200 and video decoder 300 can scale the first available candidate to form the final candidate. Thus, the temporal distance difference can be compensated.

[0086] Temporal motion vector prediction in HEVC will now be discussed. Video encoder 200 and video decoder 300 can be configured to add a TMVP candidate (if enabled and available) to the motion vector candidate list after the spatial motion vector candidates. The motion vector derivation process for the TMVP candidate is the same for both merge and AMVP modes. However, in HEVC, the target reference index for the TMVP candidate in the merge mode is set to 0.

[0087] Figure 3A shows an example TMVP candidate for block 154 (PUO), and Figure 3B shows a motion vector scaling process 156. The primary block position for the TMVP candidate derivation is the right-bottom block outside the collocated PU. This candidate is shown as block "T" in Figure 3AThe position of the block T is used to compensate for the bias of the top and left blocks used to generate spatial neighboring candidates. However, if the block is outside the current CTB column or motion information is not available, the block is replaced by the center block of the PU.

[0088] Video encoder 200 and video decoder 300 can derive the motion vector of a TMVP candidate from a collocated PU of a collocated picture indicated in the slice level. The motion vector of the collocated PU is referred to as the collocated MV. Similar to the temporal direct mode in AVC, to derive the TMVP candidate motion vector, the collocated motion vector can be scaled to compensate for the temporal distance difference, as shown in Figure 3B

[0089] Other aspects of motion prediction in HEVC with respect to the techniques described herein will now be described. Video encoder 200 and video decoder 300 can be configured to perform motion vector scaling. It is assumed that the value of a motion vector is proportional to the distance of a picture in presentation time. A motion vector relates two pictures, the reference picture and the picture containing the motion vector, i.e., the containing picture. When one motion vector is used to predict another motion vector, the distance of the containing picture and the reference picture is calculated based on picture order count (POC) values.

[0090] For a motion vector to be predicted, the associated containing picture can be different from the reference picture. Therefore, video encoder 200 and video decoder 300 can calculate a new distance based on the POCs. Video encoder 200 and video decoder 300 can scale the motion vector based on such two POC distances. For spatial neighboring candidates, the containing pictures of the two motion vectors are the same, while the reference pictures are different. In HEVC, motion vector scaling is applied to both TMVP and AMVP for spatial and temporal neighboring candidates.

[0091] Video encoder 200 and video decoder 300 can be configured to perform artificial motion vector candidate generation. If a motion vector candidate list is incomplete, an artificial motion vector candidate is generated and inserted at the end of the list until the list is complete.

[0092] In merge mode, there are two types of artificial motion vector candidates: combined candidates derived only for B slices and zero candidates only for AMVP if the first type does not provide enough artificial candidates. For each pair of candidates that are already in the candidate list and have the necessary motion information, a bi-directional combined motion vector candidate is derived by combining the motion vector of the first candidate referring to a picture in list 0 and the motion vector of the second candidate referring to a picture in list 1.

[0093] ​The video encoder 200 and video decoder 300 can be configured to perform a pruning process for candidate insertion. Candidates from different blocks may happen to be the same, which reduces the efficiency of merging / AMVP candidate lists. A pruning process is applied to address this issue. When implementing a pruning process, the video encoder 200 or video decoder 300 compares a candidate with other candidates in the current candidate list to avoid inserting identical candidates to some extent. To reduce complexity, only a limited number of pruning processes are applied, rather than comparing every potential pruning process with all other existing pruning processes.

[0094] The video encoder 200 and video decoder 300 can be configured to perform template matching prediction. Template matching prediction is a special merging mode based on frame rate upconversion (FRUC) technology. Using this mode, partial motion information of the block is not signaled but derived on the decoder side. Template matching can be applied to both AMVP mode and regular merging mode. In AMVP mode, MVP candidate selection is determined based on template matching to select the one that achieves the minimum difference between the current block template and the reference block template. In regular merging mode, a template matching mode flag is signaled to indicate the use of template matching. The video encoder 200 and video decoder 300 can then apply template matching to the merging candidates indicated by the merging index for motion vector refinement.

[0095] like Figure 4 As shown, template matching is used to derive the motion information of the current CU 160 by finding the closest match between the current template 162 in the current image and the reference template 164 in the reference image. The reference template may have the same size as the current template 162. Using AMVP candidates selected based on the initial matching error, the video encoder 200 and video decoder 300 can use template matching to refine the MVP. Utilizing the merging candidates indicated by the merging index notified by the signal, the video encoder 200 and video decoder 300 can be configured to independently refine the motion vectors corresponding to L0 and L1 via template matching, and then further refine the less accurate motion vectors based on the more accurate MV.

[0096] The video encoder 200 and video decoder 300 can be configured to implement the cost function. Motion-compensated interpolation is required when motion vectors are localized to fractional samples. To reduce complexity, bilinear interpolation is used instead of conventional 8-tap DCT-IF interpolation for template matching to generate a template on the reference image. The matching cost of template matching... The calculation is as follows: in The weighting factor is set to 4 based on experience. and SAD is used as the matching cost for template matching.

[0097] When TM is used, the motion is refined by using only the luma samples. The derived motion is used for both luma and chroma in motion compensated inter prediction. After the motion vector is decided, the final motion compensation is performed using an 8-tap interpolation filter for luma and a 4-tap interpolation filter for chroma.

[0098] Video encoder 200 and video decoder 300 can be configured to implement a search process. The motion vector refinement is a pattern-based motion vector search with the criterion of template matching cost. Two search modes are supported, i.e., diamond search and cross search for motion vector refinement. The motion vector is searched directly in a quarter luma sample MVD accuracy diamond pattern, then in a quarter luma sample MVD accuracy cross pattern, and then in an eighth luma sample MVD refinement cross pattern. The search range for motion vector refinement is set to be equal to (-8, +8) luma samples around the initial MV.

[0099] Video encoder 200 and video decoder 300 can be configured to perform bilateral matching prediction. Bilateral matching, also referred to as bilateral merge, (BM) prediction is another merge mode based on FRUC technology. When the BM mode is applied to a block, video encoder 200 and video decoder 300 can use a signaled merge candidate index to derive two initial motion vectors MV0 and MV1 to select a merge candidate in a constructed merge list. When bilateral matching is implemented, video encoder 200 and video decoder 300 search around MV0 and MV1 and derive the final MV0' and MV1' based on the minimum bilateral matching cost.

[0100] The motion vector differences MVD0 (denoted by MV0' - MV0) and MVD1 (denoted by MV1' - MV1) pointing to the two reference blocks can be proportional to the temporal distances (TDs) (e.g., TD0 and TD1) between the current picture and the two reference pictures. Figure 5 An example showing MVD0 and MVD1, where the distance (TD1) between the current picture 170 and the reference picture 172 is 4 times the distance (TD0) between the current picture 170 and the reference picture 174. Figure 5 An example showing MVD0 and MVD1 are proportional to the temporal distances.

[0101] However, there is an alternative design where MVD0 and MVD1 are mirrored regardless of the temporal distances TD0 and TD1. Figure 6The example shows that MVD0 and MVD1 are mirrored, regardless of the temporal distance (TD1) between the current picture 176 and the reference picture 178, and the temporal distance (TD0) between the current picture 176 and the reference picture 180. Figure 6 The example shows that MVD0 and MVD1 are mirrored, where TD1 is 4 times TD0.

[0102] Figure 7 The example shows a 3x3 square search pattern used to implement bilateral matching in the search range [-8, 8]. When bilateral matching is implemented, the video encoder 200 and the video decoder 300 can be configured to perform a local search around the initial MV0 and MV1 to derive the final MV0' and MV1'. In the example, the initial motion vectors point to sample 182, and the final motion vectors point to sample 184. The local search applies a 3x3 square search pattern to loop the search range [-8, 8]. Sample 186 represents an example of a sample in the search range around samples 182, 184, and sample 188. Sample 188 represents an example of a sample corresponding to a motion vector determined during an intermediate iteration of the search process. In each search iteration, the bilateral matching cost of the eight surrounding motion vectors in the search pattern is calculated and compared to the bilateral matching cost of the center MV. The motion vector with the minimum bilateral matching cost becomes the new center motion vector in the next search iteration. The local search is terminated when the current center motion vector has the minimum cost within the 3x3 square search pattern or the local search reaches a predefined maximum number of search iterations. Figure 7

[0103] The video encoder 200 and the video decoder 300 can be configured to perform decoder-side motion vector refinement (DMVR). In VVC, DMVR can be applied to improve the accuracy of the motion vector in the merge mode. In the bilateral prediction operation, a refined motion vector is searched around the initial motion vector in the reference picture list L0 and the reference picture list L1. The DMVR process calculates the distortion between two candidate blocks in the reference picture list L0 and the list L1.

[0104] Figure 8 The example shows decoder-side motion vector refinement. As Figure 8 illustrated, the video encoder 200 and the video decoder 300 can be configured to calculate the SAD between the block 190 and the block 192 based on various motion vector candidates around the initial MV. The motion vector candidate with the lowest SAD becomes the refined motion vector and is used to generate the bilateral prediction signal.

[0105] ​The refined motion vector derived from the DMVR process is used to generate inter- predicted samples and also for temporal motion vector prediction of future picture coding. Whereas the original motion vector is used for the deblocking process and also for spatial motion vector prediction of future CU coding. DMVR is a subblock-based merge mode with a predefined maximum processing unit of 16x16 luma samples. When the width and / or height of a CU is larger than 16 luma samples, the CU can be further partitioned into subblocks with width and / or height equal to 16 luma samples.

[0106] Video encoder 200 and video decoder 300 can be configured to implement a search scheme. In DVMR, the search points are around the initial motion vector and the motion vector offset follows the motion vector difference mirroring rule. In other words, any point (denoted by the candidate motion vector pair (MV0, MV1)) checked by DMVR follows the following two equations: wherein denotes the refinement offset between the initial motion vector and the refined motion vector in one of the reference pictures. In DMVR, the refinement search range is two integer luma samples from the initial MV. The search includes an integer sample offset search phase and a fractional sample refinement phase.

[0107] Video encoder 200 and video decoder 300 can be configured to apply a 25-point full search for the integer sample offset search. The SAD of the initial motion vector pair is first calculated. If the SAD of the initial motion vector pair is smaller than a threshold, the integer sample offset search phase of DMVR is terminated. Otherwise, the SAD of the remaining 24 points is calculated and checked in a raster scan order. The point with the smallest SAD is selected as the output of the integer sample offset search phase. To reduce the loss due to the uncertainty of DMVR refinement, it is suggested to support the original motion vector in the DMVR process. The SAD between the reference blocks referred by the initial motion vector candidate reduces the SAD value by 1 / 4.

[0108] After the integer sample search, video encoder 200 and video decoder 300 can be configured to perform fractional sample refinement. To save computational complexity, the fractional sample refinement is derived by using the parametric error surface equation instead of additional search by SAD comparison. The fractional sample refinement is conditionally invoked based on the output of the integer sample search phase. The fractional sample refinement is further applied when the integer sample search phase is terminated with the center having the smallest SAD in the first iteration search or the second iteration search.

[0109] In subpixel offset estimation based on parametric error surfaces, the following 2-D parabolic error surface equation is fitted using the center localization cost and the cost at four neighboring localization points from the center: in( This corresponds to the fractional location with the minimum cost, and C corresponds to the minimum cost value. The above equation is solved by using the cost values ​​of the five search points. The calculation is as follows: Since all cost values ​​are positive and the minimum value is ,therefore and The value is automatically constrained to be between -8 and 8. This corresponds to a half-pixel offset with 1 / 16 pixel motion vector precision in VVC. The calculated score ( The integer distance is added to the thinned motion vector to obtain the subpixel-accurate thinning increment MV.

[0110] The video encoder 200 and video decoder 300 can be configured to perform bilinear interpolation and sample padding. In VVC, the maximum resolution of the motion vector is 1 / 16 of a luminance sample. An 8-tap interpolation filter is used to interpolate the samples at fractional localizations. In DMVR, the search point surrounds an initial fractional pixel motion vector with an integer sample offset, therefore, interpolation is required for those fractionally localized samples in the DMVR search process. To reduce computational complexity, a bilinear interpolation filter is used to generate fractional samples for the search process in DMVR. Another important effect is that, by using a bilinear filter, DVMR does not access more reference samples compared to the normal motion compensation process in the case of a 2-sample search range. After obtaining the refined motion vector using the DMVR search process, a normal 8-tap interpolation filter is applied to produce the final prediction. To avoid accessing more reference samples in the normal motion compensation process, samples that are not needed by the interpolation process based on the original motion vector but are needed by the interpolation process based on the refined MV can be padded from those available samples.

[0111] The video encoder 200 and video decoder 300 can be configured to implement one or more enable conditions for DMVR. In one example, the video encoder 200 and video decoder 300 can be configured to enable DMVR if all of the following conditions are met (e.g., present or true). • CU-level merging mode with bidirectional predictive MV • A reference image is in the past, while another reference image is in the future, relative to the current image. • The distances (e.g., POC differences) from the two reference images to the current image are the same. • The CU has more than 64 luminance samples. • Both the CU height and CU width are greater than or equal to 8 luminance samples. • BCW weight index indicates equal weights • WP is not enabled in the current block • Combined Intra-Frame Inter-Frame Prediction (CIIP) mode is not used for the current block.

[0112] Video encoder 200 and video decoder 300 can be configured to implement BDOF. The BDOF process is used to refine the bidirectional prediction signal of luminance samples in the CU at the 4×4 sub-block level. As its name suggests, the BDOF mode is based on the concept of optical flow, which assumes that the motion of the object is smooth. For each 4×4 sub-block, motion refinement is calculated by minimizing the difference between the L0 prediction sample and the L1 prediction sample. Then, motion refinement is used to adjust the bidirectional prediction sample values ​​in the 4x4 sub-blocks. The following steps are applied during the BDOF process.

[0113] First, the horizontal gradient of the two predicted signals is calculated by directly calculating the difference between two adjacent samples. and vertical gradient , ,Right now,

[0114] in It is a list Coordinates of the predicted signal in Sample values ​​at And shift1 is calculated based on the luminance bit depth bitDepth, since shift1 is set to equal to 6.

[0115] Then, the autocorrelation and cross-correlation of gradients. , , , and The calculation is as follows:

[0116] in

[0117] in It is a 6x6 window surrounding a 4x4 sub-block, with shift2 set to 4 and shift3 set to 1.

[0118] The motion refinement is then derived using the cross-correlation term and the auto-correlation term using the following :

[0119] where . is a floor function.

[0120] Based on the motion refinement and the gradient, the following adjustment is computed for each sample in the 4x4 sub-block

[0121] Finally, the BDOF samples for the CU are computed by adjusting the bi-predicted samples as follows

[0122] where shift5 is set equal to Max(3, 15 - BitDepth), and the variable is set equal to (1 « (shift5 - 1)).

[0123] These values are chosen so that the multipliers in the BDOF process do not exceed 15 bits, and the maximum bit-width of intermediate parameters in the BDOF process is kept within 32 bits.

[0124] To derive the gradient values, some prediction samples need to be generated that are outside the current CU boundary. As shown in , the BDOF process uses an extended column and row around the CU boundary. In Figure 9 , the CU is shown as a 4x4 block 194, and an extended column and row is shown as a 6x6 surrounding area 196. To control the computational complexity of generating the out-of-boundary prediction samples, the prediction samples in the extended area are generated by directly taking the reference samples at the nearest integer positions (using the floor() operation on the coordinates) without interpolation (white positions), and the prediction samples within the CU are generated using the normal 8-tap motion compensated interpolation filter (gray positions). These extended sample values are only used for gradient computation. For the remaining steps in the BDOF process, if any sample and gradient values outside the CU boundary are needed, those are padded (e.g., repeated) from the nearest neighbors. Figure 9

[0125] The video encoder 200 and the video decoder 300 can use the BDOF process to refine the bi-predicted signal of a CU at the 4x4 sub-block level. According to existing standards such as VVC and early drafts of ECM, the BDOF process is applied to a CU if the CU meets all of the following conditions: ​• Decode the CU using a "true" bidirectional prediction mode, where one of the two reference images is displayed before the current image, and the other reference image is displayed after the current image. • Decoding the CU without using affine mode or ATMVP merge mode • The CU has more than 64 luminance samples. • Both the CU height and CU width are greater than or equal to 8 luminance samples. • BCW weight index indicates equal weights • WP is not currently enabled in the CU. • CIIP mode is not used in the current CU The video encoder 200 and video decoder 300 can be configured to implement an affine motion model. The affine motion model can be described as follows:

[0126] in( ) is the coordinate ( The motion vectors at positions (a, b, c, d, e, and f) are given, and a, b, c, d, e, and f are six affine parameters. This affine motion model is called a 6-parameter affine motion model. In a typical video decoder, images are divided into blocks for block-based decoding. A block-based affine motion model can also consist of three motion vectors (MVs) at three different positions not on the same line. , and The three positions are usually called control points, and the three motion vectors are called control point motion vectors (CPMV). When the three control points are located at the three corners of the block, the affine motion can be described as follows: in, and These are the width and height of the block.

[0127] In affine mode, video encoder 200 and video decoder 300 can derive different motion vectors for each pixel in a block according to the associated affine motion model. Thus, motion compensation can be performed on a pixel-by-pixel basis. However, to reduce complexity, sub-block based motion compensation is typically employed, in which a block is partitioned into multiple sub-blocks (which have smaller block sizes), and each sub-block is associated with one motion vector for sub-block based motion compensation. The motion vector for each sub-block is derived using representative coordinates of the sub-block. Typically, center positioning is used. In one example, a block is divided into non-overlapping sub-blocks. The block has a width of blkW and a height of blkH, a sub-block has a width of sbW and a height of sbH, there are blkH / sbH rows of sub-blocks and blkW / sbW sub-blocks in each row. For a six-parameter affine motion model, the motion vector (referred to as sub-block MV) for a sub-block at the i-th row (0 <= i < blkW / sbW) and j-th column (0 <= j < blkH / sbH) is derived as:

[0128] The sub-block motion vectors are rounded to a pre-defined precision and stored in a motion buffer for motion compensation and motion vector prediction.

[0129] A simplified 4-parameter affine model (for scaling and rotational motion) can be described as follows:

[0130] Similarly, a 4-parameter affine model for a block can be described by 2 CPMVs at 2 corners (typically the top-left and top-right corners) of the block: and The motion field is then described as

[0131] The sub-block motion vector at the i-th row and j-th column is derived as: Video encoder 200 and video decoder 300 can be configured to perform prediction refinement for affine mode. After performing sub-block based affine motion compensation, the prediction signal can be refined by adding an offset derived based on the pixel-wise motion and the gradient of the prediction signal. The offset at position can be calculated as: where respectively, is the horizontal gradient of the prediction signal, and is the vertical gradient of the prediction signal. and is the pixel position at The difference between the computed motion vector and the x and y components of the sub-block MV. The coordinates of the top-left sample of the sub-block can be ), and the center of the sub-block is ). Given the affine motion parameters a, b, c, and d, and can be derived as follows: In the control point based affine motion model, the affine motion parameters a, b, c, and d are computed from the CPMV as follows: Video encoder 200 and video decoder 300 can be configured to implement the affine merge mode. In the affine merge mode of VVC, video encoder 200 and / or video decoder 300 can generate a CPMV for a current CU based on the motion information of spatial neighboring CUs. In examples of VVC, there can be up to five candidates, and video encoder 200 can signal an index to indicate the candidate to be used for the current CU. In VVC, the following three types of candidates are used to form the affine merge candidate list: - Inherited affine merge candidate inferred from the CPMV of a neighboring CU. - Constructed affine merge candidate derived using the translation MV of a neighboring CU. - Zero motion vector.

[0132] In VVC, when a neighboring affine CU is identified, video encoder 200 and / or video decoder 300 can use the CPMV of the neighboring affine CU to derive an inherited affine merge candidate in the affine merge list of the current CU. As shown in Figure 10 , if a neighboring bottom-left block A of a current (cur) CU 400 is coded in affine mode, the motion vectors of the top-left, top-right, and bottom-left corners of the CU 402 including block A are obtained as , and When block A is coded with a 4-parameter affine model, video encoder 200 and / or video decoder 300 compute two CPMVs for the current CU 400 from the motion vectors and . In the case that block A is coded with a 6-parameter affine model, video encoder 200 and / or video decoder 300 compute the CPMVs from , and The three CPMVs for the current CU 400 are calculated. A constructed affine candidate means that the candidate is constructed by combining the neighboring translation motion information of each control point. From Figure 11 The motion information of the control points is derived from the specified spatial neighbors (A0, A1, A2, B0, B1, B2, and B3) and temporal neighbor (T) of the current block 410 as shown. The CPMVs k (k = 1, 2, 3, 4) denotes the k-th control point. For CPMV1, the video encoder 200 and / or the video decoder 300 checks the B2->B3->A2 blocks in that order and uses the motion vector of the first available block. For CPMV2, the video encoder 200 and / or the video decoder 300 checks the B1->B0 blocks in that order. For CPMV3, the video encoder 200 and / or the video decoder 300 checks the A1->A0 blocks in that order. If available, the TMVP candidate is available as CPMV4.

[0133] After obtaining the motion vectors of the four control points, the video encoder 200 and / or the video decoder 300 constructs an affine merge candidate based on the motion information of the control points. The affine candidate is constructed using the following combinations of CPMVs in order: {CPMV1, CPMV2, CPMV3}, {CPMV1, CPMV2, CPMV4}, {CPMV1, CPMV3, CPMV4}, {CPMV2, CPMV3, CPMV4}, {CPMV1, CPMV2}, {CPMV1, CPMV3} The combinations of three CPMVs construct 6-parameter affine merge candidates, while the combinations of two CPMVs construct 4-parameter affine merge candidates. To avoid the motion scaling process, if the reference indices of the control points are different, the video encoder 200 and / or the video decoder 300 can discard the relevant combinations of CPMVs.

[0134] After checking the inherited affine merge candidates and the constructed affine merge candidates, if the list is still not full, the video encoder 200 and / or the video decoder 300 can insert a zero motion vector to the end of the list (e.g., until the list reaches the predetermined number of candidates).

[0135] Video encoder 200 and video decoder 300 can be configured to perform affine AMVP mode. In VVC, an affine flag is signaled in the bitstream at the coding unit (CU) level to indicate whether affine AMVP mode is used, and then another flag is signaled to indicate 4-parameter affine or 6-parameter affine. In affine AMVP mode, the motion vector difference (MVD) between the CPMV of the current CU and its predictor CPMVP is signaled in the bitstream along with the index of the predictor for each applicable prediction direction and the index of the selected reference picture. In the case of 4-parameter affine, two MVDs are signaled for each applicable prediction direction. In the case of 6-parameter affine, three MVDs are signaled for each applicable prediction direction. When coding the second and third MVDs (in the case of 6-parameter affine), the MVDs are further predicted from the first MVD. Thus, for 6-parameter affine, the difference between the second MVD and the first MVD (instead of the second MVD) is signaled in the bitstream, and the difference between the third MVD and the first MVD (instead of the third MVD) is signaled in the bitstream. Note that the inter prediction direction is signaled in advance to indicate whether it is bi-prediction, uni-prediction from reference picture list 0, or uni-prediction from reference picture list 1.

[0136] In VVC, the affine AMVP candidate list size is generated by using the following four types of CPMVP candidates in turn: - an inherited affine AMVP candidate inferred from the CPMV of a neighboring CU. - a constructed affine AMVP candidate CPMVP derived using the translation MV of a neighboring CU. - the translation MV from a neighboring CU. - a zero motion vector.

[0137] The checking order of the inherited affine AMVP candidate is the same as that of the inherited affine merge candidate. The only difference is that for the AMVP candidate, only affine CUs with the same reference picture as in the current block are considered. When inserting the inherited affine motion predictor into the candidate list, no pruning process is applied.

[0138] The constructed AMVP candidate can be derived from the specified spatial neighbor. The same checking order as used for the affine merge candidate construction can be used for AMVP. In addition, the reference picture index of the neighboring block is also checked. The first block that is inter coded and has the same reference picture as in the current CU is used in the checking order. If there is only one inter coded neighboring block and the current CU is coded with 4-parameter affine mode, and and Both mv0 and mv1 are added as one candidate in the affine AMVP list when both are available. When the current CU is coded with 6-parameter affine mode and all three CPMVs are available, then the three CPMVs are added as one candidate in the affine AMVP list. Otherwise, the constructed AMVP candidate is set as unavailable.

[0139] If the affine AMVP candidate list is still smaller than the maximum number after inserting the valid inherited affine AMVP candidate and the constructed AMVP candidate, then and may be added as translational motion vectors to predict all CPMVs of the current CU (when available) in turn. Finally, if not full yet, zero motion vectors can be used to fill in the affine AMVP list.

[0140] Video encoder 200 and video decoder 300 can be configured to utilize linear regression based affine merge candidates. In ECM 6.0, the linear regression based affine merge candidate derivation process proposed in JVET-AAl 007 is adopted. In the proposal, two types of linear regression based affine merge candidates are derived, referred to as non-refined candidate and refined candidate. The derivation process is the same for both types of candidates, but different subblock motion information is used as input.

[0141] Figure 12 is a conceptual diagram illustrating example non-adjacent spatial neighboring blocks used to derive a non-adjacent affine candidate. For the non-refined candidate, only the subblock motion information from the non-adjacent affine CU is used as input to the linear regression process. Figure 12 An example is shown for the input of the linear regression process used to derive a non-refined linear regression based affine merge candidate. As described above with respect to BDOF, certain scan patterns can be used to search for a non-adjacent affine CU. After identifying a non-adjacent affine CU, the motion vectors of the subblocks represented by {( Figure 12 mv x0 , mv y0 ), ( mv x1 , mv y1 ), …, ( mv xN-1 , mv yN-1} are included as input to the linear regression process as in the example of x 0 , y 0 ), ( x 1 , y 1 ), …, (​​x N-1 , y N-1 Each of the motion information of the sub-blocks of the center coordinates represented by the

[0142] The scan order can follow the depicted order. For example, the non-adjacent affine CUs can follow the scan order of Figure 12 The depicted order. For example, the non-adjacent affine CUs can follow the scan order of Figure 12 The non-adjacent spatial neighboring blocks of the current block 420 are examined based on their distance (e.g., from near to far) to the current block 420. At a certain distance, the video encoder 200 or the video decoder 300 can scan horizontally from right to left and vertically from bottom to top.

[0143] By using a scan pattern such as the above or a different scan pattern, the non-adjacent affine CUs can be identified and their corresponding motion vector fields can potentially be used as input to the linear regression process to derive the affine model for the current CU.

[0144] Figure 13 An example for deriving sub-block motion information for a refined candidate is shown. For a refined candidate, in addition to the motion information from the sub-blocks 430 in the non-adjacent affine CUs (as shown in Figure 12 ), the motion information from the template sub-block 432 can also be included as input to the linear regression process.

[0145] The linear regression process for deriving the non-refined candidate as well as the refined candidate can be the same and, for example, follow the mathematical derivation described above with respect to BDOF. The only difference is which sub-block’s information is used as input to the linear regression process.

[0146] The video encoder 200 and the video decoder 300 can be configured to perform the bilateral matching AMVP merge mode as in the ECM. The bi-directional predictor is composed of an AMVP predictor in one direction and a merge predictor in the other direction. When the selected merge predictor and the AMVP predictor satisfy the DMVR condition, the mode can be enabled for the coded block where there is at least one reference picture from the past and one reference picture from the future with respect to the current picture and the two reference pictures are the same distance from the current picture, bilateral matching motion vector refinement is applied to the merge motion vector candidate and the AMVP M VP as a starting point. Otherwise, if the template matching function is enabled, template matching motion vector refinement is applied to the merge predictor or the AMVP predictor with higher template matching cost. Figure 14 An example process of the AMVP merge mode is illustrated in

[0147] In Figure 14In some examples, the video encoder 200 and the video decoder 300 can perform bi- lateral matching based merge candidate list reordering on the AMVP candidate list and / or the merge candidate list. The video encoder 200 and the video decoder 300 can perform bi-lateral matching based refinement if the candidates have equal POC distances (530), and can perform template matching based refinement if the candidates have unequal POC distances (532). The term "true bi-lateral equal POC distances" refers to a case where one reference picture has a POC less than the POC of the current picture and the other reference picture has a POC greater than the POC of the current picture.

[0148] The AMVP part of the signaled mode is signaled as regular uni-directional AMVP, e.g., the reference index is signaled as well as the MVD. If template matching is enabled, the video decoder 300 can derive the MVP index, or if template matching is disabled, the video decoder 300 can receive a syntax indicating the MVP index.

[0149] For the AMVP direction LX, X can be 0 or 1. The merge part on the other direction (1-LX) can be implicitly derived by minimizing the bi-lateral matching cost between the AMVP predictor and the merge predictor, e.g., for a pair of AMVP and merge motion vectors. For each merge candidate in the merge candidate list with a motion vector on the other direction (1-LX), the video decoder 300 can determine a bi-lateral matching cost using the merge candidate motion vector and the AMVP MV. The video decoder 300 can select the merge candidate with the minimum cost. The video decoder 300 can apply bi-lateral matching refinement to the coded block using the selected merge candidate motion vector and the AMVP motion vector as a starting point.

[0150] A third pass of multi-pass DMVR, which can be 8x8 sub-PU BDOF refinement of multi-pass DMVR, can be enabled for AMVP merge mode coded blocks. The mode can be indicated by a flag, and if the mode is enabled, the AMVP direction LX can be further indicated by another flag.

[0151] The prior art can exhibit several problems. In the current version of ECM, the BDOF process is used to refine the motion vectors at the 8x8 or 4x4 sub-block level. The motion refinement is derived by minimizing the difference between the L0 and Ll prediction samples in an extended luma sample region . The motion refinement is then used to adjust the prediction samples of the 4x4 sub-blocks. The initial motion vectors of the individual sub-blocks can be the motion vector of the current block or the bi-directional matching (DMVR) refined motion vector at the 16x16 sub-block level. The BDOF refined motion vectors are stored and used for future block motion vector prediction. The BDOF refined motion vectors are used to derive the bi-prediction signal for the luma and chroma samples in the current block.

[0152] The BDOF process can also be used to refine the bi-prediction signal for the luma samples in the coded block at the pixel level. The motion refinement is then used to adjust the prediction samples of the current block.

[0153] When the current block is an affine block, the sub-block motion vectors are derived from the affine model and the sub-block motion vectors are used to derive the bi-prediction signal for the luma and chroma samples in the current block. However, the BDOF sub-block motion vector refinement is not applied to affine coded blocks or TMVP coded blocks where the block or sub-region of the block satisfies the BDOF condition.

[0154] The present disclosure describes the process for video encoder 200 and video decoder 300 to apply BDOF sub-block motion vector refinement when the initial motion vectors of the sub-blocks are derived from the affine model (i.e., when the current block is an affine block and the sub-block motion vectors are derived by applying the affine model at the MxN sub-block level, such as M=4 and N=4). A subset of the sub-blocks that share the same motion vector can be refined by applying the BDOF sub-block motion vector refinement. The present disclosure also describes the process for video encoder 200 and video decoder 300 to apply BDOF sub-block motion vector refinement when the initial motion vectors of the sub-blocks are derived from the temporal co-located block and the current block has one or more sub-blocks. A subset of the sub-blocks that share the same motion vector can be refined by applying the BDOF sub-block motion vector refinement.

[0155] Video encoder 200 and video decoder 300 can store the BDOF refined sub-block motion vectors for future block motion prediction. For example, video encoder 200 and video decoder 300 can use the BDOF refined sub-block motion vectors of the current block as merge candidates or AMVP candidates for a subsequent video block. Video decoder 300 can use the BDOF refined sub-block motion vectors to derive the bi-prediction signal for the luma samples of the current block. Video encoder 200 and video decoder 300 can also use the BDOF process to refine the bi-prediction signal for the luma samples of the current block.

[0156] ​In some examples, video encoder 200 and video decoder 300 can use BDOF refinement of subblock motion vectors to derive bi-prediction signals for luma samples of a current block. In some examples, video encoder 200 and video decoder 300 can use the BDOF process to refine bi-prediction signals for chroma samples of a current block.

[0157] In a first example, video encoder 200 and video decoder 300 can be configured to perform BDOF subblock refinement for affine blocks. In this example, when a WxH coding block is determined to be an affine model coded block and the current block satisfies the conditions for applying the BDOF process, video encoder 200 and video decoder 300 can apply the BDOF process to refine subblock motion vectors of the coding block and apply the BDOF process to refine bi-prediction signals. Initial motion vectors for each subblock can be derived by applying the affine model at the MxN subblock level. One or several MxN subblocks sharing the same motion vector can be grouped to apply the BDOF process subblock refinement at the P x Q subblock level. The BDOF refined motion vectors can be stored for future block motion prediction. The BDOF refined motion vectors can be used for current block bi-prediction signal derivation, i.e., motion compensation.

[0158] The BDOF process can also be used to refine bi-prediction signals for luma samples. The BDOF process can also be used to refine bi-prediction signals for chroma samples.

[0159] Video decoder 300 can be configured to perform the following BDOF process for affine blocks: Video decoder 300 determines that a current coding block is coded as an affine block. The current coding block has a size of WxH. The current block is divided into K1 subblocks, denoted as AffineSubPu, where each AffineSubPu has a size of MxN, e.g., M equals 4 and N equals 4. For each subblock, video decoder 300 derives a motion vector from the affine model and the location of the subblock. Video decoder 300 starts the proposed BDOF process with an input block, referred to herein as S1, where S1 has a size of W_1xH_1 and S1 has a size that is equal to or smaller than the size of the coding block and S1 has a size that is equal to or larger than the size of AffineSubPu. For example, M ≤ W_1 ≤ W and N ≤ H_1 ≤ H. The initial motion vectors of S1 are denoted as MV_S1_L0 and MV_S1_L1 for reference picture 0 and reference picture 1, respectively. o In some examples, when S1 has only one AffineSubPu, the motion vector of the AffineSubPu is used as MV S1 L0 and MV S1 L1. o In some examples, when S1 has more than one AffineSubPu, each AffineSubPu has the same MV. The motion vector of the AffineSubPu is used as MV S1 L0 and MV S1 L1. o In some examples, when S1 has more than one AffineSubPu, the maximum motion vector difference between two AffineSubPu is less than a threshold. For example, the sum of absolute difference of two motion vectors in horizontal direction and vertical direction is less than a threshold. In one example, the average of motion vectors of each AffineSubPu is used as MV S1 L0 and MV S1 L1. In another example, the motion vector of one AffineSubPu is used as MV S1 L0 and MV S1 L1, for example, the AffineSubPu is located at the top-left corner of S1, for example, the AffineSubPu is located at the center of S1. The input block S1 is divided into K2 sub-blocks (referred to herein as S2), where S2 has a size of W_2 x H_2 and the size of S2 is equal to or smaller than the size of S1. For example, W_2 ≤ W_1 and H_2 ≤ H_1. In some examples, for each S2, the video decoder 300 determines whether to apply BDOF by a condition. In some examples, the condition is to check whether the SAD between two prediction signals in reference picture 0 and reference picture 1 is less than a threshold. The sub-block in this step defines the basic unit for deciding whether to apply BDOF to all samples within the unit. When it is decided to apply BDOF to S2, the video decoder 300 applies a BDOF process to derive an incremental MV , denoted as bioMvS2. The video decoder 300 derives the motion vector of S2 as MV S2 L0 = MV S1 L0 + bioMvS2, MV S2 L1 = MV S1 L1 - bioMvS2. The prediction signal of S2 is derived by motion compensation using the motion vector of S2. S2 is divided into K3 sub-blocks (referred to herein as S3), where S3 has a size of W_3 x H_3, where the size of S3 is equal to or smaller than the size of S2. When per-pixel BDOF refinement is applied, W_3 is equal to H_3 is equal to 1. For each S3, the video decoder 300 applies a BDOF process to derive a refined motion vector and the offsets of the samples of S3 are derived using the refined motion vectors. Video decoder 300 derives the prediction signal of S3 by applying the offsets to the samples of the prediction signal of S2 corresponding to the location of S3 in S2. In some examples, the offsets are applied only to luma samples. In some examples, the offsets are applied to each available color component.

[0160] Video encoder 200 and video decoder 300 can be configured to perform one iteration of sub-block motion vector refinement. In this example, the BDOF process is applied only once to derive the delta MVs of S2 In some examples, S2 has a predetermined size of 4x4, e.g., W_2 is equal to 4 and H_2 is equal to 4. In some examples, S2 has an adaptive size, with a maximum size of 8x8 and a minimum size of 4x4, the size being determined by checking the input block size of S1. The following subset of conditions can be used to determine the size of S2: • When W_1 is greater than 8 but not an integer multiple of 8 or H_1 is greater than 8 but not a multiple of 8, then the S2 size is determined to be 4x4. • When is greater than a threshold, W_1 is greater than 8 and H_1 is greater than 8, then the S2 size is determined to be 8x8. • When is greater than a threshold, W_1 is greater than 8 and is an integer multiple of 8, H_1 is equal to 4, then the S2 size is determined to be 8x4. • When is greater than a threshold, H_1 is greater than 8 and is an integer multiple of 8, W_1 is equal to 4, then the S2 size is determined to be 4x8. • When is less than a threshold, then the S2 size is determined to be 4x4.

[0161] Video encoder 200 and video decoder 300 can be configured to perform multiple iterations of sub-block motion vector refinement. In this example, the BDOF process is applied multiple times.

[0162] Video encoder 200 and video decoder 300 can be configured to perform a multi-iteration BDOF process on the same sub-block size. In some examples, the sub-block size of S2 is determined as described in the examples above for one-iteration sub-block MV refinement. Each S2 is refined by multiple applications of the BDOF process to derive a final delta MV. For example, in the first application of the BDOF process, the initial motion vectors are MV_S1_L0 and MV_S1_L1, and after the BDOF process, video decoder 300 derives a refined motion vector of bioMvS2_1. In the second application of the BDOF process, the initial motion vectors are (MV_S1_L0 + bioMvS2_1) and (MV_S1_L1 - bioMvS2_1), and after the BDOF process, video decoder 300 derives a refined motion vector of bioMvS2_2. In the Kth application of the BDOF process, the initial motion vectors are (MV_S1_L0 + bioMvS2_(K-1)) and (MV_S1_L1 - bioMvS2_(K-1)), and after the BDOF process, video decoder 300 derives bioMvS2_K. The final motion vectors of S2 are (MV_S1_L0 + bioMvS2_1 + bioMvS2_2 +... + bioMvS2_K) and (MV_S1_L1 - bioMvS2_1 - bioMvS2_2 -... - bioMvS2_K).

[0163] Video encoder 200 and video decoder 300 can be configured to perform a multi-iteration BDOF process on a reduced sub-block size. In some examples, given an affine coded block of size WxH, the BDOF refinement starts with a sub-block size of W_iter1xH_iter1, and the BDOF process is repeated for multiple iterations with the sub-block size being reduced after each preceding iteration. The size of the sub-block for the Kth iteration is W_iterKxH_iterK, where W_iterK≤ W_iter(K-1) and H_iterK≤ H_iter(K-1). Where W_iter1≤ W and H_iter1≤ H. For example, when the coded block is a 64x64 affine coded block, the sub-block size for the first iteration is 16x16, the sub-block size for the second iteration is 8x8, and the sub-block size for the third iteration is 4x4.

[0164] Given the affine sub-block motion vectors are derived from the block affine model, and in the Kth iteration of the BDOF, the sub-block position corresponding to the top-left corner position of the block, such as the center position of the sub-block is used to derive the sub-block MV, video decoder 300 derives the initial motion vectors for each sub-block as follows: Affine_subblock_K_MV_L0 + bioMvIter(K-1) + bioMvIter(K-2) +...+bioMvIter1 Affine_subblock_K_MV_L1 - bioMvIter(K-1) - bioMvIter(K-2) -...-bioMvIter1 Affine_subblock_MV_L0 and Affine_subblock_MV_L1 are derived based on the subblock size and its positioning (e.g. center positioning) corresponding to the block and the block affine model. bioMvIterK is the delta motion vector derived from the Kth iteration of the subblock corresponding to the current subblock, e.g. the current subblock is a subblock of the previously iterated subblock. The first iteration of the BDOF process uses only Affine_subblock_MV_L0 and Affine_subblock_MV_L1 as the initial MVs.

[0165] The video decoder 300 derives the final motion vectors after K iterations of the BDOF process as follows: Affine_subblock_K_MV_L0 + bioMvIterK + bioMvIter(K-1) +...+bioMvIter1 Affine_subblock_K_MV_L1 - bioMvIterK - bioMvIter(K-1) -...-bioMvIter1 For example, when the coded block is a 64x64 affine coded block, the BDOF process is as follows. At the first iteration, the subblock size is 16x16. There are 4 subblocks to be refined with the BDOF process, each of the four subblocks has the following initial motion vectors: • Subblock0: The BDOF process derives the delta MV bioMvIter1_subblock0 for Affine_subblock0_1_MV_L0 and Affine_subblock0_1_MV_L1, • Subblock1: The BDOF process derives the delta MV bioMvIter1_subblock1 for Affine_subblock1_1_MV_L0 and Affine_subblock1_1_MV_L1, • Subblock2: The BDOF process derives the delta MV bioMvIterl_subblock2 for Affine_subblock2_l_MV_L0 and Affine_subblock2_l_MV_Ll, • Subblock3: The BDOF process derives the delta MV bioMvIterl_subblock3 for Affine_subblock3_l_MV_L0 and Affine_subblock3_l_MV_Ll.

[0166] At the second iteration, the subblock size is 8x8. Video decoder 300 partitions subblock 0 from the first iteration into 4 subblocks, each of the four subblocks having the following initial motion vectors: • Subblock0: The BDOF process derives the delta MV bioMvIter2_subblock0 for (Affine_subblock0_2_MV_L0 + bioMvIterl_subblock0) and (Affine_subblock0_2_MV_Ll - bioMvIterl_subblock0) • Subblockl : The BDOF process derives the delta MV bioMvIter2_subblockl for (Affine_subblockl_2_MV_L0 + bioMvIterl_subblock0) and (Affine_subblockl_2_MV_Ll - bioMvIterl_subblock0) • Subblock2: The BDOF process derives the delta MV bioMvIter2_subblock2 for (Affine_subblock2_2_MV_L0 + bioMvIterl_subblock0) and (Affine_subblock2_2_MV_Ll - bioMvIterl_subblock0) • Subblock3: The BDOF process derives the delta MV bioMvIter2_subblock3 for (Affine_subblock3_2_MV_L0 + bioMvIterl_subblock0) and (Affine_subblock3_2_MV_Ll - bioMvIterl_subblock0) At the third iteration, the subblock size is 4x4. Video decoder 300 partitions subblock 0 from the second iteration into 4 subblocks, each of the four subblocks having the following initial motion vectors: • Subblock0: The BDOF process derives the delta MV bioMvIter3_subblock0 as (Affine_subblock0_3_MV_L0 + bioMvIterl_subblock0 + bioMvIter2_subblock0) and (Affine_subblock0_3_MV_L1 - bioMvIterl_subblock0 - bioMvIter2_subblock0) • Subblockl : The BDOF process derives the delta MV bioMvIter3_subblock0 as (Affine_subblockl_3_MV_L0 + bioMvIterl_subblock0 + bioMvIter2_subblock0) and (Affine_subblockl_3_MV_L1 - bioMvIterl_subblock0 - bioMvIter2_subblock0) • Subblock2: The BDOF process derives the delta MV bioMvIter3_subblock0 as (Affine_subblock2_3_MV_L0 + bioMvIterl_subblock0 + bioMvIter2_subblock0) and (Affine_subblock2_3_MV_L1 - bioMvIterl_subblock0 - bioMvIter2_subblock0) • Subblock3: The BDOF process derives the delta MV bioMvIter3_subblock0 as (Affine_subblock3_3_MV_L0 + bioMvIterl_subblock0 + bioMvIter2_subblock0) and (Affine_subblock3_3_MV_L1 - bioMvIterl_subblock0 - bioMvIter2_subblock0) The final motion vector of the top-left 4x4 subblock derived by video decoder 300 after the three iterations of BDOF refinement is: • Affine_subblock0_3_MV_L0 + bioMvIterl_subblock0 + bioMvIter2_subblock0 + bioMvIter3_subblock0 • Affine_subblock0_3_MV_L1 - bioMvIterl_subblock0 - bioMvIter2_subblock0 - bioMvIter3_subblock0 Video encoder 200 and video decoder 300 can be configured to perform refined motion vector storage and affine model storage. When the current block is an affine coded block, the motion vector information of each MxN subblock (e.g., M=N=4) can be stored and used for future blocks, e.g., future block motion vector prediction. The affine model of the current block is also stored and used for future block affine model prediction. Here, the affine model is the control point motion vector (CPMV) of the current block.

[0167] In some examples, after BDOF refinement, video decoder 300 can store the final motion vectors of each subblock with BDOF refinement for future use. For example, video decoder 300 can use the stored refined motion vectors for future block motion vector prediction of future inter predicted blocks, including non-affine inter blocks. In some examples, the block affine model can be stored unchanged and used for coding future affine blocks. In some examples, the block affine model is derived from the BDOF refined subblock MVs. The derived affine model is stored and used for future block affine model prediction. In one example, the affine model is derived by using the linear regression based affine model candidate derivation as described above with respect to linear regression based affine merge candidate.

[0168] Video encoder 200 and video decoder 300 can be configured to perform high level syntax control. The proposed process can be controlled by the high level syntax of BDOF. The proposed process can be controlled by a separate high level syntax, affine bdof enabled flag, signaled at SPS, VPS, picture header, slice header, or CU level, etc. The affine bdof enabled flag can be conditionally signaled according to the high level syntax of BDOF. For example, if BDOF is disabled, the affine bdof enabled flag is not signaled in the bitstream and inferred to be 0 (indicating not enabled).

[0169] Video encoder 200 and video decoder 300 can be configured to implement an enabling condition. When the current block is an affine coded block and all or a subset of the following conditions are satisfied, the techniques of the disclosure can be enabled: • The proposed process is enabled (indicated by a high-level syntax) • The block is a bi-predicted block. • The resolution of both reference pictures is the same as the current picture. • Neither of the two reference pictures is a long-term reference picture. • At least one predictor is located on a past reference picture relative to the current picture and at least one predictor is located on a future reference picture relative to the current picture. • Both reference pictures have equal POC distance relative to the current picture. • The weights of both predictors are equal, e.g., the parameter value of BCW is equal to BCW_DEFAULT • Local illumination compensation (LIC) is not applied to the current block.

[0170] The enabling condition can further require satisfaction of one of the following condition checks: • In some examples, the proposed process is applied when it is determined that the current block applies sub-block based affine motion compensation. • In some examples, the proposed process is applied when overlapping block motion compensation (OBMC) is applied to the current block. • In some examples, the proposed process is applied when the current block is not determined to apply pixel-based affine motion compensation.

[0171] The enabling condition can further require satisfaction of one or several of the following condition checks: • The block is an affine merge coded block. • The block is an amvp-merge mode coded block. • The block is a bilateral matching affine merge coded block. • The block is not coded using MVD.

[0172] In some examples, video encoder 200 and video decoder 300 can be configured to perform BDOF sub-block refinement for TMVP predicted blocks. In this example, the aforementioned BDOF sub-block refinement is applied to the current block or sub-region when the current block is a TMVP coded block. In this case, the initial motion vector of the BDOF process is the motion vector of the collocated block in the temporal picture.

[0173] In some examples, a sub-region contains a block that satisfies the aforementioned enabling conditions. In some examples, if a block does not satisfy the aforementioned enabling conditions, its motion vector is replaced by the motion vector of a spatial block, other temporal block, or a pre-set block.

[0174] In some examples, after BDOF refinement, video decoder 300 can store the final motion vector with BDOF refinement for future block usage, e.g., for future block motion vector prediction.

[0175] In some examples, video encoder 200 and video decoder 300 can be configured to perform a BDOF process refinement with respect to extended region motion compensation. In this example, a process is implemented that reduces the complexity of the BDOF process. The techniques can be applied to the techniques presented in this disclosure and also to the existing BDOF process in the current ECM.

[0176] In the current ECM, the subblock BDOF process requires motion compensation of an extended luma block to derive gradient information. The extended luma block is a block of 3 rows and 3 columns around the subblock on each side. When the subblock size is 4x4, the size of the extended luma block is 10x10, which requires motion compensation of a 10x10 luma region. When the design of the minimum region of motion compensation is 4x4, the extended luma block requires motion compensation of a 12x12 luma region.

[0177] To reduce the computational complexity of motion compensation while considering the design of the minimum 4x4 motion compensation region, video encoder 200 and video decoder 300 can derive a partial extended luma block by pixel padding. The padded pixels can be derived from the nearest pixels derived by motion compensation.

[0178] Given a subWxsubH subblock, the size of the extended luma block is (subW+6)x(subH+6). Where subW is an integer multiple of 4 and subH is an integer multiple of 4.

[0179] In some examples, the motion compensation region of the subblock is subWxsubH, and the surrounding region of 3 rows and 3 columns on each side is derived by pixel padding.

[0180] In some examples, the motion compensation region of the subblock is (subW+4)x(subH+4), and the surrounding region of 1 row and 1 column on each side is derived by pixel padding.

[0181] In some examples, when the subblock size is less than a threshold, the pixel padding process is applied.

[0182] In some examples, when a multi-iteration BDOF process is applied to a coded block, pixel padding is applied for one or several iterations.

[0183] Figure 15 is a block diagram of an example video encoder 200 that can perform the techniques of this disclosure. Figure 15are provided for purposes of explanation and should not be considered to be limitations thereof. For purposes of explanation, the present disclosure describes video encoder 200 in terms of the techniques of VVC and HEVC. However, the techniques of the present disclosure can be performed by video encoding devices configured to other video coding standards and video coding formats, such as AV1 and subsequent formats of the AV1 video coding format.

[0184] In Figure 15 In the example of FIG. 2, video encoder 200 includes video data memory 230, mode select unit 202, residual generation unit 204, transform processing unit 206, quantization unit 208, inverse quantization unit 210, inverse transform processing unit 212, reconstruction unit 214, filter unit 216, decoded picture buffer (DPB) 218, and entropy encoding unit 220. Any or all of video data memory 230, mode select unit 202, residual generation unit 204, transform processing unit 206, quantization unit 208, inverse quantization unit 210, inverse transform processing unit 212, reconstruction unit 214, filter unit 216, DPB 218, and entropy encoding unit 220 can be implemented in one or more processors or in processing circuitry. For instance, the units of video encoder 200 can be implemented as one or more circuits or logic elements as part of hardware circuitry, or as part of a processor, ASIC, or FPGA. Also, video encoder 200 can include additional or alternative processors or processing circuitry to perform these and other functions.

[0185] Video data memory 230 is an example of a memory storage device that can store video data to be encoded by the components of video encoder 200. Video encoder 200 can receive the video data stored in video data memory 230 from, for example, video source 104 Figure 1 DPB 218 can act as a reference picture memory to store reference video data for use in encoding video data by video encoder 200, e.g., in predicting future video data. Video data memory 230 and DPB 218 can each be formed by any of a variety of one or more memory devices or memory units, such as dynamic random access memory (DRAM), including synchronous DRAM (SDRAM), magneto resistive RAM (MRAM), resistive RAM (RRAM), or other types of memory devices. Video data memory 230 and DPB 218 can be provided by the same memory device or separate memory devices. In various examples, video data memory 230 can be on-chip with other components of video encoder 200, as illustrated, or off-chip relative to those components.

[0186] In this disclosure, references to video data memory 230 should not be construed as limited to memory inside video encoder 200 (unless specifically described) or memory outside video encoder 200 (unless specifically described). Rather, references to video data memory 230 should be understood as a reference memory that stores video data received by video encoder 200 for encoding (e.g., video data for the current block to be encoded). Figure 1 The memory 106 can also provide temporary storage for the outputs from various units of the video encoder 200.

[0187] Examples Figure 15 Various units help understand the operations performed by the video encoder 200. Units can be implemented as fixed-function circuits, programmable circuits, or combinations thereof. A fixed-function circuit is a circuit that provides specific functionality and is pre-defined for the operations that can be performed. A programmable circuit is a circuit that can be programmed to perform various tasks and provides flexible functionality for the operations that can be performed. For example, a programmable circuit can execute software or firmware that causes the programmable circuit to operate in a manner defined by the instructions of the software or firmware. A fixed-function circuit can execute software instructions (e.g., to receive or output parameters), but the type of operation performed by a fixed-function circuit is generally immutable. In some examples, one or more units in the unit may be different circuit blocks (fixed-function or programmable), and in some examples, one or more units in the unit may be integrated circuits.

[0188] The video encoder 200 may include an arithmetic logic unit (ALU), an essential function unit (EFU), digital circuitry, analog circuitry, and / or a programmable core, all formed by programmable circuitry. In an example where the operation of the video encoder 200 is performed using software executed by programmable circuitry, memory 106 ( Figure 1 The video encoder 200 may store instructions (e.g., target code) of the software received and executed by the video encoder 200, or another memory (not shown) within the video encoder 200 may store such instructions.

[0189] The video data storage unit 230 is configured to store received video data. The video encoder 200 can retrieve images of the video data from the video data storage unit 230 and provide the video data to the residual generation unit 204 and the mode selection unit 202. The video data in the video data storage unit 230 can be raw video data to be encoded.

[0190] The mode selection unit 202 includes a motion estimation unit 222, a motion compensation unit 224, and an intra-prediction unit 226. The mode selection unit 202 can include additional functional units that perform video prediction according to other prediction modes. As examples, the mode selection unit 202 can include a palette unit, an intra-block copy unit (which can be part of the motion estimation unit 222 and / or the motion compensation unit 224), an affine unit, a linear model (LM) unit, etc.

[0191] The mode selection unit 202 generally coordinates the multiple encoding passes to test combinations of encoding parameters and resulting rate-distortion values for such combinations. The encoding parameters can include partitioning of CTUs into CUs, prediction modes for the CUs, transform types for residual data of the CUs, quantization parameters for the residual data of the CUs, etc. The mode selection unit 202 can ultimately select the combination of encoding parameters that has better rate-distortion values compared to other tested combinations.

[0192] The video encoder 200 can partition a picture retrieved from the video data memory 230 into a series of CTUs, and encapsulate one or more CTUs within a slice. The mode selection unit 202 can partition the CTUs of the picture according to a tree structure described above, such as the MTT structure, the QTBT structure, the superblock structure, or the quadtree structure described above. As described above, the video encoder 200 can form one or more CUs by partitioning a CTU according to the tree structure. Such CUs can also be referred to as “video blocks” or “blocks” generally.

[0193] In general, the mode selection unit 202 also controls its components (e.g., the motion estimation unit 222, the motion compensation unit 224, and the intra-prediction unit 226) to generate prediction blocks for a current block (e.g., a current CU, or in HEVC, overlapping portions of a PU and a TU). To perform inter-prediction for the current block, the motion estimation unit 222 can perform a motion search to identify one or more closely matching reference blocks in one or more reference pictures (e.g., one or more previously coded pictures stored in the DPB 218). Specifically, the motion estimation unit 222 can calculate a value that represents how similar a potential reference block is to the current block, e.g., according to a sum of absolute difference (SAD), a sum of squared difference (SSD), a mean absolute difference (MAD), a mean squared difference (MSD), etc. The motion estimation unit 222 can generally use sample-by-sample differences between the current block and the reference block under consideration to perform these calculations. The motion estimation unit 222 can identify the reference block with the lowest value resulting from these calculations, to indicate the reference block that is most matching to the current block.

[0194] The motion estimation unit 222 can form one or more motion vectors that define a position of a reference block in a reference picture relative to a position of a current block in a current picture. The motion estimation unit 222 can then provide the motion vectors to the motion compensation unit 224. For example, for uni-directional inter prediction, the motion estimation unit 222 can provide a single motion vector, while for bi-directional inter prediction, the motion estimation unit 222 can provide two motion vectors. The motion compensation unit 224 can then generate a prediction block using the motion vectors. For example, the motion compensation unit 224 can use the motion vectors to retrieve data for the reference block. As another example, in cases where the motion vectors have fractional sample precision, the motion compensation unit 224 can interpolate values of the prediction block according to one or more interpolation filters. Moreover, for bi-directional inter prediction, the motion compensation unit 224 can retrieve data for two reference blocks identified by the respective motion vectors and combine the retrieved data, e.g., by sample-wise averaging or weighted averaging.

[0195] When operating according to the AV1 video coding format, the motion estimation unit 222 and the motion compensation unit 224 can be configured to use translational motion compensation, affine motion compensation, OBMC, and / or compound inter-intra prediction to encode coding blocks of video data (e.g., both luma and chroma coding blocks).

[0196] As another example, for intra prediction or intra prediction coding, the intra prediction unit 226 can generate a prediction block from samples neighboring the current block. For example, for directional modes, the intra prediction unit 226 can generally mathematically combine values of the neighboring samples and fill these computed values across the current block in a defined direction to produce the prediction block. As another example, for a DC mode, the intra prediction unit 226 can compute an average of the neighboring samples of the current block and generate the prediction block to include the resulting average for each sample of the prediction block.

[0197] When operating according to the AV1 video coding format, the intra prediction unit 226 can be configured to use directional intra prediction, non-directional intra prediction, recursive filter intra prediction, luma-chroma (CFL) prediction, intra block copy (IBC), and / or palette mode to encode coding blocks of video data (e.g., both luma and chroma coding blocks). The mode selection unit 202 can include additional functional units that perform video prediction according to other prediction modes.

[0198] The mode selection unit 202 provides the prediction block to a residual generation unit 204. The residual generation unit 204 receives an uncoded original version of the current block from the video data memory 230 and the prediction block from the mode selection unit 202. The residual generation unit 204 computes the sample-by-sample difference between the current block and the prediction block. The resulting sample-by-sample difference defines a residual block for the current block. In some examples, the residual generation unit 204 can also determine the difference between sample values in the residual block to generate the residual block using residual differential pulse code modulation (RDPCM). In some examples, the residual generation unit 204 can use one or more subtractor circuits that perform binary subtraction to form.

[0199] In examples in which the mode selection unit 202 partitions the CU into PUs, each PU can be associated with a luma prediction unit and corresponding chroma prediction units. Video encoder 200 and video decoder 300 can support PUs having various sizes. As noted above, a size of a CU can refer to a size of a luma coding block of the CU, while a size of a PU can refer to a size of a luma prediction unit of the PU. Assuming that a particular CU has a size of 2Nx2N, video encoder 200 can support PU sizes of 2Nx2N or NxN for intra-prediction, and 2Nx2N, 2NxN, Nx2N, NxN, or similar symmetric PU sizes for inter-prediction. Video encoder 200 and video decoder 300 can also support asymmetric partitioning for PU sizes of 2NxnU, 2NxnD, nLx2N, and nRx2N for inter-prediction.

[0200] In examples in which the mode selection unit 202 does not further partition the CU into PUs, each CU can be associated with a luma coding block and corresponding chroma coding blocks. As above, a size of a CU can refer to a size of a luma coding block of the CU. Video encoder 200 and video decoder 300 can support CU sizes of 2Nx2N, 2NxN, or Nx2N.

[0201] For other video coding techniques, such as intra block copy mode coding, affine mode coding, and linear model (LM) mode coding, as some examples, the mode selection unit 202 generates a prediction block for the current block being coded via a respective unit associated with the coding technique. In some examples, such as palette mode coding, the mode selection unit 202 can not generate a prediction block, but instead generate syntax elements that indicate the manner in which the block is to be reconstructed based on a selected palette. In such modes, the mode selection unit 202 can provide these syntax elements to the entropy encoding unit 220 for encoding.

[0202] As described above, the residual generation unit 204 receives video data for a current block and a corresponding prediction block. The residual generation unit 204 then generates a residual block for the current block. To generate the residual block, the residual generation unit 204 calculates the sample-by-sample difference between the prediction block and the current block.

[0203] The transform processing unit 206 applies one or more transforms to the residual block to generate a block of transform coefficients (referred to herein as a “transform coefficient block”). The transform processing unit 206 can apply various transforms to the residual block to form a transform coefficient block. For example, the transform processing unit 206 can apply a discrete cosine transform (DCT), a directional transform, a Karhunen-Loeve transform (KLT), or a conceptually similar transform to the residual block. In some examples, the transform processing unit 206 can perform multiple transforms on the residual block, e.g., a primary transform and a secondary transform such as a rotation transform. In some examples, the transform processing unit 206 does not apply a transform to the residual block.

[0204] When operating according to AV1, the transform processing unit 206 can apply one or more transforms to the residual block to generate a block of transform coefficients (referred to herein as a “transform coefficient block”). The transform processing unit 206 can apply various transforms to the residual block to form a transform coefficient block. For example, the transform processing unit 206 can apply a horizontal / vertical transform combination, which can include a discrete cosine transform (DCT), an asymmetric discrete sine transform (ADST), a flipped ADST (e.g., ADST in reverse order), and an identity transform (IDTX). When the identity transform is used, the transform is skipped in one of the vertical or horizontal directions. In some examples, the transform processing can be skipped.

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

[0206] Inverse quantization unit 210 and inverse transform processing unit 212 can apply inverse quantization and inverse transform, respectively, to the quantized transform coefficient block to reconstruct a residual block from the transform coefficient block. Reconstruction unit 214 can produce a reconstructed block corresponding to the current block (albeit potentially with some degree of distortion) based on the reconstructed residual block and the prediction block generated by mode selection unit 202. For example, reconstruction unit 214 can add samples of the reconstructed residual block to corresponding samples from the prediction block generated by mode selection unit 202 to produce the reconstructed block.

[0207] Filter unit 216 can perform one or more filtering operations on the reconstructed block. For example, filter unit 216 can perform a deblocking operation to reduce blocking artifacts along edges of the CU. In some examples, the operations of filter unit 216 can be skipped.

[0208] When operating according to AV1, filter unit 216 can perform one or more filtering operations on the reconstructed block. For example, filter unit 216 can perform a deblocking operation to reduce blocking artifacts along edges of the CU. In other examples, filter unit 216 can apply a constrained direction enhancement filter (CDEF), which can be applied after deblocking and can include application of a non-separable, non-linear, low-pass directional filter based on an estimated edge direction. Filter unit 216 can also include a loop restoration filter applied after CDEF, and can include a separable, symmetric, normalized Wiener filter or a double self-guided filter.

[0209] Video encoder 200 stores the reconstructed block in DPB 218. For example, in examples in which the operations of filter unit 216 are not performed, reconstruction unit 214 can store the reconstructed block to DPB 218. In examples in which the operations of filter unit 216 are performed, filter unit 216 can store the filtered reconstructed block to DPB 218. Motion estimation unit 222 and motion compensation unit 224 can retrieve reference pictures formed from reconstructed (and potentially filtered) blocks from DPB 218 to inter-predict blocks of subsequent coded pictures. In addition, intra-prediction unit 226 can use reconstructed blocks of the current picture in DPB 218 to intra-predict other blocks in the current picture.

[0210] In general, entropy encoding unit 220 can entropy encode syntax elements received from other functional components of video encoder 200. For example, entropy encoding unit 220 can entropy encode quantized transform coefficient blocks from quantization unit 208. As another example, entropy encoding unit 220 can entropy encode prediction syntax elements (e.g., motion information for inter-prediction or intra-mode information for intra-prediction) from mode select unit 202. Entropy encoding unit 220 can 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, entropy encoding unit 220 can perform a context- adaptive variable length coding (CAVLC) operation, a CABAC operation, a variable- to-variable (V2V) length coding operation, a syntax-based context- adaptive binary arithmetic coding (SBAC) operation, a Probability Interval Partitioning Entropy (PIPE) coding operation, an Exponential-Golomb coding operation, or another type of entropy encoding operation. In some examples, entropy encoding unit 220 can operate in a bypass mode in which syntax elements are not entropy encoded.

[0211] Video encoder 200 can output a bitstream that includes the entropy encoded syntax elements necessary to reconstruct blocks of a slice or picture. In particular, entropy encoding unit 220 can output the bitstream.

[0212] According to AV1, entropy encoding unit 220 can be configured as a symbol-to-symbol adaptive multi-symbol arithmetic coder. Syntax elements in AV1 include an alphabet of N elements, and a context (e.g., a probability model) includes a set of N probabilities. Entropy encoding unit 220 can store the probabilities as n-bit (e.g., 15-bit) cumulative distribution functions (CDFs). Entropy encoding unit 220 can perform recursive scaling using an update factor based on the alphabet size to update the context.

[0213] The operations described above are described with respect to a block. Such description should be understood as operations for a luma coding block and / or a chroma coding block. As described above, in some examples, the luma coding block and the chroma coding block are luma and chroma components of a CU. In some examples, the luma coding block and the chroma coding block are luma and chroma components of a PU.

[0214] In some examples, operations performed with respect to a luma coding block do not need to be repeated for a chroma coding block. As one example, operations to identify a motion vector for a luma coding block and a reference picture do not need to be repeated for identifying a motion vector for a chroma block and a reference picture. Rather, the motion vector for the luma coding block can be scaled to determine the motion vector for the chroma block, and the reference picture can be the same. As another example, an intra-prediction process can be the same for luma coding blocks and chroma coding blocks.

[0215] Video encoder 200 represents an example of a device configured to encode video data, the device including a memory configured to store video data and one or more processing units implemented in circuitry and configured to: derive an initial motion vector based on an affine model of the current block; refine the bidirectional optical flow sub-block motion vector and apply it to the initial motion vector to determine a modified motion vector for the current block; determine a prediction block for the current block based on the modified motion vector; and use the prediction block to determine a decoded version of the current block. Video encoder 200 also represents an example of a device configured to encode video data, the device including a memory configured to store video data and one or more processing units implemented in circuitry and configured to: derive an initial motion vector for the current block from a temporally co-located block of the current block; refine the bidirectional optical flow sub-block motion vector and apply it to the initial motion vector to determine a modified motion vector for the current block; determine a prediction block for the current block based on the modified motion vector; and use the prediction block to determine a decoded version of the current block.

[0216] Figure 16 This is a block diagram illustrating an example video decoder 300 that can perform the techniques of this disclosure. Figure 16 This disclosure is provided for illustrative purposes and not for limiting the techniques extensively illustrated and described herein. For illustrative purposes, the video decoder 300 is described in accordance with VVC and HEVC techniques. However, the techniques of this disclosure can be implemented by video decoding devices configured for other video decoding standards.

[0217] exist Figure 16 In the example, the video decoder 300 includes a decoded picture buffer (CPB) memory 320, an entropy decoding unit 302, a prediction processing unit 304, an inverse quantization unit 306, an inverse transform processing unit 308, a reconstruction unit 310, a filter unit 312, and a DPB 314. Any or all of the CPB memory 320, entropy decoding unit 302, prediction processing unit 304, inverse quantization unit 306, inverse transform processing unit 308, reconstruction unit 310, filter unit 312, and DPB 314 can be implemented in one or more processors or in processing circuitry. For example, the units of the video decoder 300 can be implemented as one or more circuit or logic elements as part of hardware circuitry, or as part of a processor, ASIC, or FPGA. Furthermore, the video decoder 300 may include additional or alternative processors or processing circuitry to perform these and other functions.

[0218] The prediction processing unit 304 includes a motion compensation unit 316 and an intra-prediction unit 318. The prediction processing unit 304 can include additional units to perform prediction according to other prediction modes. As examples, the prediction processing unit 304 can include a palette unit, an intra-block copy unit (which can form a part of the motion compensation unit 316), an affine unit, a linear model (LM) unit, etc. In other examples, the video decoder 300 can include more, less, or different functional components.

[0219] When operating according to AV1, the motion compensation unit 316 can be configured to decode coding blocks (e.g., both luma and chroma coding blocks) of video data using translational motion compensation, affine motion compensation, OBMC, and / or compound inter-intra prediction, as described above. The intra-prediction unit 318 can be configured to decode coding blocks (e.g., both luma and chroma coding blocks) of video data using directional intra-prediction, non-directional intra-prediction, recursive filter intra-prediction, CFL, IBC, and / or palette mode, as described above.

[0220] The CPB memory 320 is an example of a memory system that can store video data, such as an encoded video bitstream, to be decoded by the components of the video decoder 300. The video data stored in the CPB memory 320 can be obtained, for example, from the computer-readable medium 110 Figure 1 ). The CPB memory 320 can include a CPB that stores encoded video data (e.g., syntax elements) from an encoded video bitstream. Also, the CPB memory 320 can 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 300. The DPB 314 is an example of a memory system that generally stores decoded pictures that the video decoder 300 can output, and / or use as reference video data when decoding subsequent data or pictures of an encoded video bitstream. The CPB memory 320 and the DPB 314 can each be formed by any of a variety of memory devices or memory structures, such as DRAM, including SDRAM, MRAM, RRAM, or other types of memory devices. The CPB memory 320 and the DPB 314 can be provided by the same memory device or separate memory devices. In various examples, the CPB memory 320 can be on-chip with other components of the video decoder 300, or off-chip relative to those components.

[0221] Additionally or alternatively, in some examples, the video decoder 300 can obtain the video data from the memory 120 Figure 1to retrieve the coded video data. That is, memory 120 can store data using CPB memory 320 as discussed above. Also, when some or all functionality of video decoder 300 is implemented in software to be executed by processing circuitry of video decoder 300, memory 120 can store the instructions to be executed by video decoder 300.

[0222] The various units shown in FIG. 3A are illustrative only. In some examples, one or more of the units can be integrated, combined or shared with one or more other units. In some examples, one or more of the units can be performed by one or more components of video decoder 300 other than the processing circuitry. In some examples, one or more of the units can be integrated within a fixed function unit, such as a fixed function hardware block. Figure 16 The various units shown in FIG. 3A are illustrative only. In some examples, one or more of the units can be integrated, combined or shared with one or more other units. In some examples, one or more of the units can be performed by one or more components of video decoder 300 other than the processing circuitry. In some examples, one or more of the units can be integrated within a fixed function unit, such as a fixed function hardware block. Figure 15 Fixed function circuitry refers to circuitry that provides a particular functionality and is preset for the operations that it can perform. Programmable circuitry refers to circuitry that can be programmed to perform various tasks and provides flexible functionality in the operations that it can perform. For example, programmable circuitry can execute software or firmware that cause the programmable circuitry to operate in the manner defined by the instructions of the software or firmware. Fixed function circuitry can execute software instructions (e.g., to receive parameters or output parameters), but the types of operations that the fixed function circuitry performs are generally immutable. In some examples, one or more of the units can be distinct circuit blocks (fixed function or programmable) and in some examples, one or more of the units can be integrated circuitry.

[0223] Video decoder 300 can include ALUs, EFUs, digital circuits, analog circuits, and / or programmable cores formed from programmable circuitry. In examples where the operations of video decoder 300 are performed by software executing on programmable circuitry, on-chip or off-chip memory can store instructions (e.g., object code) of the software that video decoder 300 receives and executes.

[0224] Entropy decoding unit 302 can receive encoded video data from the CPB and entropy decode the video data to reproduce syntax elements. Prediction processing unit 304, inverse quantization unit 306, inverse transform processing unit 308, reconstruction unit 310, and filter unit 312 can generate decoded video data based on the syntax elements extracted from the bitstream.

[0225] In general, video decoder 300 reconstructs a picture on a block-by-block basis. Video decoder 300 can perform reconstruction operations on each block individually (where the block that is currently being reconstructed (i.e., decoded) can be referred to as the “current block”).

[0226] Entropy decoding unit 302 can 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 a transform mode indication. Inverse quantization unit 306 can use the QP associated with the quantized transform coefficient block to determine a degree of quantization, and, likewise, a degree of inverse quantization for inverse quantization unit 306 to apply. Inverse quantization unit 306 may, for example, perform a bit- wise left shift operation to inverse quantize the quantized transform coefficients. Inverse quantization unit 306 may, thereby, form a transform coefficient block comprising transform coefficients.

[0227] After inverse quantization unit 306 forms the transform coefficient block, inverse transform processing unit 308 can apply one or more inverse transforms to the transform coefficient block to generate a residual block associated with the current block. For example, inverse transform processing unit 308 can apply an inverse DCT, an inverse integer transform, an inverse Karhunen-Loeve Transform (KLT), an inverse rotational transform, an inverse directional transform, or another inverse transform to the transform coefficient block.

[0228] Furthermore, prediction processing unit 304 generates a prediction block from the prediction information syntax elements entropy decoded by entropy decoding unit 302. For example, in the case that the prediction information syntax elements indicate that the current block is inter predicted, motion compensation unit 316 can generate the prediction block. In this case, the prediction information syntax elements can indicate a reference picture in DPB 314 to retrieve a reference block therefrom, and a motion vector identifying a location of the reference block in the reference picture relative to a location of the current block in the current picture. Motion compensation unit 316 can perform the inter prediction process generally in a manner substantially similar to that described with respect to motion compensation unit 224 Figure 15 ) described above.

[0229] As another example, in the case that the prediction information syntax elements indicate that the current block is intra predicted, intra prediction unit 318 can generate the prediction block according to an intra prediction mode indicated by the prediction information syntax elements. Again, intra prediction unit 318 can perform the intra prediction process generally in a manner substantially similar to that described with respect to intra prediction unit 226 Figure 15 ) described above. Intra prediction unit 318 can retrieve data for neighboring samples of the current block from DPB 314.

[0230] Reconstruction unit 310 can reconstruct the current block using the prediction block and the residual block. For example, reconstruction unit 310 can add samples of the residual block to corresponding samples of the prediction block to reconstruct the current block.

[0231] Filter unit 312 can perform one or more filtering operations on the reconstructed block. For example, filter unit 312 can perform a deblocking operation to reduce blocking artifacts along the edges of the reconstructed block. The operations of filter unit 312 are not necessarily performed in all examples.

[0232] Video decoder 300 can store the reconstructed block in DPB 314. For example, in examples in which the operations of filter unit 312 are not performed, reconstruction unit 310 can store the reconstructed block to DPB 314. In examples in which the operations of filter unit 312 are performed, filter unit 312 can store the filtered reconstructed block to DPB 314. As discussed above, DPB 314 can provide reference information, such as samples of a current picture for intra prediction and previously decoded pictures for subsequent motion compensation, to prediction processing unit 304. In addition, video decoder 300 can output decoded pictures (e.g., decoded video) from DPB 314 for subsequent presentation on a display device, such as display device 118. Figure 1

[0233] In this way, video decoder 300 represents an example of a video decoding device including a memory configured to store video data and one or more processing units implemented in circuitry and configured to derive an initial motion vector from an affine model of a current block, apply a bi-directional optical flow sub-block motion vector refinement to the initial motion vector to determine a modified motion vector for the current block, determine a prediction block for the current block based on the modified motion vector, and use the prediction block to determine a decoded version of the current block. Video decoder 300 represents an example of a video decoding device including a memory configured to store video data, one or more processing units implemented in circuitry and configured to store video data, and one or more processing units implemented in circuitry and configured to derive an initial motion vector for a current block from a temporally collocated block of the current block, apply a bi-directional optical flow sub-block motion vector refinement to the initial motion vector to determine a modified motion vector for the current block, determine a prediction block for the current block based on the modified motion vector, and use the prediction block to determine a decoded version of the current block.

[0234] Figure 17 is a flowchart illustrating an example method for encoding a current block in accordance with the techniques of this disclosure. The current block can be or can include a current CU. Although described with respect to video encoder 200 Figure 1 and Figure 15 ), it should be understood that other devices can be configured to perform methods similar to the method of Figure 17

[0235] ​​In this example, video encoder 200 initially predicts the current block (600). For example, video encoder 200 can form a prediction block for the current block. Video encoder 200 can then calculate a residual block for the current block (602). To calculate the residual block, video encoder 200 can calculate a difference between an unencoded original block for the current block and the prediction block. Video encoder 200 can then transform the residual block and quantize the transform coefficients of the residual block (604). Next, video encoder 200 can scan the quantized transform coefficients of the residual block (606). During or after the scan, video encoder 200 can entropy encode the transform coefficients (608). For example, video encoder 200 can use CAVLC or CABAC to encode the transform coefficients. Video encoder 200 can then output the entropy encoded data for the block (610).

[0236] Figure 18 is a flowchart illustrating an example method for decoding a current block of video data in accordance with the techniques of this disclosure. The current block can be or can include a current CU. Although described with respect to video decoder 300 Figure 1 and Figure 16 ), it should be understood that other devices can be configured to perform methods similar to the method of Figure 18 .

[0237] Video decoder 300 can receive entropy encoded data for the current block, such as entropy encoded prediction information and entropy encoded data for transform coefficients of a residual block corresponding to the current block (612). Video decoder 300 can entropy decode the entropy encoded data to determine prediction information for the current block and to reproduce transform coefficients of the residual block (614). Video decoder 300 can predict the current block (616), e.g., using an intra-prediction mode or an inter-prediction mode as indicated by the prediction information for the current block, to calculate a prediction block for the current block. Video decoder 300 can then inverse scan the reproduced transform coefficients (618) to create a block of quantized transform coefficients. Video decoder 300 can then inverse quantize the transform coefficients and apply an inverse transform to the transform coefficients to produce a residual block (620). Video decoder 300 can finally decode the current block by combining the prediction block and the residual block (622).

[0238] Figure 19 is a flowchart illustrating an example method for decoding a current block of video data in accordance with the techniques of this disclosure. The current block can be or can include a current CU. Although described with respect to video decoder 300 Figure 1 and Figure 16 ), it should be understood that other devices can be configured to perform methods similar to the method of Figure 19 . For example, Figure 19The processing of the techniques can also be performed by a video decoding loop of the video encoding 200.

[0239] In Figure 19 In an example, the video decoder 300 determines that a current block having a size of W CB ×H CB is coded in an affine prediction mode (630). The video decoder 300 partitions the current block into a first plurality of sub-blocks, where each sub-block has a size of W SB ×H SB , where W SB is less than W CB and H SB is less than H CB (632). The video decoder 300 predicts each sub-block of the first plurality of sub-blocks using an affine motion model associated with the affine prediction mode to determine an initial prediction block for the current block (634). The video decoder 300 partitions the initial prediction block into a second plurality of sub-blocks, where each sub-block of the second plurality of sub-blocks has a size of W SBIPB ×H SBIPB , where W SBIPB is less than or equal to W CB and less than or equal to W SB , and H SBIPB is less than or equal to H CB and less than or equal to H SB (636).

[0240] The video decoder 300 applies a bi-directional optical flow process to a first sub-block of the second plurality of sub-blocks to determine a first refined prediction sub-block (638). The video decoder 300 applies the bi-directional optical flow process to a second sub-block of the second plurality of sub-blocks to determine a second refined prediction sub-block (640). The video decoder 300 determines a refined prediction block based on the first refined sub-block and the second refined sub-block (642). The video decoder 300 determines a decoded version of the current block based on the refined prediction block (644).

[0241] The following numbered clauses exemplify one or more aspects of the devices and techniques described in this disclosure.

[0242] Clause 1A: A method of coding video data, the method comprising: deriving an initial motion vector from an affine model of a current block; and applying a bi-directional optical flow sub-block motion vector refinement to the initial motion vector to determine a modified motion vector for the current block; determining a prediction block for the current block based on the modified motion vector; and using the prediction block to determine a decoded version of the current block.

[0243] Clause 2A: A method of coding video data, the method comprising: deriving an initial motion vector for a current block from a temporally collocated block of the current block; and applying bi-directional optical flow sub-block motion vector refinement to the initial motion vector to determine a modified motion vector for the current block; determining a prediction block for the current block based on the modified motion vector; and using the prediction block to determine a decoded version of the current block.

[0244] Clause 3A: The method of clause 1A or 2A, wherein coding comprises decoding.

[0245] Clause 4A: The method of any of clauses 1A-3A, wherein coding comprises encoding.

[0246] Clause 5A: A device for coding video data, the device comprising one or more means for performing the method of any of clauses 1A-4A.

[0247] Clause 6A: The device of clause 5A, wherein the one or more means comprise one or more processors implemented in circuitry.

[0248] Clause 7A: The device of any of clauses 5A and 6A, the device further comprising: a memory to store the video data.

[0249] Clause 8A: The device of any of clauses 5A-7A, the device further comprising a display configured to display decoded video data.

[0250] Clause 9A: The device of any of clauses 5A-8A, wherein the device comprises one or more of a video camera, a computer, a mobile device, a broadcast receiver device, or a set-top box.

[0251] Clause 10A: The device of any of clauses 5A-9A, wherein the device comprises a video decoder.

[0252] Clause 11A: The device of any of clauses 5A-10A, wherein the device comprises a video encoder.

[0253] Clause 12A: A computer-readable storage medium having stored thereon instructions that, when executed by one or more processors, perform the method of any of clauses 1A-4A.

[0254] Clause 1B: A method of decoding video data, the method comprising: determining that a current block of the video data is coded in an affine prediction mode, wherein the current block has a width (W CB ) x height (HCB ) of the current block; predicting each sub-block of a first plurality of sub-blocks using an affine motion model associated with the affine prediction mode to determine an initial prediction block for the current block, wherein each sub-block of the first plurality of sub-blocks has a size of width (W SB ) x height (H SB ), where W SB is less than W CB and H SB is less than H CB ; applying a bi-directional optical flow process to a first sub-block of a second plurality of sub-blocks to determine a first refined prediction sub-block, wherein each sub-block of the second plurality of sub-blocks has a size of width (W SBIPB ) x height (H SBIPB ), where W SBIPB is less than or equal to W CB and less than or equal to W SB , and H SBIPB is less than or equal to H CB and less than or equal to H SB ; applying the bi-directional optical flow process to a second sub-block of the second plurality of sub-blocks to determine a second refined prediction sub-block; determining a refined prediction block based on the first refined sub-block and the second refined sub-block; and determining a decoded version of the current block based on the refined prediction block.

[0255] Clause 2B: The method of clause IB, wherein predicting each sub-block of the first plurality of sub-blocks using the affine motion model associated with the affine prediction mode to determine the initial prediction block for the current block comprises: receiving two or more control point motion vectors; deriving an initial motion vector for the sub-block of the first plurality of sub-blocks; and using the initial motion vector for the sub-block to locate an initial prediction block for the sub-block.

[0256] Clause 3B: The method of clause 2B, wherein applying the bi-directional optical flow process to the first sub-block of the second plurality of sub-blocks to determine the first refined prediction sub-block comprises: determining an updated motion vector for the first sub-block of the second sub-block of the second plurality of sub-blocks.

[0257] Clause 4B: The method of clause 3B, the method further comprising: storing the updated motion vector for the first sub-block of the second plurality of sub-blocks; and using the updated motion vector to predict a subsequent block of video data.

[0258] Clause 5B: The method of clause 4B, wherein determining the refined prediction block based on the first refined sub-block and the second refined sub-block comprises: applying a per-pixel bi-directional optical flow process to the first refined prediction sub-block.

[0259] Clause 6B: The method of any of clauses 1B-5B, wherein determining the refined prediction block based on the first refined subblock and the second refined subblock comprises: applying a second bi-directional optical flow process to the first refined prediction subblock; and applying the second bi-directional optical flow process to the second refined prediction subblock.

[0260] Clause 7B: The method of any of clauses 1B-6B, the method further comprising: receiving a syntax element, wherein a value of the syntax element indicates that the bi-directional optical flow process is enabled for the current block.

[0261] Clause 8B: The method of any of clauses 1B-7B, wherein W SBIPB is equal to 1 and H SBIPB is equal to 1.

[0262] Clause 9B: The method of any of clauses 1B-8B, wherein W SB is greater than or equal to 4 and H SB is greater than or equal to 4.

[0263] Clause 10B: The method of any of clauses 1B-9B, wherein the current block comprises a bi-prediction block.

[0264] Clause 11B: The method of any of clauses 1B-6B or 8B-10B, wherein the decoding method is performed as part of a video encoding process.

[0265] Clause 12B: A device for decoding encoded video data, the device comprising: a memory configured to store video data; one or more processors implemented in circuitry and configured to: determine that a current block of the video data is coded in an affine prediction mode, wherein the current block has a size of width (W CB ) x height (H CB ); predict individual subblocks of a first plurality of subblocks using an affine motion model associated with the affine prediction mode to determine an initial prediction block for the current block, wherein individual subblocks of the first plurality of subblocks have a size of width (W SB ) x height (H SB ), wherein W SB is less than W CB and H SB is less than H CB ; apply a bi-directional optical flow process to a first subblock of a second plurality of subblocks to determine a first refined prediction subblock, wherein individual subblocks of the second plurality of subblocks have a size of width (W SBIPB ) x height (H SBIPB ).SBIPB less than or equal to W CB and less than or equal to W SB and H SBIPB less than or equal to H CB and less than or equal to H SB applying the bi-directional optical flow process to a second subblock of the second plurality of subblocks to determine a second refined predictor subblock; determining a refined prediction block based on the first refined subblock and the second refined subblock; and determining a decoded version of the current block based on the refined prediction block.

[0266] Clause 13B: The device of clause 12B, wherein to predict individual subblocks of the first plurality of subblocks using the affine motion model associated with the affine prediction mode to determine the initial prediction block for the current block, the one or more processors are further configured to: receive two or more control point motion vectors; derive an initial motion vector for the subblock of the first plurality of subblocks; and use the initial motion vector for the subblock to locate an initial prediction block for the subblock.

[0267] Clause 14B: The device of clause 13B, wherein to apply the bi-directional optical flow process to the first subblock of the second plurality of subblocks to determine the first refined predictor subblock, the one or more processors are further configured to: determine an updated motion vector for the first subblock of the second subblock of the second plurality of subblocks.

[0268] Clause 15B: The device of clause 14B, wherein the one or more processors are further configured to: store the updated motion vector for the first subblock of the second plurality of subblocks; and use the updated motion vector to predict a subsequent block of video data.

[0269] Clause 16B: The device of clause 15B, wherein to determine the refined prediction block based on the first refined subblock and the second refined subblock, the one or more processors are further configured to: apply a per-pixel bi-directional optical flow process to the first refined predictor subblock.

[0270] Clause 17B: The device of any of clauses 12B-16B, wherein to determine the refined prediction block based on the first refined subblock and the second refined subblock, the one or more processors are further configured to: apply a second bi-directional optical flow process to the first refined predictor subblock; and apply the second bi-directional optical flow process to the second refined predictor subblock.

[0271] Clause 18B: The device of any of clauses 12B-17B, wherein the one or more processors are further configured to: receive a syntax element, wherein a value of the syntax element indicates that the bi-directional optical flow process is enabled for the current block.

[0272] Clause 19B: The device of any of clauses 12B-18B, wherein W SBIPB_1 is equal to 1 and H SBIPB_1 is equal to 1.

[0273] Clause 20B: The device of any of clauses 12B-19B, wherein W SB is greater than or equal to 4 and H SB is greater than or equal to 4.

[0274] Clause 21B: The device of any of clauses 12B-20B, wherein the current block comprises a bi-predictive block.

[0275] Clause 22B: The device of any of clauses 12B-20B, the device further comprising a display configured to display pictures of decoded video data that include the decoded version of the current block.

[0276] Clause 23B. The device of any of clauses 12B-20B, wherein the device comprises one or more of a camera, a computer, a mobile device, a broadcast receiver device, or a set-top box.

[0277] Clause 24B: The device of any of clauses 12B-23B, wherein the device comprises a wireless communication device, the device further comprising a receiver configured to receive the encoded video data.

[0278] Clause 25B: The device of clause 24B, wherein the wireless communication device comprises a handheld phone, and wherein the receiver is configured to demodulate a signal comprising the encoded video data according to a wireless communication standard.

[0279] Clause 26B: The device of any of clauses 12B-26B, wherein the device comprises a video decoder.

[0280] Clause 27B: The device of any of clauses 12B-17B or 19B-25B, wherein the device comprises a video encoder.

[0281] Clause 28B: A computer-readable storage medium storing instructions that, when executed by one or more processors, cause the one or more processors to: determine that a current block of video data is coded in an affine prediction mode, wherein the current block has a width (WCB ) x height (H CB ) of the current block; predicting each sub-block of a first plurality of sub-blocks using an affine motion model associated with the affine prediction mode to determine an initial prediction block for the current block, wherein each sub-block of the first plurality of sub-blocks has a size of width (W SB ) x height (H SB ), wherein W SB is less than W CB and H SB is less than H CB ; applying a bi-directional optical flow process to a first sub-block of a second plurality of sub-blocks to determine a first refined prediction sub-block, wherein each sub-block of the second plurality of sub-blocks has a size of width (W SBIPB ) x height (H SBIPB ), wherein W SBIPB is less than or equal to W CB and less than or equal to W SB , and H SBIPB is less than or equal to H CB and less than or equal to H SB ; applying the bi-directional optical flow process to a second sub-block of the second plurality of sub-blocks to determine a second refined prediction sub-block; determining a refined prediction block based on the first refined sub-block and the second refined sub-block; and determining a decoded version of the current block based on the refined prediction block.

[0282] Clause 29B: The computer-readable storage medium of Clause 28B, wherein to predict each sub-block of the first plurality of sub-blocks using the affine motion model associated with the affine prediction mode to determine the initial prediction block for the current block, the instructions cause the one or more processors to: receive two or more control point motion vectors; derive an initial motion vector for the first sub-block of the plurality of sub-blocks; and use the initial motion vector for the sub-block to locate an initial prediction block for the first sub-block.

[0283] Clause 30B: The computer-readable storage medium of Clause 29B, wherein to apply the bi-directional optical flow process to the first sub-block of the second plurality of sub-blocks to determine the first refined prediction sub-block, the one or more processors are further configured to: determine an updated motion vector for the first sub-block of the second sub-block of the second plurality of sub-blocks.

[0284] Clause 31B: The computer-readable storage medium of Clause 30B, wherein the instructions cause the one or more processors to: store the updated motion vector for the first sub-block of the second plurality of sub-blocks; and use the updated motion vector to predict a subsequent block of video data.

[0285] Clause 32B: The computer-readable storage medium of clause 31B, wherein to determine the refined prediction block based on the first refined sub-block and the second refined sub-block, the instructions cause the one or more processors to: apply a per-pixel optical flow process to the first refined prediction sub-block.

[0286] Clause 33B: The computer-readable storage medium of any of clauses 28B-32B, wherein to determine the refined prediction block based on the first refined sub-block and the second refined sub-block, the instructions cause the one or more processors to: apply a second optical flow process to the first refined prediction sub-block; and apply the second optical flow process to the second refined prediction sub-block.

[0287] Clause 34B: The computer-readable storage medium of any of clauses 28B-33B, wherein the instructions cause the one or more processors to: receive a syntax element, wherein a value of the syntax element indicates that the optical flow process is enabled for the current block.

[0288] Clause 35B: The computer-readable storage medium of any of clauses 28B-34B, wherein W SBIPB_1 is equal to 1 and H SBIPB_1 is equal to 1.

[0289] Clause 36B: The computer-readable storage medium of any of clauses 28B-35B, wherein W SB is greater than or equal to 4 and H SB is greater than or equal to 4.

[0290] Clause 37B: The computer-readable storage medium of any of clauses 28B-36B, wherein the current block comprises a bi-predictive block.

[0291] Clause 38B: A method of decoding video data, the method comprising: determining that a current block of the video data is coded in an affine prediction mode, wherein the current block has a size of width (W CB ) x height (H CB ); determining a motion vector of the current block based on a temporal motion vector predictor candidate; determining an initial prediction block for the current block using the motion vector; applying a bi-directional optical flow process to a first sub-block of a plurality of sub-blocks of the initial prediction block to determine a first refined prediction sub-block, wherein each sub-block of the plurality of sub-blocks has a size of width (W SBIPB ) x height (H SBIPB ), wherein W SBIPB is less than or equal to W CB and H SBIPB is less than or equal to H CBapplying the bi-directional optical flow process to a second sub-block of the plurality of sub-blocks to determine a second refined predictor sub-block; determining a refined prediction block based on the first refined sub-block and the second refined sub-block; and determining a decoded version of the current block based on the refined prediction block.

[0292] It is recognized that, in accordance with examples, certain acts or events that are described can be performed in a different sequence, can be added, merged, or omitted altogether (for example, not all described acts or events are necessary to implement the techniques). Moreover, in certain examples, acts or events can be performed concurrently, e.g., through multi-threaded processing, interrupt processing, or multiple processors, rather than sequentially.

[0293] In one or more examples, the functions described can be implemented in hardware, software, firmware, or any combination thereof. If implemented in software, the functions can be stored on or transmitted over as one or more instructions or code on a computer-readable medium and executed by a hardware-based processing unit. Computer-readable media can include computer-readable storage media, which corresponds to a tangible medium such as data storage media, or communication media including any medium that facilitates transfer of a computer program from one place to another, e.g., according to a communication protocol. In this manner, computer- readable media generally can correspond to (1) tangible computer-readable storage media which is non-transitory or (2) a communication medium such as a signal or carrier wave. Data storage media can be any available media that can be accessed by one or more computers or one or more processors to retrieve instructions, code, and / or data structures for implementation of the techniques described in this disclosure. A computer program product can include a computer-readable medium.

[0294] By way of example, and not limitation, such computer-readable storage media can include one or more of RAM, ROM, EEPROM, CD-ROM or other optical disk storage, magnetic disk storage, or other magnetic storage devices, flash memory, or any other storage medium that can be used to store desired program code in the form of instructions or data structures and that can be accessed by a computer. Also, any

[0295] Instructions can be executed by one or more processors, such as one or more DSPs, general purpose microprocessors, ASICs, FPGAs, or other equivalent integrated or discrete logic circuitry. Accordingly, the terms "processor" and "processing circuitry," as used herein can refer to any of the foregoing structures or any other structure suitable for implementation of the techniques described herein. In addition, in some aspects, the functionality described herein can be provided within dedicated hardware and / or software modules configured for encoding and decoding, or incorporated in a combined codec. Also, the techniques could be fully implemented in one or more circuits or logic elements.

[0296] The techniques of this disclosure can be implemented in a wide variety of devices or apparatuses, including a wireless handset, an integrated circuit (IC) or a set of ICs (e.g., a chip set). Various components, modules, or units are described in this disclosure to emphasize functional aspects of devices configured to perform the disclosed techniques, but do not necessarily require

[0297] Various examples have been described. These and other examples are within the scope of the following claims.

Claims

1. A method of decoding video data, the method comprising: determining that a current block of the video data is coded in an affine prediction mode, wherein the current block has a size of width (W CB ) x height (H CB ) predicting each sub-block of a first plurality of sub-blocks using an affine motion model associated with the affine prediction mode to determine an initial predicted block of the current block, wherein each sub-block of the first plurality of sub-blocks has a size of width (W SB ) x height (H SB ), wherein W SB is less than W CB and H SB is less than H CB ; applying a bi-directional optical flow process to a first sub-block of the second plurality of sub-blocks to determine a first refined predictor block, wherein each sub-block of the second plurality of sub-blocks has a size of width (W SBIPB ) x height (H SBIPB ), wherein W SBIPB is less than or equal to W CB and less than or equal to W SB , and H SBIPB is less than or equal to H CB and less than or equal to H SB ; applying the bi-directional optical flow process to a second sub-block of the second plurality of sub-blocks to determine a second refined prediction sub-block; determining a refined prediction block based on the first refined sub-block and the second refined sub-block; and determining a decoded version of the current block based on the refined prediction block.

2. The method of claim 1, wherein predicting each sub-block of the first plurality of sub-blocks using the affine motion model associated with the affine prediction mode to determine the initial prediction block for the current block comprises: receiving two or more control point motion vectors; deriving an initial motion vector for the sub-block of the first plurality of sub-blocks; and locating an initial prediction block for the sub-block using the initial motion vector for the sub-block.

3. The method of claim 2, wherein applying the bi-directional optical flow process to the first sub-block of the second plurality of sub-blocks to determine the first refined prediction sub-block comprises: determining an updated motion vector for the first sub-block of the second sub-block of the second plurality of sub-blocks.

4. The method of claim 3, the method further comprising: storing the updated motion vector for the first sub-block of the second plurality of sub-blocks; and using the updated motion vector to predict a subsequent block of video data.

5. The method of claim 4, wherein determining a refined prediction block based on the first refined sub-block and the second refined sub-block comprises: applying a per-pixel bi-directional optical flow process to the first refined prediction sub-block.

6. The method of claim 1, wherein determining a refined prediction block based on the first refined sub-block and the second refined sub-block comprises: applying a second bi-directional optical flow process to the first refined prediction sub-block; and applying the second bi-directional optical flow process to the second refined prediction sub-block.

7. The method of claim 1, the method further comprising: receiving a syntax element, wherein a value of the syntax element indicates that the bi-directional optical flow process is enabled for the current block.

8. The method of claim 1, wherein W SBIPB equals 1 and H SBIPB equals 1.​​ 9. The method of claim 1, wherein W SB greater than or equal to 4 and H SB greater than or equal to 4.

10. The method of claim 1, wherein the current block comprises a bi-directional prediction block.

11. The method of claim 1, wherein the method of decoding is performed as part of a video encoding process.

12. An apparatus for decoding encoded video data, the apparatus comprising: a memory configured to store video data; one or more processors implemented in circuitry and configured to: determining that a current block of the video data is coded in an affine prediction mode, wherein the current block has a size of width (W CB ) x height (H CB ) predicting each sub-block of a first plurality of sub-blocks using an affine motion model associated with the affine prediction mode to determine an initial predicted block of the current block, wherein each sub-block of the first plurality of sub-blocks has a size of width (W SB ) x height (H SB ), wherein W SB is less than W CB and H SB is less than H CB ; applying a bi-directional optical flow process to a first sub-block of the second plurality of sub-blocks to determine a first refined predictor block, wherein each sub-block of the second plurality of sub-blocks has a size of width (W SBIPB ) x height (H SBIPB ), wherein W SBIPB is less than or equal to W CB and less than or equal to W SB , and H SBIPB is less than or equal to H CB and less than or equal to H SB ; apply the bi-directional optical flow process to a second sub-block of the second plurality of sub-blocks to determine a second refined prediction sub-block; determine a refined prediction block based on the first refined sub-block and the second refined sub-block; and determine a decoded version of the current block based on the refined prediction block.

13. The device of claim 12, wherein to predict individual sub-blocks of the first plurality of sub-blocks using the affine motion model associated with the affine prediction mode to determine the initial prediction block for the current block, the one or more processors are further configured to: receive two or more control point motion vectors; derive an initial motion vector for the sub-block of the first plurality of sub-blocks; and use the initial motion vector for the sub-block to locate an initial prediction block for the sub-block.

14. The device of claim 13, wherein to apply the bi-directional optical flow process to the first sub-block of the second plurality of sub-blocks to determine the first refined prediction sub-block, the one or more processors are further configured to: determine an updated motion vector for the first sub-block of the second sub-block of the second plurality of sub-blocks.

15. The device of claim 14, wherein the one or more processors are further configured to: store the updated motion vector for the first sub-block of the second plurality of sub-blocks; and use the updated motion vector to predict a subsequent block of video data.

16. The device of claim 15, wherein to determine the refined prediction block based on the first refined sub-block and the second refined sub-block, the one or more processors are further configured to: apply a per-pixel bi-directional optical flow process to the first refined prediction sub-block.

17. The device of claim 12, wherein to determine the refined prediction block based on the first refined sub-block and the second refined sub-block, the one or more processors are further configured to: apply a second bi-directional optical flow process to the first refined prediction sub-block; and apply the second bi-directional optical flow process to the second refined prediction sub-block.

18. The device of claim 12, wherein the one or more processors are further configured to: receive a syntax element, wherein a value of the syntax element indicates that the bi-directional optical flow process is enabled for the current block.

19. The apparatus of claim 12, wherein W SBIPB_1 equals 1 and H SBIPB_1 equals 1.​​ 20. The apparatus of claim 12, wherein W SB greater than or equal to 4, H SB greater than or equal to 4.

21. The device of claim 12, wherein the current block comprises a bi-predictive block.

22. The device of claim 12, further comprising a display configured to display pictures of decoded video data including the decoded version of the current block.

23. The device of claim 12, wherein the device comprises one or more of a camera, a computer, a mobile device, a broadcast receiver device, or a set-top box.

24. The device of claim 12, wherein the device comprises a wireless communication device, the device further comprising a receiver configured to receive the encoded video data.

25. The device of claim 24, wherein the wireless communication device comprises a handheld phone, and wherein the receiver is configured to demodulate a signal comprising the encoded video data according to a wireless communication standard.

26. The device of claim 12, wherein the device comprises a video decoder.

27. The device of claim 12, wherein the device comprises a video encoder.

28. A computer-readable storage medium storing instructions that when executed by one or more processors cause the one or more processors to: determining that a current block of video data is coded in an affine prediction mode, wherein the current block has a size of width (W CB ) x height (H CB ) predicting each sub-block of a first plurality of sub-blocks using an affine motion model associated with the affine prediction mode to determine an initial predicted block of the current block, wherein each sub-block of the first plurality of sub-blocks has a size of width (W SB ) x height (H SB ), wherein W SB is less than W CB and H SB is less than H CB ; applying a bi-directional optical flow process to a first sub-block of the second plurality of sub-blocks to determine a first refined predictor block, wherein each sub-block of the second plurality of sub-blocks has a size of width (W SBIPB ) x height (H SBIPB ), wherein W SBIPB is less than or equal to W CB and less than or equal to W SB , and H SBIPB is less than or equal to H CB and less than or equal to H SB ; apply the bi-directional optical flow process to a second sub-block of the second plurality of sub-blocks to determine a second refined prediction sub-block; determine a refined prediction block based on the first refined sub-block and the second refined sub-block; and determine a decoded version of the current block based on the refined prediction block.

29. The computer-readable storage medium of claim 28, wherein to predict individual sub-blocks of the first plurality of sub-blocks using the affine motion model associated with the affine prediction mode to determine the initial prediction block for the current block, the instructions cause the one or more processors to: receive two or more control point motion vectors; derive an initial motion vector for the first sub-block of the plurality of sub-blocks; and use the initial motion vector for the sub-block to locate an initial prediction block for the first sub-block.

30. The computer-readable storage medium of claim 29, wherein to apply the bi-directional optical flow process to the first sub-block of the second plurality of sub-blocks to determine the first refined prediction sub-block, the one or more processors are further configured to: determine an updated motion vector for the first sub-block of the second sub-block of the second plurality of sub-blocks.

31. The computer-readable storage medium of claim 30, wherein the instructions cause the one or more processors to: store the updated motion vector for the first sub-block of the second plurality of sub-blocks; and use the updated motion vector to predict a subsequent block of video data.

32. The computer-readable storage medium of claim 31, wherein to determine the refined prediction block based on the first refined sub-block and the second refined sub-block, the instructions cause the one or more processors to: apply a per-pixel bi-directional optical flow process to the first refined prediction sub-block.

33. The computer-readable storage medium of claim 28, wherein to determine the refined prediction block based on the first refined sub-block and the second refined sub-block, the instructions cause the one or more processors to: apply a second bi-directional optical flow process to the first refined prediction sub-block; and apply the second bi-directional optical flow process to the second refined prediction sub-block.

34. The computer-readable storage medium of claim 28, wherein instructions cause the one or more processors to: receive a syntax element, wherein a value of the syntax element indicates that the bi-directional optical flow process is enabled for the current block.

35. The computer-readable storage medium of claim 28, wherein W SBIPB_1 equals 1 and H SBIPB_1 equals 1.​​ 36. The computer-readable storage medium of claim 28, wherein W SB greater than or equal to 4, H SB greater than or equal to 4.

37. The computer-readable storage medium of claim 28, wherein the current block comprises a bi-prediction block.

38. A method of decoding video data, the method comprising: determining that a current block of the video data is coded in an affine prediction mode, wherein the current block has a size of width (W CB ) x height (H CB ) determining a motion vector for the current block based on a temporal motion vector predictor candidate; using the motion vector to determine an initial prediction block for the current block; applying a bi-directional optical flow process to a first sub-block of a plurality of sub-blocks of the initial prediction block to determine a first refined predictor block, wherein each sub-block of the plurality of sub-blocks has a size of width (W SBIPB ) x height (H SBIPB ), wherein W SBIPB is less than or equal to W CB and H SBIPB is less than or equal to H CB ; applying the bi-directional optical flow process to a second sub-block of the plurality of sub-blocks to determine a second refined predictor sub-block; determining a refined prediction block based on the first refined sub-block and the second refined sub-block; and determining a decoded version of the current block based on the refined prediction block.