Model-Based Motion Vector Differential Derivation and Template Matching Prediction for Video Coding

JP2024508216A5Active Publication Date: 2025-01-23QUALCOMM INC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
JP2023541798
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Priority Date
2022-01-27
Filing Date
2022-01-28
Publication Date
2025-01-23
Estimated Expiration
2042-01-28

AI Technical Summary

Technical Problem

Existing video coding techniques face challenges in accurately predicting motion vectors, leading to increased bit rates and processing burdens due to the use of fractional pixel precision, which introduces inefficiencies in encoding and decoding processes.

Method used

Implementing decoder-side motion vector derivation (DMVD) techniques such as template matching and bilateral prediction to refine motion vectors to fractional pixel precision, reducing the need for interpolation and improving accuracy.

Benefits of technology

This approach reduces bit rates and processing burdens by enhancing the accuracy of motion vector prediction, thereby improving the efficiency of video codecs and reducing computational demands on encoders and decoders.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 00000000_0000_ABST
    Figure 00000000_0000_ABST
Patent Text Reader

Abstract

An exemplary device for decoding video data includes a memory configured to store the video data and one or more processors, where the one or more processors are configured to decode data representing an initial motion vector for a current block of the video data, the initial motion vector having integer motion vector differential (MVD) precision, determine a search range around a reference area identified by the initial motion vector in a reference picture, perform a template matching search process in the search range to identify a best matching region, determine error values ​​of neighboring pixels to the best matching region, perform a model-based fractional-pixel motion vector refinement using the error values ​​of the neighboring pixels to derive motion vector difference values, apply at least one of the motion vector difference values ​​to the initial motion vector to determine an improved motion vector for the current block, and decode the current block using the improved motion vector.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] This application claims priority to U.S. Patent Application No. 17 / 586,492, filed January 27, 2022, and U.S. Provisional Application No. 63 / 143,585, filed January 29, 2021, the entire contents of which are incorporated herein by reference. U.S. Patent Application No. 17 / 586,492, filed January 27, 2022, claims the benefit of U.S. Provisional Application No. 63 / 143,585, filed January 29, 2021.

[0002] TECHNICAL FIELD This disclosure relates to video coding, including video encoding and video decoding. [Background technology]

[0003] Digital video capabilities may 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 "smartphones," video teleconferencing devices, video streaming devices, and the like. Digital video devices implement video coding techniques, such as those techniques described in 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), and extensions to such standards. By implementing such video coding techniques, video devices may more efficiently transmit, receive, encode, decode, and / or store digital video information.

[0004] Video coding techniques include spatial (intra-picture) prediction and / or temporal (inter-picture) prediction to reduce or remove redundancy inherent in video sequences. For block-based video coding, a video slice (e.g., a video picture, or a portion of a video picture) may be partitioned into video blocks, which may also be referred to as 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 with respect to reference samples in neighboring blocks in the same picture. Video blocks in an inter-coded (P or B) slice of a picture may use spatial prediction with respect to reference samples in neighboring blocks in the same picture or temporal prediction with respect to reference samples in other reference pictures. A picture may be referred to as a frame, and a reference picture may be referred to as a reference frame. [Prior art documents] [Patent documents]

[0005] [Patent Document 1] U.S. Provisional Application No. 63 / 131,676 Summary of the Invention [Means for solving the problem]

[0006] In general, this disclosure describes techniques for decoder-side motion vector derivation (DMVD). A video coder (such as a video encoder and / or a video decoder) may be configured to perform DMVD using one or more various techniques, such as template matching, bilateral prediction, decoder-side motion vector refinement, etc. These techniques may be applied to existing video codecs, such as High Efficiency Video Coding (HEVC), Versatile Video Coding (VVC), Essential Video Coding (EVC), or other existing codecs / video coding standards. These techniques may also be implemented in future video coding standards / codecs.

[0007] In one example, a method for decoding video data includes determining an initial motion vector for a current block of the video data, the initial motion vector having integer motion vector differential (MVD) accuracy; determining a search range around a reference area identified by the initial motion vector in a reference picture; performing a template matching search process in the search range to identify a best matching region; determining error values ​​of neighboring pixels to the best matching region; performing a model-based fractional-pixel motion vector refinement using the error values ​​of the neighboring pixels to derive motion vector differential values; applying at least one of the motion vector differential values ​​to the initial motion vector to determine an improved motion vector for the current block; and decoding the current block using the improved motion vector.

[0008] In another example, a device for decoding video data includes a memory configured to store the video data and one or more processors implemented in circuitry, the one or more processors configured to determine an initial motion vector for a current block of the video data, the initial motion vector having integer motion vector differential (MVD) precision, determine a search range around a reference area identified by the initial motion vector in a reference picture, perform a template matching search process in the search range to identify a best matching region, determine error values ​​of neighboring pixels to the best matching region, perform a model-based fractional-pixel motion vector refinement using the error values ​​of the neighboring pixels to derive motion vector difference values, apply at least one of the motion vector difference values ​​to the initial motion vector to determine an improved motion vector for the current block, and decode the current block using the improved motion vector.

[0009] In another example, a computer-readable storage medium storing instructions that, when executed, cause a processor of a device for decoding video data to determine an initial motion vector for a current block of the video data, the initial motion vector having integer motion vector differential (MVD) precision, determine a search range around a reference area identified by the initial motion vector in a reference picture, perform a template matching search process in the search range to identify a best matching region, determine error values ​​of neighboring pixels to the best matching region, perform a model-based fractional-pixel motion vector refinement using the error values ​​of the neighboring pixels to derive motion vector differential values, apply at least one of the motion vector differential values ​​to the initial motion vector to determine an improved motion vector for the current block, and decode the current block using the improved motion vector.

[0010] In another example, a device for decoding video data includes means for determining an initial motion vector for a current block of the video data, the initial motion vector having integer motion vector differential (MVD) precision; means for determining a search range around a reference area identified by the initial motion vector in a reference picture; means for performing a template matching search process in the search range to identify a best matching region; means for determining error values ​​of neighboring pixels to the best matching region; means for using the error values ​​of the neighboring pixels to perform a model-based fractional-pixel motion vector refinement to derive motion vector differential values; means for applying at least one of the motion vector differential values ​​to the initial motion vector to determine an improved motion vector for the current block; and means for decoding the current block using the improved motion vector.

[0011] The details of one or more examples are set forth in the accompanying drawings and the description below. Other features, objects, and advantages will become apparent from the description, drawings, and claims. [Brief description of the drawings]

[0012] [Figure 1] FIG. 1 is a block diagram illustrating an example video encoding and decoding system that may implement the techniques of this disclosure. [Figure 2A] FIG. 1 is a conceptual diagram illustrating an exemplary quad-tree binary tree (QTBT) structure. [Figure 2B] FIG. 1 is a conceptual diagram showing a coding tree unit (CTU) corresponding to a QTBT structure. [Figure 3A] FIG. 13 is a conceptual diagram illustrating spatially adjacent motion vector candidates for merge mode. [Figure 3B] FIG. 1 is a conceptual diagram showing spatially adjacent motion vector candidates for advanced motion vector prediction (AMVP). [Figure 4A] FIG. 1 is a conceptual diagram showing temporal motion vector prediction (TMVP) candidates. [Figure 4B]A conceptual diagram showing motion vector scaling for TMVP. [Diagram 5] FIG. 1 is a conceptual diagram illustrating template matching performed against a search area around a block using an initial motion vector. [Figure 6] FIG. 1 is a conceptual diagram illustrating an example of bilateral match prediction in which two motion vector difference (MVD) values ​​are proportional based on temporal distance. [Figure 7] FIG. 1 is a conceptual diagram illustrating an example of bilateral matching prediction in which two MVDs are mirrored regardless of time distance. [Figure 8] FIG. 1 is a conceptual diagram showing a 3×3 square search pattern in a search range. [Figure 9] FIG. 1 is a conceptual diagram illustrating decoder-side motion vector refinement (DMVR). [Figure 10] FIG. 1 is a conceptual diagram showing a merge mode with motion vector difference (MMVD). [Figure 11] 1 is a block diagram illustrating an example video encoder that may perform the techniques of this disclosure. [Figure 12] 1 is a block diagram illustrating an example video decoder that may perform the techniques of this disclosure. [Figure 13] 1 is a flowchart illustrating an example method for encoding a current block, in accordance with techniques of this disclosure. [Figure 14] 5 is a flowchart illustrating an example method for decoding a current block, in accordance with techniques of this disclosure. [Figure 15] 4 is a flowchart illustrating an example method for encoding or decoding video data in accordance with techniques of this disclosure. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

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

[0014] A video decoder decodes the residual data and adds it to the predictive block to generate a reconstructed video block that matches the original video block more closely than the predictive block alone. Due to losses introduced by transforming and quantizing the residual data, the initial reconstructed block may have distortions or artifacts. One common type of artifact or distortion is called blockiness, which is the visibility of boundaries of blocks used to code the video data.

[0015] To further improve the quality of the decoded video, the video decoder may perform one or more filtering operations on the reconstructed video blocks. Examples of these filtering operations include deblocking filtering, sample adaptive offset (SAO) filtering, and adaptive loop filtering (ALF). Parameters for these filtering operations may either be determined by the video encoder and explicitly signaled in the encoded video bitstream, or may be implicitly determined by the video decoder without the parameters having to be explicitly signaled in the encoded video bitstream.

[0016] This disclosure describes techniques related to decoder-side motion vector derivation (DMVD) techniques, such as template matching, bilateral matching, and decoder-side MV refinement. Although these techniques are referred to as being performed at the decoder side, the decoder-side motion vector derivation techniques described herein may also be performed by a video encoder, for example, to determine how to encode a block of video data and store the same reference data as the decoded reference data available to the video decoder. The techniques of this disclosure may be applied to any existing video codec, such as High Efficiency Video Coding (HEVC), Versatile Video Coding (VVC), Essential Video Coding (EVC), or may be an efficient tool in future video coding standards.

[0017] Various techniques of this disclosure may improve the performance of video codecs (encoders and decoders) and reduce the bit rate of coded video data. In general, techniques of this disclosure include using DMVD to refine an initial motion vector for a current block of video data, where the initial motion vector has integer precision. That is, the initial motion vector points to a full integer pixel location rather than a fractional pixel location. Refining the initial motion vector may cause the refined motion vector to have fractional pixel precision. The initial motion vector may be coded in a bitstream such that fewer bits are required to represent the initial motion vector in the bitstream (rather than more bits being required for a motion vector with fractional pixel precision). Furthermore, encoding and decoding a full integer precision motion vector may require fewer processing operations than encoding and decoding a motion vector with fractional pixel precision.

[0018] However, by refining the motion vector to potentially have fractional pixel accuracy, the refined motion vector is more accurate and therefore can more accurately identify the predictive block for the current block. As a result, the residual for the current block can be reduced, which further reduces the bit rate of the bitstream, as well as the encoding and decoding operations required to encode or decode the residual data. Thus, these techniques can improve the operation of both the encoder and the decoder, and reduce the bit rate of the bitstream that includes data representing the coded video sequence.

[0019] Moreover, performing DMVD using integer pixel precision reduces the burden on the encoder and decoder compared to performing DMVD using fractional pixel precision. Specifically, to perform DMVD, the encoder or decoder performs a search in an area around an area identified by an initial motion vector. When the initial motion vector has integer pixel precision, the decoded pixels in the area can be used directly. In contrast, when the initial motion vector has sub-integer pixel precision (i.e., fractional pixel precision), the sub-integer pixel values ​​must be interpolated, which increases the processing and memory consumption demands imposed on the encoder and decoder.

[0020] Video coding standards include ITU-T H.261, ISO / IEC MPEG-1 Visual, ITU-T H.262 or ISO / IEC MPEG-2 Visual, ITU-T H.263, ISO / IEC MPEG-4 Visual, and ITU-T H.264 (also known as ISO / IEC MPEG-4 AVC), including their Scalable Video Coding (SVC) and Multi-view Video Coding (MVC) extensions.

[0021] Additionally, High Efficiency Video Coding (HEVC) or ITU-T H.265, including its range extension, multiview extension (MV-HEVC), and scalable extension (SHVC), has been developed by the Joint Collaboration Team on Video Coding (JCT-VC) and the Joint Collaboration Team on 3D Video Coding Extension Development (JCT-3V) of the ITU-T Video Coding Experts Group (VCEG) and the ISO / IEC Motion Picture Experts Group (MPEG). The HEVC draft specification, hereafter referred to as HEVC WD, is available at phenix.int-evry.fr / jct / doc_end_user / documents / 14_Vienna / wg11 / JCTVC-N1003-v1.zip.

[0022] ITU-T VCEG (Q6 / 16) and ISO / IEC MPEG (JTC 1 / SC 29 / WG 11) are investigating future video coding techniques with compression capabilities that significantly exceed those of the HEVC standard (including its current extensions and near-term extensions for screen content coding and high dynamic range coding). The groups are working together on this research in a collaboration known as the Joint Video Exploration Team (JVET) to evaluate compression design proposals by experts in the field. The latest version of the reference software, namely VVC Test Model 11.2 (VTM 11.2), is available at vcgit.hhi.fraunhofer.de / jvet / VVCSoftware_VTM. The Versatile Video Coding (VVC) draft specification is called Document JVET-T2001. The algorithm description of Versatile Video Coding and Test Model 11 (VTM11.0) is called Document JVET-T2002.

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

[0024] 1, in this example, system 100 includes a source device 102 that provides encoded video data to be decoded and displayed by a destination device 116. Specifically, source device 102 provides the video data to destination device 116 via a computer-readable medium 110. Source device 102 and destination device 116 may comprise any of a wide range of devices, including desktop computers, notebook (i.e., laptop) computers, mobile devices, tablet computers, set-top boxes, telephone handsets such as smartphones, televisions, cameras, display devices, digital media players, video gaming consoles, video streaming devices, and the like. In some cases, source device 102 and destination device 116 may be capable of wireless communication and thus may be referred to as wireless communication devices.

[0025] In the example of FIG. 1, source device 102 includes a video source 104, memory 106, video encoder 200, and output interface 108. Destination device 116 includes an input interface 122, a video decoder 300, memory 120, and a display device 118. According to this disclosure, the video encoder 200 of source device 102 and the video decoder 300 of destination device 116 may be configured to apply techniques for model-based motion vector differential derivation and template matching prediction. Thus, source device 102 represents an example of a video encoding device, while destination device 116 represents an example of a video decoding device. In other examples, the source device and destination device may include other components or configurations. For example, source device 102 may receive video data from an external video source, such as an external camera. Similarly, destination device 116 may interface with an external display device rather than including an integrated display device.

[0026] The system 100 as shown in FIG. 1 is only an example. In general, any digital video encoding and / or decoding device may perform techniques for model-based motion vector differential derivation and template matching prediction. The source device 102 and the destination device 116 are only examples of coding devices, such that the source device 102 generates coded video data for transmission to the destination device 116. This disclosure refers to a "coding" device as a device that performs coding (encoding and / or decoding) of data. Thus, the video encoder 200 and the video decoder 300 represent examples of coding devices, specifically, video encoders and video decoders, respectively. In some examples, the source device 102 and the destination device 116 may operate substantially symmetrically, such that each of the source device 102 and the destination device 116 includes video encoding and decoding components. Thus, the system 100 may support one-way or two-way video transmission between the source device 102 and the destination device 116, for example, video streaming, video playback, video broadcasting, or video telephony.

[0027] In general, video source 104 represents a source of video data (i.e., raw, uncoded video data) and provides a continuous series of pictures (also called "frames") of the video data to video encoder 200, which encodes the data for the pictures. Video source 104 of source device 102 may include a video capture device, such as a video camera, a video archive containing previously captured raw video, and / or a video feed interface for receiving video from a video content provider. As a further alternative, video source 104 may generate computer graphics-based data as source video, or a combination of live, archived, and computer-generated video. In each case, video encoder 200 encodes the captured, pre-captured, or computer-generated video data. Video encoder 200 may reorder the pictures from the order in which they are received (sometimes called "display order") to a coding order for coding. Video encoder 200 may generate a bitstream including the encoded video data. The source device 102 may then output the encoded video data via the output interface 108 to a computer-readable medium 110 for receipt and / or retrieval, for example, by the input interface 122 of the destination device 116 .

[0028] The memory 106 of the source device 102 and the memory 120 of the destination device 116 represent general-purpose memories. In some examples, the memories 106, 120 may store raw video data, e.g., raw video from the video source 104 and raw decoded video data from the video decoder 300. Additionally or alternatively, the memories 106, 120 may store software instructions executable by, e.g., the video encoder 200 and the video decoder 300, respectively. Although the memories 106 and 120 are shown separately from the video encoder 200 and the video decoder 300 in this example, it should be understood that the video encoder 200 and the video decoder 300 may also include internal memories for functionally similar or equivalent purposes. Additionally, the memories 106, 120 may store encoded video data, e.g., output from the video encoder 200 and input to the video decoder 300. In some examples, a portion of the memory 106, 120 may be allocated as one or more video buffers, e.g., to store raw, decoded, and / or encoded video data.

[0029] The computer-readable medium 110 may represent any type of medium or device capable of transferring encoded video data from the source device 102 to the destination device 116. In one example, the computer-readable medium 110 represents a communication medium for enabling the source device 102 to transmit the encoded video data directly to the destination device 116 in real time, for example, via a radio frequency network or a computer-based network. The output interface 108 may modulate a transmission signal including the encoded video data, and the input interface 122 may demodulate a received transmission signal according to a communication standard such as a wireless communication protocol. The communication medium may include any wireless or wired communication medium, such as a radio frequency (RF) spectrum or one or more physical transmission lines. The communication medium may form part of a packet-based network, such as a local area network, a wide area network, or a global network such as the Internet. The communication medium may include routers, switches, base stations, or any other equipment that may be useful for facilitating communication from the source device 102 to the destination device 116.

[0030] In some examples, source device 102 may output the encoded data from output interface 108 to storage device 112. Similarly, destination device 116 may access the encoded data from storage device 112 via input interface 122. Storage device 112 may include any of a variety of distributed or locally accessed data storage media, such as a hard drive, a Blu-ray® disc, a DVD, a CD-ROM, flash memory, volatile or non-volatile memory, or any other suitable digital storage medium for storing encoded video data.

[0031] In some examples, source device 102 may output the encoded video data to a file server 114 or another intermediate storage device, which may store the encoded video data generated by source device 102. Destination device 116 may access the stored video data from file server 114 via streaming or download.

[0032] The file server 114 may be any type of server device capable of storing encoded video data and transmitting the encoded video data to the destination device 116. The file server 114 may represent a web server (e.g., for a website), a server configured to provide file transfer protocol services (such as File Transfer Protocol (FTP) or 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. The file server 114 may 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, etc.

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

[0034] The output interface 108 and the input interface 122 may represent a wireless transmitter / receiver, a modem, a wired networking component (e.g., an Ethernet card), a wireless communication component operating according to any of the various IEEE 802.11 standards, or other physical components. In examples in which the output interface 108 and the input interface 122 comprise wireless components, the output interface 108 and the input interface 122 may 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, etc. In some examples in which the output interface 108 comprises a wireless transmitter, the output interface 108 and the input interface 122 may be configured to transfer data, such as encoded video data, according to other wireless standards, such as the IEEE 802.11 specification, the IEEE 802.15 specification (e.g., ZigBee™), the Bluetooth™ standard, etc. In some examples, the source device 102 and / or the destination device 116 may include respective system-on-chip (SoC) devices. For example, the source device 102 may include a SoC device for performing functions attributed to the video encoder 200 and / or the output interface 108, and the destination device 116 may include a SoC device for performing functions attributed to the video decoder 300 and / or the input interface 122.

[0035] The techniques of this disclosure may be applied to video coding supporting any of a variety of multimedia applications, such as television broadcast over the airwaves, cable television transmission, satellite television transmission, Internet streaming video transmission such as dynamic adaptive streaming over HTTP (DASH), digital video encoded on a data storage medium, decoding of digital video stored on a data storage medium, or other applications.

[0036] The input interface 122 of the destination device 116 receives an encoded video bitstream from the computer-readable medium 110 (e.g., a communication medium, a storage device 112, a file server 114, etc.). The encoded video bitstream may include signaling information defined by the video encoder 200 that is also used by the video decoder 300, such as syntax elements having values ​​that describe characteristics and / or processing of video blocks or other coded units (e.g., slices, pictures, groups of pictures, sequences, etc.). The display device 118 displays decoded pictures of the decoded video data to a user. The display device 118 may represent any of a variety of display devices, such as a liquid crystal display (LCD), a plasma display, an organic light emitting diode (OLED) display, or another type of display device.

[0037] 1, in some examples, the video encoder 200 and the video decoder 300 may each be integrated with an audio encoder and / or an audio decoder and may include appropriate MUX-DEMUX units, or other hardware and / or software, to handle multiplexed streams that include both audio and video in a common data stream. Where applicable, the MUX-DEMUX units may conform to the ITU H.223 multiplexer protocol or other protocols, such as the User Datagram Protocol (UDP).

[0038] The video encoder 200 and the video decoder 300 may each be implemented as any of a variety of suitable encoder and / or decoder circuits, such as one or more microprocessors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field programmable gate arrays (FPGAs), discrete logic, software, hardware, firmware, or any combination thereof. When the techniques are implemented partially in software, a device may store instructions for the software on 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 the video encoder 200 and the video decoder 300 may be included in one or more encoders or decoders, any of which may be integrated as part of a combined encoder / decoder (codec) within the respective device. A device including the video encoder 200 and / or the video decoder 300 may comprise an integrated circuit, a microprocessor, and / or a wireless communication device such as a mobile phone.

[0039] Video encoder 200 and video decoder 300 may operate according to a video coding standard such as ITU-T H.265, also referred to as High Efficiency Video Coding (HEVC), or extensions thereof such as multiview and / or scalable video coding extensions. Alternatively, video encoder 200 and video decoder 300 may operate according to other proprietary or industry standards, such as Versatile Video Coding (VVC). A draft of the VVC standard is set forth in Bross et al., "Versatile Video Coding (Draft 9)," ITU-T SG 16 WP 3 and ISO / IEC JTC 1 / SC 29 / WG 11 Joint Video Experts Team (JVET), 18th Meeting, April 15-24, JVET-R2001-v8 (hereinafter "VVC Draft 9"). However, the techniques of this disclosure are not limited to any particular coding standard.

[0040] In general, the video encoder 200 and the video decoder 300 may perform block-based coding of pictures. The term “block” generally refers to a structure that includes data to be processed (e.g., encoded, decoded, or otherwise used in the encoding and / or decoding process). For example, a block may include a two-dimensional matrix of luma and / or chroma data samples. In general, the video encoder 200 and the video decoder 300 may code video data represented in a YUV (e.g., Y, Cb, Cr) format. That is, rather than coding red, green, and blue (RGB) data for a sample of a picture, the video encoder 200 and the video decoder 300 may code luma and chroma components, which may include chroma components for both red and blue hues. In some examples, the video encoder 200 converts received RGB formatted data into a YUV representation before encoding, and the video decoder 300 converts the YUV representation into the RGB format. Alternatively, pre-processing and post-processing units (not shown) may perform these conversions.

[0041] This disclosure may generally refer to coding (e.g., encoding and decoding) a picture as including a process of encoding or decoding data for a picture. Similarly, this disclosure may refer to coding a block of a picture as including a process of encoding or decoding data for the block, e.g., predictive and / or residual coding. A coded video bitstream generally includes a set of values ​​for syntax elements that represent coding decisions (e.g., coding modes) and partitioning of a picture into blocks. Thus, references to coding a picture or a block should be understood generally as coding values ​​for the syntax elements that form the picture or block.

[0042] HEVC defines various blocks, including coding units (CUs), prediction units (PUs), and transform units (TUs). According to HEVC, a video coder (such as the video encoder 200) partitions coding tree units (CTUs) into CUs according to a quadtree structure. That is, the video coder partitions CTUs and CUs into four equal non-overlapping squares, and each node of the quadtree has either zero or four child nodes. A node without children may be called a "leaf node", and a CU of such a leaf node may include one or more PUs and / or one or more TUs. The video coder may further partition PUs and TUs. For example, in HEVC, a residual quadtree (RQT) represents a partition of TUs. In HEVC, a PU represents inter-predicted data, while a TU represents residual data. An intra-predicted CU includes intra-prediction information, such as an intra-mode indication.

[0043] As another example, the video encoder 200 and the video decoder 300 may be configured to operate according to VVC. According to VVC, a video coder (such as the video encoder 200) partitions a picture into multiple coding tree units (CTUs). The video encoder 200 may partition the CTUs according to a tree structure, such as a quad-tree binary tree (QTBT) structure or a multi-type tree (MTT) structure. The QTBT structure removes the concept of multiple partition types, such as the separation of CUs, PUs, and TUs in HEVC. The QTBT structure includes two levels: a first level partitioned according to a quad-tree partition, and a second level partitioned according to a binary tree partition. The root node of the QTBT structure corresponds to a CTU. The leaf nodes of the binary tree correspond to coding units (CUs).

[0044] In the MTT partitioning structure, blocks may be partitioned using quad tree (QT) partitioning, binary tree (BT) partitioning, and one or more types of triple tree (TT) (also called ternary tree (TT)) partitioning. Triple tree or ternary tree partitioning is a partitioning in which a block is divided into three sub-blocks. In some examples, triple tree or ternary tree partitioning divides a block into three sub-blocks without splitting the original block through the center. The partition types in MTT (e.g., QT, BT, and TT) may be symmetric or asymmetric.

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

[0046] Video encoder 200 and video decoder 300 may be configured to use quadtree partitioning, QTBT partitioning, MTT partitioning, or other partition structures in accordance with HEVC. For purposes of illustration, the description of the techniques of this disclosure is presented with respect to QTBT partitioning. However, it should be understood that the techniques of this disclosure may also be applied to video coders that are configured to use quadtree partitioning, or other types of partitioning.

[0047] In some examples, the CTU includes a coding tree block (CTB) of luma samples, two corresponding CTBs of chroma samples for a picture with three sample arrays, or a CTB of samples for a picture coded using three separate color planes and syntax structures used to code a monochrome picture or sample. The CTB may be an N×N block of samples for some value of N such that the division of the components into the CTB is partitioned. The components may be an array or a single sample of that array from one of the three arrays (luma and two chromas) for a 4:2:0, 4:2:2, or 4:4:4 color format picture, or an array or a single sample of that array for a monochrome format picture. In some examples, the coding block is an M×N block of samples for some value of M and N such that the division of the CTB into coding blocks is partitioned.

[0048] Blocks (e.g., CTUs or CUs) may be grouped in various ways in a picture. As an example, a brick may refer to a rectangular region of a CTU row in a particular tile in a picture. A tile may be a rectangular region of a CTU in a particular tile column and a particular tile row in a picture. A tile column refers to a rectangular region of a CTU with a height equal to the height of the picture and a width specified by a syntax element (e.g., in a picture parameter set, etc.). A tile row refers to a rectangular region of a CTU with a height specified by a syntax element (e.g., in a picture parameter set, etc.) and a width equal to the width of the picture.

[0049] In some examples, a tile may be partitioned into multiple bricks, each of which may include one or more CTU rows within the tile. A tile that is not partitioned into multiple bricks may also be referred to as a brick. However, a brick that is a true subset of a tile may not be referred to as a tile.

[0050] Bricks in a picture may also be arranged as slices. A slice may be an integer number of bricks of a picture that may be contained exclusively in a single Network Abstraction Layer (NAL) unit. In some examples, a slice includes either a certain number of complete tiles or only a contiguous sequence of complete bricks of one tile.

[0051] This disclosure may use "NxN" and "N by N" interchangeably to refer to sample dimensions of a block (such as a CU or other video block) in terms of vertical and horizontal dimensions, e.g., 16x16 samples or 16 by 16 samples. Generally, a 16x16 CU has 16 samples in the vertical direction (y=16) and 16 samples in the horizontal direction (x=16). Similarly, an NxN CU generally has N samples in the vertical direction and N samples in the horizontal direction, where N represents a non-negative integer value. Samples in a CU may be arranged as rows and columns. Moreover, a CU does not necessarily have to have the same number of samples in the horizontal direction as in the vertical direction. For example, a CU may comprise NxM samples, where M is not necessarily equal to N.

[0052] The video encoder 200 encodes video data for a CU that represents prediction and / or residual information, as well as other information. The prediction information indicates how the CU should be predicted to form a predictive block for the CU. The residual information generally represents sample-by-sample differences between samples of the CU before encoding and the predictive block.

[0053] To predict a CU, the video encoder 200 may generally form a predictive block for the CU through inter prediction or intra prediction. Inter prediction generally refers to predicting a CU from data of a previously coded picture, while intra prediction generally refers to predicting a CU from previously coded data of the same picture. To perform inter prediction, the video encoder 200 may generate a predictive block using one or more motion vectors. The video encoder 200 may generally perform motion search to identify a reference block that matches well with the CU, for example, with respect to the difference between the CU and the reference block. The video encoder 200 may calculate a difference metric using a sum of absolute differences (SAD), a sum of squared differences (SSD), a mean absolute difference (MAD), a mean squared difference (MSD), or other such difference calculation to determine whether the reference block matches well with the current CU. In some examples, the video encoder 200 may predict the current CU using unidirectional prediction or bidirectional prediction.

[0054] Some examples of VVC also provide an affine motion compensation mode, which may be considered an inter-prediction mode. In an affine motion compensation mode, the video encoder 200 may determine two or more motion vectors that represent non-translational motion, such as zooming in or out, rotation, projective motion, or other irregular motion types.

[0055] To perform intra prediction, the video encoder 200 may select an intra prediction mode to generate a predictive block. Some examples of VVC provide 67 intra prediction modes, including various orientation modes, as well as a planar mode and a DC mode. In general, the video encoder 200 selects an intra prediction mode that describes neighboring samples for a current block (e.g., a block of a CU) from which samples of the current block should be predicted. Such samples may generally be above, above and to the left, or to the left of the current block, in the same picture as the current block, assuming that the video encoder 200 codes CTUs and CUs in raster scan order (left to right, top to bottom).

[0056] Video encoder 200 encodes data representing a prediction mode for the current block. For example, in an inter prediction mode, video encoder 200 may encode data representing which of various available inter prediction modes is used, as well as motion information for the corresponding mode. For unidirectional or bidirectional inter prediction, for example, video encoder 200 may encode motion vectors using an advanced motion vector prediction (AMVP) mode or a merge mode. Video encoder 200 may encode motion vectors for an affine motion compensation mode using a similar mode.

[0057] According to a prediction, such as intra-prediction or inter-prediction, of the block, the video encoder 200 may calculate residual data for the block. The residual data, such as a residual block, represents sample-by-sample differences between the block and a predictive block for that block formed using a corresponding prediction mode. The video encoder 200 may apply one or more transforms to the residual block to generate transformed data in the transform domain instead of the sample domain. For example, the video encoder 200 may apply a discrete cosine transform (DCT), an integer transform, a wavelet transform, or a conceptually similar transform to the residual video data. In addition, the video encoder 200 may apply a secondary transform, such as a mode-dependent non-separable secondary transform (MDNSST), a signal-dependent transform, a Karhunen-Loeve transform (KLT), etc., following the initial transform. The video encoder 200 generates transform coefficients following application of the one or more transforms.

[0058] As mentioned above, following any transformation to generate transform coefficients, the video encoder 200 may perform quantization of the transform coefficients. Quantization generally refers to a process in which transform coefficients are quantized to possibly reduce the amount of data used to represent the transform coefficients, achieving further compression. By performing a quantization process, the video encoder 200 may reduce the bit depth associated with some or all of the transform coefficients. For example, the video encoder 200 may round an n-bit value to an m-bit value during quantization, where n is greater than m. In some examples, to perform quantization, the video encoder 200 may perform a bitwise right shift of the value to be quantized.

[0059] Following quantization, the video encoder 200 may scan the transform coefficients and generate a one-dimensional vector from the two-dimensional matrix including the quantized transform coefficients. The scan may be designed to place higher energy (and therefore lower frequency) transform coefficients at the front of the vector and lower energy (and therefore higher frequency) transform coefficients at the rear of the vector. In some examples, the video encoder 200 may utilize a predetermined scan order to scan the quantized transform coefficients to generate a serialized vector and then entropy code the quantized transform coefficients of the vector. In other examples, the video encoder 200 may perform an adaptive scan. After scanning the quantized transform coefficients to form the one-dimensional vector, the video encoder 200 may entropy code the one-dimensional vector, for example, according to context-adaptive binary arithmetic coding (CABAC). The video encoder 200 may also entropy code values ​​for syntax elements that describe metadata associated with the encoded video data for use by the video decoder 300 in decoding the video data.

[0060] To perform CABAC, the video encoder 200 may assign a context in a context model to a symbol to be transmitted. The context may relate, for example, to whether neighboring values ​​of the symbol are 0. The probability determination may be based on the context assigned to the symbol.

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

[0062] In this manner, video encoder 200 may generate a bitstream including encoded video data, e.g., syntax elements that describe partitions of a picture into blocks (e.g., CUs) and predictive and / or residual information for the blocks. Finally, video decoder 300 may receive the bitstream and decode the encoded video data.

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

[0064] The residual information may be represented, for example, by quantized transform coefficients. The video decoder 300 may dequantize and inverse transform the quantized transform coefficients of the block to reconstruct a residual block for the block. The video decoder 300 may form a predictive block for the block using the signaled prediction mode (intra-prediction or inter-prediction) and associated prediction information (e.g., motion information for inter-prediction). The video decoder 300 may then combine the predictive block and the residual block (sample by sample) to reconstruct the original block. The video decoder 300 may perform additional processing, such as performing a deblocking process, to reduce visual artifacts along block boundaries.

[0065] This disclosure may generally refer to "signaling" some information, such as a syntax element. The term "signaling" may generally refer to communication of a value for a syntax element and / or other data used to decode the encoded video data. That is, the video encoder 200 may signal a value for a syntax element in a bitstream. In general, signaling refers to generating a value in a bitstream. As noted above, the source device 102 may forward the bitstream to the destination device 116 in substantially real-time or non-real-time, which may occur, such as when storing the syntax element in the storage device 112 for later retrieval by the destination device 116.

[0066] 2A and 2B are conceptual diagrams illustrating an exemplary quad-tree binary tree (QTBT) structure 130 and a corresponding coding tree unit (CTU) 132. The solid lines represent quad-tree partitioning, and the dotted lines represent binary tree partitioning. At each partition (i.e., non-leaf) node of the binary tree, one flag is signaled to indicate which partition type (i.e., horizontal or vertical) is used, with 0 indicating horizontal partitioning and 1 indicating vertical partitioning in this example. In quad-tree partitioning, the quad-tree node divides a block horizontally and vertically into four sub-blocks of equal size, so there is no need to indicate the partition type. Thus, the video encoder 200 can encode, and the video decoder 300 can decode, syntax elements (e.g., partition information) for the region tree level (i.e., solid lines) of the QTBT structure 130 and syntax elements (e.g., partition information) for the prediction tree level (i.e., dashed lines) of the QTBT structure 130. The video encoder 200 may encode, and the video decoder 300 may decode, video data, such as prediction data and transformation data, for CUs represented by terminal leaf nodes of the QTBT structure 130.

[0067] 2B may be associated with parameters that define the sizes of blocks corresponding to nodes of the QTBT structure 130 at the first and second levels. These parameters may include a CTU size (representing the size of the CTU 132 in the example), a minimum quad-tree size (MinQTSize, representing the minimum allowed quad-tree leaf node size), a maximum binary tree size (MaxBTSize, representing the maximum allowed binary tree root node size), a maximum binary tree depth (MaxBTDepth, representing the maximum allowed binary tree depth), and a minimum binary tree size (MinBTSize, representing the minimum allowed binary tree leaf node size).

[0068] The root node of the QTBT structure corresponding to the CTU may have four child nodes at the first level of the QTBT structure, each of which may be partitioned according to a quadtree partition. That is, the nodes at the first level are either leaf nodes (having no child nodes) or have four child nodes. The example QTBT structure 130 represents such nodes as including a parent node and child nodes with solid lines for branching. If the nodes at the first level are not larger than the maximum allowed binary tree root node size (MaxBTSize), the nodes may be further partitioned by their respective binary trees. The binary tree partitioning of one node may be repeated until the nodes resulting from the partitioning reach the minimum allowed binary tree leaf node size (MinBTSize) or the maximum allowed binary tree depth (MaxBTDepth). The example QTBT structure 130 represents such nodes as having dashed lines for branching. The binary tree leaf nodes are called coding units (CUs), which are used for prediction (e.g., intra-picture or inter-picture prediction) and transformation without further partitioning. As discussed above, a CU may also be referred to as a "video block" or a "block."

[0069] In one example of a QTBT partitioning structure, the CTU size is set as 128x128 (luma samples and two corresponding 64x64 chroma samples), MinQTSize is set as 16x16, MaxBTSize is set as 64x64, MinBTSize (for both width and height) is set as 4, and MaxBTDepth is set as 4. To generate a quadtree leaf node, quadtree partitioning is first applied to the CTU. The quadtree leaf node may have a size from 16x16 (i.e., MinQTSize) to 128x128 (i.e., CTU size). If the quadtree leaf node is 128x128, it is not further divided by the binary tree because the size exceeds MaxBTSize (i.e., 64x64 in this example). Otherwise, the quadtree leaf node may be further partitioned by the binary tree. Thus, the quadtree leaf node is also the root node of the binary tree and has a binary tree depth of 0. When the binary tree depth reaches MaxBTDepth (4 in this example), no further splits are allowed. A binary tree node having a width equal to MinBTSize (4 in this example) implies that no further vertical splits (i.e., width splits) are allowed for that binary tree node. Similarly, a binary tree node having a height equal to MinBTSize implies that no further horizontal splits (i.e., height splits) are allowed for that binary tree node. As mentioned above, the leaf nodes of the binary tree are called CUs and are further processed according to further partitionless predictions and transformations.

[0070] In HEVC, the largest coding unit in a slice is the CTB, also called the CTU. The CTB contains a quadtree whose nodes are CUs. The size of the CTB can range from 16x16 to 64x64 in the HEVC Main Profile (although technically a CTB size of 8x8 can be supported). CUs can be the same size as the CTB, or as small as 8x8. Each CU is coded with one coding mode, e.g., inter or intra. When a CU is inter-coded, it may be further partitioned into two or four PUs, or only one PU when no further partitioning is applied. When there are two PUs in one CU, the two PUs may be rectangles with half the size of the CU, or two rectangles with ¼ or ¾ the size of the CU.

[0071] 3A and 3B are conceptual diagrams illustrating spatially adjacent motion vector candidates for merge mode and advanced motion vector prediction (AMVP). When a CU is inter-coded, each PU has one set of motion information, which is derived using a unique inter prediction mode. In the HEVC standard, there are two inter prediction modes for a PU, named merge mode (skip is considered to be a special case of merge) and advanced motion vector prediction (AMVP) mode, respectively.

[0072] In either the AMVP mode or the merge mode, the video encoder 200 and the video decoder 300 may be configured to maintain a motion vector (MV) candidate list for multiple motion vector predictors. The video encoder 200 and the video decoder 300 may be configured to generate a motion vector for the current PU, as well as a reference index in the merge mode, by taking one candidate from the MV candidate list.

[0073] In HEVC, the MV candidate list includes up to five candidates for merge mode and only two candidates for AMVP mode. The merge candidate may include a set of motion information, e.g., a motion vector corresponding to both the reference picture list (list 0 and list 1) and a reference index. If the merge candidate is identified by the merge index, the video encoder 200 and the video decoder 300 may be configured to determine the reference picture used for prediction of the current block, as well as the associated motion vector. On the other hand, under AMVP mode for each potential prediction direction from either list 0 or list 1, the reference index is explicitly signaled along with the MV predictor (MVP) index to the MV candidate list, since the AMVP candidate includes only a motion vector. In AMVP mode, the predicted motion vector may be further refined. The candidates for both modes are similarly derived from the same spatially and temporally neighboring blocks.

[0074] 3A and 3B are conceptual diagrams illustrating spatially neighboring motion vector candidates for merge mode and advanced motion vector prediction (AMVP). Although spatial MV candidates are derived from neighboring blocks (shown in FIG. 3A and FIG. 3B) for a particular PU (PU0), the process for generating candidates from blocks is different between merge mode and AMVP mode.

[0075] In merge mode, up to four spatial MV candidates may be derived for PU0 140 in the order shown in Figure 3A: left (0), top (1), top-right (2), bottom-left (3), and top-left (4).

[0076] As shown in Fig. 3B, in AVMP mode, the neighboring blocks of block PU0 142 are divided into two groups: a left group including blocks 0 and 1, and an upper group including blocks 2, 3, and 4. For each group, potential candidates among the neighboring blocks that refer to the same reference picture as the reference picture indicated by the signaled reference index have the highest priority when selected to form the final candidate of the group. It may be that all neighboring blocks do not contain motion vectors that point to the same reference picture. Therefore, if such a candidate cannot be found, the first available candidate may be scaled to form the final candidate, so that the difference in temporal distance may be compensated.

[0077] 4A and 4B are conceptual diagrams illustrating temporal motion vector prediction (TMVP) candidates and motion vector scaling for TMVP. Video encoder 200 and video decoder 300 may be configured to add a temporal motion vector predictor (TMVP) candidate to an MV candidate list after a spatial motion vector candidate if it is enabled and a TMVP candidate is available. The process of motion vector derivation for a TMVP candidate is the same for both merge mode and AMVP mode. However, in HEVC, the target reference index for a TMVP candidate in merge mode is set to 0.

[0078] FIG. 4A shows an example TMVP candidate for block PU0 156, and FIG. 4B shows the motion vector scaling process. The primary block location for TMVP candidate derivation is the bottom right block outside the collocated PU. This candidate is shown as block T150 in FIG. 4A. The location of block T150 is used to compensate for the bias towards the blocks above and to the left used to generate spatial neighbor candidates. However, if block T150 is located outside the current CTB row or if motion information is not available, block T152 is replaced with block T154 in the center of PU156, as shown for block T152.

[0079] The motion vectors for the TMVP candidates are derived from the co-located PUs of the co-located pictures, which are shown at the slice level. The motion vectors for the co-located PUs are called co-located MVs. Similar to the temporal direct mode in AVC, to derive the TMVP candidate motion vectors, the co-located MVs may be scaled to compensate for the temporal distance difference, as shown in FIG. 4B.

[0080] The video encoder 200 and the video decoder 300 may be configured to perform motion vector scaling. The value of a motion vector is assumed to be proportional to the distance of the pictures at the time of presentation. A motion vector relates two pictures, namely, a reference picture and a picture that contains the motion vector (i.e., a stored picture). When a motion vector is used to predict another motion vector, the distance between the stored picture and the reference picture is calculated based on a Picture Order Count (POC) value.

[0081] For a motion vector to be predicted, both its associated stored picture and reference picture may be different. Therefore, a new distance (based on POC) is calculated and the motion vector is scaled based on these two POC distances. For spatially adjacent candidates, the stored pictures for the two motion vectors are the same, but the reference pictures are different. In HEVC, the motion vector scaling is applied to both TMVP and AMVP for spatially and temporally adjacent candidates.

[0082] Video encoder 200 and video decoder 300 may be configured to perform artificial motion vector candidate generation. If the motion vector candidate list is not complete (e.g., has less than some predetermined number of candidates), artificial motion vector candidates are generated and inserted at the end of the list until the list has the specified number of candidates.

[0083] In merge mode, there are two types of artificial MV candidates: synthetic candidates that are derived only for B slices, and zero motion vector candidates that are used for AMVP if the first type does not yield enough artificial candidates.

[0084] For each pair of candidates already in the candidate list and having the necessary motion information, a bidirectional composite motion vector candidate is derived by combining the motion vector of the first candidate that references a picture in list 0 and the motion vector of the second candidate that references a picture in list 1.

[0085] The video encoder 200 and the video decoder 300 may 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 the merge / AMVP candidate list. To solve this problem, a pruning process is applied. The pruning process compares a candidate with other candidates in the current candidate list to some extent to avoid inserting the same candidate. To reduce the complexity, instead of comparing each possible candidate with all other existing candidates, only a limited number of pruning processes are applied.

[0086] FIG. 5 is a conceptual diagram illustrating template matching (TM) performed on a search area around a block using an initial motion vector. Video encoder 200 and video decoder 300 may be configured to perform template matching TM prediction. TM prediction is a special merge mode based on Frame-Rate Up Conversion (FRUC) technique. In this mode, the motion information of a block is not signaled and is derived at the decoder side. It applies to both AMVP mode and normal merge mode. In AMVP mode, MVP candidate selection is determined based on template matching to choose the one that minimizes the difference between the current block template and the reference block template. In normal merge mode, a TM mode flag may be signaled to indicate the use of TM, and then TM is applied to the merge candidate indicated by the merge index for MV refinement.

[0087] FIG. 5 shows an example template matching performed on a search area around an initial MV. As shown in FIG. 5, video encoder 200 and video decoder 300 may be configured to use template matching to derive motion information of a current CU by finding a best match between a template in a current picture (above and / or left neighboring block of the current CU) and a block in a reference picture (same size as the template). Using an AMVP candidate selected based on an initial matching error, the MVP is refined by template matching. Using a merge candidate indicated by a signaled merge index, the merged MVs corresponding to L0 and L1 are refined by template matching independently, and the less accurate candidate is further refined again using the better candidate as a prior.

[0088] The video encoder 200 and the video decoder 300 may be configured to implement a cost function. When the motion vector points to a fractional sample position, motion compensated interpolation is necessary. To reduce complexity, bilinear interpolation may be used instead of the usual 8-tap DCT-IF interpolation for both template matching to generate a template on a reference picture. The matching cost C of template matching is calculated as follows:

[0089]

number

[0090] where w is a weighting factor empirically set to 4, and MV and MV s denote the currently tested MV and the initial MV (e.g., the MVP candidate in AMVP mode or the merged motion vector in merge mode), respectively. The SAD is used as the matching cost for template matching.

[0091] When TM is used, motion is refined by using only luma samples. The derived motion can be used for both luma and chroma for MC inter prediction. After the MV is determined, the final MC is performed using an 8-tap interpolation filter for luma and a 4-tap interpolation filter for chroma.

[0092] The video encoder 200 and the video decoder 300 may be configured to implement a search process for motion vector (MV) refinement using template matching as discussed above. The MV refinement is a pattern-based MV search using a criterion of template matching cost and a hierarchical structure. Two search patterns are supported for the MV refinement: diamond search and cross search. The hierarchical structure specifies an iterative process for refining the MV, starting from a coarse motion vector differential (MVD) precision (e.g., quarter pixel (pel)) and ending with a high precision (e.g., 1 / 8-pel). The MV is directly searched at quarter luma sample MVD precision using the diamond pattern, followed by quarter luma sample MVD precision using the cross pattern, followed by eighth luma sample MVD refinement using the cross pattern. The search range of the MV refinement is set equal to (-8, +8) luma samples around the initial MV. When the current block is a bi-predictive block, both MVs are independently refined, and the best MV among them (in terms of matching cost) is set as the prior for further refinement of the other MV by bi-prediction using CU-level weighting (BCW) weighting values.

[0093] FIG. 6 is a conceptual diagram illustrating an example of bilateral match prediction in which two motion vector difference (MVD) values ​​are proportional based on a temporal distance. The video encoder 200 and the video decoder 300 may be configured to perform bilateral match prediction. Bilateral match (also known as bilateral merge) (BM) prediction is another merge mode based on the FRUC technique. When a block is determined to apply the BM mode, two initial motion vectors MV0 and MV1 are derived by using the signaled merge candidate index to select a merge candidate in the constructed merge list. When implementing bilateral match, the video encoder 200 and the video decoder 300 search around MV0 and MV1. The final MV0' and MV1' are derived based on the minimum bilateral match cost.

[0094] The motion vector difference MVD0 (denoted by MV0'-MV0) and MVD1 (denoted by MV1'-MV1) pointing to two reference blocks may be proportional to the temporal distance (TD) between the current picture and the two reference pictures, for example, TD0 and TD1. Figure 6 shows an example of MVD0 and MVD1, where TD1 is four times TD0. Figure 6 shows that the example of MVD0 and MVD1 are proportional based on the temporal distance.

[0095] FIG. 7 is a conceptual diagram showing an example of bilateral matching prediction in which two MVDs are mirrored regardless of the time distance. It is an optional design in which MVD0 and MVD1 are mirrored regardless of the time distance TD0 and TD1. FIG. 7 shows an example of mirrored MVD0 and MVD1, where TD1 is four times larger than TD0.

[0096] FIG. 8 is a conceptual diagram illustrating a 3×3 square search pattern in a search range. When performing bilateral matching, the video encoder 200 and the video decoder 300 may be configured to perform a local search around the initial MV0 and MV1 to derive the final MV0′ and MV1′. The local search applies a 3×3 square search pattern to loop through the search range [−8, 8]. In each search iteration, the bilateral matching costs of the eight peripheral MVs in the search pattern are calculated and compared with the bilateral matching cost of the central MV. The MV with the smallest bilateral matching cost becomes the new central MV in the next search iteration. The local search ends when the current central MV has the smallest cost in the 3×3 square search pattern or when the local search reaches a predetermined maximum search iteration. FIG. 8 illustrates an example of a 3×3 square search pattern in a search range [−8, 8].

[0097] FIG. 9 is a conceptual diagram illustrating decoder-side motion vector refinement (DMVR). Video encoder 200 and video decoder 300 may be configured to perform decoder-side motion vector refinement. To improve the accuracy of MV in merge mode, decoder-side motion vector refinement (DMVR) is applied in VVC. In bi-prediction operation, an improved MV is searched around an initial MV in reference picture list L0 and reference picture list L1. The DMVR process calculates the distortion between two candidate blocks in reference picture list L0 and list L1. As shown in FIG. 9, the SAD between blocks based on each MV candidate around the initial MV is calculated. The MV candidate with the lowest SAD becomes the improved MV and is used to generate a bi-predicted signal, for example, blocks 170 and 172 in FIG. 9.

[0098] Figure 9 shows an example of decoder-side motion vector refinement. The refined MV derived by the DMVR process is used to generate inter-prediction samples and is also used in temporal motion vector prediction for coding future pictures. Meanwhile, the original MV is used in the deblocking process and is also used in spatial motion vector prediction for coding future CUs. DMVR is a sub-block-based merge mode with a predetermined maximum processing unit of 16x16 luma samples. When the width and / or height of a CU is larger than 16 luma samples, it may be further divided into sub-blocks with width and / or height equal to 16 luma samples.

[0099] The video encoder 200 and the video decoder 300 may be configured to implement a search scheme. In DVMR, the search points surround the initial MV, and the MV offset follows the MV difference mirroring rule. In other words, every point identified by the DMVR, represented by a candidate MV pair (MV0, MV1), follows the following two equations: MV0'=MV0+MV_offset MV1'=MV1-MV_offset Here, MV_offset represents the refinement offset between the initial MV and the refined MV in one of the reference pictures. The refinement search range is two integer luma samples from the initial MV. The search includes an integer sample offset search stage and a fractional sample refinement stage.

[0100] The video encoder 200 and the video decoder 300 may be configured to apply a 25-point full search for integer sample offset search. The SAD of the initial MV pair is calculated first. If the SAD of the initial MV pair is less than a threshold, the integer sample stage of DMVR is terminated. Otherwise, the SAD of the remaining 24 points is calculated and checked in raster scan order. The point with the smallest SAD is selected as the output of the integer sample offset search stage. To reduce the penalty of uncertainty in DMVR refinement, it is proposed to prioritize the original MV during the DMVR process. The SAD between the reference blocks referenced by the initial MV candidates is reduced by ¼ of the SAD value.

[0101] Following the integer sample search, the video encoder 200 and the video decoder 300 may be configured to perform fractional sample refinement. To reduce computational complexity, the fractional sample refinement is derived by using a parametric error surface equation instead of an additional search with SAD comparison. The fractional sample refinement is conditionally invoked based on the output of the integer sample search stage. When the integer sample search stage ends with a center with the smallest SAD in either the first iteration search or the second iteration search, the fractional sample refinement is further applied.

[0102] Sethuraman et al., "Decoder Side MV Refinement / Derivation with CTB-level concurrency and other normative complexity reduction techniques," ITU-T SG 16 WP 3 and ISO / IEC JTC 1 / SC 29 / WG 11 Joint Video Experts Team (JVET), Document JVET-K0041-v2, 11th Meeting, Ljubljana, Slovenia, July 10-18, 2018, available at phenix.it-sudparis.eu / jvet / doc_end_user / current_document.php?id=3542, describes a model-based fractional-pixel (fractional-pel) motion vector refinement process. JVET-K0041 describes the use of a quadratic parametric function to form a prediction error surface for each possible fractional-pel MV.

[0103] Essentially, the quadratic parametric function is an interpolation function that interpolates the value of the prediction error as an estimator. Based on the exact prediction error value from the integer interval MV refinement, the parameters of the quantization parametric function can be derived, and thus the best motion sampling position for this error search can be found. Then, instead of actually performing a fractional-pel motion vector search by the codec, the original MV is adjusted to this exact motion sampling position. This parametric function takes the cost value from five points as a criterion to interpolate the error surface of all possible sampling positions of the MV and find the best position on this surface with the smallest cost value. These five points form an intersection shape, with the interval between each two adjacent points being one pixel wide, and the center / left / right / top / bottom points are adjusted to (0,0), (-1,0), (1,0), (0,-1), and (0,1) relative to the point pointed to by the MV (which the integer sample search finds). Specifically, this parametric error surface function is a 2D parabolic error surface equation. E x, y= A(x -Δx) 2 +B(y -Δy) 2 +C Here, E x, y represents the SAD associated with the MV pointing to (MV0'+x, MV1'+y), (Δx, Δy) is the unknown term corresponding to the position with the minimum cost, and C corresponds to the minimum cost value.

[0104] By solving five equations for five unknowns, (Δx,Δy) is calculated as follows: Δx = floor((α(E -1,0 -E 1,0 )) / (2(E -1,0 +E 1,0 -2E 0,0 ))) Δy = floor((α(E 0,-1 -E 0,1 )) / (2(E 0,-1 +E 0,1 -2E 0,0 ))) where α is an integer scaling factor introduced to express (Δx,Δy) to some fractional-pel precision, e.g., 16 for one-sixteenth precision and 4 for one-quarter precision. In VVC, 16 is always used. To obtain the fractional-pel precision MV, the computed fractional (Δx,Δy) is added to the MV found by the integer sample search.

[0105] In VVC, (Δx, Δy) is not calculated but is set equal to (0,0) when at least one of the following conditions is met: The MV_offset as discussed above hits the horizontal boundaries of the search range (eg, ±N pixels for DMVR or bilateral matching, where N can be 1, 2, 3, 4, 5, 6, 7, or 8 pixels or more). The MV_offset as discussed above hits the vertical boundaries of the search range (eg, ±N pixels for DMVR or bilateral matching, where N can be 1, 2, 3, 4, 5, 6, 7, or 8 pixels or more). E 0,0 is equal to 0.

[0106] The video encoder 200 and the video decoder 300 may be configured to perform bilinear interpolation and sample padding. In VVC, the resolution of the MV is 1 / 16 luma samples. Samples at fractional positions are interpolated using an 8-tap interpolation filter. In DMVR, the search points surround the initial fractional-pel MV with integer sample offsets, and thus samples at those fractional positions need to be interpolated for 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 with a search range of 2 samples, DMVR does not access more reference samples compared to the normal motion compensation process. After the improved MV is obtained using the DMVR search process, a normal 8-tap interpolation filter is applied to generate the final prediction. In order to avoid accessing more reference samples than the normal MC process, samples that are not needed for the original MV-based interpolation process but are needed for the improved MV-based interpolation process may be padded from their available samples.

[0107] The video encoder 200 and the video decoder 300 may be configured to implement one or more enablement conditions. In one example, the video encoder 200 and the video decoder 300 may enable the DMVR if all of the following conditions are met: -CU level merge mode with bi-predictive MV For the current picture, one reference picture is in the past and another is in the future. The distance from both reference pictures to the current picture (i.e. the POC difference) is the same CU has more than 64 luma samples Both CU Height and CU Width are greater than or equal to 8 luma samples ·BCW weight index indicates equal weights Weighted Prediction (WP) is not enabled for the current block · Synthetic Intra-Inter Prediction (CIIP) mode is not used for the current block

[0108] FIG. 10 is a conceptual diagram illustrating a merge mode with motion vector differential (MMVD). Video encoder 200 and video decoder 300 may be configured to implement the merge mode with motion vector differential (MMVD). MMVD is a merge mode that allows explicitly signaling additional motion vector differentials to refine the merge mode motion field. The MMVD flag may be signaled immediately after sending the skip flag, the merge flag, and the normal merge flag to indicate whether the MMVD mode is used for a CU. In MMVD, after a merge candidate is selected, it is further refined by the signaled MVD information. The further information includes a merge candidate flag, an index for specifying the magnitude of the motion, and an index for an indication of the direction of the motion. In the MMVD mode, the information for the first two candidates in the merge list is selected to be used as the basis for the MV. The merge candidate flag is signaled to specify which candidate is used.

[0109] FIG. 10 shows an example of MMVD search points in each List 0 (L0) reference 180 and List 1 (L1) reference 182. The distance index specifies the motion magnitude information and indicates a predefined offset from the starting point. As shown in FIG. 10, the offset is added to either the horizontal or vertical component of the starting MV. The relationship between the distance index and the predefined offset is 2 idx-2 where idx is an integer ranging from 0 to 7. When the picture header syntax (e.g., pic_fpel_mmvd_enabled_flag) is enabled, the mapping between index and offset is 2 idx Note that this can be modified to:

[0110] The direction index represents the direction of the MVD relative to the starting point. The direction index can represent four directions, as shown in the table below, where 00, 01, 10, and 11 represent right, left, top, and bottom, respectively. Note that the meaning of the MVD code can vary according to the information of the starting MV. When the starting MV is a uni-predictive MV, or a bi-predictive MV with both lists pointing to the same side of the current picture (i.e., the POCs of the two references are both greater than the POC of the current picture, or both less than the POC of the current picture), the code in the table below specifies the sign of the MV offset added to the starting MV. When the starting MV is a bi-predictive MV with two MVs pointing to different sides of the current picture (i.e., the POC of one reference is greater than the POC of the current picture, and the POC of the other reference is less than the POC of the current picture), the code in the table below specifies the sign of the MV offset added to the list0 MV component of the starting MV, and the code for the list1 MV has the opposite value.

[0111] [Table 1]

[0112] The processing procedure of the conventional TM technique may bring extra burden to the hardware decoding design because the conventional technique requires performing fractional-pel search. Therefore, the conventional TM technique is unavoidable to generate search area samples in additional interpolation with extra decoding latency to calculate TM cost. A model-based fractional-pel MV refinement method was introduced in VVC to avoid fractional-pel interpolation. The model-based fractional-pel MV refinement method can be combined with TM to reduce the need to perform interpolation for each level of MVD precision required during the MV refinement process of TM. Therefore, a lower complexity decoder design can be expected.

[0113] This disclosure describes various techniques that may improve the performance of various decoder-side motion vector derivation / refinement techniques, including template matching, bilateral matching, decoder-side motion vector refinement, model-based motion vector differential derivation, etc. Video encoder 200 and video decoder 300 may be configured to perform the techniques of this disclosure, alone or in any combination.

[0114] In one example, the video encoder 200 and the video decoder 300 may be configured to perform model-based fractional-pixel (sub-pel) motion vector refinement for template matching (TM). First, the video encoder 200 and the video decoder 300 calculate an initial MV(v x ,v y ) around the predefined search range [±SR x ,±SR y ], where SRx and SRy are integer values. Without loss of generality, this disclosure provides x ,v y ) is represented by the highest MV storage precision (e.g., 16 for VVC and 4 for HEVC), and SR x and S.R. y is already scaled according to the best MV memory accuracy. When the TM search process is completed, the lowest template matching error (e.g., SAD, SSE, MRSAD, MRSSE, SSIM, MS-SSIM) within the search range is E 0,0 The template matching error of each neighboring point on the left / right / top / bottom (i.e., all of them are located one pixel away from the center) is denoted as E -1,0 , E 1,0 , E 0,-1 , and E 0,1 It is written as follows.

[0115] For brevity, E 0,0 The motion vector associated with (v x ', v y '), and |(v x ',v y ')-(v x ,vy )|≦(SR x ,SR y ) As discussed above, the video encoder 200 and the video decoder 300 then use the error value (E 0,0 , E -1,0 , E 1,0 , E 0,-1 and E 0,1 ), and the resulting motion vector of TM is (v x '+Δx, v y Similarly, (Δx,Δy) can be a zero vector, for example, if at least one of the conditions discussed above is satisfied (described again below). |v x '-v x | is SR x is equal to |v y '-v y | is SR y is equal to E 0,0 is equal to 0.

[0116] For simplicity, this disclosure assumes that the required scaling factors specified by the adaptive motion vector resolution (AMVR) mode are already calculated using (v x ',v y ').

[0117] In one example, we use a model-based fractional-pel MV refinement method as follows: x ',v y The above conditions can be modified so that they apply to improve only one direction, E 0,0 ≠0 and |v x '-v x | <SR x If Δx is E 0,0 , E -1,0 , and E 1,0 Instead, it can be derived based on E 0,0 =0 or |vx '-v x |≧SR x If so, then Δx is set equal to 0. E 0,0 ≠0 and |v y '-v y | <SR y If Δy is E 0,0 , E 0,-1 , and E 0,1 Instead, it can be derived based on E 0,0 =0 or |v y '-v y |≧SR y If so, then Δy is set equal to 0.

[0118] In some examples, the video encoder 200 and the video decoder 300 may be configured with additional enabling conditions for model-based fractional-pel MV refinement. For example, the video encoder 200 and the video decoder 300 may be configured to enable or disable the model-based fractional-pel MV refinement with additional conditions in addition to the conditions discussed above. The enabling / disabling conditions may be any of the following: · The initial MV of the TM is improved by bilateral matching or DMVR, The resulting MV of TM is further refined by bilateral matching or DMVR; The conditions for enabling bilateral matching or DMVR are met, i.e. each of the following is true: ○CU level merge mode with bi-predictive MV ○ For the current picture, one reference picture is in the past and another is in the future ○ The distance from both reference pictures to the current picture (i.e. the POC difference) is the same ○ The CU has more than 64 luma samples Both the CU height and CU width are 8 luma samples or more ○BCW Weight Index indicates equal weights Weighted Prediction (WP) is not enabled for the current block No synthetic intra-inter prediction (CIIP) mode is used for the current block

[0119] Alternatively, the enabling / disabling conditions may be as follows: · The initial MV of the TM is not improved by bilateral matching or DMVR, The resulting MV of the TM is not further refined by bilateral matching or DMVR, The conditions for enabling bilateral matching or DMVR are not met, i.e. at least one of the following is not true: ○CU level merge mode with bi-predictive MV ○ For the current picture, one reference picture is in the past and another is in the future ○ The distance from both reference pictures to the current picture (i.e. the POC difference) is the same ○ The CU has more than 64 luma samples Both the CU height and CU width are 8 luma samples or more ○BCW Weight Index indicates equal weights Weighted Prediction (WP) is not enabled for the current block No synthetic intra-inter prediction (CIIP) mode is used for the current block

[0120] In some examples, video encoder 200 and video decoder 300 may adjust the α term adaptively defined according to the use of AMVR mode or a 1 / 2-pel interpolation filter (which is the same filter used when AMVR mode is at 1 / 2-pel precision). For example, as follows: When the AMVR mode is full-pel, 2-pel, 4-pel, or less (i.e., greater than 4-pel), the model-based fractional-pel MV refinement method is not applied or the α term is set equal to 0 or 1. When the AMVR mode is 1 / 2-pel or when a 1 / 2-pel interpolation filter is used, the α term is set equal to 2. When the AMVR mode is 1 / 4-pel, the α term is set equal to 4. When the AMVR mode is 1 / 8-pel, the α term is set equal to 8. When the AMVR mode is 1 / 16-pel, the α term is set equal to 16. When the AMVR is 1 / N-pel, where N is 32, 64, 128, or greater, the α term is set equal to N.

[0121] This disclosure relates to x ,v y ) is assumed to be represented with the highest MV storage precision (e.g., 16 for VVC and 4 for HEVC), so the model output (Δx, Δy) needs to be adjusted according to the value of the α term. If α≦16, then the model output becomes Δx=s*floor((α(E -1,0 -E 1,0 )) / (2(E -1,0 +E 1,0 -2E 0,0 ))) Δy=s*floor((α(E 0,-1 -E 0,1 )) / (2(E 0,-1 +E 0,1 -2E 0,0 ))) where s = 16 / α. In other cases where α > 16, the MV storage precision must be higher than 16, and the scaling factor s of the model output is M / α, where M is (v x ,v y ) MV memory precision, M≧N.

[0122] In another example, the α term is set equal to 16 (or the highest value according to the MV storage precision, e.g., 16 for VVC and 4 for HEVC), regardless of the use of a 1 / 2-pel interpolation filter. Then, (v x '+Δx, v yThe resulting MV of the TM, which is Δy′+Δy, is rounded to the MV precision indicated by the AMVR mode.

[0123] In another example, the α term is set equal to 16 (or the highest value according to the MV storage precision, e.g., 16 for VVC and 4 for HEVC), regardless of the use of the AMVR mode. Then, (v x '+Δx, v y The resulting MV of the TM, which is Δy′+Δy, is rounded to the MV precision indicated by the AMVR mode.

[0124] Some techniques of U.S. Provisional Application No. 63 / 131,676, filed December 29, 2020, may be combined with the model-based fractional-pel MV refinement techniques of the present disclosure as discussed below. As disclosed herein, the TM search precision may vary according to the AMVR mode. For example, when the AMVR mode is 1 / 4-pel, the video encoder 200 and the video decoder 300 may start the TM search process at full-pel MVD precision, followed by 1 / 2-pel MVD precision, and stop at 1 / 4-pel MVD precision. In this example, the TM does not search toward the highest MVD precision indicated by the AMVR mode in terms of simplicity. In some examples, the video encoder 200 and the video decoder 300 may be configured to perform the following: When the AMVR mode is 1 / 2-pel, the TM starts and stops with full-pel MVD accuracy, then α=2, s=8, and {E 0,0 , E -1,0 , E 1,0 , E 0,-1 , E 0,1}, a model-based method is applied. When the AMVR mode is 1 / 4-pel, the TM can start and stop at a full-pel, then α=4, s=4, and {E 0,0 , E -1,0 , E 1,0 , E 0,-1 , E 0,1}, a model-based method is applied. When the AMVR mode is 1 / 4-pel, the TM can start at full-pel and stop at 1 / 2-pel, and then the model-based method is applied with α=2, s=4, and {E 0,0 , E -1,0 , E 1,0 , E 0,-1 , E 0,1} is {E 0,0 , E -0.5,0 , E 0.5,0 , E 0,-0.5 , E 0,0.5} can be used to replace it. When the AMVR mode is 1 / 16-pel, the TM can start and stop at a full pel, then α=16, s=1, and {E 0,0 , E -1,0 , E 1,0 , E 0,-1 , E 0,1}, a model-based method is applied. When the AMVR mode is 1 / 16-pel, the TM can start at full-pel and stop at 1 / 2-pel. Then, the model-based method is applied with α=8, s=1, and {E 0,0 , E -1,0 , E 1,0 , E 0,-1 , E 0,1} is {E 0,0 , E -0.5,0 , E 0.5,0 , E 0,-0.5 , E 0,0.5} can be used to replace it. When the AMVR mode is 1 / 16-pel, the TM can start with a full pel, followed by 1 / 2-pel and stopped with 1 / 4-pel. Then, the model-based method is applied with α=4, s=1, and {E 0,0 , E -1,0 , E 1,0 , E 0,-1 , E 0,1} is {E 0,0 , E -0.25,0 , E 0.25,0 , E 0,-0.25 , E 0,0.25} can be used to replace it. When the AMVR mode is 1 / 16-pel, the TM can start with a full-pel, followed by 1 / 2-pel and 1 / 4-pel in sequence, and stop at 1 / 8-pel. Then, the model-based method is applied with α=2, s=1, and {E 0,0 , E -1,0 , E 1,0 , E 0,-1 , E 0,1} is {E 0,0 , E -0.125,0 , E 0.125,0 , E 0,-0.125 , E 0,0.125} can be used to replace it.

[0125] In various examples, the four neighboring points are not always located at a distance of one pixel around the center because the video encoder 200 and the video decoder 300 may be configured to perform the TM search at a higher MVD precision than the full-pel MVD precision. The distance may be less than one pixel according to the AMVR mode. For example, when the AMVR mode is 1 / 2-pel, {E 0,0 , E -1,0 , E 1,0 , E 0,-1 , E 0,1} is {E 0,0 , E -0.5,0 , E 0.5,0 , E 0,-0.5 , E 0,0.5} can be used instead.

[0126] In some examples, the video encoder 200 and the video decoder 300 perform the TM search only at full-pel precision, regardless of the AMVR mode, and use α=16, s=1, and {E 0,0 , E -1,0 , E 1,0 , E 0,-1 , E 0,1}The model-based method is then applied. The resulting MV is then rounded to the MV precision indicated by the AMVR mode.

[0127] In some examples, the video encoder 200 and the video decoder 300 perform the TM search at full-pel and 1 / 2-pel precision, independent of the AMVR mode, and with α=8, s=1, and {E 0,0 , E -0.5,0 , E 0.5,0 , E 0,-0.5 , E 0,0.5}The model-based method is then applied. The resulting MV is then rounded to the MV precision indicated by the AMVR mode.

[0128] In some examples, the video encoder 200 and the video decoder 300 perform the TM search at full-pel precision, 1 / 2-pel precision, and 1 / 4-pel precision, independent of the AMVR mode, and with α=4, s=1, and {E 0,0 , E -0.25,0 , E 0.25,0 , E 0,-0.25 , E 0,0.25}The model-based method is then applied. The resulting MV is then rounded to the MV precision indicated by the AMVR mode.

[0129] In some examples, the video encoder 200 and the video decoder 300 perform the TM search at full-pel, 1 / 2-pel, 1 / 4-pel, and 1 / 8-pel precision, independent of the AMVR mode, and with α=2, s=1, and {E 0,0 , E -0.125,0 , E 0.125,0 , E 0,-0.125 , E 0,0.125}The model-based method is then applied. The resulting MV is then rounded to the MV precision indicated by the AMVR mode.

[0130] In some examples, the video encoder 200 and the video decoder 300 perform a TM search with full-pel precision and 1 / 2-pel precision, with α=8, s=2, and {E 0,0 , E -0.5,0 , E 0.5,0 , E 0,-0.5 , E0,0.5}The model-based method is then applied. The resulting MV is then rounded to the MV precision indicated by the AMVR mode.

[0131] Video encoder 200 and video decoder 300 may be configured to perform a simplified search process for bi-predicted TM merge mode. In some examples, the TM merge mode for a bi-predicted block becomes a two-fold process: (1) select one of the MVs for MV refinement performed by TM, and (2) the refined MV is then set as a prior for further refinement of the other MV using the BCW weight value. There are some rules that may be defined for step 1 to choose one MV from a bi-predicted block, as follows: · The MV associated with the reference picture list Lx, where x can be either 0 or 1. MV associated with reference picture list Lx, x is set equal to 1 when ph_mvd_l1_zero_flag=true. (ph_mvd_l1_zero_flag may be named differently in various video standards, but its function remains the same, i.e., MVD L1 Set to 0 and MVD L1 (Note that this is skipping the syntax signaling for · The MV associated with the reference picture list Lx, where x is set equal to 1 when ph_mvd_l1_zero_flag=false. MV associated with reference picture list Lx, where x is the MV L0 and M.V. L1 can be either 0 or 1 depending on the TM cost of each of them. ·Music Video L0 If has a lower TM cost, then x is set equal to 0, otherwise it is set equal to 1. MV associated with reference picture list Lx, where x is the MV L0 and M.V. L1 can be either 0 or 1 depending on the TM cost of each of them. ·Music VideoL0 If has a lower TM cost, then x is set equal to 1, otherwise it is set equal to 0.

[0132] In some examples, when the current block is bi-predicted, one of the MVs is selected (according to one of the methods defined above) as a prior for further refining the other MV using the BCW weight values.

[0133] In some examples, the video encoder 200 and the video decoder 300 may be configured to use a constrained search range for the TM merge mode. For example, when performing a bilateral match (BM) mode before the TM merge mode, the video encoder 200 and the video decoder 300 may be configured to use the TM to further refine the BM-refined MV within the same search range around the initial MV of the BM. Thus, both the TM and the BM can share the same reference sample fetched from the reference picture. Similarly, when the TM is performed before the BM, the BM can be used to further refine the TM-refined MV within the same search range around the initial MV of the TM. Thus, both the TM and the BM can share the same reference sample fetched from the reference picture.

[0134] In some examples, the TM and BM may form a chained process, such that the TM is performed before the BM, or the BM is performed before the TM. Regardless of which comes first, the search process may not only be constrained within the same search range, but also limited to integer MVD precision only. The fractional-pel MV refinement may be performed only at the stage of the TM or BM, whichever was performed last in the chained process. For example, the video encoder 200 and the video decoder 300 may be configured with a chained process of {BM -> TM -> sub-block BM}, where the fractional-pel MV refinement is performed only at the stage of the sub-block BM, while the other is performed only at integer MVD precision. In another example, where the sub-block BM may be disabled, the fractional-pel MV refinement is performed only at the stage of the TM, while the other is performed only at integer MVD precision.

[0135] In some examples, when the AMVR mode is 4-pel, the video encoder 200 and the video decoder 300 may disable the TM AMVP mode. "Disabled" may mean that template matching is not applied to refine the AMVP candidates or used to select the AMVP candidates, so that the AMVP mode runs the same as VVC or HEVC without modification. In some examples, when the AMVR mode is 2-pel or less (e.g., 4-pel or more), the video encoder 200 and the video decoder 300 may disable the TM AMVP mode.

[0136] 11 is a block diagram illustrating an example video encoder 200 that may perform the techniques of this disclosure. FIG. 11 is provided for purposes of illustration and should not be considered a limitation of the techniques as broadly illustrated and described in this disclosure. For purposes of illustration, this disclosure describes video encoder 200 in the context of video coding standards such as the ITU-T H.265 / HEVC video coding standard and the developing VVC video coding standard. However, the techniques of this disclosure are not limited to these video coding standards and are generally applicable to other video encoding and decoding standards.

[0137] In the example of Figure 11, the video encoder 200 includes a video data memory 230, a mode selection unit 202, a residual generation unit 204, a transform processing unit 206, a quantization unit 208, an inverse quantization unit 210, an inverse transform processing unit 212, a reconstruction unit 214, a filter unit 216, a decoded picture buffer (DPB) 218, and an entropy coding unit 220. Any or all of the video data memory 230, the mode selection unit 202, the residual generation unit 204, the transform processing unit 206, the quantization unit 208, an inverse quantization unit 210, an inverse transform processing unit 212, a reconstruction unit 214, a filter unit 216, a DPB 218, and an entropy coding unit 220 may be implemented in one or more processors or processing circuits. For example, the units of the video encoder 200 may be implemented as one or more circuits or logic elements as part of a hardware circuit, or as part of a processor, an ASIC, or an FPGA. Further, video encoder 200 may include additional or alternative processors or processing circuitry for performing these and other functions.

[0138] The video data memory 230 may store video data to be encoded by the components of the video encoder 200. The video encoder 200 may receive the video data stored in the video data memory 230, for example, from the video source 104 (FIG. 1). The DPB 218 may operate as a reference picture memory, storing reference video data for use in predicting subsequent video data by the video encoder 200. The video data memory 230 and the DPB 218 may be formed by any of a variety of memory devices, such as dynamic random access memory (DRAM), including synchronous DRAM (SDRAM), magnetoresistive RAM (MRAM), resistive RAM (RRAM), or other types of memory devices. The video data memory 230 and the DPB 218 may be provided by the same memory device or separate memory devices. In various examples, the video data memory 230 may be on-chip with other components of the video encoder 200, as shown, or may be off-chip relative to those components.

[0139] In this disclosure, references to video data memory 230 should not be construed as limited to memory internal to video encoder 200 unless otherwise stated, nor should they be construed as limited to memory external to video encoder 200 unless otherwise stated. Rather, references to video data memory 230 should be understood as a reference memory that stores video data that video encoder 200 receives for encoding (e.g., video data for a current block to be encoded). Memory 106 of FIG. 1 may also provide temporary storage of outputs from various units of video encoder 200.

[0140] The various units in FIG. 11 are shown to aid in understanding the operations performed by the video encoder 200. The units may be implemented as fixed-function circuits, programmable circuits, or a combination thereof. A fixed-function circuit refers to a circuit that provides a specific function, and the operations that may be performed are pre-defined. A programmable circuit refers to a circuit that may be programmed to perform various tasks, and provides flexibility in the operations that may be performed. For example, a programmable circuit may execute software or firmware that causes the programmable circuit to operate in a manner defined by the software or firmware instructions. A fixed-function circuit may execute software instructions (e.g., to receive parameters or to output parameters), but the types of operations that a fixed-function circuit performs are generally immutable. In some examples, one or more of the units may be separate circuit blocks (fixed function or programmable), and in some examples, one or more of the units may be integrated circuits.

[0141] The video encoder 200 may include an arithmetic logic unit (ALU), a basic functional unit (EFU), digital circuits, analog circuits, and / or a programmable core formed from programmable circuits. In examples in which the operations of the video encoder 200 are performed using software executed by a programmable circuit, the memory 106 (FIG. 1) may store instructions (e.g., object code) of the software that the video encoder 200 receives and executes, or another memory (not shown) within the video encoder 200 may store such instructions.

[0142] The video data memory 230 is configured to store the received video data. The video encoder 200 may retrieve pictures of the video data from the video data memory 230 and provide the video data to the residual generation unit 204 and the mode selection unit 202. The video data in the video data memory 230 may be raw video data to be encoded.

[0143] The mode selection unit 202 includes a motion estimation unit 222, a motion compensation unit 224, and an intra prediction unit 226. The mode selection unit 202 may include additional functional units for performing video prediction according to other prediction modes. By way of example, the mode selection unit 202 may include a palette unit, an intra block copy unit (which may be part of the motion estimation unit 222 and / or the motion compensation unit 224), an affine unit, a linear model (LM) unit, etc.

[0144] The mode selection unit 202 typically coordinates multiple encoding passes to test combinations of encoding parameters and the rate-distortion values ​​obtained for such combinations. The encoding parameters may include partitioning of the CTU into CUs, prediction modes for the CUs, transform types for the residual data of the CUs, quantization parameters for the residual data of the CUs, etc. The mode selection unit 202 may ultimately select a combination of encoding parameters that has a better rate-distortion value than the other tested combinations.

[0145] Video encoder 200 may partition a picture retrieved from video data memory 230 into a series of CTUs and encapsulate one or more CTUs within a slice. Mode selection unit 202 may partition the CTUs of a picture according to a tree structure, such as the QTBT structure or the quadtree structure of HEVC described above. As described above, video encoder 200 may form one or more CUs from partitioning the CTUs according to the tree structure. Such a CU may also be generally referred to as a "video block" or a "block."

[0146] Generally, the mode selection unit 202 also controls its components (e.g., motion estimation unit 222, motion compensation unit 224, and intra prediction unit 226) to generate a prediction block for a current block (e.g., a current CU, or in HEVC, an overlapping portion of a PU and a TU). For inter prediction of the current block, the motion estimation unit 222 may perform motion search to identify one or more well-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 may calculate values ​​representing how similar a potential reference block is to the current block, for example, according to a sum of absolute differences (SAD), a sum of squared differences (SSD), a mean absolute difference (MAD), a mean squared difference (MSD), etc. The motion estimation unit 222 may generally perform these calculations using a sample-by-sample difference between the current block and the reference block under consideration. The motion estimation unit 222 may identify a reference block having the lowest value resulting from these calculations, which indicates a reference block that best matches the current block.

[0147] The motion estimation unit 222 may form one or more motion vectors (MVs) 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 may then provide the motion vectors to the motion compensation unit 224. For example, for unidirectional inter prediction, the motion estimation unit 222 may provide a single motion vector, while for bidirectional inter prediction, the motion estimation unit 222 may provide two motion vectors. The motion compensation unit 224 may then generate a predictive block using the motion vectors. For example, the motion compensation unit 224 may use the motion vectors to retrieve data of the reference block. As another example, if the motion vectors have fractional sample precision, the motion compensation unit 224 may interpolate values ​​for the predictive block according to one or more interpolation filters. Moreover, for bidirectional inter prediction, the motion compensation unit 224 may retrieve data for the two reference blocks identified by the respective motion vectors and combine the retrieved data, for example, through a sample-wise average or weighted average.

[0148] Moreover, the motion compensation unit 224 may be configured to perform decoder-side motion vector refinement / derivation techniques in accordance with any or all of the techniques of this disclosure, in any combination. For example, the motion compensation unit 224 may perform template matching and model-based fractional-pixel motion vector refinement to refine the full-pixel resolution motion vectors initially received using these techniques from the motion estimation unit 222.

[0149] For example, the motion compensation unit 224 may receive an initial motion vector from the motion estimation unit 222. The initial motion vector may have full integer pixel resolution. The motion compensation unit 224 and the entropy coding unit 220 may code the initial motion vector using advanced motion vector prediction (AMVP) using motion vector difference (MVD) values ​​with full integer pixel accuracy. The motion compensation unit 224 may further refine the initial motion vector, which may include, for example, determining a search range around a reference area identified by the initial motion vector in a reference picture. The motion compensation unit 224 may then perform a template matching search process in the search range to identify a best matching region. The best matching region may be a region that produces the lowest rate-distortion optimization (RDO) value. The RDO value may be calculated, for example, using a sum of absolute difference values, a sum of squared difference values, a mean absolute difference value, a mean squared difference value, or the like.

[0150] Through determining the best matching region, the motion compensation unit 224 may obtain an improved motion vector with integer precision. The motion compensation unit 224 may then further determine error values ​​for neighboring pixels in the best matching region to perform model-based fractional-pixel motion vector refinement to derive motion vector difference values ​​(e.g., x (horizontal) and / or y (vertical) component motion vector difference values). The motion compensation unit 224 may further apply at least one of the motion vector difference values ​​to the initial motion vector to determine an improved motion vector for the current block. The improved motion vector may have fractional-pixel precision. The motion compensation unit 224 may then use the improved motion vector to generate a predictive block and provide the predictive block to the residual generation unit 204 and the reconstruction unit 214.

[0151] Specifically, for each of the motion vector difference components, motion compensation unit 224 may determine whether the error value for the best matching region is equal to 0. Motion compensation unit 224 may then apply the motion vector difference value for a component of the initial motion vector to that component after further determining that the absolute value of the difference between that component and the corresponding motion vector difference value for that component is less than the corresponding search region value for that component.

[0152] As mentioned above, the motion compensation unit 224 (or the motion selection unit 202) may also determine whether to perform the motion vector refinement techniques of this disclosure. For example, the mode selection unit 202 or the motion compensation unit 224 may determine each of: an initial motion vector is a coding unit (CU) level merge mode with bi-predictive motion vectors; a first reference picture for the current block has a display order value less than a display order value of the current picture containing the current block; a second reference picture for the current block has a display order value greater than a display order value of the current picture; temporal distances between the current picture and the first and second reference pictures are equal; the current block has more than 64 luma pixels; a height of the current block is at least 8 luma pixels; a width of the current block is at least 8 luma pixels; weight values ​​for bi-prediction with CU-level weight (BCW) are equal; weighted prediction (WP) is not enabled for the current block; and a synthesized intra-inter prediction (CIIP) mode is not used for the current block, and in response, determine a motion vector refinement technique.

[0153] In some examples, if the current block is bi-predicted, motion compensation unit 224 may perform these motion vector refinement techniques for both motion vectors of the current block.

[0154] As another example, for intra prediction or intra predictive coding, the intra prediction unit 226 may generate a predictive block from samples neighboring the current block. For example, in a directional mode, the intra prediction unit 226 may generally mathematically combine values ​​of neighboring samples to fill in these calculated values ​​in a defined direction across the current block to produce a predictive block. As another example, in a DC mode, the intra prediction unit 226 may calculate an average of samples neighboring the current block and generate a predictive block to include this resulting average for each sample of the predictive block.

[0155] The mode selection unit 202 provides the prediction block to the residual generation unit 204. The residual generation unit 204 receives a raw, uncoded 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 calculates sample-by-sample differences between the current block and the prediction block. The resulting sample-by-sample differences define a residual block for the current block. In some examples, the residual generation unit 204 may also determine differences 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 may be formed using one or more subtractor circuits that perform binary subtraction.

[0156] In an example where the mode selection unit 202 partitions a CU into PUs, each PU may be associated with a luma prediction unit and a corresponding chroma prediction unit. The video encoder 200 and the video decoder 300 may support PUs having various sizes. As indicated above, the size of a CU may refer to the size of the luma coding block of the CU, and the size of a PU may refer to the size of the luma prediction unit of the PU. Assuming that the size of a particular CU is 2N×2N, the video encoder 200 may support a PU size of 2N×2N or N×N for intra prediction, and a symmetric PU size of 2N×2N, 2N×N, N×2N, N×N, or similar for inter prediction. The video encoder 200 and the video decoder 300 may also support asymmetric partitioning for PU sizes of 2N×nU, 2N×nD, nL×2N, and nR×2N for inter prediction.

[0157] In examples where the mode selection unit 202 does not further partition the CUs into PUs, each CU may be associated with a luma coding block and a corresponding chroma coding block. As above, the size of a CU may refer to the size of the luma coding block of the CU. The video encoder 200 and the video decoder 300 may support CU sizes of 2N×2N, 2N×N, or N×2N.

[0158] In 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 select unit 202 generates a predictive 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 select unit 202 may not generate a predictive block, but instead generate syntax elements that indicate how to reconstruct the block based on a selected palette. In such modes, the mode select unit 202 may provide these syntax elements to the entropy coding unit 220 to be coded.

[0159] As described above, the residual generation unit 204 receives video data for a current block and a corresponding predictive 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 a sample-by-sample difference between the predictive block and the current block.

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

[0161] The quantization unit 208 may quantize the transform coefficients in the transform coefficient block to generate a quantized transform coefficient block. The quantization unit 208 may quantize the transform coefficients of the transform coefficient block according to a quantization parameter (QP) value associated with the current block. The video encoder 200 (e.g., via the mode selection unit 202) may adjust the degree of quantization applied to the transform coefficient block associated with the current block by adjusting the QP value associated with the CU. Quantization may result in loss of information, and thus the quantized transform coefficients may be less accurate than the original transform coefficients generated by transform processing unit 206.

[0162] The inverse quantization unit 210 and the inverse transform processing unit 212 may apply inverse quantization and inverse transform to the quantized transform coefficient block, respectively, to reconstruct a residual block from the transform coefficient block. The reconstruction unit 214 may generate a reconstructed block that corresponds to the current block (possibly with some distortion) based on the reconstructed residual block and the predictive block generated by the mode selection unit 202. For example, the reconstruction unit 214 may add samples of the reconstructed residual block to corresponding samples from the predictive block generated by the mode selection unit 202 to generate the reconstructed block.

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

[0164] The video encoder 200 stores the reconstructed blocks in the DPB 218. For example, in examples where the operation of the filter unit 216 is not required, the reconstruction unit 214 may store the reconstructed blocks in the DPB 218. In examples where the operation of the filter unit 216 is required, the filter unit 216 may store the filtered reconstructed blocks in the DPB 218. The motion estimation unit 222 and the motion compensation unit 224 may retrieve reference pictures from the DPB 218, formed from the reconstructed (and possibly filtered) blocks, to inter predict blocks of a later-encoded picture. In addition, the intra prediction unit 226 may use the reconstructed blocks in the DPB 218 of the current picture to intra predict other blocks in the current picture.

[0165] In general, the entropy encoding unit 220 may entropy encode syntax elements received from other functional components of the video encoder 200. For example, the entropy encoding unit 220 may entropy encode quantized transform coefficient blocks from the quantization unit 208. As another example, the entropy encoding unit 220 may entropy encode predictive syntax elements (e.g., motion information for inter prediction or intra mode information for intra prediction) from the mode selection unit 202. The entropy encoding unit 220 may perform one or more entropy encoding operations on syntax elements, which are another example of video data, to generate entropy encoded data. For example, the entropy encoding unit 220 may perform a context-adaptive variable length coding (CAVLC) operation, a CABAC operation, a variable-length-to-variable-length (V2V) coding operation, a syntax-based context-adaptive binary arithmetic coding (SBAC) operation, a probability interval partitioned entropy (PIPE) coding operation, an exponential-Golomb coding operation, or another type of entropy coding operation on the data. In some examples, the entropy encoding unit 220 may operate in a bypass mode in which syntax elements are not entropy coded.

[0166] The video encoder 200 may output a bitstream that includes entropy-encoded syntax elements needed to reconstruct blocks of a slice or picture. Specifically, the entropy encoding unit 220 may output the bitstream.

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

[0168] In some examples, operations performed with respect to luma coding blocks do not need to be repeated for chroma coding blocks. As an example, operations to identify motion vectors (MVs) and reference pictures for luma coding blocks do not need to be repeated to identify MVs and reference pictures for chroma blocks. Rather, MVs for luma coding blocks may be scaled to determine MVs for chroma blocks, and the reference pictures may be the same. As another example, the intra prediction process may be the same for luma coding blocks and chroma coding blocks.

[0169] Thus, the video encoder 200 of FIG. 11 represents an example of a device for encoding and decoding video data, including a memory configured to store video data and one or more processors implemented in circuitry, the one or more processors configured to determine an initial motion vector for a current block of the video data, the initial motion vector having integer motion vector differential (MVD) precision, determine a search range around a reference area identified by the initial motion vector in a reference picture, perform a template matching search process in the search range to identify a best matching region, determine error values ​​of neighboring pixels relative to the best matching region, perform a model-based fractional-pixel motion vector refinement using the error values ​​of the neighboring pixels to derive motion vector difference values, apply at least one of the motion vector difference values ​​to the initial motion vector to determine an improved motion vector for the current block, and decode the current block using the improved motion vector.

[0170] FIG. 12 is a block diagram illustrating an example video decoder 300 that may perform techniques of this disclosure. FIG. 12 is provided for purposes of illustration and not to limit the techniques as broadly illustrated and described in this disclosure. For purposes of illustration, this disclosure describes a video decoder 300 according to VVC and HEVC (ITU-T H.265) techniques. However, the techniques of this disclosure may be performed by video coding devices configured according to other video coding standards.

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

[0172] The prediction processing unit 304 includes a motion compensation unit 316 and an intra prediction unit 318. The prediction processing unit 304 may include additional units for performing prediction according to other prediction modes. By way of example, the prediction processing unit 304 may include a palette unit, an intra block copy unit (which may form part of the motion compensation unit 316), an affine unit, a linear model (LM) unit, etc. In other examples, the video decoder 300 may include more, fewer, or different functional components.

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

[0174] Additionally or alternatively, in some examples, video decoder 300 may retrieve coded video data from memory 120 (FIG. 1). That is, memory 120 may store data such as those discussed above for CPB memory 320. Similarly, memory 120 may store instructions to be executed by video decoder 300 when some or all of the functionality of video decoder 300 is implemented in software to be executed by processing circuitry of video decoder 300.

[0175] The various units shown in FIG. 12 are shown to aid in understanding the operations performed by the video decoder 300. The units may be implemented as fixed-function circuits, programmable circuits, or a combination thereof. As with FIG. 11, fixed-function circuits refer to circuits that provide a particular function and are predefined in the operations that may be performed. Programmable circuits refer to circuits that may be programmed to perform various tasks and provide flexible functionality in the operations that may be performed. For example, a programmable circuit may execute software or firmware that causes the programmable circuit to operate in a manner defined by the software or firmware instructions. A fixed-function circuit may execute software instructions (e.g., to receive parameters or to output parameters), but the types of operations that a fixed-function circuit performs are generally immutable. In some examples, one or more units may be separate circuit blocks (fixed function or programmable), and in some examples, one or more units may be integrated circuits.

[0176] The video decoder 300 may include a programmable core formed from an ALU, an EFU, digital circuits, analog circuits, and / or programmable circuits. In examples in which the operations of the video decoder 300 are performed by software executing on a programmable circuit, on-chip or off-chip memory may store instructions (e.g., object code) of the software that the video decoder 300 receives and executes.

[0177] The entropy decoding unit 302 may receive the encoded video data from the CPB and entropy decode the video data to recover the syntax elements. The prediction processing unit 304, the inverse quantization unit 306, the inverse transform processing unit 308, the reconstruction unit 310, and the filter unit 312 may generate decoded video data based on the syntax elements extracted from the bitstream.

[0178] In general, the video decoder 300 reconstructs a picture on a block-by-block basis. The video decoder 300 may perform a reconstruction operation on each block individually (wherein the block currently being reconstructed, i.e., decoded, may be referred to as the “current block”).

[0179] The entropy decoding unit 302 may entropy decode syntax elements defining the quantized transform coefficients of the quantized transform coefficient block, as well as transform information, such as a quantization parameter (QP) and / or a transform mode indication. The inverse quantization unit 306 may use the QP associated with the quantized transform coefficient block to determine the degree of quantization and, similarly, the degree of inverse quantization that the inverse quantization unit 306 should apply. The inverse quantization unit 306 may, for example, perform a bitwise left shift operation to inverse quantize the quantized transform coefficients. In this manner, the inverse quantization unit 306 may form a transform coefficient block including the transform coefficients.

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

[0181] Further, prediction processing unit 304 generates a prediction block according to the prediction information syntax element entropy decoded by entropy decoding unit 302. For example, if the prediction information syntax element indicates that the current block is inter-predicted, motion compensation unit 316 may generate a prediction block. In this case, the prediction information syntax element may indicate a reference picture in DPB 314 from which to retrieve a reference block, as well as a motion vector that specifies the location of the reference block in the reference picture relative to the location of the current block in the current picture. Motion compensation unit 316 may generally perform inter-prediction processing in a manner substantially similar to that described with respect to motion compensation unit 224 (FIG. 11).

[0182] Further, in accordance with the techniques of this disclosure, the motion compensation unit 316 may refine the decoded motion vectors received from the entropy decoding unit 302, e.g., using template matching and model-based fractional-pixel motion vector refinement. The motion compensation unit 316 may apply any or all of the techniques of this disclosure for decoder-side motion vector refinement / derivation, alone or in any combination.

[0183] Moreover, the motion compensation unit 316 may be configured to perform decoder-side motion vector refinement / derivation techniques in accordance with any or all of the techniques of this disclosure, in any combination. For example, the motion compensation unit 316 may perform template matching and model-based fractional-pixel motion vector refinement to refine the full-pixel resolution motion vectors initially received using these techniques from the entropy decoding unit 302.

[0184] For example, the motion compensation unit 316 may receive data representing an initial motion vector from the entropy decoding unit 302. The initial motion vector may have full integer pixel resolution. The motion compensation unit 316 and the entropy decoding unit 302 may decode the initial motion vector using advanced motion vector prediction (AMVP) using motion vector difference (MVD) values ​​with full integer pixel accuracy. The motion compensation unit 316 may further refine the initial motion vector, which may include, for example, determining a search range around a reference area identified by the initial motion vector in a reference picture. The motion compensation unit 316 may then perform a template matching search process in the search range to identify a best matching region. The best matching region may be a region that produces the lowest rate-distortion optimization (RDO) value. The RDO value may be calculated, for example, using a sum of absolute difference values, a sum of squared difference values, a mean absolute difference value, a mean squared difference value, or the like.

[0185] Through determining the best matching region, the motion compensation unit 316 may obtain an improved motion vector with integer precision. The motion compensation unit 316 may then further determine error values ​​for neighboring pixels in the best matching region to perform model-based fractional-pixel motion vector refinement to derive motion vector difference values ​​(e.g., x (horizontal) and / or y (vertical) component motion vector difference values). The motion compensation unit 316 may further apply at least one of the motion vector difference values ​​to the initial motion vector to determine an improved motion vector for the current block. The improved motion vector may have fractional-pixel precision. The motion compensation unit 316 may then use the improved motion vector to generate a predictive block and provide the predictive block to the reconstruction unit 310.

[0186] Specifically, for each of the motion vector difference components, motion compensation unit 316 may determine whether the error value for the best matching region is equal to 0. Motion compensation unit 316 may then apply the motion vector difference value for a component of the initial motion vector to that component after further determining that the absolute value of the difference between that component and the corresponding motion vector difference value for that component is less than the corresponding search region value for that component.

[0187] As mentioned above, the motion compensation unit 316 may also determine whether to perform the motion vector refinement technique of the present disclosure. For example, the motion compensation unit 316 may determine each of the following: the initial motion vector is a coding unit (CU) level merge mode using a bi-predictive motion vector; the first reference picture for the current block has a display order value smaller than the display order value of the current picture including the current block; the second reference picture for the current block has a display order value larger than the display order value for the current picture; the temporal distance between the current picture and the first reference picture and the second reference picture is equal; the current block has more than 64 luma pixels; the height of the current block is at least 8 luma pixels; the width of the current block is at least 8 luma pixels; the weight values ​​for bi-prediction using CU level weights (BCW) are equal; weighted prediction (WP) is not enabled for the current block; and a composite intra-inter prediction (CIIP) mode is not used for the current block, and in response thereto, determine a motion vector refinement technique.

[0188] In some examples, if the current block is bi-predicted, motion compensation unit 316 may perform these motion vector refinement techniques for both motion vectors for the current block.

[0189] As another example, if the prediction information syntax element indicates that the current block is intra predicted, the intra prediction unit 318 may generate a predictive block according to the intra prediction mode indicated by the prediction information syntax element. Again, the intra prediction unit 318 may generally perform an intra prediction process in a manner substantially similar to that described with respect to the intra prediction unit 226 (FIG. 11). The intra prediction unit 318 may retrieve data of samples neighboring the current block from the DPB 314.

[0190] The reconstruction unit 310 may reconstruct the current block using the predictive block and the residual block. For example, the reconstruction unit 310 may add samples of the residual block to corresponding samples of the predictive block to reconstruct the current block.

[0191] Filter unit 312 may perform one or more filter operations on the reconstructed block. For example, filter unit 312 may perform a deblocking operation to reduce blockiness artifacts along the edges of the reconstructed block. In all examples, the operations of filter unit 312 may not be performed.

[0192] The video decoder 300 may store the reconstructed block in the DPB 314. For example, in examples where the operation of the filter unit 312 is not required, the reconstruction unit 310 may store the reconstructed block in the DPB 314. In examples where the operation of the filter unit 312 is performed, the filter unit 312 may store the filtered reconstructed block in the DPB 314. As discussed above, the DPB 314 may provide reference information to the prediction processing unit 304, such as samples of the current picture for intra prediction and previously decoded pictures for subsequent motion compensation. Moreover, the video decoder 300 may output the decoded picture from the DPB 314 for later presentation on a display device, such as the display device 118 of FIG. 1.

[0193] Thus, the video decoder 300 of FIG. 12 represents an example of a device for decoding video data including a memory configured to store video data and one or more processors implemented in circuitry, the one or more processors configured to determine an initial motion vector for a current block of the video data, the initial motion vector having integer motion vector differential (MVD) precision, determine a search range around a reference area identified by the initial motion vector in a reference picture, perform a template matching search process in the search range to identify a best matching region, determine error values ​​of neighboring pixels relative to the best matching region, perform a model-based fractional-pixel motion vector refinement using the error values ​​of the neighboring pixels to derive motion vector difference values, apply at least one of the motion vector difference values ​​to the initial motion vector to determine an improved motion vector for the current block, and decode the current block using the improved motion vector.

[0194] 13 is a flowchart illustrating an example method for encoding a current block according to the techniques of this disclosure. The current block may comprise a current CU. Although described with respect to video encoder 200 (FIGS. 1 and 11), it should be understood that other devices may be configured to perform a method similar to that of FIG.

[0195] In this example, video encoder 200 may first predict a current block (350). For example, video encoder 200 may form a predictive block for the current block. Specifically, video encoder 200 may apply any or all of the techniques of this disclosure, alone or in any combination, to perform decoder-side motion vector derivation / refinement, e.g., using model-based motion vector differential derivation and template matching prediction, to form an improved motion vector, and then generate a predictive block using the improved motion vector. Video encoder 200 may then calculate a residual block for the current block (352). To calculate the residual block, video encoder 200 may calculate the difference between an original uncoded block and a predictive block for the current block. Video encoder 200 may then transform and quantize coefficients of the residual block (354). Video encoder 200 may then scan the quantized transform coefficients of the residual block (356). During or following the scan, video encoder 200 may entropy code the coefficients (358). For example, the video encoder 200 may encode the coefficients using CAVLC or CABAC. The video encoder 200 may then output entropy coded data for the block (360).

[0196] Video encoder 200 may also decode the current block after encoding it to use the decoded version of the current block as reference data for later coded data (e.g., in inter-prediction or intra-prediction modes). Accordingly, video encoder 200 may inverse quantize and inverse transform the coefficients to reconstruct the residual block (362). Video encoder 200 may combine the residual block with the predictive block to form a decoded block (364). Video encoder 200 may then store the decoded block in DPB 218 (366).

[0197] Thus, the method of Figure 13 represents an example of a method for decoding video data, including the steps of determining an initial motion vector for a current block of video data, the initial motion vector having integer motion vector differential (MVD) accuracy, determining a search range around a reference area identified by the initial motion vector in a reference picture, performing a template matching search process in the search range to identify a best matching region, determining error values ​​of neighboring pixels to the best matching region, using the error values ​​of the neighboring pixels to perform a model-based fractional pixel motion vector refinement to derive motion vector difference values, applying at least one of the motion vector difference values ​​to the initial motion vector to determine an improved motion vector for the current block, and decoding the current block using the improved motion vector. The method of Figure 13 also represents such a method for encoding video data.

[0198] 14 is a flowchart illustrating an example method for decoding a current block according to the techniques of this disclosure. The current block may comprise a current CU. Although described with respect to the video decoder 300 (FIGS. 1 and 12), it should be understood that other devices may be configured to perform a method similar to that of FIG.

[0199] The video decoder 300 may receive entropy coded data for the current block, such as entropy coded prediction information and entropy coded data for coefficients of a residual block corresponding to the current block (370). The video decoder 300 may entropy decode the entropy coded data to determine prediction information for the current block and to reconstruct the coefficients of the residual block (372). The video decoder 300 may predict the current block, e.g., using an inter prediction mode as indicated by the prediction information for the current block, to calculate a predictive block for the current block (374). In particular, the video decoder 300 may apply any or all of the techniques of this disclosure, alone or in any combination, to perform decoder-side motion vector derivation / refinement, e.g., using model-based motion vector differential derivation and template matching prediction, to form a refined motion vector, and then generate a predictive block using the refined motion vector. The video decoder 300 may then inverse scan the reconstructed coefficients to produce a block of quantized transform coefficients (376). The video decoder 300 may then dequantize and inverse transform the quantized transform coefficients to produce a residual block (378). The video decoder 300 may finally decode the current block by combining the predictive block and the residual block (380).

[0200] Thus, the method of FIG. 14 represents an example of a method for decoding video data, including the steps of determining an initial motion vector for a current block of video data, the initial motion vector having integer motion vector differential (MVD) precision; determining a search range around a reference area identified by the initial motion vector in a reference picture; performing a template matching search process in the search range to identify a best matching region; determining error values ​​of adjacent pixels to the best matching region; performing a model-based fractional pixel error vector refinement using the error values ​​of the adjacent pixels to derive motion vector differential values; applying at least one of the motion vector differential values ​​to the initial motion vector to determine an improved motion vector for the current block; and decoding the current block using the improved motion vector.

[0201] 15 is a flowchart illustrating an example method of encoding or decoding video data in accordance with the techniques of this disclosure. The method of FIG. 15 is described with respect to the video decoder 300 of FIG. 1 and FIG. 12. Other devices, such as the video encoder 200 of FIG. 1 and FIG. 11, may also be configured to perform this method or a similar method.

[0202] First, the video decoder 300 may obtain an initial motion vector having an integer-precision motion vector differential (MVD) value for the current block (400). The video decoder 300 may decode data representing the initial motion vector. In some examples, the video decoder 300 may refine the decoded data representing the motion vector using bilateral matching, and the resulting motion vector may be the initial motion vector. In examples in which the video encoder 200 performs the method, the video encoder 200 may obtain the initial motion vector through a search process, e.g., performed by the motion estimation unit 222 as discussed above.

[0203] The video decoder 300 may then determine a search range (402), where the search range is around a reference area identified by the initial motion vector in the reference picture. The video decoder 300 may then perform a template matching search process in the search range to identify a best matching region (404).

[0204] The video decoder 300 may then determine error values ​​of neighboring pixels for the best matching region (406). The video decoder 300 may use the error values ​​to perform model-based fractional-pixel motion vector refinement to derive motion vector difference values ​​(408). The video decoder 300 may then apply the motion vector difference values ​​to the initial motion vector to obtain an improved motion vector (410). The video decoder 300 may then decode the current block using the improved motion vector (412). In examples in which the video encoder 200 performs the method, the video encoder 200 may both encode and decode the current block using the improved motion vector.

[0205] Thus, the method of FIG. 15 represents an example of a method for decoding video data, including the steps of determining an initial motion vector for a current block of video data, the initial motion vector having integer motion vector differential (MVD) precision; determining a search range around a reference area identified by the initial motion vector in a reference picture; performing a template matching search process in the search range to identify a best matching region; determining error values ​​of adjacent pixels to the best matching region; performing a model-based fractional pixel error vector refinement using the error values ​​of the adjacent pixels to derive motion vector differential values; applying at least one of the motion vector differential values ​​to the initial motion vector to determine an improved motion vector for the current block; and decoding the current block using the improved motion vector.

[0206] Various examples of the techniques of this disclosure are summarized in the following paragraphs.

[0207] Clause 1: A method for decoding video data, comprising the steps of: decoding data representing an initial motion vector for a current block of the video data, the initial motion vector having integer motion vector differential (MVD) precision; determining a search range around a reference area identified by the initial motion vector in a reference picture; performing a template matching search process in the search range to identify a best matching region; determining error values ​​of adjacent pixels to the best matching region; performing a model-based fractional-pixel motion vector refinement using the error values ​​of the adjacent pixels to derive motion vector differential values; applying at least one of the motion vector differential values ​​to the initial motion vector to determine an improved motion vector for the current block; and decoding the current block using the improved motion vector.

[0208] Clause 2: The method of clause 1, wherein the motion vector differential value includes a horizontal motion vector differential value and a vertical motion vector differential value.

[0209] Clause 3: The method of any of clauses 1 and 2, wherein applying at least one of the motion vector difference values ​​comprises applying all of the motion vector difference values.

[0210] Clause 4: The method of any of clauses 1 and 2, wherein the step of applying at least one of the motion vector differential values ​​comprises the steps of determining that an error value of the best matching region is not equal to 0, and in response to determining that an absolute value of a difference between a component of the initial motion vector and the corresponding motion vector differential value for that component is less than the corresponding search region value for that component, applying the motion vector differential value for that component to that component.

[0211] Clause 5: The method of any of clauses 1 and 2, wherein the step of applying at least one of the motion vector difference values ​​comprises a step of preventing applying the motion vector difference value for that component to the component in response to determining at least one of: an error value for the best matching region is equal to 0; or an absolute value of a difference between a component of the initial motion vector and a corresponding motion vector difference value for that component is greater than or equal to a corresponding search region value for that component.

[0212] Clause 6: The step of performing model-based fractional-pixel motion vector refinement includes: 1) an initial motion vector is refined using bilateral match or decoder-side motion vector (DMVR) refinement; 2) the refined motion vector is further refined using bilateral match or DMVR; or 3) the initial motion vector is a coding unit (CU) level merge mode using bi-predictive motion vectors; a first reference picture for the current block has a display order value that is smaller than a display order value of a current picture that contains the current block; a second reference picture for the current block has a display order value that is larger than a display order value of the current picture; performing model-based fractional-pixel motion vector refinement in response to determining one or more of each of: the temporal distances between the current block and the first and second reference pictures are equal; the current block has more than 64 luma pixels; a height of the current block is at least 8 luma pixels; a width of the current block is at least 8 luma pixels; weight values ​​for bi-prediction with CU level weights (BCW) are equal; weighted prediction (WP) is not enabled for the current block; and a composite intra-inter prediction (CIIP) mode is not used for the current block.

[0213] Clause 7: The step of performing model-based fractional-pixel motion vector refinement includes: 1) the initial motion vector was not refined using bilateral match or decoder-side motion vector (DMVR) refinement; 2) the refined motion vector is not further refined using bilateral match or DMVR; or 3) the initial motion vector is a coding unit (CU) level merge mode using bi-predictive motion vectors; a first reference picture for the current block has a display order value that is smaller than a display order value of a current picture that includes the current block; a second reference picture for the current block has a display order value that is larger than a display order value of the current picture; 6. The method of any of clauses 1 to 5, comprising: performing a model-based fractional-pixel motion vector refinement in response to determining that at least one of: the temporal distances between the reference picture and the second reference picture are equal; the current block has more than 64 luma pixels; the height of the current block is at least 8 luma pixels; the width of the current block is at least 8 luma pixels; the weight values ​​for bi-prediction with CU level weights (BCW) are equal; weighted prediction (WP) is not enabled for the current block; and a composite intra-inter prediction (CIIP) mode is not used for the current block is not true.

[0214] Clause 8: The motion vector difference value comprises a horizontal motion vector difference (Δx) and a vertical motion vector difference (Δy), and the error value of the adjacent pixel is E x,y and the step of determining the error value comprises E x, y =A(x -Δx) 2 +B(y -Δy) 2 +C, and performing model-based fractional-pixel motion vector refinement comprises the step of calculating s*floor((α(E -1,0 -E 1,0 )) / (2(E -1,0 +E 1,0 -2E 0,0))) and calculating Δx according to s*floor((α(E 0,-1 -E 0,1 )) / (2(E 0,-1 +E 0,1 -2E 0,0 8. The method of any of clauses 1 to 7, comprising: calculating Δy according to (Δx, Δy) according to (a))), wherein α is an integer scaling factor introduced to express (Δx, Δy) with some decimal-pel precision, and s is the scaling value.

[0215] Clause 9: The method of clause 8, further comprising determining a value of α according to an adaptive motion vector resolution (AMVR) mode for the current block.

[0216] Clause 10: The method of any of clauses 8 and 9, further comprising determining the value of α according to whether a half-pixel interpolation filter is used.

[0217] Clause 11: The method of any of clauses 9 and 10, wherein the step of determining the value of α comprises the step of determining that the value of α is equal to 0 or 1 when the AMVR mode is one of full pixel, 2 pixel, 4 pixel, or greater than 4 pixel.

[0218] Clause 12: The method of any of clauses 9 to 11, wherein the step of determining the value of α comprises the step of determining that the value of α is equal to 2 when the AMVR mode is ½ pixel or when a ½ pixel interpolation filter is used.

[0219] Clause 13: The method of any of clauses 9 to 12, wherein determining the value of α comprises determining that the value of α is equal to 4 when the AMVR mode is ¼ pixel.

[0220] Clause 14: The method of any of clauses 9 to 13, wherein determining the value of α comprises determining that the value of α is equal to 8 when the AMVR mode is 1 / 8 pixel.

[0221] Clause 15: The method of any of clauses 9 to 14, wherein determining the value of α comprises determining that the value of α is equal to 16 when the AMVR mode is 1 / 16 pixel.

[0222] Clause 16: The method of any of clauses 9 to 15, wherein determining the value of α comprises determining that the value of α is equal to N when the AMVR mode is 1 / N pixel.

[0223] Clause 17. The method of any of clauses 9 to 16, further comprising the step of calculating the value of s as equal to 16 / α.

[0224] Clause 18: The method of any of clauses 9 to 16, further comprising the step of calculating the value of s as equal to M / α, where M is the motion vector storage precision.

[0225] Clause 19: Any of the methods of clauses 9 to 16, wherein when the AMVR mode is ½ pixel, the step of performing the template matching search process comprises the step of performing the template matching search process with full pixel motion vector differential accuracy, and the step of determining a value of α comprises the step of determining that the value of α is equal to 2, and the method further comprises the step of determining a value of s as equal to 8.

[0226] Clause 20: Any of the methods of clauses 9 to 16, wherein when the AMVR mode is ¼ pixel, the step of performing the template matching search process comprises performing the template matching search process with full pixel motion vector differential accuracy, and the step of determining a value of α comprises determining that the value of α is equal to 4, and the method further comprises determining a value of s as equal to 4.

[0227] Clause 21: Any of the methods of clauses 9 to 16, wherein when the AMVR mode is ¼ pixel, the step of performing the template matching search process comprises performing the template matching search process with full pixel motion vector differential accuracy, and the step of determining a value of α comprises determining that the value of α is equal to 2, and the method further comprises determining a value of s as equal to 4.

[0228] Clause 22: Any of the methods of clauses 9 to 16, wherein when the AMVR mode is 1 / 16 pixel, the step of performing the template matching search process comprises the step of performing the template matching search process with full pixel motion vector differential accuracy, and the step of determining a value of α comprises the step of determining that the value of α is equal to 2, and the method further comprises the step of determining a value of s as equal to 1.

[0229] Clause 23: Any of clauses 9 to 16, wherein when the AMVR mode is 1 / 16 pixel, the step of performing the template matching search process comprises performing the template matching search process with full pixel motion vector differential accuracy, and the step of determining a value of α comprises determining that the value of α is equal to 8, and the method further comprises determining a value of s as equal to 1.

[0230] Clause 24: Any of clauses 9 to 16, wherein when the AMVR mode is 1 / 16 pixel, the step of performing the template matching search process comprises performing the template matching search process with full pixel motion vector differential accuracy and with 1 / 2 pixel motion vector differential accuracy, and the step of determining a value of α comprises determining that the value of α is equal to 4, and the method further comprises determining a value of s as equal to 1.

[0231] Clause 25: Any of the methods of clauses 9 to 16, wherein when the AMVR mode is 1 / 16 pixel, the step of performing the template matching search process comprises the steps of performing the template matching search process with full pixel motion vector differential accuracy, with 1 / 2 pixel motion vector differential accuracy, and with 1 / 4 pixel motion vector differential accuracy, and the step of determining a value of α comprises the step of determining that the value of α is equal to 2, and the method further comprises the step of determining a value of s as equal to 1.

[0232] Clause 26: Any of the methods of clauses 1 to 25, wherein the current block is bi-predicted, the initial motion vector comprises a first initial motion vector, and the refined motion vector comprises a first refined motion vector, and the method further comprises the step of refining a second initial motion vector for the current block using the first refined motion vector.

[0233] Clause 27: The method of clause 26, wherein the first initial motion vector is associated with reference picture list 0.

[0234] Clause 28: The method of clause 26, wherein the first initial motion vector is associated with reference picture list 1.

[0235] Clause 29: The method of clause 26, wherein a first initial motion vector is associated with reference picture list x, and the method further comprises determining that x is equal to 1 when the data indicates that the motion vector differential value for reference picture list 1 is forced to be equal to 0 and data of a syntax element for the motion vector differential value for reference picture list 1 is not decoded.

[0236] Clause 30: The method of clause 26, wherein a first initial motion vector is associated with reference picture list x, and the method further comprises a step of determining that x is equal to 1 when the data indicates that the motion vector differential value for reference picture list 1 is not forced to be equal to 0, and when data of the syntax element for the motion vector differential value for reference picture list 1 is decoded.

[0237] Clause 31: The method of clause 26, wherein a first initial motion vector is associated with reference picture list x, and the method further comprises a step of determining a value of x as being either 0 or 1 according to TM costs of the motion vector for reference picture list 0 and reference picture list 1.

[0238] Clause 32: The method of clause 31, wherein determining the value of x comprises determining that x is equal to 0 when the TM cost of the motion vector for reference picture list 0 is less than the TM cost of the motion vector for reference picture list 1.

[0239] Clause 33: The method of clause 31, wherein determining the value of x comprises determining that x is equal to 0 when the TM cost of the motion vector for reference picture list 1 is less than the TM cost of the motion vector for reference picture list 0.

[0240] Clause 34: The method of any of clauses 1 to 33, further comprising refining the decoded data representing the motion vectors using bilateral matching to form an initial motion vector.

[0241] Clause 35: The method of any of clauses 1 to 33, further comprising the step of refining the refined motion vector using bilateral matching to form a further refined motion vector, and wherein decoding the current block comprises decoding the current block using the further refined motion vector.

[0242] Clause 36: The method of any of clauses 34 and 35, wherein bilateral matching and template matching share the same search scope.

[0243] Clause 37: Any of the methods of clauses 1 to 36, wherein the step of performing a template matching search process comprises a step of performing a template matching search process after determining that the adaptive motion vector resolution (AMVR) mode is not a 4-pixel mode.

[0244] Clause 38: The method of any of clauses 1 to 36, wherein the step of performing a template matching search process comprises the step of performing a template matching search process after determining that the adaptive motion vector resolution (AMVR) mode is greater than 2 pixel mode.

[0245] Clause 39: The method of any of clauses 1 to 38, further comprising the step of encoding the current block prior to decoding the current block.

[0246] Clause 40: A device for decoding video data, the device comprising one or more means for performing the methods of any of clauses 1 to 39.

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

[0248] Clause 42: The device of any of clauses 40 and 41, further comprising a display configured to display the decoded video data.

[0249] Clause 43: The device of any of clauses 40 to 42, wherein the device comprises one or more of a camera, a computer, a mobile device, a broadcast receiver device, or a set-top box.

[0250] Clause 44: The device of clauses 40 to 43, further comprising a memory configured to store video data.

[0251] Clause 45: A computer-readable storage medium having stored thereon instructions that, when executed, cause a processor of a device for decoding video data to perform any of the methods of clauses 1 to 39.

[0252] Clause 46: A device for decoding video data, comprising: means for decoding data representing an initial motion vector for a current block of the video data, the initial motion vector having integer motion vector differential (MVD) precision; means for determining a search range around a reference area identified by the initial motion vector in a reference picture; means for performing a template matching search process in the search range to identify a best matching region; means for determining error values ​​of adjacent pixels to the best matching region; means for using the error values ​​of the adjacent pixels to perform a model-based fractional-pixel motion vector refinement to derive motion vector differential values; means for applying at least one of the motion vector differential values ​​to the initial motion vector to determine an improved motion vector for the current block; and means for decoding the current block using the improved motion vector.

[0253] Clause 47: A method for decoding video data, comprising the steps of: decoding data representing an initial motion vector for a current block of the video data, the initial motion vector having integer motion vector differential (MVD) precision; determining a search range around a reference area identified by the initial motion vector in a reference picture; performing a template matching search process in the search range to identify a best matching region; determining error values ​​of adjacent pixels to the best matching region; performing a model-based fractional pixel error vector refinement using the error values ​​of the adjacent pixels to derive motion vector differential values; applying at least one of the motion vector differential values ​​to the initial motion vector to determine an improved motion vector for the current block; and decoding the current block using the improved motion vector.

[0254] Clause 48: The method of clause 47, wherein the motion vector differential value includes a horizontal motion vector differential value and a vertical motion vector differential value.

[0255] Clause 49: The method of clause 47, wherein applying at least one of the motion vector difference values ​​comprises applying all of the motion vector difference values.

[0256] Clause 50: The method of clause 47, wherein the step of applying at least one of the motion vector differential values ​​comprises the steps of determining that an error value of the best matching region is not equal to 0, and in response to determining that an absolute value of a difference between a component of the initial motion vector and the corresponding motion vector differential value for that component is less than the corresponding search region value for that component, applying the motion vector differential value for that component to that component.

[0257] Clause 51: The method of clause 47, wherein the step of applying at least one of the motion vector difference values ​​comprises a step of preventing applying the motion vector difference value for that component to the component in response to determining at least one of: an error value for the best matching region is equal to 0; or an absolute value of a difference between a component of the initial motion vector and a corresponding motion vector difference value for that component is greater than or equal to a corresponding search region value for that component.

[0258] Clause 52: The method of clause 47, wherein the step of performing model-based fractional-pixel motion vector refinement comprises performing model-based fractional-pixel motion vector refinement in response to determining each of: the initial motion vector is a coding unit (CU) level merge mode using bi-predictive motion vectors; a first reference picture for the current block has a display order value that is less than a display order value of the current picture containing the current block; a second reference picture for the current block has a display order value that is greater than a display order value of the current picture; temporal distances between the current picture and the first and second reference pictures are equal; the current block has more than 64 luma pixels; a height of the current block is at least 8 luma pixels; a width of the current block is at least 8 luma pixels; weight values ​​for bi-prediction using CU level weights (BCW) are equal; weighted prediction (WP) is not enabled for the current block; and a composite intra-inter prediction (CIIP) mode is not used for the current block.

[0259] Clause 53: The method of clause 47, wherein the step of performing model-based fractional-pixel motion vector refinement comprises performing model-based fractional-pixel motion vector refinement in response to determining at least one of: 1) that the initial motion vector has been refined using bilateral match or decoder-side motion vector (DMVR) refinement, or 2) that the refined motion vector is further refined using bilateral match or DMVR.

[0260] Clause 54: The step of performing model-based fractional-pixel motion vector refinement includes: 1) the initial motion vector was not refined using bilateral match or decoder-side motion vector (DMVR) refinement; 2) the refined motion vector is not further refined using bilateral match or DMVR; or 3) the initial motion vector is a coding unit (CU) level merge mode using bi-predictive motion vectors; a first reference picture for the current block has a display order value that is less than a display order value of a current picture that contains the current block; a second reference picture for the current block has a display order value that is greater than a display order value of the current picture; and the temporal distance between the first and second reference pictures is equal, the current block has more than 64 luma pixels, a height of the current block is at least 8 luma pixels, a width of the current block is at least 8 luma pixels, weight values ​​for bi-prediction with CU level weights (BCW) are equal, weighted prediction (WP) is not enabled for the current block, and a composite intra-inter prediction (CIIP) mode is not used for the current block are not true.

[0261] Clause 55: The motion vector difference value comprises a horizontal motion vector difference (Δx) and a vertical motion vector difference (Δy), and the error value of the adjacent pixel is E x,y and the step of determining the error value comprises E x, y =A(x -Δx) 2 +B(y -Δy) 2 +C, and performing model-based fractional-pixel motion vector refinement comprises the step of calculating s*floor((α(E -1,0 -E 1,0 )) / (2(E -1,0 +E 1,0 -2E 0,0))) and calculating Δx according to s*floor((α(E 0,-1 -E 0,1 )) / (2(E 0,-1 +E 0,1 -2E 0,0 48. The method of claim 47, comprising: calculating Δy according to (Δx, Δy) according to (a)), wherein α is an integer scaling factor introduced to express (Δx, Δy) with some fractional-pel precision, and s is the scaling value.

[0262] Clause 56: The method of clause 55, further comprising determining the value of α as equal to 16, regardless of whether a half-pixel interpolation filter is used.

[0263] Clause 57: The method of clause 55, further comprising determining a value of α according to an adaptive motion vector resolution (AMVR) mode for the current block.

[0264] Clause 58: The method of clause 55, further comprising determining a value of α according to whether a half-pixel interpolation filter is used.

[0265] Clause 59: The method of clause 47, wherein the current block is bi-predicted, the initial motion vector comprises a first initial motion vector, and the refined motion vector comprises a first refined motion vector, and the method further comprises the step of refining a second initial motion vector for the current block using the first refined motion vector.

[0266] Clause 60: The method of clause 47, further comprising refining the decoded data representing the motion vectors using bilateral matching to form an initial motion vector.

[0267] Clause 61: The method of clause 47, further comprising the step of refining the refined motion vector using bilateral matching to form a further refined motion vector, and wherein decoding the current block comprises decoding the current block using the further refined motion vector.

[0268] Clause 62: The method of clause 47, wherein the step of performing a template matching search process comprises the step of performing a template matching search process after determining that the adaptive motion vector resolution (AMVR) mode is not a 4 pixel mode.

[0269] Clause 63: The method of clause 47, further comprising the step of encoding the current block prior to decoding the current block.

[0270] Clause 64: A device for decoding video data, the device comprising: a memory configured to store the video data; and one or more processors implemented in circuitry, the one or more processors configured to decode data representing an initial motion vector for a current block of the video data, the initial motion vector having integer motion vector differential (MVD) precision, determine a search range around a reference area identified by the initial motion vector in a reference picture, perform a template matching search process in the search range to identify a best matching region, determine error values ​​of adjacent pixels to the best matching region, perform a model-based fractional-pixel motion vector refinement using the error values ​​of the adjacent pixels to derive motion vector difference values, apply at least one of the motion vector difference values ​​to the initial motion vector to determine an improved motion vector for the current block, and decode the current block using the improved motion vector.

[0271] Clause 65: The device of clause 64, wherein to apply at least one of the motion vector differential values, the one or more processors are configured to apply the motion vector differential value for a component to a component in response to determining that an error value of the best matching region is not equal to zero and determining that an absolute value of a difference between a component of the initial motion vector and a corresponding motion vector differential value for that component is less than a corresponding search region value for that component.

[0272] Clause 66: The device of clause 64, wherein the one or more processors are configured to perform model-based fractional-pixel motion vector refinement in response to determining each of: the initial motion vector is a coding unit (CU) level merge mode using bi-predictive motion vectors; a first reference picture for the current block has a display order value less than a display order value of a current picture containing the current block; a second reference picture for the current block has a display order value greater than a display order value of the current picture; temporal distances between the current picture and the first and second reference pictures are equal; the current block has more than 64 luma pixels; a height of the current block is at least 8 luma pixels; a width of the current block is at least 8 luma pixels; weight values ​​for bi-prediction using CU level weights (BCW) are equal; weighted prediction (WP) is not enabled for the current block; and a composite intra-inter prediction (CIIP) mode is not used for the current block.

[0273] Clause 67: The motion vector difference value comprises a horizontal motion vector difference (Δx) and a vertical motion vector difference (Δy), and the error value of the adjacent pixel is E x,y and one or more processors for determining the error value include: x, y =A(x -Δx) 2 +B(y -Δy) 2 +C, and for performing model-based fractional-pixel motion vector refinement, the one or more processors are configured to calculate s*floor((α(E -1,0 -E 1,0 )) / (2(E -1,0 +E 1,0 -2E 0,0 Calculate Δx according to s*floor((α(E 0,-1 -E 0,1 )) / (2(E 0,-1 +E 0,1 -2E 0,0))) and determining a value of α as equal to 16 regardless of whether a half-pixel interpolation filter is used or not, where α is an integer scaling factor introduced to express (Δx, Δy) with some fractional-pel precision, and s is the scaling value.

[0274] Clause 68: The device of clause 64, wherein the one or more processors are further configured to refine the decoded data representing the motion vectors using bilateral matching to form an initial motion vector.

[0275] Clause 69: The device of clause 64, wherein the one or more processors are further configured to refine the refined motion vector using bilateral matching to form a further refined motion vector, and the one or more processors are configured to decode the current block using the further refined motion vector.

[0276] Clause 70: The device of clause 64, wherein the one or more processors are configured to perform a template matching search process after determining that the adaptive motion vector resolution (AMVR) mode is not a 4-pixel mode.

[0277] Clause 71: The device of clause 64, further comprising a display configured to display the decoded video data.

[0278] Clause 72: The device of clause 64, wherein the device comprises one or more of a camera, a computer, a mobile device, a broadcast receiver device, or a set-top box.

[0279] Clause 73: A computer-readable storage medium storing instructions that, when executed, cause a processor of a device for decoding video data to decode data representing an initial motion vector for a current block of the video data, the initial motion vector having integer motion vector differential (MVD) precision, determine a search range around a reference area identified by the initial motion vector in a reference picture, perform a template matching search process in the search range to identify a best matching region, determine error values ​​of adjacent pixels to the best matching region, perform a model-based fractional-pixel motion vector refinement using the error values ​​of the adjacent pixels to derive motion vector differential values, apply at least one of the motion vector differential values ​​to the initial motion vector to determine an improved motion vector for the current block, and decode the current block using the improved motion vector.

[0280] Clause 74: The computer-readable storage medium of clause 73, comprising instructions that cause the processor to apply at least one of the motion vector differential values, the instructions causing the processor to determine that an error value of the best matching region is not equal to zero, and in response to determining that an absolute value of a difference between a component of the initial motion vector and the corresponding motion vector differential value for that component is less than the corresponding search region value for that component, apply the motion vector differential value for that component to the component.

[0281] Clause 75: The computer-readable storage medium of clause 73, comprising instructions for causing a processor to perform model-based fractional-pixel motion vector refinement in response to determining each of: an initial motion vector is a coding unit (CU) level merge mode using bi-predictive motion vectors; a first reference picture for the current block has a display order value that is less than a display order value of a current picture that includes the current block; a second reference picture for the current block has a display order value that is greater than a display order value of the current picture; temporal distances between the current picture and the first and second reference pictures are equal; the current block has more than 64 luma pixels; a height of the current block is at least 8 luma pixels; a width of the current block is at least 8 luma pixels; weight values ​​for bi-prediction using CU level weights (BCW) are equal; weighted prediction (WP) is not enabled for the current block; and a composite intra-inter prediction (CIIP) mode is not used for the current block.

[0282] Clause 76: The motion vector difference value comprises a horizontal motion vector difference (Δx) and a vertical motion vector difference (Δy), and the error value of the adjacent pixel is E x,y and instructions to the processor for determining an error value, the instructions including: x, y =A(x -Δx) 2 +B(y -Δy) 2 +C, and instructions for causing the processor to perform model-based fractional pixel motion vector refinement include instructions for causing the processor to calculate s*floor((α(E -1,0 -E 1,0 )) / (2(E -1,0 +E 1,0 -2E 0,0 ))) and calculate Δx according to s*floor((α(E 0,-1 -E 0,1 )) / (2(E 0,-1 +E 0,1 -2E 0,074. The computer-readable storage medium of claim 73, comprising instructions to calculate Δy according to a step (a) of the first arithmetic operation of claim 73, and to determine a value of α as equal to 16 regardless of whether a half-pixel interpolation filter is used or not, where α is an integer scaling factor introduced to express (Δx, Δy) with a certain fractional-pel precision, and s is the scaling value.

[0283] Clause 77: The computer-readable storage medium of clause 73, further comprising instructions that cause a processor to refine decoded data representing motion vectors using bilateral matching to form an initial motion vector.

[0284] Clause 78: The computer-readable storage medium of clause 73, further comprising instructions that cause the processor to refine the refined motion vector using bilateral matching to form a further refined motion vector, and the instructions that cause the processor to decode the current block comprise instructions that cause the processor to decode the current block using the further refined motion vector.

[0285] Clause 79: The computer-readable storage medium of clause 73, wherein the instructions for causing the processor to perform a template matching search process comprise instructions for causing the processor to perform a template matching search process after determining that the adaptive motion vector resolution (AMVR) mode is not a 4-pixel mode.

[0286] Clause 80: A device for decoding video data, comprising: means for decoding data representing an initial motion vector for a current block of the video data, the initial motion vector having integer motion vector differential (MVD) precision; means for determining a search range around a reference area identified by the initial motion vector in a reference picture; means for performing a template matching search process in the search range to identify a best matching region; means for determining error values ​​of neighboring pixels to the best matching region; means for using the error values ​​of the neighboring pixels to perform a model-based fractional-pixel motion vector refinement to derive motion vector differential values; means for applying at least one of the motion vector differential values ​​to the initial motion vector to determine an improved motion vector for the current block; and means for decoding the current block using the improved motion vector.

[0287] Clause 81: A method for decoding video data, comprising the steps of: decoding data representing an initial motion vector for a current block of the video data, the initial motion vector having integer motion vector differential (MVD) precision; determining a search range around a reference area identified by the initial motion vector in a reference picture; performing a template matching search process in the search range to identify a best matching region; determining error values ​​of adjacent pixels to the best matching region; performing a model-based fractional pixel error vector refinement using the error values ​​of the adjacent pixels to derive motion vector differential values; applying at least one of the motion vector differential values ​​to the initial motion vector to determine an improved motion vector for the current block; and decoding the current block using the improved motion vector.

[0288] Clause 82: The method of clause 81, wherein the motion vector differential value includes a horizontal motion vector differential value and a vertical motion vector differential value.

[0289] Clause 83: The method of any of clauses 81 and 82, wherein applying at least one of the motion vector difference values ​​comprises applying all of the motion vector difference values.

[0290] Clause 84: The method of any of clauses 81 and 82, wherein the step of applying at least one of the motion vector differential values ​​comprises the steps of determining that an error value of the best matching region is not equal to 0, and in response to determining that an absolute value of the difference between a component of the initial motion vector and the corresponding motion vector differential value for that component is less than the corresponding search region value for that component, applying the motion vector differential value for that component to that component.

[0291] Clause 85: The method of any of clauses 81 and 82, wherein the step of applying at least one of the motion vector difference values ​​comprises a step of preventing applying the motion vector difference value for that component to the component in response to determining at least one of: an error value for the best matching region is equal to 0; or an absolute value of a difference between a component of the initial motion vector and a corresponding motion vector difference value for that component is greater than or equal to a corresponding search region value for that component.

[0292] Clause 86: The method of any of clauses 81 to 85, wherein the step of performing the model-based fractional-pixel motion vector refinement comprises performing the model-based fractional-pixel motion vector refinement in response to determining each of: the initial motion vector is a coding unit (CU) level merge mode using bi-predictive motion vectors; a first reference picture for the current block has a display order value that is less than a display order value of the current picture containing the current block; a second reference picture for the current block has a display order value that is greater than a display order value of the current picture; temporal distances between the current picture and the first and second reference pictures are equal; the current block has more than 64 luma pixels; a height of the current block is at least 8 luma pixels; a width of the current block is at least 8 luma pixels; weight values ​​for bi-prediction using CU level weights (BCW) are equal; weighted prediction (WP) is not enabled for the current block; and a composite intra-inter prediction (CIIP) mode is not used for the current block.

[0293] Clause 87: Any of the methods of clauses 81 to 85, wherein the step of performing model-based fractional-pixel motion vector refinement comprises performing model-based fractional-pixel motion vector refinement in response to determining at least one of: 1) that the initial motion vector has been refined using bilateral match or decoder-side motion vector (DMVR) refinement, or 2) that the refined motion vector is further refined using bilateral match or DMVR.

[0294] Clause 88: The step of performing model-based fractional-pixel motion vector refinement includes: 1) the initial motion vector was not refined using bilateral match or decoder-side motion vector (DMVR) refinement; 2) the refined motion vector is not further refined using bilateral match or DMVR; or 3) the initial motion vector is a coding unit (CU) level merge mode using bi-predictive motion vectors; a first reference picture for the current block has a display order value that is smaller than a display order value of a current picture that includes the current block; a second reference picture for the current block has a display order value that is larger than a display order value of the current picture; 86. The method of any of clauses 81 to 85, comprising performing model-based fractional-pixel motion vector refinement in response to determining that at least one of: the temporal distances between the current block and the second reference picture are equal; the current block has more than 64 luma pixels; the height of the current block is at least 8 luma pixels; the width of the current block is at least 8 luma pixels; the weight values ​​for bi-prediction with CU level weights (BCW) are equal; weighted prediction (WP) is not enabled for the current block; and a composite intra-inter prediction (CIIP) mode is not used for the current block is not true.

[0295] Clause 89: The motion vector difference value comprises a horizontal motion vector difference (Δx) and a vertical motion vector difference (Δy), and the error value of the adjacent pixel is E x,y and the step of determining the error value comprises E x, y =A(x -Δx) 2 +B(y -Δy) 2 +C, and performing model-based fractional-pixel motion vector refinement comprises the step of calculating s*floor((α(E -1,0 -E 1,0 )) / (2(E -1,0 +E 1,0 -2E 0,0))) and calculating Δx according to s*floor((α(E 0,-1 -E 0,1 )) / (2(E 0,-1 +E 0,1 -2E 0,0 89. The method of any of clauses 81 to 88, comprising: calculating Δy according to

[0296] Clause 90: The method of clause 89, further comprising determining the value of α as equal to 16, regardless of whether a half-pixel interpolation filter is used.

[0297] Clause 91: The method of any of clauses 89 and 90, further comprising determining a value of α in accordance with an adaptive motion vector resolution (AMVR) mode for the current block.

[0298] Clause 92: The method of any of clauses 89 and 91, further comprising determining a value of α according to whether a half-pixel interpolation filter is used.

[0299] Clause 93: The method of any of clauses 81 to 92, wherein the current block is bi-predicted, the initial motion vector comprises a first initial motion vector, and the refined motion vector comprises a first refined motion vector, and the method further comprises the step of refining a second initial motion vector for the current block using the first refined motion vector.

[0300] Clause 94: The method of any of clauses 81 to 93, further comprising refining the decoded data representing the motion vectors using bilateral matching to form an initial motion vector.

[0301] Clause 95: The method of any of clauses 81 to 93, further comprising the step of refining the refined motion vector using bilateral matching to form a further refined motion vector, and wherein decoding the current block comprises decoding the current block using the further refined motion vector.

[0302] Clause 96: The method of any of clauses 81 to 95, wherein the step of performing a template matching search process comprises the step of performing a template matching search process after determining that the adaptive motion vector resolution (AMVR) mode is not a 4-pixel mode.

[0303] Clause 97: The method of any of clauses 81 to 96, further comprising the step of encoding the current block prior to decoding the current block.

[0304] Clause 98: A device for decoding video data, the device comprising: a memory configured to store the video data; and one or more processors implemented in circuitry, the one or more processors configured to decode data representing an initial motion vector for a current block of the video data, the initial motion vector having integer motion vector differential (MVD) precision, determine a search range around a reference area identified by the initial motion vector in a reference picture, perform a template matching search process in the search range to identify a best matching region, determine error values ​​of adjacent pixels to the best matching region, perform a model-based fractional-pixel motion vector refinement using the error values ​​of the adjacent pixels to derive motion vector differential values, apply at least one of the motion vector differential values ​​to the initial motion vector to determine an improved motion vector for the current block, and decode the current block using the improved motion vector.

[0305] Clause 99: The device of clause 98, wherein to apply at least one of the motion vector differential values, the one or more processors are configured to apply the motion vector differential value for a component to a component in response to determining that an error value of the best matching region is not equal to zero and determining that an absolute value of a difference between a component of the initial motion vector and the corresponding motion vector differential value for that component is less than the corresponding search region value for that component.

[0306] Clause 100: The device of any of clauses 98 and 99, wherein the one or more processors are configured to perform model-based fractional-pixel motion vector refinement in response to determining each of: an initial motion vector is a coding unit (CU) level merge mode using bi-predictive motion vectors; a first reference picture for the current block has a display order value that is less than a display order value of a current picture that includes the current block; a second reference picture for the current block has a display order value that is greater than a display order value of the current picture; temporal distances between the current picture and the first and second reference pictures are equal; the current block has more than 64 luma pixels; a height of the current block is at least 8 luma pixels; a width of the current block is at least 8 luma pixels; weight values ​​for bi-prediction using CU level weights (BCW) are equal; weighted prediction (WP) is not enabled for the current block; and a composite intra-inter prediction (CIIP) mode is not used for the current block.

[0307] Clause 101: The motion vector difference value comprises a horizontal motion vector difference (Δx) and a vertical motion vector difference (Δy), and the error value of the adjacent pixel is E x,y and one or more processors for determining the error value include: x, y =A(x -Δx) 2 +B(y -Δy) 2+C, and for performing model-based fractional-pixel motion vector refinement, the one or more processors are configured to calculate s*floor((α(E -1,0 -E 1,0 )) / (2(E -1,0 +E 1,0 -2E 0,0 Calculate Δx according to s*floor((α(E 0,-1 -E 0,1 )) / (2(E 0,-1 +E 0,1 -2E 0,0 ))) and determining a value of α as equal to 16 regardless of whether a half-pixel interpolation filter is used or not, where α is an integer scaling factor introduced to express (Δx, Δy) with some fractional-pel precision, and s is the scaling value.

[0308] Clause 102: The device of any of clauses 98 to 101, wherein the one or more processors are further configured to refine the decoded data representing the motion vectors using bilateral matching to form an initial motion vector.

[0309] Clause 103: The device of any of clauses 98 to 102, wherein the one or more processors are further configured to refine the refined motion vector using bilateral matching to form a further refined motion vector, and the one or more processors are configured to decode the current block using the further refined motion vector.

[0310] Clause 104: The device of any of clauses 98 to 103, wherein the one or more processors are configured to perform a template matching search process after determining that the adaptive motion vector resolution (AMVR) mode is not a 4-pixel mode.

[0311] Clause 105: The device of any of clauses 98 to 104, further comprising a display configured to display the decoded video data.

[0312] Clause 106: The device of any of clauses 98 to 105, wherein the device comprises one or more of a camera, a computer, a mobile device, a broadcast receiver device, or a set-top box.

[0313] Clause 107: A computer-readable storage medium storing instructions that, when executed, cause a processor of a device for decoding video data to decode data representing an initial motion vector for a current block of the video data, the initial motion vector having integer motion vector differential (MVD) precision, determine a search range around a reference area identified by the initial motion vector in a reference picture, perform a template matching search process in the search range to identify a best matching region, determine error values ​​of adjacent pixels to the best matching region, perform a model-based fractional-pixel motion vector refinement using the error values ​​of the adjacent pixels to derive motion vector differential values, apply at least one of the motion vector differential values ​​to the initial motion vector to determine an improved motion vector for the current block, and decode the current block using the improved motion vector.

[0314] Clause 108: The computer-readable storage medium of clause 107, comprising instructions that cause the processor to apply at least one of the motion vector differential values, the instructions causing the processor to determine that an error value of the best matching region is not equal to zero, and in response to determining that an absolute value of a difference between a component of the initial motion vector and the corresponding motion vector differential value for that component is less than the corresponding search region value for that component, apply the motion vector differential value for that component to the component.

[0315] Clause 109: The computer-readable storage medium of any of clauses 107 and 108, comprising instructions for causing a processor to perform model-based fractional-pixel motion vector refinement in response to determining each of: an initial motion vector is a coding unit (CU) level merge mode using bi-predictive motion vectors; a first reference picture for the current block has a display order value that is less than a display order value of a current picture that includes the current block; a second reference picture for the current block has a display order value that is greater than a display order value of the current picture; temporal distances between the current picture and the first and second reference pictures are equal; the current block has more than 64 luma pixels; a height of the current block is at least 8 luma pixels; a width of the current block is at least 8 luma pixels; weight values ​​for bi-prediction using CU level weights (BCW) are equal; weighted prediction (WP) is not enabled for the current block; and a composite intra-inter prediction (CIIP) mode is not used for the current block.

[0316] Clause 110: The motion vector difference value comprises a horizontal motion vector difference (Δx) and a vertical motion vector difference (Δy), and the error value of the adjacent pixel is E x,y and instructions to the processor for determining an error value, the instructions including: x, y =A(x -Δx) 2 +B(y -Δy) 2 +C, and instructions for causing the processor to perform model-based fractional pixel motion vector refinement include instructions for causing the processor to calculate s*floor((α(E -1,0 -E 1,0 )) / (2(E -1,0 +E 1,0 -2E 0,0 ))) and calculate Δx according to s*floor((α(E 0,-1 -E 0,1 )) / (2(E 0,-1 +E 0,1 -2E 0,0109. The computer-readable storage medium of any of clauses 107 to 109, comprising instructions to calculate Δy according to a step (a) of the first arithmetic unit (1) and to determine a value of α as equal to 16 regardless of whether a half-pixel interpolation filter is used or not, where α is an integer scaling factor introduced to express (Δx, Δy) with a certain fractional-pel precision, and s is the scaling value.

[0317] Clause 111: The computer-readable storage medium of any of clauses 107 to 110, further comprising instructions that cause a processor to refine decoded data representing motion vectors using bilateral matching to form an initial motion vector.

[0318] Clause 112: The computer-readable storage medium of any of clauses 107 to 111, further comprising instructions that cause the processor to refine the refined motion vector using bilateral matching to form a further refined motion vector, and the instructions that cause the processor to decode the current block comprise instructions that cause the processor to decode the current block using the further refined motion vector.

[0319] Clause 113: The computer-readable storage medium of any of clauses 107 to 112, wherein the instructions for causing the processor to perform a template matching search process include instructions for causing the processor to perform a template matching search process after determining that the adaptive motion vector resolution (AMVR) mode is not a 4-pixel mode.

[0320] Clause 114: A device for decoding video data, comprising: means for decoding data representing an initial motion vector for a current block of the video data, the initial motion vector having integer motion vector differential (MVD) precision; means for determining a search range around a reference area identified by the initial motion vector in a reference picture; means for performing a template matching search process in the search range to identify a best matching region; means for determining error values ​​of neighboring pixels to the best matching region; means for using the error values ​​of the neighboring pixels to perform a model-based fractional-pixel motion vector refinement to derive motion vector differential values; means for applying at least one of the motion vector differential values ​​to the initial motion vector to determine an improved motion vector for the current block; and means for decoding the current block using the improved motion vector.

[0321] It should be appreciated that in some examples, some acts or events of any of the techniques described herein may be performed in a different order, or may be added, combined, or omitted entirely (e.g., not all acts or events described are necessary to the practice of the techniques). Moreover, in some examples, acts or events may be performed simultaneously rather than sequentially, for example, through multi-threaded processing, interrupt processing, or multiple processors.

[0322] In one or more examples, the functions described may be implemented in hardware, software, firmware, or any combination thereof. If implemented in software, the functions may be stored on or transmitted via a computer-readable medium as one or more instructions or code and executed by a hardware-based processing unit. The computer-readable medium may include a computer-readable storage medium, which corresponds to a tangible medium, such as a data storage medium, or a communication medium, which includes any medium that facilitates the transfer of a computer program from one place to another, for example, according to a communication protocol. In this manner, the computer-readable medium may generally correspond to (1) a tangible computer-readable storage medium that is non-transitory, or (2) a communication medium, such as a signal or carrier wave. The data storage medium may be any available medium 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 may include a computer-readable medium.

[0323] By way of example and not limitation, such computer-readable storage media may comprise RAM, ROM, EEPROM, CD-ROM or other optical disk storage, magnetic disk storage or other magnetic storage devices, flash memory, or any other 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 connection is properly referred to as a computer-readable medium. For example, if instructions are transmitted from a website, server, or other remote source using coaxial cable, fiber optic cable, twisted pair, digital subscriber line (DSL), or wireless technologies such as infrared, radio, and microwave, the coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwave are included within the definition of the medium. However, it should be understood that computer-readable storage media and data storage media do not include connections, carrier waves, signals, or other transitory media, but instead cover non-transitory tangible storage media. As used herein, disk and disc include compact disc (CD), laser disc, optical disc, digital versatile disc (DVD), floppy disk, and Blu-ray disc, where disks typically reproduce data magnetically and discs reproduce data optically using lasers. Combinations of the above should also be included within the scope of computer readable media.

[0324] The instructions may be executed by one or more processors, such as one or more digital signal processors (DSPs), general-purpose microprocessors, application specific integrated circuits (ASICs), field programmable gate arrays (FPGAs), or other equivalent integrated or discrete logic circuitry. Thus, the terms "processor" and "processing circuitry" as used herein may refer to any of the above structures, or any other structures suitable for implementing the techniques described herein. In addition, in some aspects, the functionality described herein may be provided within dedicated hardware and / or software modules configured for encoding and decoding, or may be incorporated into a composite codec. Also, the techniques may be fully implemented in one or more circuits or logic elements.

[0325] The techniques of the present disclosure may be implemented in a wide variety of devices or apparatuses, including wireless handsets, integrated circuits (ICs), or sets of ICs (e.g., chipsets). Although various components, modules, or units have been described in this disclosure to highlight functional aspects of devices configured to perform the disclosed techniques, they do not necessarily require realization by different hardware units. Rather, as described above, the various units may be combined in a codec hardware unit or may be provided by a collection of interoperable hardware units, including one or more processors as described above, along with appropriate software and / or firmware.

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

[0327] 102 Source Device 104 Video Sources 106 Memory 108 Output Interface 110 Computer-readable medium 112 Storage Devices 114 File Server 116 Destination Device 118 Display Devices 120 Memory 122 Input Interface 130 QTBT structure 132 Coding Tree Units 150 blocks 152 blocks 154 Center Block 170 blocks 172 blocks 180 See L0 182 See L1 200 Video Encoder 202 Mode Selection Unit 204 Residual Generation Unit 206 Conversion Processing Unit 208 Quantization Units 210 Inverse Quantization Unit 212 Inverse Transformation Processing Unit 214 Reconstruction Unit 216 Filter unit 218 Decoded Picture Buffer 220 Entropy Coding Unit 222 Motion Estimation Unit 224 Motion Compensation Unit 226 intra prediction units 230 Video Data Memory 300 Video Decoder 302 Entropy Decoding Unit 304 Prediction Processing Unit 306 Inverse Quantization Unit 308 Inverse Transformation Processing Unit 310 Reconstruction Unit 312 Filter unit 314 DPB 316 Motion Compensation Unit 318 Intra Prediction Units 320 CPB memory

Claims

1. 1. A method for decoding video data, comprising the steps of: determining an initial motion vector for a current block of video data, the initial motion vector having integer motion vector differential (MVD) precision; determining a search range around a reference area around said initial motion vector in a reference picture; performing a template matching search process using integer precision samples in the search range to identify a best matching region without using fractional samples in the search range during the template matching search process; determining error values ​​for adjacent pixels in the best matching region; using the error values ​​of the neighboring pixels to perform a model-based fractional-pixel motion vector refinement to derive motion vector difference values, at least one of the motion vector difference values ​​comprising a non-zero fractional value; applying at least one of the motion vector differential values ​​to the initial motion vector to determine a refined motion vector for the current block, the refined motion vector identifying a fractional sample location within the reference picture; and decoding the current block using the refined motion vector.

2. The method of claim 1 , wherein the motion vector difference values ​​include horizontal motion vector difference values ​​and vertical motion vector difference values.

3. The method of claim 1 , wherein applying the at least one of the motion vector difference values ​​comprises applying all of the motion vector difference values.

4. applying the at least one of the motion vector differential values determining that the error value of the best matching region is not equal to zero; and in response to determining that an absolute value of a difference between a component of the initial motion vector and a corresponding motion vector difference value for the component is less than a corresponding search area value for the component, applying the motion vector difference value for the component to the component.

5. 2. The method of claim 1 , wherein the step of applying the at least one of the motion vector difference values ​​comprises the step of preventing applying the motion vector difference value for the component to the component in response to determining at least one of: an error value of the best matching region is equal to 0; or an absolute value of a difference between a component of the initial motion vector and a corresponding motion vector difference value for the component is greater than or equal to a corresponding search region value for the component.

6. 2. The method of claim 1, wherein performing the model-based fractional-pixel motion vector refinement comprises performing the model-based fractional-pixel motion vector refinement in response to determining each of: the initial motion vector is a coding unit (CU) level merge mode using bi-predictive motion vectors; a first reference picture for the current block has a display order value that is less than a display order value of a current picture containing the current block; a second reference picture for the current block has a display order value that is greater than the display order value of the current picture; temporal distances between the current picture and the first and second reference pictures are equal; the current block has more than 64 luma pixels; a height of the current block is at least 8 luma pixels; a width of the current block is at least 8 luma pixels; weight values ​​for bi-prediction with CU level weights (BCW) are equal;

7. 2. The method of claim 1, wherein the current block is bi-predicted, the initial motion vector comprises a first initial motion vector, and the refined motion vector comprises a first refined motion vector, the method further comprising: refining a second initial motion vector for the current block using the first refined motion vector.

8. 1. A device for decoding video data, comprising: a memory configured to store video data; and one or more processors implemented in a circuit, the one or more processors comprising: determining an initial motion vector for the current block of video data, the initial motion vector having integer motion vector differential (MVD) precision; determining a search range around a reference area around the initial motion vector in a reference picture; performing a template matching search process using integer precision samples in the search range to identify a best matching region without using fractional samples in the search range during the template matching search process; determining error values ​​for adjacent pixels within the best matching region; performing a model-based fractional-pixel motion vector refinement using the error values ​​of the neighboring pixels to derive motion vector difference values, at least one of the motion vector difference values ​​comprising a non-zero fractional value; applying at least one of the motion vector differential values ​​to the initial motion vector to determine a refined motion vector for the current block, the refined motion vector identifying a fractional sample location within the reference picture; Decoding the current block using the improved motion vector. The device is configured to:

9. To apply the at least one of the motion vector differential values, the one or more processors: determining that the error value of the best matching region is not equal to zero; 9. The device of claim 8, configured to apply the motion vector difference value for a component to the component in response to determining that an absolute value of a difference between a component of the initial motion vector and a corresponding motion vector difference value for the component is less than a corresponding search area value for the component.

10. 10. The device of claim 8, wherein the one or more processors are configured to perform the model-based fractional-pixel motion vector refinement in response to determining each of: the initial motion vector is a coding unit (CU) level merge mode with bi-predictive motion vectors; a first reference picture for the current block has a display order value that is less than a display order value of a current picture that contains the current block; a second reference picture for the current block has a display order value that is greater than the display order value of the current picture; temporal distances between the current picture and the first and second reference pictures are equal; the current block has more than 64 luma pixels; a height of the current block is at least 8 luma pixels; a width of the current block is at least 8 luma pixels; weight values ​​for bi-prediction with CU level weights (BCW) are equal;

11. 10. The device of claim 8, wherein the one or more processors are further configured to refine the decoded data representing the motion vectors using bilateral matching to form the initial motion vector.

12. 10. The device of claim 8, wherein the one or more processors are further configured to refine the refined motion vector using bilateral matching to form a further refined motion vector, and wherein the one or more processors are configured to decode the current block using the further refined motion vector.

13. The device of claim 8 , further comprising a display configured to display the decoded video data.

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

15. A computer readable storage medium having stored thereon instructions which, when executed, cause a processor of a device for decoding video data to perform the method of any one of claims 1 to 7.