Template Matching in Video Coding
By iteratively adjusting the step size to match motion vector precision, the complexity and rounding errors in motion vector refinement are reduced, enhancing coding performance.
Patent Information
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2021-12-22
- Publication Date
- 2026-03-03
AI Technical Summary
Starting the motion vector refinement process with a ¼-pel step size introduces undesirable complexity and rounding errors, leading to lower coding gain in certain scenarios.
Iteratively reduce the step size from an initial step size to a final step size equal to the motion vector precision, aligning the finest motion vector precision with the motion vector being refined.
Reduces complexity and rounding errors, improving coding performance by aligning motion vector precision in template matching processes.
Smart Images

Figure 0007823047000003 
Figure 0007823047000004 
Figure 0007823047000005
Abstract
Description
[Technical Field]
[0001] This application claims priority to U.S. Patent Application No. 17 / 558,119, filed December 21, 2021, and U.S. Provisional Patent Application No. 63 / 131,676, filed December 29, 2020, the entire contents of which are incorporated herein by reference. U.S. Patent Application No. 17 / 558,119, filed December 21, 2021, claims the benefit of U.S. Provisional Patent Application No. 63 / 131,676, filed December 29, 2020.
[0002] TECHNICAL FIELD This disclosure relates to video encoding and 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 radiotelephones, so-called "smartphones," video teleconferencing devices, video streaming devices, etc. Digital video devices implement video coding techniques such as those 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 are also sometimes 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 Patent Application No. 63 / 129,221 Summary of the Invention [Problem to be solved by the invention]
[0006] The video decoder may be configured to perform template matching. When decoding video data according to the template matching mode, some or all of the motion information for a block is not signaled but instead derived by the video decoder. Template matching may be performed for one or both of selecting a motion vector candidate from a candidate list or motion vector refinement. Template matching may be applied in both the advanced motion vector predictor (AMVP) mode and the normal merge mode. In the AMVP mode, a motion vector predictor (MVP) candidate may be selected from a list of candidates using template matching to identify the candidate in the list that has the smallest difference between the current block template and the reference block template. In the normal merge mode, a template matching mode flag may be signaled to indicate the use of template matching, and template matching may then be used for motion vector refinement of the motion vector selected from the merge candidate list.
[0007] When performing template matching, the video decoder finds the closest match between a reference template in the current picture (a neighboring block above and / or to the left of the current CU) and a corresponding template region in a reference picture search area that is the same size as the reference template. The search area in the reference picture may, for example, be identified for the current CU.
[0008] As introduced above, a video decoder may be configured to perform motion vector refinement. Some motion vector refinement processes utilize a pattern-based motion vector search process that may include a hierarchical structure. Using a specified search pattern, the video decoder determines a template matching cost relative to a reference template and corresponding template regions in the current picture. The hierarchical structure specifies an iterative process for motion refinement that starts at a coarse precision (e.g., ¼ pel) and ends at a fine precision (e.g., ⅛ pel). In one example, the video decoder may be configured to first search for motion vectors at ¼ luma sample precision using a diamond pattern, followed by ¼ luma sample precision using a cross pattern, and then ⅛ luma sample precision using a cross pattern.
[0009] Starting the motion vector refinement process with a quarter-pel step size may introduce both undesirable complexity and rounding errors in some coding scenarios, regardless of whether the motion vector precision of the motion vectors is improved. This may result in lower performance in terms of coding gain for those coding scenarios. To address this potential problem, this disclosure describes techniques for aligning the finest motion vector precision used in template matching with the motion vector precision of the motion vector being refined. By iteratively reducing the step size from an initial step size until the step size is set to a final step size equal to the motion vector precision, the techniques of this disclosure may yield the advantage of reducing the complexity and rounding errors introduced by the motion vector refinement process. [Means for solving the problem]
[0010] According to one example, a device for decoding video data includes one or more processors implemented in a circuit configuration, the one or more processors being configured to: determine that a current block of a current picture is coded in an inter-prediction mode; determine a motion vector for the current block based on the inter-prediction mode; determine motion vector accuracy for the motion vector; identify a current block template in the current picture; search within a search area for a final reference block template corresponding to the current block template, wherein to search within the search area, the one or more processors are further configured to identify an initial reference block template based on the motion vector, search other reference block templates around the initial reference block template using a step size set to the initial step size, and iteratively reduce the step size from the initial step size until the step size is set to a final step size equal to the motion vector accuracy; determine a predictive block for the current block based on the final reference block template; decode the current picture based on the determined predictive block; and output a decoded version of the current picture.
[0011] According to another example, a method for decoding video data includes determining that a current block of a current picture is coded in an inter-prediction mode, determining a motion vector for the current block based on the inter-prediction mode, determining a motion vector accuracy for the motion vector, identifying a current block template in the current picture, searching within a search area for a final reference block template corresponding to the current block template, wherein searching within the search area comprises identifying an initial reference block template based on the motion vector, searching other reference block templates around the initial reference block template using a step size set to the initial step size, and iteratively reducing the step size from the initial step size until the step size is set to a final step size equal to the motion vector accuracy, determining a predictive block for the current block based on the final reference block template, decoding the current picture based on the determined predictive block, and outputting a decoded version of the current picture.
[0012] According to another example, a computer-readable storage medium stores instructions that, when executed by one or more processors, cause the one or more processors to: determine that a current block of a current picture is coded in an inter-prediction mode; determine a motion vector for the current block based on the inter-prediction mode; determine motion vector accuracy for the motion vector; identify a current block template in the current picture; and search within a search area for a final reference block template corresponding to the current block template, wherein to search within the search area, the instructions cause the one or more processors to identify an initial reference block template based on the motion vector, search other reference block templates around the initial reference block template using a step size set to the initial step size, and iteratively reduce the step size from the initial step size until the step size is set to a final step size equal to the motion vector accuracy; determine a predictive block for the current block based on the final reference block template; decode the current picture based on the determined predictive block; and output a decoded version of the current picture.
[0013] According to another example, a device for decoding video data includes means for determining that a current block of a current picture is coded in an inter-prediction mode, means for determining a motion vector for the current block based on the inter-prediction mode, means for determining motion vector accuracy for the motion vector, means for identifying a current block template in the current picture, means for searching within a search area for a final reference block template corresponding to the current block template, wherein the means for searching within the search area includes means for identifying an initial reference block template based on the motion vector, means for searching other reference block templates around the initial reference block template using a step size set to the initial step size, and means for iteratively reducing the step size from the initial step size until the step size is set to a final step size equal to the motion vector accuracy, means for determining a predictive block for the current block based on the final reference block template, means for decoding the current picture based on the determined predictive block, and means for outputting a decoded version of the current picture.
[0014] 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 explanation of the drawings]
[0015] [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 illustrating a corresponding coding tree unit (CTU). [Figure 3A] FIG. 10 is a conceptual diagram illustrating spatial motion vector candidates for merge mode. [Figure 3B]FIG. 1 is a conceptual diagram illustrating spatial motion vector candidates for Advanced Motion Vector Prediction (AMVP) mode. [Figure 4A] FIG. 10 is a conceptual diagram illustrating temporal motion vector candidates. [Figure 4B] FIG. 1 is a conceptual diagram illustrating motion vector scaling. [Figure 5] FIG. 1 illustrates an exemplary template matching process. [Figure 6] FIG. 10 is a diagram illustrating an example of a motion vector difference with respect to a time distance. [Figure 7] FIG. 10 is a diagram illustrating an example of a motion vector difference with respect to a time distance. [Figure 8] FIG. 1 illustrates an exemplary search pattern for two-way matching. [Figure 9] FIG. 10 illustrates an exemplary decoding-side motion vector refinement process. [Figure 10] FIG. 10 illustrates an example of a merge mode with motion vector difference (MMVD) search points. [Figure 11] FIG. 2 is a block diagram illustrating an example video encoder that may perform the techniques of this disclosure. [Figure 12] FIG. 2 is a block diagram illustrating an example video decoder that may perform the techniques of this disclosure. [Figure 13] 10 is a flowchart illustrating an example process for encoding a current block, in accordance with techniques of this disclosure. [Figure 14] 10 is a flowchart illustrating an example process for decoding a current block in accordance with techniques of this disclosure. [Figure 15] 10 is a flowchart illustrating an example process for decoding a current block in accordance with techniques of this disclosure. DETAILED DESCRIPTION OF THE INVENTION
[0016] 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, a 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 an encoded bitstream. The compression achieved by the transform and quantization processes may be lossy, meaning that the transform and quantization processes may introduce distortion into the decoded video data.
[0017] 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 initially reconstructed block may have distortions or artifacts. One common type of artifact or distortion is called blockiness, where the boundaries of blocks used to code the video data are visible.
[0018] 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 coded video bitstream, or may be implicitly determined by the video decoder without the parameters having to be explicitly signaled in the coded video bitstream.
[0019] The video decoder may be configured to perform template matching. With this mode, some or all of the motion information for a block is not signaled but instead derived by the video decoder. Template matching may be performed for one or both of selecting a motion vector candidate from a candidate list or motion vector refinement. Template matching may be applied in both advanced motion vector predictor (AMVP) mode and normal merge mode. In AMVP mode, a motion vector predictor (MVP) candidate may be selected from a list of candidates using template matching to identify the candidate in the list that has the smallest difference between the current block template and the reference block template. In normal merge mode, a template matching mode flag may be signaled to indicate the use of template matching, and template matching may then be used for motion vector refinement of the motion vector selected from the merge candidate list.
[0020] When performing template matching, the video decoder finds the closest match between a reference template in the current picture (a neighboring block above and / or to the left of the current CU) and a corresponding template region in a reference picture search area that is the same size as the reference template. The search area in the reference picture may, for example, be identified for the current CU.
[0021] As introduced above, a video decoder may be configured to perform motion vector refinement. Motion vector refinement is a pattern-based motion vector search process with a hierarchical structure. Using a specified search pattern, the video decoder determines a template matching cost against a reference template and corresponding template regions in the current picture. The hierarchical structure specifies an iterative process for motion refinement that starts at a coarse precision (e.g., ¼ pel) and ends at a fine precision (e.g., ⅛ pel). In one example, the video decoder may be configured to first search for a motion vector at ¼ luma sample precision using a diamond pattern, followed by ¼ luma sample precision using a cross pattern, and then ⅛ luma sample precision using a cross pattern. The search range for motion vector refinement may be set equal to (−8, +8) luma samples around the initial motion vector, for example.
[0022] Starting the motion vector refinement process with a ¼-pel step size may introduce both undesirable complexity and rounding errors in some coding scenarios, regardless of whether the motion vector precision of the motion vector is improved, which may result in poorer performance in terms of coding gain for those coding scenarios. To address this potential issue, this disclosure describes techniques for aligning the finest motion vector precision used in template matching with the motion vector precision of the motion vector being refined. That is, for a determined motion vector precision (i.e., 4 pel, 1 pel, ½ pel, ¼ pel, ⅛ pel, 1 / 16 pel, etc. for all power-of-two precisions), a video decoder may be configured so that the template matching refinement process stops at and does not exceed the motion vector precision of the specified motion vector. Thus, the template matching refinement motion vector has a motion vector precision equal to or greater than the motion vector precision of the initial motion vector.
[0023] The initial step size of the template matching motion vector refinement process using a hierarchical search pattern may be determined based on the motion vector precision of the initial motion vector. The initial step size may be the same precision as or somewhat larger than the precision of the initial motion vector. Generally, when the initial motion vector has a motion vector precision of N pels (e.g., N is a power of two, including 4, 1, ½, ¼, ⅛, and 1 / 16), the initial step size may be M pels, where M pels is set equal to or somewhat larger than N, 2N, or 4N with a power-of-two scale. By iteratively reducing the step size from the initial step size until the step size is set to a final step size equal to the motion vector precision, the techniques of this disclosure may yield the advantages of reducing complexity and rounding errors described above.
[0024] This disclosure generally describes techniques related to decoder-side motion vector derivation techniques, such as template matching, bidirectional matching, and decoder-side MV refinement. Although these techniques are referred to as being performed at the decoder side, it should be understood that the decoder-side motion vector derivation techniques described herein may also be performed by a video encoder as part of determining how to encode a block of video data. The techniques of this disclosure may be applied to any of the existing video codecs, such as High Efficiency Video Coding (HEVC), Versatile Video Coding (VVC), Essential Video Coding (EVC), etc., or may be efficient coding tools in future video coding standards.
[0025] 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. Generally, video data includes any data for processing video. Thus, video data may include raw uncoded video, coded video, decoded (e.g., reconstructed) video, and video metadata, such as signaling data.
[0026] 1, system 100 includes a source device 102 that, in this example, provides encoded video data to be decoded and displayed by a destination device 116. In particular, source device 102 provides 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, broadcast receiver devices, etc. In some cases, source device 102 and destination device 116 may be equipped for wireless communication and therefore may be referred to as wireless communication devices.
[0027] In the example of FIG. 1, source device 102 includes a video source 104, memory 106, a video encoder 200, and an 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, video encoder 200 of source device 102 and video decoder 300 of destination device 116 may be configured to apply decoder-side motion vector derivation techniques described herein. Thus, source device 102 represents an example of a video encoding device, and 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.
[0028] System 100 as shown in FIG. 1 is merely an example. In general, any digital video encoding and / or decoding device may perform the decoder-side motion vector derivation techniques described herein. Source device 102 and destination device 116 are merely examples of coding devices, such that source device 102 generates coded video data for transmission to destination device 116. This disclosure refers to a “coding” device as a device that performs coding (encoding and / or decoding) of data. Accordingly, video encoder 200 and video decoder 300 represent examples of coding devices, specifically, video encoders and video decoders, respectively. In some examples, source device 102 and destination device 116 may operate substantially symmetrically, such that source device 102 and destination device 116 each include video encoding and decoding components. Thus, system 100 may support one-way or two-way video transmission between source device 102 and destination device 116, e.g., for video streaming, video playback, video broadcasting, or video telephony.
[0029] Generally, video source 104 represents a source of video data (i.e., raw, unencoded 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 video, archived video, and computer-generated video. In each case, video encoder 200 encodes the captured video data, pre-captured video data, or computer-generated video data. Video encoder 200 may reorder the pictures from the order in which they were received (sometimes referred to as “display order”) to a coding order for coding. Video encoder 200 may generate a bitstream including the encoded video data. Source device 102 may then output the encoded video data onto computer-readable medium 110 via output interface 108 for receipt and / or retrieval by, for example, input interface 122 of destination device 116 .
[0030] Memory 106 of source device 102 and memory 120 of destination device 116 represent general-purpose memory. In some examples, memory 106, 120 may store raw video data, e.g., raw video from video source 104 and raw decoded video data from video decoder 300. Additionally or alternatively, memory 106, 120 may store software instructions executable by video encoder 200 and video decoder 300, respectively, for example. While memory 106 and memory 120 are shown separate from video encoder 200 and video decoder 300 in this example, it should be understood that video encoder 200 and video decoder 300 may also include internal memory for functionally similar or equivalent purposes. Furthermore, memory 106, 120 may store encoded video data, e.g., output from video encoder 200 and input to video decoder 300. In some examples, portions of the memory 106, 120 may be allocated as one or more video buffers, for example, for storing raw decoded video data and / or encoded video data.
[0031] The computer-readable medium 110 may represent any type of medium or device capable of transporting 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 that enables the source device 102 to transmit 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 containing the encoded video data, and the input interface 122 may demodulate a received transmission signal, in accordance with a communication standard such as a wireless communication protocol. The communication medium may comprise any wireless or wired communication medium, such as a radio frequency (RF) spectrum or one or more physical transmission lines. The communication medium may form part of a packet-based network, such as a local area network, a wide area network, or a global network such as the Internet. The communication medium may include routers, switches, base stations, or any other equipment that may be useful for facilitating communication from the source device 102 to the destination device 116.
[0032] In some examples, source device 102 may output encoded data from output interface 108 to storage device 112. Similarly, destination device 116 may access 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.
[0033] In some examples, source device 102 may output the encoded video data to 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.
[0034] File server 114 may be any type of server device capable of storing encoded video data and transmitting the encoded video data to destination device 116. File server 114 may represent a web server (e.g., for a website), a server configured to provide file transfer protocol services (e.g., 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. 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.
[0035] Destination device 116 may access the encoded video data from 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 encoded video data stored on file server 114. Input interface 122 may be configured to operate according to any one or more of the various protocols described above for retrieving or receiving media data from file server 114 or other such protocols for retrieving media data.
[0036] Output interface 108 and input interface 122 may represent wireless transmitters / receivers, modems, wired networking components (e.g., Ethernet cards), wireless communication components operating according to any of the various IEEE 802.11 standards, or other physical components. In examples in which output interface 108 and input interface 122 comprise wireless components, output interface 108 and input interface 122 may be configured to transfer data such as encoded video data according to cellular communication standards such as 4G, 4G-LTE (Long Term Evolution), LTE-Advanced, 5G, etc. In some examples in which output interface 108 comprises a wireless transmitter, output interface 108 and 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, source device 102 and / or destination device 116 may include respective system-on-chip (SoC) devices. For example, the source device 102 may include an SoC device for performing functionality attributed to the video encoder 200 and / or the output interface 108, and the destination device 116 may include an SoC device for performing functionality attributed to the video decoder 300 and / or the input interface 122.
[0037] The techniques of this disclosure may be applied to video coding supporting any of a variety of multimedia applications, such as over-the-air television broadcast, cable television transmission, satellite television transmission, Internet streaming video transmission such as Dynamic Adaptive Streaming over HTTP (DASH), digital video being encoded on a data storage medium, decoding of digital video stored on a data storage medium, or other applications.
[0038] The input interface 122 of the destination device 116 receives the 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 the 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.
[0039] 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 an appropriate MUX-DEMUX unit or other hardware and / or software to process multiplexed streams that include both audio and video in a common data stream. Where applicable, the MUX-DEMUX unit may conform to the ITU H.223 multiplexer protocol or other protocols, such as the User Datagram Protocol (UDP).
[0040] The video encoder 200 and the video decoder 300 may each be implemented as any of a variety of suitable encoder and / or decoder circuit configurations, 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. The 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 cellular phone.
[0041] Video encoder 200 and video decoder 300 may operate according to a video coding standard such as ITU-T H.265, also known as High Efficiency Video Coding (HEVC), or extensions thereof, such as range extension, multiview extension (MV-HEVC), or scalable extension (SHVC). Additionally or alternatively, video encoder 200 and video decoder 300 may operate according to other proprietary or industry standards, such as ITU-T H.266, also known as Versatile Video Coding (VVC).
[0042] Generally, the video encoder 200 and the video decoder 300 may perform block-based coding of pictures. The term “block” generally refers to a structure containing data to be processed (e.g., encoded, decoded, or otherwise used in an encoding and / or decoding process). For example, a block may include a two-dimensional matrix of luminance and / or chrominance data samples. Generally, the video encoder 200 and the video decoder 300 may code video data represented in YUV (e.g., Y, Cb, Cr) format. That is, rather than coding red, green, and blue (RGB) data for the samples of a picture, the video encoder 200 and the video decoder 300 may code the luminance and chrominance components, where the chrominance components may include chrominance components of 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 an RGB format. Alternatively, pre-processing and post-processing units (not shown) may perform these transformations.
[0043] This disclosure may generally refer to coding (e.g., encoding and decoding) a picture to include the process of encoding or decoding data for the picture. Similarly, this disclosure may refer to coding of a block of a picture, e.g., predictive and / or residual coding, to include the process of encoding or decoding data for the block. A coded video bitstream generally includes a series of values for syntax elements that represent coding decisions (e.g., coding modes) and the partitioning of a picture into blocks. Thus, references to coding a picture or a block should generally be understood as coding values for the syntax elements that form the picture or block.
[0044] HEVC defines various blocks, including coding units (CUs), prediction units (PUs), and transform units (TUs). According to HEVC, a video coder (such as 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 in the quadtree has either zero or four child nodes. A node with no child nodes 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, and a TU represents residual data. An intra-predicted CU includes intra-prediction information, such as an intra-mode indication.
[0045] As another example, video encoder 200 and video decoder 300 may be configured to operate according to VVC. According to VVC, a video coder (such as video encoder 200) partitions a picture into multiple coding tree units (CTUs). 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 eliminates the concept of multiple partition types, such as the separation between CUs, PUs, and TUs in HEVC. The QTBT structure includes two levels: a first level partitioned according to quad-tree partitioning and a second level partitioned according to binary tree partitioning. The root node of the QTBT structure corresponds to a CTU. The leaf nodes of the binary tree correspond to CUs.
[0046] In the MTT partitioning structure, blocks may be partitioned using quadtree (QT) partitioning, binary tree (BT) partitioning, and one or more types of triple tree (TT) (also called ternary tree (TT)) partitioning. A triple tree partitioning or triple tree partitioning is a partitioning in which a block is divided into three sub-blocks. In some examples, a triple tree partitioning or triple 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) can be symmetric or asymmetric.
[0047] In some examples, the video encoder 200 and the video decoder 300 may use a single QTBT or MTT structure to represent each of the luminance and chrominance 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 luminance component and another QTBT / MTT structure for both chrominance components (or two QTBT / MTT structures for each chrominance component).
[0048] Video encoder 200 and video decoder 300 may be configured to use quadtree partitioning according to HEVC, QTBT partitioning, MTT partitioning, or other partition structures. For illustrative purposes, 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 configured to use quadtree partitioning or other types of partitioning.
[0049] In some examples, a CTU includes a coding tree block (CTB) of luma samples and two corresponding CTBs of chroma samples for a picture with three sample arrays, or a CTB of samples for a monochrome picture or a picture encoded using three separate color planes and syntax structures used to code the samples. 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. A component is an array or a single sample from one of the three arrays (luma and two chroma) that make up a picture in 4:2:0, 4:2:2, or 4:4:4 color format, or an array or a single sample from an array that creates a picture in monochrome format. In some examples, a coding block is an M×N block of samples for some value of M and N such that the division of the CTB into the coding block is partitioned.
[0050] Blocks (e.g., CTUs or CUs) may be grouped in various ways within a picture. As an example, a brick may refer to a rectangular region of a CTU row within a particular tile within a picture. A tile may be a rectangular region of a CTU within a particular tile column and a particular tile row within 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). 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) and a width equal to the width of the picture.
[0051] 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.
[0052] The bricks in a picture may also be arranged into slices. A slice may be an integer number of bricks of a picture that may be contained exclusively within a single Network Abstraction Layer (NAL) unit. In some examples, a slice includes either several complete tiles or only a contiguous sequence of complete bricks of one tile.
[0053] This disclosure may use "N x N" and "N by N," e.g., 16 x 16 samples or 16 by 16 samples, interchangeably to refer to the sample dimensions of a block (such as a CU or other video block) in terms of the vertical and horizontal dimensions. Generally, a 16 x 16 CU has 16 samples in the vertical direction (y = 16) and 16 samples in the horizontal direction (x = 16). Similarly, an N x N 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 within a CU may be arranged in 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 N x M samples, where M is not necessarily equal to N.
[0054] Video encoder 200 encodes video data for a CU, which represents prediction and / or residual information, as well as other information. The prediction information indicates how the CU will be predicted to form a predictive block for the CU. The residual information generally represents sample-by-sample differences between the samples of the CU before encoding and the samples of the predictive block.
[0055] To predict a CU, 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, and intra-prediction generally refers to predicting a CU from previously coded data of the same picture. To perform inter-prediction, video encoder 200 may generate a predictive block using one or more motion vectors. Video encoder 200 may generally perform motion search to identify a reference block that closely matches the CU with respect to the difference between the CU and the reference block, for example. Video encoder 200 may calculate a difference metric using sum of absolute differences (SAD), sum of squared differences (SSD), mean absolute difference (MAD), mean squared difference (MSD), or other such difference calculation to determine whether the reference block closely matches the current CU. In some examples, video encoder 200 may predict the current CU using unidirectional prediction or bidirectional prediction.
[0056] Some examples of VVC also provide an affine motion compensation mode, which may be considered an inter-prediction mode. In the 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, viewpoint shifting, or other irregular motion types.
[0057] To perform intra prediction, 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 directional modes, as well as a planar mode and a DC mode. Generally, video encoder 200 selects an intra prediction mode that describes neighboring samples to 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 video encoder 200 codes CTUs and CUs in raster scan order (left to right, top to bottom).
[0058] The video encoder 200 encodes data representing a prediction mode for the current block. For example, in the case of an inter prediction mode, the 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. In the case of unidirectional or bidirectional inter prediction, for example, the video encoder 200 may encode motion vectors using AMVP mode or merge mode. The video encoder 200 may use a similar mode to encode motion vectors for an affine motion compensation mode.
[0059] Following prediction, such as intra- or inter-prediction, of a 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 transform data in the transform domain rather than 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. Additionally, the video encoder 200 may apply a secondary transform, such as a mode-dependent non-separable secondary transform (MDNSST), a signal-dependent transform, or a Karhunen-Loeve transform (KLT), following the initial transform. The video encoder 200 generates transform coefficients following application of the one or more transforms.
[0060] As described 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, thereby providing further compression. By performing the 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 truncate 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.
[0061] Following quantization, the video encoder 200 may scan the transform coefficients, generating a one-dimensional vector from a two-dimensional matrix including the quantized transform coefficients. The scan may be designed to place transform coefficients with higher energy (and therefore lower frequency) at the front of the vector and transform coefficients with lower energy (and therefore higher frequency) at the back of the vector. In some examples, the video encoder 200 may utilize a default scan order to scan the quantized transform coefficients to generate a serialized vector and then entropy encode 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 encode the one-dimensional vector, for example, according to context-adaptive binary arithmetic coding (CABAC). The video encoder 200 may also entropy encode values for syntax elements describing metadata associated with the encoded video data for use by the video decoder 300 in decoding the video data.
[0062] To perform CABAC, 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 zeroed. A probability determination may be based on the context assigned to the symbol.
[0063] Video encoder 200 may further generate syntax data such as block-based syntax data, picture-based syntax data, and sequence-based syntax data, among other syntax data such as a picture header, a block header, a slice header, or a sequence parameter set (SPS), a picture parameter set (PPS), or a video parameter set (VPS), to video decoder 300. Video decoder 300 may similarly decode such syntax data to determine how to decode corresponding video data.
[0064] In this manner, video encoder 200 may generate a bitstream including coded video data, e.g., syntax elements that describe partitions of a picture into blocks (e.g., CUs) and prediction and / or residual information for the blocks. Finally, video decoder 300 may receive the bitstream and may decode the coded video data.
[0065] Generally, video decoder 300 performs a reciprocal process to that performed by video encoder 200 to decode encoded video data of a bitstream. For example, video decoder 300 may decode values for syntax elements of a bitstream using CABAC in a manner that is reciprocal but substantially similar to the CABAC encoding process of video encoder 200. The syntax elements may specify partition information for the partition of a picture into CTUs and the partition of each CTU according to a corresponding partition structure, such as a QTBT structure, to specify the CUs of the CTU. The syntax elements may further specify prediction information and residual information for blocks of video data (e.g., CUs).
[0066] The residual information may be represented by, for example, quantized transform coefficients. The video decoder 300 may inverse quantize 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.
[0067] This disclosure may generally refer to “signaling” some information, such as syntax elements. The term “signaling” may generally refer to communicating values for syntax elements and / or other data used to decode encoded video data. That is, video encoder 200 may signal values for syntax elements in a bitstream. Generally, signaling refers to generating values in a bitstream. As mentioned above, source device 102 may transport the bitstream to destination device 116 in substantially real time or non-real time, as may occur when storing syntax elements to storage device 112 for later retrieval by destination device 116.
[0068] 2A and 2B are conceptual diagrams illustrating an exemplary quadtree-binary tree (QTBT) structure 130 and corresponding coding tree unit (CTU) 132. Solid lines represent quadtree partitioning, and dotted lines represent binary tree partitioning. At each partitioned (i.e., non-leaf) node of the binary tree, a flag is signaled to indicate which partition type (e.g., horizontal or vertical) is used, where, in this example, 0 indicates horizontal partitioning and 1 indicates vertical partitioning. In the case of quadtree partitioning, the quadtree node divides a block horizontally and vertically into four equal-sized sub-blocks, so there is no need to indicate the partition type. Therefore, 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 may be encoded by the video encoder 200 and decoded by the video decoder 300. Video encoder 200 may encode and video decoder 300 may decode video data, such as prediction data and transform data, for CUs represented by terminal leaf nodes of QTBT structure 130.
[0069] 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 samples), a minimum quadtree size (MinQTSize, representing the smallest allowed quadtree leaf node size), a maximum binary tree size (MaxBTSize, representing the largest allowed binary tree root node size), a maximum binary tree depth (MaxBTDepth, representing the largest allowed binary tree depth), and a minimum binary tree size (MinBTSize, representing the smallest allowed binary tree leaf node size).
[0070] The root node of the QTBT structure corresponding to the CTU may have four child nodes at the first level of the QTBT structure, and each child node may be partitioned according to a quadtree partition. That is, a node at the first level is either a leaf node (with no child nodes) or has four child nodes. The example QTBT structure 130 represents a node including a parent node and child nodes with solid lines for branching. If a node at the first level is not larger than the maximum allowed binary tree root node size (MaxBTSize), the node may be further partitioned by its respective binary tree. The binary tree partitioning of a node may be repeated until the resulting node reaches the minimum allowed binary tree leaf node size (MinBTSize) or the maximum allowed binary tree depth (MaxBTDepth). The example QTBT structure 130 represents a node with dashed lines for branching. The binary tree leaf nodes are called CUs, and CUs are used for prediction (e.g., intra-picture prediction or inter-picture prediction) and transform without further partitioning. As explained above, a CU is sometimes called a "video block" or "block."
[0071] In one example of a QTBT partitioning structure, the CTU size is set as 128x128 (luma sample 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. Quadtree partitioning is first applied to the CTU to generate a quadtree leaf node. 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, the leaf quadtree node may not be further divided by a binary tree because the size exceeds MaxBTSize (i.e., 64x64 in this example). Otherwise, the quadtree leaf node may be further partitioned by a binary tree. Therefore, the quadtree leaf node is also the root node for the binary tree and has the binary tree depth as 0. When the binary tree depth reaches MaxBTDepth (4 in this example), no further splits are allowed. A binary tree node with 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 with 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 the prediction and transformation without further partitioning.
[0072] In HEVC, the largest coding unit in a slice is the CTB, also called the CTU. The CTB contains a quadtree, and the nodes of the quadtree are CUs. The size of the CTB can typically range from 16x16 to 64x64 in the HEVC Main Profile, but in some scenarios, a CTB size of 8x8 may also be supported. CUs can range in size from the same size as the CTB to as small as 8x8. Each CU is coded using one coding mode, for example, an inter-coding mode or an intra-coding mode. When a CU is inter-coded, it may be further partitioned into two or four PUs, or may be just one PU if no further partitioning applies. When there are two PUs in one CU, the two PUs may be half a rectangle, or two rectangles each ¼ or ¾ the size of the CU.
[0073] When a CU is inter-coded, each PU has one set of motion information derived using a specific inter-prediction mode. In the HEVC standard, there are two inter-prediction modes for a PU, called merge mode (skip mode is considered a special case of merge mode) and AMVP mode, respectively.
[0074] In either AMVP mode or merge mode, video encoder 200 and video decoder 300 may be configured to maintain a motion vector (MV) candidate list, which includes multiple motion vector predictors. Video encoder 200 and video decoder 300 may be configured to generate a motion vector, as well as a reference index in merge mode, for a current PU by selecting a candidate from the MV candidate list.
[0075] In HEVC, the MV candidate list includes up to five candidates for merge mode and only two candidates for AMVP mode. A 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. When a merge candidate is identified by a merge index, video encoder 200 and video decoder 300 may be configured to determine the reference picture and associated motion vector used for prediction of the current block based on the selected candidate. In contrast, for AMVP mode, for each possible prediction direction from either List 0 or List 1, a reference index is explicitly signaled along with the MV predictor (MVP) index to the MV candidate list. In AMVP mode, the predicted motion vector may be further refined, for example, by receiving a motion vector differential, which may be added to the MVP. Candidates for the candidate list in both modes may be derived similarly from the same spatial and temporal neighboring blocks.
[0076] FIG. 3A is a conceptual diagram illustrating an example of spatially neighboring motion vector candidates for merge mode. Video decoder 300 may generate a candidate list by adding motion information of spatially neighboring candidates to the candidate list. Spatial MV candidates are derived from neighboring blocks shown in FIGS. 3A and 3B for a particular PU (PU0), although the process for generating candidates from that block may differ for merge mode and AMVP mode. In merge mode, up to five spatial MV candidates may be derived for block 140 (PU0) with the order shown in FIG. 3A. The order is as follows, as shown in FIG. 3A: left (0), top (1), top-right (2), bottom-left (3), and top-left (4).
[0077] 3B is a conceptual diagram illustrating an example of spatially adjacent motion vector candidates for AMVP. In AMVP mode, the neighboring blocks of block 142 (PU0) are divided into two groups, a left group including blocks 0 and 1, and an upper group including blocks 2, 3, and 4, as shown in FIG. 3B. For each group, possible candidates among neighboring blocks that refer to the same reference picture as indicated by the signaled reference are prioritized to form the final candidate for the group. It is possible that not all neighboring blocks 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, allowing the temporal distance difference to be compensated.
[0078] Temporal motion vector prediction in HEVC is next described. Video encoder 200 and video decoder 300 may be configured to add a temporal motion vector predictor (TMVP) candidate, if enabled and available, into the MV candidate list after the spatial motion vector candidate is added. The process of motion vector derivation for a TMVP candidate may be the same for both merge mode and AMVP mode. However, in HEVC, the target reference index for a TMVP candidate in merge mode may be set to 0.
[0079] Figure 4A is a conceptual diagram illustrating an example of a TMVP candidate for block 144 (PU0). The primary block location for TMVP candidate derivation is the outer, lower-right block of the co-located PU, shown as block "T" in Figure 4A, to compensate for the bias toward the blocks above and to the left used to generate spatially neighboring candidates. However, if the block is located outside the current CTB row or motion information is not available, the block is replaced with the center block of the PU.
[0080] The video decoder 300 may derive motion vectors for TMVP candidates from the co-located PUs of the co-located pictures, which are indicated at the slice level. The motion vectors for the co-located PUs are called co-located MVs. A block in a reference picture may be considered to be co-located with a block in a current picture, for example, if the block in the reference picture and the current block each contain at least one pixel that corresponds to the same relative position in the reference picture and the current picture.
[0081] 4B is a conceptual timing diagram illustrating an example of the motion vector scaling process 146. Similar to the temporal direct mode in AVC, to derive TMVP candidate motion vectors, the video decoder 300 may scale the co-located MVs to compensate for the temporal distance difference, as shown in FIG. 4B. With motion vector scaling, it is generally assumed that the value of a motion vector is proportional to the distance of the pictures in presentation time. A motion vector associates two pictures, i.e., a reference picture and a picture containing the motion vector (i.e., the 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.
[0082] When a motion vector is predicted, the associated stored picture and reference picture may be different. Therefore, a new distance based on POC may be calculated, and the motion vector may be scaled based on the 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, motion vector scaling is applied to both TMVP and AMVP for spatially and temporally adjacent candidates.
[0083] 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 fewer 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.
[0084] In merge mode, there are two types of artificial MV candidates: composite candidates, which are derived only for B slices, and zero motion vector candidates, which are used for AMVP if the first type does not provide enough artificial candidates.
[0085] For each pair of candidates already in the candidate list that have the required 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.
[0086] Video encoder 200 and 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 one candidate against others in the current candidate list to some extent to avoid inserting identical candidates. To reduce complexity, rather than comparing each possible candidate with every other existing candidate, the pruning process is applied only a limited number of times.
[0087] The video encoder 200 and the video decoder 300 may be configured to perform template matching (TM) prediction. TM prediction is a special merge mode based on the frame rate up-conversion (FRUC) technique. In this mode, motion information for a block is not signaled but is derived at the decoder side. TM prediction may be applied to both AMVP mode and normal merge mode. In AMVP mode, MVP candidate selection is determined based on template matching, which identifies the candidate that results in the smallest 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 may be applied to the merge candidate indicated by the merge index for MV improvement.
[0088] 5 shows an exemplary template matching process being 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 derive motion information of a current CU using template matching by finding the closest match between current template 148 (a neighboring block above and / or to the left of the current CU) in current picture 150 and a template in reference template 152 for a reference block (the same size as that template) in reference picture 154. Using an AMVP candidate selected based on the initial matching error, video encoder 200 and video decoder 300 may improve the MVP using template matching. Using the merge candidate indicated by the signaled merge index, merged MVs corresponding to L0 and L1 may be independently improved by template matching. Less accurate ones of the merged MVs may then be further improved based on the more accurate merged MVs.
[0089] Video encoder 200 and 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 required. To reduce complexity, bilinear interpolation may be used instead of the usual 8-tap DCT-IF interpolation for both template matching to generate the template in the reference picture. An exemplary matching cost C for template matching is as follows:
[0090]
number
[0091] where w is a weighting factor empirically set to 4, and MV and MV s and denote the currently tested MV and the initial MV (e.g., MVP candidate in AMVP mode, or merged MV in merge mode), respectively. SAD is used as the matching cost for template matching.
[0092] When TM is used, video encoder 200 and video decoder 300 may be configured to refine motion vectors (e.g., initial MVs) using only luma samples. However, motion vectors determined based on the refinement may be used for both luma and chroma for MC inter prediction. After the MVs are determined, final MC may be performed using an 8-tap interpolation filter for luma and a 4-tap interpolation filter for chroma.
[0093] The video encoder 200 and the video decoder 300 may be configured to perform a search process. MV refinement may include a pattern-based MV search process that utilizes a hierarchical structure with a template matching cost criterion. Two search patterns are supported for MV refinement: diamond search and cross search. The hierarchical structure specifies an iterative process for MV refinement that starts at a coarse MVD precision (e.g., ¼ pel) and ends at a finer precision (e.g., ⅛ pel). For example, ¼ pel MV precision implies that a template matching process is performed on a search area around the initial MV to identify the MV to be refined, where the search step size uses ¼ of the luma sample distance (or resolution) (between the initial MV and the MV to be refined) as the MVD precision. The MV is directly searched at ¼ luma sample MVD precision using the diamond pattern, followed by ¼ luma sample MVD precision using the cross pattern, and then ⅛ luma sample MVD refinement using the cross pattern. The search range for MV improvement is set equal to (-8, +8) luma samples around the initial MV. When the current block is bi-predictive, both MVs are improved independently, and then the best one among them (in terms of matching cost) is set as the priority for further improving other MVs using BCW weight values.
[0094] The video encoder 200 and the video decoder 300 may be configured to perform bidirectional matching prediction. Bidirectional matching (BM) prediction, also referred to as bidirectional merging, is another merge mode based on the FRUC technique. When applying the BM mode to a block, the video encoder 200 and the video decoder 300 may derive two initial motion vectors MV0 and MV1 using the signaled merge candidate index to select a merge candidate in the constructed merge list. When performing bidirectional matching, the video encoder 200 and the video decoder 300 search around MV0 and MV1 and derive final MV0′ and MV1′ based on the minimum bidirectional matching cost.
[0095] The motion vector differentials 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, e.g., TD0 and TD1. Figure 6 shows an example of MVD0 and MVD1, where the distance (TD1) between the current picture 156 and the reference picture 158 is four times the distance (TD0) between the current picture 156 and the reference picture 160. Figure 6 shows an example of MVD0 and MVD1 being proportional based on the temporal distance.
[0096] However, there is an optional design in which MVD0 and MVD1 are mirror-reflective regardless of the temporal distances TD0 and TD1. Figure 7 shows an example in which MVD0 and MVD1 are mirror-reflective regardless of the temporal distance (TD1) between the current picture 162 and the reference picture 164 and the temporal distance (TD0) between the current picture 162 and the reference picture 166. Figure 7 shows an example of mirror-reflective MVD0 and MVD1, where TD1 is four times TD0.
[0097] FIG. 8 shows an example of a 3×3 square search pattern within a search range [−8, 8] for performing bidirectional matching. When performing bidirectional matching, video encoder 200 and video decoder 300 may be configured to perform a local search around initial MV0 and MV1 to derive final MV0′ and MV1′. In the example of FIG. 8, the initial MV points to sample 170, and the final MV points to sample 172. The local search applies a 3×3 square search pattern to a loop through the search range [−8, 8]. Sample 174 represents an example of a sample within the search range around samples 170, 172, and 176. Sample 176 represents an example of a sample corresponding to an MV determined during an intermediate iteration of the search process. In each search iteration, the bidirectional matching costs of the eight surrounding MVs in the search pattern are calculated and compared with the bidirectional matching cost of the central MV. The MV with the smallest bidirectional matching cost becomes the new central MV in the next search iteration. The local search terminates when the current central MV has the smallest cost within a 3x3 square search pattern or when the local search reaches a predefined maximum search iteration.
[0098] The video encoder 200 and the video decoder 300 may be configured to perform decoder-side motion vector refinement (DMVR). In VVC, DMVR may be applied to improve the accuracy of MVs in merge mode. In bi-predictive operation, the refined 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.
[0099] 9 shows an example of decoder-side motion vector refinement. As shown in FIG. 9, video encoder 200 and video decoder 300 may be configured to calculate the SAD between block 178 and block 180 based on each MV candidate around the initial MV. The MV candidate with the smallest SAD becomes the refined MV and is used to generate the bi-predicted signal.
[0100] The improved MVs derived by the DMVR process are used to generate inter-prediction samples, which are also used in temporal motion vector prediction for future picture coding. The original MVs are used in the deblocking process, but are also used in spatial motion vector prediction for future CU coding. DMVR is a sub-block-based merge mode with a default maximum processing unit of 16x16 luma samples. When the width and / or height of a CU is greater than 16 luma samples, the CU may be further divided into sub-blocks with widths and / or heights equal to 16 luma samples.
[0101] 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, any point checked by the DMVR, indicated by a candidate MV pair (MV0, MV1), follows the following two equations: MV0'=MV0+MV_offset MV1'=MV1-MV_offset where MV_offset represents the refinement offset between the initial MV in one of the reference pictures and the MV to be refined. In DMVR, 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.
[0102] The video encoder 200 and the video decoder 300 may be configured to apply a 25-point full search for the integer sample offset search. The SAD of the initial MV pair is first calculated. If the SAD of the initial MV pair is smaller than a threshold, the integer sample offset search stage of the DMVR terminates. Otherwise, the SADs of the remaining 24 points are 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 uncertainty penalty of DMVR improvement, it is proposed to prefer 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.
[0103] Following the integer sample search, the video encoder 200 and the video decoder 300 may be configured to perform fractional sample refinement. To save computational complexity, the fractional sample refinement is derived by using a parametric error surface equation rather than an additional search involving 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 terminates with the center having the smallest SAD in either the first or second iteration, the fractional sample refinement is further applied.
[0104] In parametric error surface based sub-pixel offset estimation, the central position cost and the costs at four adjacent positions from the center are used to fit a 2D parabolic error surface equation of the form: E(x,y)=A(xx min ) 2 +B(yy min ) 2 +C However, (x min ,y min ) corresponds to the fractional position with the lowest cost, and C corresponds to the minimum cost value. By solving the above equation using the cost values of the five search points, we can obtain (x min ,y min )but, xmin =(E(-1,0)-E(1,0)) / (2(E(-1,0)+E(1,0)-2E(0,0))) y min =(E(0,-1)-E(0,1)) / (2((E(0,-1)+E(0,1)-2E(0,0))) Since all cost values are positive and the minimum value is E(0,0), x min and y min The value of is automatically constrained to be between -8 and 8, which corresponds to a 1 / 2 pel offset with 1 / 16 pel MV precision in VVC. The calculated fraction (x min ,y min ) is added to the integer distance refinement MV to get the sub-pixel accuracy refinement delta MV.
[0105] The video encoder 200 and the video decoder 300 may be configured to perform bilinear interpolation and sample padding. In VVC, the maximum resolution of the MV is 1 / 16 luma sample. 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 therefore, 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 advantage is that by using a bilinear filter, with a search range of two samples, DVMR does not access more reference samples than a conventional motion compensation process. After the improved MV is achieved using the DMVR search process, a conventional 8-tap interpolation filter is applied to generate the final prediction. To avoid accessing more reference samples than the conventional 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 the available samples.
[0106] Video encoder 200 and video decoder 300 may be configured to implement one or more enablement conditions for DMVR. In one example, video encoder 200 and video decoder 300 may be configured to enable DMVR if all of the following conditions are met, e.g., exist or are true: CU level merge mode with bi-predictive MV. · For the current picture, there is one reference picture in the past and another in the future. · The distance (e.g., POC difference) from both reference pictures to the current picture is the same. The 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. · WP is not currently enabled for the block. · The combined intra and inter prediction (CIIP) mode is not used for the current block.
[0107] Video encoder 200 and video decoder 300 may be configured to implement a merge mode using motion vector differential (MMVD). MMVD is a merge mode that allows explicit signaling of additional motion vector differentials to improve the merge mode motion field. To indicate whether the MMVD mode is used for a CU, the MMVD flag may be signaled immediately after sending the skip flag, merge flag, and normal merge flag. In MMVD, after a merge candidate is selected, the merge candidate is further refined by the signaled MVD information. The additional information includes a merge candidate flag, an index for specifying the motion magnitude, and an index for indicating the motion direction. In MMVD mode, one of the first two candidates in the merge list is selected to be used as the MV basis. A merge candidate flag is signaled to specify which merge candidate is used.
[0108] FIG. 10 shows an example of MMVD search points. Points 182 and 184 represent starting points identified by the starting MV. Other points correspond to refined motion vectors. The distance index specifies motion magnitude information and indicates a predetermined offset from the starting point. As shown in FIG. 10, the offset may be added to either the horizontal or vertical component of the starting MV. The relationship between the distance index and the predetermined offset is 2 idx-2 where index (idx) is an integer ranging from 0 to 7. When the picture header syntax (e.g., pic_fpel_mmvd_enabled_flag) is set to enabled, the mapping from index to offset is 2 idx can be modified to become:
[0109] 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. The MVD code may change according to the type of the starting MV. When the starting MV is a non-predicted MV or a bi-predictive MV with both list points to the same side of the current picture (i.e., when the POCs of the two references are both greater than 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 MV points to different sides of the current picture (i.e., when 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 list 0 MV component of the starting MV, and the code for list 1 MV has the opposite value.
[0110] [Table 1]
[0111] For example, previous techniques that perform template matching (TM), such as those described above with respect to template matching prediction, may result in degraded performance when used with AMVP mode and merge mode. In AMVP mode, TM begins by improving an initial MV using a step size of 1 / 4 pel regardless of the MV precision of the adaptive motion vector resolution (AMVR). Nevertheless, to ensure that the improved MV has the expected precision from the AMVR (1 / 4 luma sample, 1 / 2 luma sample, integer luma sample, or 4 luma samples), the motion vector predictor for a CU in previous techniques is rounded to the same precision as the MVD precision before being added together with the MVD. Therefore, rounding errors in the improved MV may be unavoidable. In merge mode, TM acts as an independent mode that does not take into account possible combinations or interactions with other merge modes, such as MMVD and bidirectional matching, resulting in lower performance in terms of coding gain. This disclosure describes techniques that can address these issues.
[0112] Video encoder 200 and video decoder 300 may be configured to implement MV precision for the TM based on the AMVR. Techniques of this disclosure may align the finest MV precision of the TM with the indication of the AMVR. As described above with respect to template matching prediction, the TM always refines the initial MV using a quarter-pel step size, even when there is an explicit indication of AMVR selection, resulting in potential rounding errors in the resulting refined MV. For example, if the initial MV is (0, 0) using an integer-pel AMVR, the TM refined MV may be (0.25, 0.25). Due to rounding, the TM refined MV may round to something other than what was searched, triggering unexpected rounding errors in the TM refined MV to the precision of the motion vector (e.g., as indicated with the AMVR) and essentially wasting computational power dedicated to performing decoder-side search. To avoid this potential source of error, this disclosure describes techniques for forcing the search step size of the TM to be aligned with the indicated AMVR. In particular, with a given AMVR mode (e.g., 4-pel, 1-pel, ½-pel, ¼-pel, ⅛-pel, 1 / 16-pel, etc., for all power-of-two precisions), video encoder 200 and video decoder 300 may be configured to stop the TM refinement process at the same MV precision indicated by the AMVR and not exceed that MV precision. In other words, the TM-refined MV may be constrained to have an MV precision equal to or greater than, but not less than, the MV precision of the AMVR mode.
[0113] The video encoder 200 and the video decoder 300 may be configured to determine the initial step size of the TM MV improvement process using a hierarchical search pattern based on the MV accuracy of the AMVR mode. The initial step size may be the same precision as or somewhat larger than the AMVR accuracy. Generally, when the AMVR specifies an MV accuracy of N pels (e.g., N is a power of two, including 4, 1, ½, ¼, ⅛, and ⅛), the initial step size may be, for example, M pels, where M pels is set equal to or somewhat larger than N, 2N, or 4N with a power-of-two scale. Thus, the video encoder 200 and the video decoder 300 may be configured to implement the search process as described above with respect to template matching prediction as a four-fold process.
[0114] First, the video encoder 200 or the video decoder 300 may search for an initial MV at a luma sample MV precision of M pels using a given search pattern (e.g., diamond, square, cross). Then, the video encoder 200 or the video decoder 300 may further refine the improved MV at the same luma sample MV precision of M pels using another search pattern that is the same or different from that used in the previous process. Then, the video encoder 200 or the video decoder 300 may iteratively further refine the improved MV using a luma sample MV precision that is twice finer than that of the previous iteration using the given search pattern (e.g., from n pels to n / 2 pels). The video encoder 200 or the video decoder 300 may continue the iterative process until the precision reaches the MV precision of N pels indicated by the AMVR.
[0115] In one example, given a ¼-pel AMVR coded block, video encoder 200 or video decoder 300 may determine the initial step size of the TM MV refinement process to be equal to 1 pel. Video encoder 200 or video decoder 300 may then start the TM MV refinement process at 1 pel precision, followed by a second round of refinement at ½ pel precision, and stopped at a third round of refinement at ¼ pel precision.
[0116] In one example, the value of (M, N) may be (4, 4) for a 4-pel AMVR, (1, 1) for a 1-pel AMVR, (1, 1 / 2) for a 1 / 2-pel AMVR, (1, 1 / 4) for a 1 / 4-pel AMVR, (1, 1 / 8) for a 1 / 8-pel AMVR, and (1, 1 / 16) for a 1 / 16-pel AMVR. In some cases (e.g., merge mode), when the AMVR is not always explicitly indicated in the bitstream, the setting of (M, N) may be specified or predefined as (1, 1 / 4), (1, 1 / 8), or (1, 1 / 16) at the sequence level, picture level, slice level, tile level, or subpicture level. In these examples, M represents the initial step size, and N represents the final step size, where the final step size is greater than or equal to the precision of the initial MV.
[0117] In one example, the value of M may be sequence resolution dependent. In general, for higher resolution sequences, video encoder 200 and video decoder 300 may use a larger value of M, and for lower resolution sequences, they may use a smaller value of M.
[0118] Video encoder 200 and video decoder 300 may be configured to perform simplified bidirectional refinement for TM. Techniques of this disclosure may simplify TM by eliminating one of the unidirectional MV refinement processes for bi-predicted blocks. When a current inter block is encoded using bi-prediction, TM as described above with respect to template matching prediction refines each unidirectional MV independently, and then the unidirectional MV with a larger matching error (i.e., hereinafter referred to as the second MV) is further refined by using the other unidirectional MV (i.e., hereinafter referred to as the first MV) as the priority for joint optimization. However, because both MVs are refined toward finding an optimal match for the same current block template, joint optimization may reduce the opportunity for reaching a better prediction for bi-prediction cases. Generally, the second MV in bi-prediction is used to better compensate for the delta signal between the original block samples and the predicted samples corresponding to the first MV. Therefore, this disclosure describes techniques for simplifying TM as a dual MV refinement process. The video encoder 200 and the video decoder 300 may first choose the first MV in bi-prediction for independent improvement, and then take the TM-improved first MV as a priority for improving the second MV.
[0119] There are several processes that can be used to specify the criteria for taking the first MV for independent improvement. For example, Lxmay be the only one to be improved independently and is set as a priority for improving other MVs using the BCW weight value, where Lx may be predefined as either L0 or L1, or may be specified at the sequence level, picture level, slice level, tile level, sub-picture level, CTU level, or block level. Lx may be determined based on which reference picture has a shorter POC distance toward the current picture. In some examples, Lx may be determined based on which reference picture has a longer POC distance to the current picture. In some examples, Lx may be determined based on which reference picture has a smaller quantization parameter (QP) value. In some examples, Lx may be determined based on which reference picture has a larger QP value. In some examples, Lx may be set equal to L0 when ph_mvd_l1_zero_flag is enabled. (ph_mvd_l1_zero_flag may be named differently in various video standards, but its functionality remains the same, i.e., MVD L1 Force MVD L1 (Note that syntax signaling for ph_mvd_l1_zero_flag is skipped.) In some examples, Lx may be set equal to L0 when ph_mvd_l1_zero_flag is disabled. In some examples, Lx may be determined based on which of MVL0 and MVL1 can produce the lower matching cost before the TM MV improvement process is performed. The matching cost may be the same as the template matching cost (i.e., template matching prediction as described above) or a subsampled template matching cost that only considers every other N (e.g., every 2nd, 3rd, 4th, ...) samples from the template block in the matching cost calculation.
[0120] In other examples, Lx is the MV after the MV refinement process of TM has been performed on both MVs. L0 and MVL1 may be determined based on which of them can produce a lower matching cost. The best one among them (in terms of matching cost) is then set as the priority for improving the original vector of the other MV (before MV improvement) using the BCW weight value.
[0121] Video encoder 200 and video decoder 300 may be configured to perform bi-directional matching for TM merge mode. The techniques of this disclosure may extend the concept of bi-directional matching to TM merge mode (bi-directional TM or TM bilateral ), with which the matching process of the TM will find the best match that can minimize the difference between the two reference block templates. Note that bidirectional TM differs from bidirectional matching as described above in that while bidirectional matching improves the MV based on the minimum cost between the two reference blocks, bidirectional TM improves the MV based on the minimum cost between the two templates.
[0122] In one example, when a CU is bi-predictive for TM, the video encoder 200 and the video decoder 300 perform an MV refinement process (i.e., TM) for each unidirectional MV. 2uni ), but apply bidirectional TM, which finds the best match that should minimize the delta between the two reference block templates. bilateral}.
[0123] In another example, when a CU is bi-predictive for TM, video encoder 200 and video decoder 300 may still be configured to perform the MV refinement process independently for each unidirectional MV. Then, video encoder 200 and video decoder 300 may be configured to perform bi-directional TM on the refined MV to find the best match that should minimize the delta between two reference block templates. In short, the processing order is {TM 2uni , TMbilateral}.
[0124] In some examples, when a CU is bi-predictive for TM, video encoder 200 and video decoder 300 still perform the normal MV improvement process to improve each unidirectional MV independently, and perform joint optimization as described above for template matching prediction for the MV that incurs the larger matching cost (i.e., TM bi ) followed by the reference block template. The video encoder 200 and the video decoder 300 may then be configured to perform bidirectional matching on the refined MV to find the best match that should minimize the delta between the two reference block templates. In essence, the processing order is 2uni , TM bi , TM bilateral}.
[0125] The processing order in some of the above examples may be reversed, with bidirectional TM performed before normal TM. bilateral , TM 2uni} or {TM bilateral , TM 2uni , TM bi}.
[0126] Compared with some of the above examples, the two-way TM may be replaced by using normal two-way matching or PU-based DMVR. In short, the processing order is, but not limited to, {TM 2uni , BM}, {TM 2uni , TM bi , BM}, {BM, TM 2uni}, and {BM, TM 2uni , TM bi}. Note that depending on whether BM and DMVR are both implemented in the video codec, BM can be replaced by using DMVR.
[0127] In one example, when a CU is encoded using bi-prediction, video encoder 200 and video decoder 300 may be configured to apply sub-block-based DMVR or sub-block-based BM to the resulting motion field after both regular TM and bi-directional TM are performed. Therefore, the processing order of these decoder-side modes is summarized as follows: · {TM 2uni , BM, subblock BM} or {TM 2uni , TM bilateral , sub-block BM}, · {TM 2uni , TM bi , BM, subblock BM} or {TM 2uni , TM bi , TM bilateral , sub-block BM}, · {BM, TM 2uni , subblock BM} or {TM bilateral , TM 2uni , sub-block BM}, · {BM, TM2 uni , TM bi , subblock BM} or {TM bilateral , TM2 uni , TM bi , subblock BM}. Note that the BM can be replaced by using the DMVR, depending on whether both the BM and the DMVR are implemented in the video codec.
[0128] In the above example, a PU-based BM or TM is constructed. bilateral can be eliminated to reduce the complexity overhead, yielding: · {TM 2uni , sub-block BM}, · {TM 2uni , TM bi , sub-block BM}, · {TM 2uni , sub-block BM}, · {TM2 uni , TMbi , subblock BM}. Note that the BM can be replaced by using the DMVR, depending on whether both the BM and the DMVR are implemented in the video codec.
[0129] In one example, when a CU is bi-predictive, video encoder 200 and video decoder 300 may be configured to conditionally perform bi-directional TM according to the same enabling conditions described above for DMVR. When the conditions are not met, video encoder 200 and video decoder 300 may be configured to perform TM without bi-directional matching; otherwise, bi-directional matching functions for TM as when the conditions are met. Note that the same rules apply when a bi-directional BM is replaced by a DMVR or BM.
[0130] In another example, building on the example above, when the TM cost of bi-prediction is N times larger than the best uni-prediction, the TM bi may degenerate bi-predictive motion unidirectionally, where N may be a predefined scale such as 1.125, 1.25, 1.5, etc., or may be specified at the sequence level, picture level, slice level, tile level, sub-picture level, CTU level, or block level. When such a condition is met, the resulting motion field derived by the TM becomes unidirectional, which happens to skip the BM and sub-block BM.
[0131] In one example, the video encoder 200 and the video decoder 300 may be configured to conditionally skip the MV refinement process for the TM merge mode based on the matching cost of the BM or the bidirectional TM (e.g., depending on which approach is taken in Examples 4, 5, and 6 above). 2uni and TM bi ) before BM (or TM bilateral In cases where BM (or TM) is applied, bilateralIf the bidirectional matching cost of ) is less than a given threshold, the MV improvement process of the normal TM may be skipped. The threshold is a function of the number of block samples, i.e., f(scale) = scale * number of block samples (or TM bilateral When is used, f(scale) may be defined as f(scale) = scale * number of template block samples), where scale may be a positive real number such as 0.5, 0.75, 1.0, 1.25, 1.50, 1.75, 2.0, etc., specified per sequence, picture, subpicture, tile, slice, or may be predefined.
[0132] In one example, normal TM and / or bidirectional TM can be incorporated into the multipath DMVR as one redundant pass for MV improvement before the sub-block process. The normal TM or bidirectional TM can be present just before (or just after) the first pass of the multipath DMVR. The following summarizes all possible combinations. · {TM 2uni , Multipath DMVR}, · {TM 2uni , TM bi , Multipath DMVR}, · {TM bilateral , Multipath DMVR}, · {TM bilateral , TM 2uni , Multipath DMVR}, · {TM bilateral , TM 2uni , TM bi , Multipath DMVR}, · {TM 2uni , TM bilateral , Multipath DMVR}, · {TM 2uni , TM bi , TM bilateral , Multipath DMVR}.
[0133] In one example, a regular TM and / or a bidirectional TM can replace the first path of a multipath DMVR, as described in U.S. Provisional Patent Application No. 63 / 129,221. The following summarizes all possible combinations: · {TM 2uni , multipath DMVR whose first path has been removed}, · {TM 2uni , TM bi , multipath DMVR whose first path has been removed}, · {TM bilateral , multipath DMVR whose first path has been removed}, · {TM bilateral , TM 2uni , multipath DMVR whose first path has been removed}, · {TM bilateral , TM 2uni , TM bi , multipath DMVR whose first path has been removed}, · {TM 2uni , TM bilateral , multipath DMVR whose first path has been removed}, · {TM 2uni , TM bi , TM bilateral , multipath DMVR} whose first path has been removed.
[0134] Video encoder 200 and video decoder 300 may be configured to perform MMVD using TM. The techniques of this disclosure apply TM to MMVD candidates for MV improvement. TM may be applied to either the basis vectors of MMVD or each of the MMVD candidates.
[0135] In one example, TM is applied only to MMVD basis vectors. In one example, TM is applied only to MMVD basis vectors, and the best one among them is determined as the final MMVD basis vector for generating MMVD candidates. With this, the flag sent to indicate the selection of the MMVD basis vector does not need to be signaled. In other words, the index of the MMVD basis vector is derived from the TM rather than from decoding the bitstream. In one example, the MMVD basis vector selection in the previous example is simplified through a TM cost calculated for each MMVD basis vector without performing MV refinement. Only the MMVD basis vector with a lower TM cost is selected as the MMVD basis vector and applied to the MV refinement. The TM-improved vector serves as the MMVD basis vector for generating MMVD candidates. Note that the flag sent to indicate the selection of the MMVD basis vector does not need to be signaled in this example. In one example, TM works for each possible MMVD candidate. This example can work independently or in combination with the above-mentioned example of improving MMVD basis vectors. In one example, the MMVD basis vectors can be subsampled from a regular merge candidate list or a TM candidate list. The subsampling process can include subsampling the first N from the above-mentioned candidate list, where N can be predefined as 1, 2, 3, 4, etc., or can be specified at the sequence level, slice level, tile level, picture level, or subpicture level.
[0136] Video encoder 200 and video decoder 300 may be configured to utilize a matching cost-based enablement condition. Bidirectional matching for TM merge mode may be conditionally disabled based on the matching cost of the BM or bidirectional TM (depending on which approach is taken in Examples 4, 5, and 6 above regarding bidirectional matching for TM merge mode). 2uni and TM bi ) before BM (or TM bilateralIn cases where BM (or TM) is applied, bilateral If the two-way matching cost of the normal TM is less than a given threshold, the normal TM may be skipped. The threshold is a function of the number of block samples, i.e., f(scale) = scale * number of block samples (or TM bilateral When is used, f(scale) may be defined as f(scale) = scale * number of template block samples), where scale may be a positive real number such as 0.5, 0.75, 1.0, 1.25, 1.50, 1.75, 2.0, etc., specified per sequence, picture, subpicture, tile, slice, or may be predefined.
[0137] 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 explanation and should not be considered a limitation of the techniques as broadly illustrated and described in this disclosure. For purposes of explanation, this disclosure describes video encoder 200 in accordance with VVC (ITU-T H.266 under development) and HEVC (ITU-T H.265) techniques. However, the techniques of this disclosure may be performed by video encoding devices configured for other video coding standards.
[0138] 11 , video encoder 200 includes video data memory 230, mode select unit 202, residual generation unit 204, transform processing unit 206, quantization unit 208, inverse quantization unit 210, inverse transform processing unit 212, reconstruction unit 214, filter unit 216, decoded picture buffer (DPB) 218, and entropy coding unit 220. Any or all of video data memory 230, mode select unit 202, residual generation unit 204, transform processing unit 206, quantization unit 208, inverse quantization unit 210, inverse transform processing unit 212, reconstruction unit 214, filter unit 216, DPB 218, and entropy coding unit 220 may be implemented in one or more processors or processing circuitry. For example, the units of video encoder 200 may be implemented as one or more circuits or logic elements as part of hardware circuitry, or as part of a processor, ASIC, or FPGA. Moreover, video encoder 200 may include additional or alternative processors or processing circuitry for performing these and other functions.
[0139] Video data memory 230 may store video data to be encoded by components of video encoder 200. Video encoder 200 may receive video data stored in video data memory 230, for example, from video source 104 (FIG. 1). DPB 218 may act as a reference picture memory, storing reference video data for use in predicting subsequent video data by video encoder 200. Video data memory 230 and 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. Video data memory 230 and DPB 218 may be provided by the same memory device or separate memory devices. In various examples, video data memory 230 may be on-chip with other components of video encoder 200, as shown, or may be off-chip relative to those components.
[0140] In this disclosure, references to video data memory 230 should not be construed as limited to memory internal to video encoder 200 unless specifically stated as such, or to memory external to video encoder 200 unless specifically stated as such. 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.
[0141] The various units in FIG. 11 are shown to aid in understanding the operations performed by 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 specific functionality and is preconfigured for the operations that may be performed. A programmable circuit refers to a circuit that can be programmed to perform various tasks and provides 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 or output parameters), but the types of operations that the fixed-function circuit performs are generally invariant. In some examples, one or more of the units may be different circuit blocks (fixed function or programmable), and in some examples, one or more of the units may be integrated circuits.
[0142] Video encoder 200 may include an arithmetic logic unit (ALU), an elementary function unit (EFU), digital circuitry, analog circuitry, and / or a programmable core formed from programmable circuitry. In examples in which the operations of video encoder 200 are performed using software executed by programmable circuitry, memory 106 (FIG. 1) may store instructions (e.g., object code) of the software that video encoder 200 receives and executes, or another memory (not shown) within video encoder 200 may store such instructions.
[0143] The video data memory 230 is configured to store 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.
[0144] The mode select unit 202 includes a motion estimation unit 222, a motion compensation unit 224, and an intra prediction unit 226. The mode select unit 202 may include additional functional units for performing video prediction according to other prediction modes. By way of example, the mode select 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.
[0145] The mode selection unit 202 typically coordinates multiple encoding passes to test combinations of encoding parameters and the resulting rate-distortion values for such combinations. The encoding parameters may include partitioning of the CTUs into CUs, prediction modes for the CUs, transform types for residual data of the CUs, quantization parameters for residual data of the CUs, etc. The mode selection unit 202 may ultimately select a combination of encoding parameters that results in a better rate-distortion value than the other combinations tested.
[0146] Video encoder 200 may partition a picture retrieved from video data memory 230 into a series of CTUs and may encapsulate one or more CTUs within a slice. Mode select unit 202 may partition the CTUs of a picture according to a tree structure, such as the HEVC QTBT structure or quadtree structure described above. As described above, video encoder 200 may form one or more CUs from partitioning the CTUs according to the tree structure. Such CUs may also be generally referred to as "video blocks" or "blocks."
[0147] Generally, the mode select unit 202 also controls its components (e.g., the motion estimation unit 222, the motion compensation unit 224, and the intra prediction unit 226) to generate a predictive block for a current block (e.g., the current CU, or in HEVC, the overlapping portion of the PU and TU). In the case of inter prediction of the current block, the motion estimation unit 222 may perform a motion search to identify one or more closely matching reference blocks in one or more reference pictures (e.g., one or more previously coded pictures stored in the DPB 218). In particular, the motion estimation unit 222 may calculate a value representing how similar a potential reference block is to the current block according to, for example, the sum of absolute differences (SAD), the sum of squared differences (SSD), the mean absolute difference (MAD), the mean squared difference (MSD), etc. The motion estimation unit 222 may generally perform these calculations using the sample-by-sample difference between the current block and the reference block under consideration. Motion estimation unit 222 may identify the reference block having the smallest value resulting from these calculations, indicating the reference block that most closely matches the current block.
[0148] The motion estimation unit 222 may form one or more motion vectors (MVs) that specify the position of a reference block in a reference picture relative to the position of a current block in the current picture. The motion estimation unit 222 may then provide the motion vectors to the motion compensation unit 224. For example, in the case of unidirectional inter prediction, the motion estimation unit 222 may provide a single motion vector, while in the case of 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, in the case of 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 sample-wise averaging or weighted averaging.
[0149] In some coding scenarios, the motion compensation unit 224 may generate a prediction block using a motion vector and motion vector refinement. The motion vector refinement may be based on template matching, for example. For example, the motion compensation unit 224 may identify an initial current block template based on the motion vector, search other templates around the initial current block template using a step size set to the initial step size, and iteratively reduce the step size from the initial step size until the step size is set to a final step size equal to the motion vector precision. The motion compensation unit 224 may perform the search using a variety of different search patterns.
[0150] As another example, in the case of 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 the case of a directional mode, the intra prediction unit 226 may generally mathematically combine the values of the neighboring samples and distribute these calculated values in a predefined direction across the current block to generate a predictive block. As another example, in the case of a DC mode, the intra prediction unit 226 may calculate an average of the neighboring samples for the current block and generate a predictive block to include this resulting average for each sample of the predictive block.
[0151] The mode select 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 select 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.
[0152] In examples in which mode select unit 202 partitions CUs into PUs, each PU may be associated with a luma prediction unit and a corresponding chroma prediction unit. Video encoder 200 and video decoder 300 may support PUs with 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, 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. Video encoder 200 and video decoder 300 may also support asymmetric partitioning for PU sizes of 2N×nU, 2N×nD, nL×2N, and nR×2N for inter prediction.
[0153] In examples where the mode select unit 202 does not further partition CUs into PUs, each CU may be associated with a luma coding block and a corresponding chroma coding block. As described above, the size of a CU may refer to the size of the luma coding block of the CU. The video encoder 200 and the video decoder 300 may support CU sizes of 2N×2N, 2N×N, or N×2N.
[0154] For other video coding techniques, such as intra-block copy mode coding, affine mode coding, and linear model (LM) mode coding, as some examples, 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, mode select unit 202 may not generate a predictive block, but instead may generate syntax elements that indicate a scheme for reconstructing the block based on a selected palette. In such modes, mode select unit 202 may provide these syntax elements to entropy coding unit 220 to be coded.
[0155] 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 sample-by-sample differences between the predictive block and the current block.
[0156] 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 linear transform and a quadratic 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.
[0157] The quantization unit 208 may quantize the transform coefficients within 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 select 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 therefore, the quantized transform coefficients may have lower precision than the original transform coefficients generated by the transform processing unit 206.
[0158] Inverse quantization unit 210 and inverse transform processing unit 212 may apply inverse quantization and inverse transform, respectively, to the quantized transform coefficient block to reconstruct a residual block from the transform coefficient block. Reconstruction unit 214 may generate a reconstructed block corresponding to the current block (potentially with some degree of distortion) based on the reconstructed residual block and the predictive block generated by mode select unit 202. For example, reconstruction unit 214 may add samples of the reconstructed residual block to corresponding samples from the predictive block generated by mode select unit 202 to generate the reconstructed block.
[0159] The filter unit 216 may perform one or more filter operations on the reconstructed block. For example, the filter unit 216 may perform a deblocking operation to reduce blockiness artifacts along the edges of the CU. In some examples, the operations of the filter unit 216 may be skipped.
[0160] Video encoder 200 stores reconstructed blocks in DPB 218. For example, in examples where the operations of filter unit 216 are not performed, reconstruction unit 214 may store reconstructed blocks in DPB 218. In examples where the operations of filter unit 216 are performed, filter unit 216 may store filtered reconstructed blocks in DPB 218. Motion estimation unit 222 and motion compensation unit 224 may retrieve reference pictures formed from reconstructed (and potentially filtered) blocks from DPB 218 to inter-predict blocks of a later-encoded picture. Additionally, intra-prediction unit 226 may use reconstructed blocks in DPB 218 of a current picture to intra-predict other blocks in the current picture.
[0161] Generally, entropy encoding unit 220 may entropy encode syntax elements received from other functional components of video encoder 200. For example, entropy encoding unit 220 may entropy encode quantized transform coefficient blocks from quantization unit 208. As another example, 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 mode select unit 202. 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, entropy encoding unit 220 may perform a context-adaptive variable length coding (CAVLC) operation, a CABAC operation, a variable-to-variable (V2V) length coding operation, a syntax-based context-adaptive binary arithmetic coding (SBAC) operation, a probability interval partitioned entropy (PIPE) coding operation, an exponential-Golomb coding operation, or another type of entropy coding operation on the data. In some examples, entropy encoding unit 220 may operate in a bypass mode in which syntax elements are not entropy coded.
[0162] Video encoder 200 may output a bitstream that includes entropy coding syntax elements needed to reconstruct blocks of a slice or picture. In particular, entropy coding unit 220 may output the bitstream.
[0163] The operations described above are described with respect to blocks. Such descriptions should be understood as operations for luma coding blocks and / or chroma coding blocks. As described above, in some examples, the luma coding blocks and chroma coding blocks are 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.
[0164] In some examples, operations performed with respect to luma coding blocks need not be repeated for chroma coding blocks. As one example, operations for identifying motion vectors (MVs) and reference pictures for luma coding blocks need not 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.
[0165] 12 is a block diagram illustrating an example video decoder 300 that may perform the techniques of this disclosure. Figure 12 is provided for purposes of explanation and not as a limitation of the techniques as broadly illustrated and described in this disclosure. For purposes of explanation, this disclosure describes a video decoder 300 in accordance with VVC (ITU-T H.266 under development) and HEVC (ITU-T H.265) techniques. However, the techniques of this disclosure may be performed by video coding devices configured for other video coding standards.
[0166] In the example of Figure 12, the video decoder 300 includes a coded picture buffer (CPB) memory 320, an entropy decoding unit 302, a prediction processing unit 304, an inverse quantization unit 306, an inverse transform processing unit 308, a reconstruction unit 310, a 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 circuitry. For example, the units of the video decoder 300 may be implemented as one or more circuits or logic elements as part of hardware circuitry, or as part of a processor, ASIC, or FPGA. Moreover, the video decoder 300 may include additional or alternative processors or processing circuitry for performing these and other functions.
[0167] Prediction processing unit 304 includes a motion compensation unit 316 and an intra prediction unit 318. Prediction processing unit 304 may include additional units for performing prediction according to other prediction modes. By way of example, prediction processing unit 304 may include a palette unit, an intra block copy unit (which may form part of motion compensation unit 316), an affine unit, a linear model (LM) unit, etc. In other examples, video decoder 300 may include more, fewer, or different functional components.
[0168] CPB memory 320 may store video data, such as an encoded video bitstream, to be decoded by components of video decoder 300. The video data stored in CPB memory 320 may be retrieved, for example, from computer-readable medium 110 (FIG. 1). CPB memory 320 may include a CPB that stores encoded video data (e.g., syntax elements) from the encoded video bitstream. CPB memory 320 may also store video data other than syntax elements of coded pictures, such as temporary data representing output from various units of video decoder 300. DPB 314 generally stores decoded pictures that video decoder 300 may output and / or use as reference video data when decoding subsequent data or pictures of the encoded video bitstream. CPB memory 320 and DPB 314 may be formed by any of a variety of memory devices, such as DRAM, including SDRAM, MRAM, RRAM, or other types of memory devices. CPB memory 320 and DPB 314 may be provided by the same memory device or separate memory devices. In various examples, the CPB memory 320 may be on-chip with other components of the video decoder 300, or may be off-chip relative to those components.
[0169] 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 as described above using 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.
[0170] The various units shown in FIG. 12 are presented to aid in understanding the operations performed by 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 specific functionality and are preconfigured for the operations that may be performed. Programmable circuits refer to circuits that can 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. While a fixed-function circuit may execute software instructions (e.g., to receive or output parameters), the types of operations that the fixed-function circuit performs are generally invariant. In some examples, one or more of the units may be different circuit blocks (fixed function or programmable), and in some examples, one or more of the units may be integrated circuits.
[0171] 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 programmable circuits, on-chip or off-chip memory may store instructions (e.g., object code) of the software that the video decoder 300 receives and executes.
[0172] 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.
[0173] In general, video decoder 300 reconstructs a picture on a block-by-block basis. Video decoder 300 may perform a reconstruction operation on each block individually (here, the block currently being reconstructed, i.e., decoded, may be referred to as the “current block”).
[0174] The entropy decoding unit 302 may entropy decode syntax elements that specify the quantized transform coefficients of a quantized transform coefficient block, as well as transform information such as a quantization parameter (QP) and / or a transform mode indication. 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 to apply. The inverse quantization unit 306 may, for example, perform a bitwise left-shift operation to inverse quantize the quantized transform coefficients. The inverse quantization unit 306 may thereby form a transform coefficient block including the transform coefficients.
[0175] After the inverse quantization unit 306 forms the transform coefficient blocks, the inverse transform processing unit 308 may apply one or more inverse transforms to the transform coefficient blocks to generate residual blocks 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 blocks.
[0176] Further, prediction processing unit 304 generates a predictive 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 the predictive 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 identifies 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 the inter-prediction process in a manner substantially similar to that described with respect to motion compensation unit 224 (FIG. 11).
[0177] The motion compensation unit 316 includes a DMVR unit 317, which may perform various techniques described in this disclosure, including the TM techniques described herein. The DMVR unit 317 may be configured to improve the motion vector based on TM, for example, by identifying a current block template in the current picture and searching within a search area for a final reference block template corresponding to the current block template. To search within the search area, the DMVR unit 317 may be configured to identify an initial reference block template based on the motion vector, search other reference block templates around the initial reference block template using a step size set to the initial step size, and iteratively reduce the step size from the initial step size until the step size is set to a final step size equal to the motion vector precision. The DMVR unit 317 may then determine a predictive block for the block based on the final reference block template. The predictive block may be, for example, the block to the lower right of the final reference block template, as shown by FIG. 5.
[0178] As another example, if the prediction information syntax element indicates that the current block is intra-predicted, the intra prediction unit 318 may generate the predictive block according to the intra-prediction mode indicated by the prediction information syntax element. Again, the intra prediction unit 318 may generally perform the 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 neighboring samples to the current block from the DPB 314.
[0179] 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.
[0180] The filter unit 312 may perform one or more filter operations on the reconstructed block. For example, the filter unit 312 may perform a deblocking operation to reduce blockiness artifacts along the edges of the reconstructed block. The operations of the filter unit 312 may not be performed in all instances.
[0181] The video decoder 300 may store the reconstructed blocks in the DPB 314. For example, in examples where the operations of the filter unit 312 are not performed, the reconstruction unit 310 may store the reconstructed blocks in the DPB 314. In examples where the operations of the filter unit 312 are performed, the filter unit 312 may store the filtered reconstructed blocks in the DPB 314. As described above, the DPB 314 may provide reference information to the prediction processing unit 304, such as samples of the current picture for intra prediction and previously decoded pictures for subsequent motion compensation. Moreover, the video decoder 300 may output decoded pictures (e.g., decoded video) from the DPB 314 for later presentation on a display device, such as the display device 118 of FIG. 1.
[0182] 13 is a flowchart illustrating an example process for encoding a current block in accordance with 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 process similar to that of FIG. 13.
[0183] In this example, the video encoder 200 first predicts the current block (350). For example, the video encoder 200 may form a predictive block for the current block. The video encoder 200 may then calculate a residual block for the current block (352). To calculate the residual block, the video encoder 200 may calculate the difference between an original uncoded block and a predictive block for the current block. The video encoder 200 may then transform the residual block and quantize the transform coefficients of the residual block (354). The video encoder 200 may then scan the quantized transform coefficients of the residual block (356). During or following the scan, the video encoder 200 may entropy code the transform coefficients (358). For example, the video encoder 200 may code the transform coefficients using CAVLC or CABAC. The video encoder 200 may then output entropy-coded data for the block (360).
[0184] 14 is a flowchart illustrating an example process for decoding a current block of video data in accordance with the techniques of this disclosure. The current block may comprise a current CU. Although described with respect to video decoder 300 (FIGS. 1 and 12), it should be understood that other devices may be configured to perform a process similar to that of FIG. 14.
[0185] The video decoder 300 may receive entropy-coded data for the current block, such as entropy-coded prediction information and entropy-coded data for transform 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 reconstruct the transform coefficients of the residual block (372). The video decoder 300 may predict the current block, e.g., using an intra or inter prediction mode as indicated by the prediction information for the current block, to calculate a predictive block for the current block (374). The video decoder 300 may then inverse scan the reconstructed transform coefficients to create a block of quantized transform coefficients (376). The video decoder 300 may then dequantize the transform coefficients and apply an inverse transform to the transform coefficients to generate a residual block (378). The video decoder 300 may finally decode the current block by combining the predictive block and the residual block (380).
[0186] 15 is a flowchart illustrating an example process for decoding a current block in accordance with the techniques of this disclosure. The current block may comprise a current CU. FIG. 15 is described with respect to a generic video decoder, which may correspond to the video decoding loop of, for example, video decoder 300 (FIGS. 1 and 12) or video encoder 200 (FIGS. 1 and 11). However, it should be understood that other devices may be configured to perform a process similar to that of FIG. 15.
[0187] The video decoder determines that a block of a current picture is coded in an inter-prediction mode (400). The inter-prediction mode may be, for example, AMVP mode or merge mode.
[0188] The video decoder determines a motion vector for the current block based on the inter prediction mode (402) and determines the motion vector precision for the motion vector (404). For example, if the inter prediction mode is AMVP mode, the video decoder may determine the motion vector precision for the current block by receiving a syntax element in the bitstream that indicates the motion vector precision. For example, if the inter prediction mode is merge mode, the video decoder may determine the motion vector precision for the current block by determining the motion vector precision from candidates in the merge list.
[0189] The video decoder identifies a current block template within the current picture (406). The video decoder may locate the template around the current block, including, for example, samples above and to the left of the current block, as shown in FIG.
[0190] The video decoder searches within a search area for a final current block template that corresponds to the reference block template (408). The search area may be, for example, an area that is within eight samples in the x-direction of a top-left sample of the reference block in the reference picture determined from the motion vector and within eight samples in the y-direction of the top-left sample.
[0191] To search within the search area for a final reference block template that corresponds to the current block template, the video decoder identifies an initial reference block template based on the motion vector (410), searches other reference block templates around the initial reference block template using a step size that is set to the initial step size (412), and iteratively reduces the step size from the initial step size until the step size is set to a final step size that is equal to the motion vector precision (414).
[0192] In contrast to techniques that always use a default pel step size, such as a step size of 1 / 8 pel, according to the techniques of this disclosure, the final step size may be larger than 1 / 8 pel in some coding scenarios. All values of the step size used to search within the search area may be greater than or equal to the motion vector precision. The initial step size may be equal to n pels, for example, and to iteratively reduce the step size from the initial step size until the step size is set to a final step size equal to the motion vector precision, the video decoder may reduce the step size from n pels to n / 2 pels, and continue to reduce the step size by a factor of 1 / 2 until the step size is equal to the motion vector precision.
[0193] To iteratively reduce the initial step size until the final step size is equal to the motion vector precision, the video decoder may, for example, determine that the step size is equal to the motion vector precision and may terminate the iterative reduction of the step size in response to determining that the step size is equal to the motion vector precision. Additionally or alternatively, to iteratively reduce the initial step size until the final step size is equal to the motion vector precision, the video decoder may, for example, search other templates around the initial current block template using the initial step size to determine a first improved motion vector, iteratively reduce the step size from the initial step size to a high precision step size, identify a new initial current block template based on the first improved motion vector, and search a second group of other templates around the new initial current block template using the high precision step size to determine a second improved motion vector. Additionally or alternatively, to iteratively reduce the initial step size until the final step size is equal to the motion vector precision, the video decoder may search other templates around the initial current block template using the initial step size and a first search pattern to determine a first improved motion vector, may identify a new initial current block template based on the first improved motion vector, and may search a second group of other templates around the new initial current block template using the initial step size and a second search pattern to determine a second improved motion vector.
[0194] The video decoder determines a predictive block for the current block based on the final current block template (416). Due to the motion vector refinement process, the predictive block determined for the current block based on the final current block template may not be the same as the initial reference block identified by the motion vector.
[0195] The video decoder decodes the current picture based on the determined prediction block (418). The video decoder may, for example, add the determined prediction to the residual block to form a reconstructed block and may perform one or more filtering operations on the reconstructed block.
[0196] The video decoder outputs a decoded version of the current picture (420). To output the decoded version of the current picture, the video decoder may be configured to output the decoded version of the current picture for display. In cases where the video decoder is a component of a video encoder, the video decoder may be configured to output the decoded version of the current picture by storing the decoded version of the current picture for use in encoding subsequent blocks of video data.
[0197] The following numbered clauses describe one or more aspects of the devices and techniques described in this disclosure.
[0198] Clause 1A. A method for decoding video data, the method comprising: determining that a current block of video data is encoded in an inter-prediction mode; and decoding the current block of video data using the inter-prediction mode.
[0199] Clause 2A. The method of clause 1A, wherein decoding the current block of video data using an inter prediction mode comprises maintaining a candidate list for the current block, selecting a candidate from the candidate list, and decoding the current block of video data using motion information of the selected candidate.
[0200] Clause 3A. The method of clause 1A or 2A, further comprising performing a template matching motion vector refinement process using an initial step size that is equal to or greater than the motion vector resolution of the motion vectors used decoded blocks.
[0201] Clause 4A. The method of any of clauses 1A to 3A, wherein the inter-prediction mode comprises a bidirectional inter-prediction mode, and the method further comprises performing a template matching motion vector refinement process on a first unidirectional motion vector, and after performing the template matching motion vector refinement process on the first motion vector, performing a template matching motion vector refinement process on a second unidirectional motion vector.
[0202] Clause 5A. The method of clause 3A or 4A, wherein performing the template matching motion vector refinement process comprises identifying an initial location in the reference picture based on the motion vector and performing template matching within a search area around the initial location, and decoding the current block of video data using the motion information of the selected candidate comprises identifying the reference block based on the template matching.
[0203] Clause 6A. The method of any one of clauses 1A to 5A, wherein the decoding method is performed as part of the encoding method.
[0204] Clause 7A. A device for coding video data, the device comprising one or more means for performing the methods of any of clauses 1A to 6A.
[0205] Clause 8A. The device of clause 7A, wherein the one or more means comprise one or more processors implemented in circuitry.
[0206] Clause 9A. The device of clause 7A or 8A, further comprising a memory for storing video data.
[0207] Clause 10A. The device of any of clauses 7A to 9A, further comprising a display configured to display the decoded video data.
[0208] Clause 11A. The device of any of clauses 7A to 10A, wherein the device comprises one or more of a camera, a computer, a mobile device, a broadcast receiver device, or a set-top box.
[0209] Clause 12A. The device of any one of clauses 7A to 11A, wherein the device comprises a video decoder.
[0210] Clause 13A. The device of any one of clauses 7A to 12A, wherein the device comprises a video encoder.
[0211] Clause 14A. A computer-readable storage medium having stored thereon instructions that, when executed, cause one or more processors to perform the method of any of clauses 1A-6A.
[0212] Clause 15A. A device for encoding video data, the device comprising: means for determining that a current block of video data is encoded in an inter-prediction mode; and means for decoding the current block of video data using the inter-prediction mode.
[0213] Clause 1B. A device for decoding video data, the device comprising: a memory configured to store video data; and one or more processors implemented in a circuit configuration, the one or more processors configured to: determine that a current block of a current picture is coded in an inter-prediction mode; determine a motion vector for the current block based on the inter-prediction mode; determine motion vector accuracy for the motion vector; identify a current block template in the current picture; search within a search area for a final reference block template corresponding to the current block template, wherein to search within the search area, the one or more processors are further configured to identify an initial reference block template based on the motion vector, search other reference block templates around the initial reference block template using a step size set to the initial step size, and iteratively reduce the step size from the initial step size until the step size is set to a final step size equal to the motion vector accuracy; determine a predictive block for the current block based on the final reference block template; decode the current picture based on the determined predictive block; and output a decoded version of the current picture.
[0214] Clause 2B. The device of clause 1B, wherein, to iteratively reduce the step size from an initial step size until the step size is set to a final step size equal to the motion vector precision, the one or more processors are further configured to determine that the step size is equal to the motion vector precision, and to terminate the iterative reduction of the step size in response to determining that the step size is equal to the motion vector precision.
[0215] Clause 3B. The device of Clause 1B, wherein, to iteratively reduce the initial step size until the final step size is equal to the motion vector precision, the one or more processors are further configured to: search other reference block templates around the initial reference block template using the initial step size to determine a first improved motion vector; iteratively reduce the step size from the initial step size to a high precision step size; identify a new initial reference block template based on the first improved motion vector; and search a second group of other reference block templates around the new initial reference block template using the high precision step size to determine a second improved motion vector.
[0216] Clause 4B. The device of clause 1B, wherein the initial step size is equal to n pels, and the one or more processors are further configured to reduce the step size from n pels to n / 2 pels to iteratively reduce the step size from the initial step size until the step size is set to a final step size equal to the motion vector precision.
[0217] Clause 5B. The device of clause 1B, wherein all values of the step sizes used to search within the search area are greater than or equal to the motion vector precision.
[0218] Clause 6B. The device of clause 1B, wherein, for iteratively reducing the step size, the one or more processors are further configured to reduce the step size by a factor of 1 / 2.
[0219] Clause 7B. The device of Clause 1B, wherein, to iteratively reduce the initial step size until the final step size is equal to the motion vector precision, the one or more processors are further configured to: search other reference block templates around the initial reference block template using the initial step size and a first search pattern to determine a first improved motion vector; identify a new initial reference block template based on the first improved motion vector; and search a second group of other reference block templates around the new initial reference block template using the initial step size and a second search pattern to determine a second improved motion vector.
[0220] Clause 8B. The device of clause 1B, wherein the motion vector identifies a top-left sample of a reference block in the reference picture, and the search area is an area within 8 samples in the x-direction of the top-left sample and within 8 samples in the y-direction of the top-left sample.
[0221] Clause 9B. The device of clause 1B, wherein the motion vector precision and final step size are greater than 1 / 8 pel.
[0222] Clause 10B. The device of clause 1B, wherein the inter prediction mode comprises AMVP mode, and determining the motion vector precision for the current block comprises receiving in the bitstream a syntax element indicating the motion vector precision.
[0223] Clause 11B. The device of clause 1B, wherein the inter prediction mode comprises a merge mode, and determining the motion vector accuracy for the current block comprises determining the motion vector accuracy from candidates in a merge list.
[0224] Clause 12B. The device of clause 1B, wherein for outputting the decoded version of the current picture, the one or more processors are further configured to output the decoded version of the current picture for display.
[0225] Clause 13B. The device of clause 1B, wherein the device for decoding is configured to decode a current block of a current picture as part of performing an encoding process for the current picture, and wherein the one or more processors are further configured to store the decoded version of the current picture for use in encoding subsequent blocks of video data, to output the decoded version of the current picture.
[0226] Clause 14B. The device of clause 1B, wherein the device comprises a wireless communication device, further comprising a receiver configured to receive encoded video data.
[0227] Clause 15B. The device of clause 14B, wherein the wireless communications device comprises a telephone handset, and the receiver is configured to demodulate the signal comprising the encoded video data in accordance with a wireless communications standard.
[0228] Clause 16B. The device of clause 1B, further comprising a display configured to display the decoded video data.
[0229] Clause 17B. The device of clause 1B, wherein the device comprises one or more of a computer, a mobile device, a broadcast receiver device, or a set-top box.
[0230] Clause 18B. The device of clause 1B, wherein the device comprises a camera configured to capture video data.
[0231] Clause 19B. A method for decoding video data, the method comprising: determining that a current block of a current picture is coded in an inter-prediction mode; determining a motion vector for the current block based on the inter-prediction mode; determining motion vector precision for the motion vector; identifying a current block template in the current picture; searching within a search area for a final reference block template corresponding to the current block template, wherein searching within the search area comprises identifying an initial reference block template based on the motion vector; searching other reference block templates around the initial reference block template using a step size set to the initial step size; and iteratively reducing the step size from the initial step size until the step size is set to a final step size equal to the motion vector precision; determining a predictive block for the current block based on the final reference block template; decoding the current picture based on the determined predictive block; and outputting a decoded version of the current picture.
[0232] Clause 20B. The method of clause 19B, wherein iteratively reducing the step size from an initial step size until the step size is set to a final step size equal to the motion vector precision comprises determining that the step size is equal to the motion vector precision; and terminating the iteratively reducing the step size in response to determining that the step size is equal to the motion vector precision.
[0233] Clause 21B. The method of clause 19B, wherein iteratively reducing the initial step size until the final step size is equal to the motion vector precision comprises searching other reference block templates around the initial reference block template using the initial step size to determine a first improved motion vector; iteratively reducing the step size from the initial step size to a high precision step size; identifying a new initial reference block template based on the first improved motion vector; and searching a second group of other reference block templates around the new initial reference block template using the high precision step size to determine a second improved motion vector.
[0234] Clause 22B. The method of clause 19B, wherein the initial step size is equal to n pels, and wherein iteratively reducing the step size from the initial step size until the step size is set to a final step size equal to the motion vector precision comprises reducing the step size from n pels to n / 2 pels.
[0235] Clause 23B. The method of clause 19B, wherein all values of the step sizes used to search within the search area are greater than or equal to the motion vector precision.
[0236] Clause 24B. The method of clause 19B, wherein iteratively reducing the step size comprises reducing the step size by a factor of 1 / 2.
[0237] Clause 25B. The method of clause 19B, wherein iteratively reducing the initial step size until the final step size is equal to the motion vector precision comprises searching other reference block templates around the initial reference block template using the initial step size and a first search pattern to determine a first improved motion vector, identifying a new initial reference block template based on the first improved motion vector, and searching a second group of other reference block templates around the new initial reference block template using the initial step size and a second search pattern to determine a second improved motion vector.
[0238] Clause 26B. The method of clause 19B, wherein the motion vector identifies a top-left sample of a reference block in the reference picture, and the search area is an area within 8 samples in the x-direction of the top-left sample and within 8 samples in the y-direction of the top-left sample.
[0239] Clause 27B. The method of clause 19B, wherein the motion vector precision and final step size are greater than 1 / 8 pel.
[0240] Clause 28B. The method of clause 19B, wherein the inter prediction mode comprises AMVP mode, and determining the motion vector precision for the current block comprises receiving a syntax element in the bitstream indicating the motion vector precision.
[0241] Clause 29B. The method of clause 19B, wherein the inter prediction mode comprises a merge mode, and determining the motion vector accuracy for the current block comprises determining the motion vector accuracy from candidates in a merge list.
[0242] Clause 30B. The method of clause 19B, wherein outputting the decoded version of the current picture comprises outputting the decoded version of the current picture for display.
[0243] Clause 31B. The method of clause 19B, wherein the decoding method is performed as part of a video encoding process, and wherein outputting the decoded version of the current picture comprises storing the decoded version of the current picture for use in encoding subsequent blocks of video data.
[0244] Clause 32B. A computer-readable storage medium storing instructions, which, when executed by one or more processors, cause the one or more processors to: determine that a current block of a current picture is coded in an inter-prediction mode; determine a motion vector for the current block based on the inter-prediction mode; determine a motion vector accuracy for the motion vector; identify a current block template in the current picture; and search within a search area for a final reference block template corresponding to the current block template, wherein to search within the search area, the instructions cause the one or more processors to identify an initial reference block template based on the motion vector, search other reference block templates around the initial reference block template using a step size set to an initial step size, and iteratively reduce the step size from the initial step size until the step size is set to a final step size equal to the motion vector accuracy; determine a predictive block for the current block based on the final reference block template; decode the current picture based on the determined predictive block; and output a decoded version of the current picture.
[0245] Clause 33B. The computer-readable storage medium of Clause 32B, wherein to iteratively reduce the step size from the initial step size until the step size is set to a final step size equal to the motion vector precision, the one or more processors are further configured to: determine that the step size is equal to the motion vector precision; and, in response to determining that the step size is equal to the motion vector precision, terminate the iterative reduction of the step size.
[0246] Clause 34B. The computer-readable storage medium of Clause 32B, wherein to iteratively reduce the initial step size until the final step size is equal to the motion vector precision, the one or more processors are further configured to: search other reference block templates around the initial reference block template using the initial step size to determine a first improved motion vector; iteratively reduce the step size from the initial step size to a high precision step size; identify a new initial reference block template based on the first improved motion vector; and search a second group of other reference block templates around the new initial reference block template using the high precision step size to determine a second improved motion vector.
[0247] Clause 35B. The computer-readable storage medium of clause 32B, wherein the initial step size is equal to n pels, and the one or more processors are further configured to reduce the step size from n pels to n / 2 pels to iteratively reduce the step size from the initial step size until the step size is set to a final step size equal to the motion vector precision.
[0248] Clause 36B. The computer-readable storage medium of clause 32B, wherein all values of the step sizes used to search within the search area are greater than or equal to the motion vector precision.
[0249] Clause 37B. The computer-readable storage medium of clause 32B, wherein, to iteratively reduce the step size, the one or more processors are further configured to reduce the step size by a factor of ½.
[0250] Clause 38B. The computer-readable storage medium of Clause 32B, wherein to iteratively reduce the initial step size until the final step size is equal to the motion vector precision, the one or more processors are further configured to: search other reference block templates around the initial reference block template using the initial step size and a first search pattern to determine a first improved motion vector; identify a new initial reference block template based on the first improved motion vector; and search a second group of other reference block templates around the new initial reference block template using the initial step size and a second search pattern to determine a second improved motion vector.
[0251] Clause 39B. The computer-readable storage medium of clause 32B, wherein the motion vector identifies a top-left sample of a reference block in the reference picture, and the search area is an area within 8 samples in an x-direction of the top-left sample and within 8 samples in a y-direction of the top-left sample.
[0252] Clause 40B. The computer-readable storage medium of clause 32B, wherein the motion vector precision and final step size are greater than 1 / 8 pel.
[0253] Clause 41B. The computer-readable storage medium of clause 32B, wherein the inter prediction mode comprises an AMVP mode, and determining the motion vector precision for the current block comprises receiving a syntax element in the bitstream indicating the motion vector precision.
[0254] Clause 42B. The computer-readable storage medium of clause 32B, wherein the inter prediction mode comprises a merge mode, and determining the motion vector accuracy for the current block comprises determining the motion vector accuracy from candidates in a merge list.
[0255] Clause 43B. The computer-readable storage medium of clause 32B, wherein to output the decoded version of the current picture, the one or more processors are further configured to output the decoded version of the current picture for display.
[0256] Clause 44B. The computer-readable storage medium of clause 32B, wherein the device for decoding is configured to decode a current block of a current picture as part of performing an encoding process for the current picture, and wherein the one or more processors are further configured to store the decoded version of the current picture for use in encoding subsequent blocks of video data to output the decoded version of the current picture.
[0257] Clause 45B. A device for decoding video data, the device comprising: means for determining that a current block of a current picture is coded in an inter-prediction mode; means for determining a motion vector for the current block based on the inter-prediction mode; means for determining motion vector accuracy for the motion vector; means for identifying a current block template in the current picture; means for searching within a search area for a final reference block template corresponding to the current block template, the means for searching within the search area comprising: means for identifying an initial reference block template based on the motion vector; means for searching other reference block templates around the initial reference block template using a step size set to the initial step size; and means for iteratively reducing the step size from the initial step size until the step size is set to a final step size equal to the motion vector accuracy; means for determining a predictive block for the current block based on the final reference block template; means for decoding the current picture based on the determined predictive block; and means for outputting a decoded version of the current picture.
[0258] Clause 1C. A device for decoding video data, the device comprising: a memory configured to store the video data; and one or more processors implemented in a circuit configuration, the one or more processors configured to: determine that a current block of a current picture is coded in an inter-prediction mode; determine a motion vector for the current block based on the inter-prediction mode; determine motion vector accuracy for the motion vector; identify a current block template in the current picture; and search within a search area for a final reference block template corresponding to the current block template, wherein to search within the search area, the one or more processors are further configured to identify an initial reference block template based on the motion vector, search other reference block templates around the initial reference block template using a step size set to the initial step size, and iteratively reduce the step size from the initial step size until the step size is set to a final step size equal to the motion vector accuracy; determine a predictive block for the current block based on the final reference block template; decode the current picture based on the determined predictive block; and output a decoded version of the current picture.
[0259] Clause 2C. The device of clause 1C, wherein, to iteratively reduce the step size from an initial step size until the step size is set to a final step size equal to the motion vector precision, the one or more processors are further configured to determine that the step size is equal to the motion vector precision, and to terminate the iterative reduction of the step size in response to determining that the step size is equal to the motion vector precision.
[0260] Clause 3C. The device of any of Clauses 1C to 2C, wherein, to iteratively reduce the initial step size until the final step size is equal to the motion vector precision, the one or more processors are further configured to: search other reference block templates around the initial reference block template using the initial step size to determine a first improved motion vector; iteratively reduce the step size from the initial step size to a high precision step size; identify a new initial reference block template based on the first improved motion vector; and search a second group of other reference block templates around the new initial reference block template using the high precision step size to determine a second improved motion vector.
[0261] Clause 4C. The device of any of clauses 1C to 3C, wherein the initial step size is equal to n pels, and wherein the one or more processors are further configured to reduce the step size from n pels to n / 2 pels to iteratively reduce the step size from the initial step size until the step size is set to a final step size equal to the motion vector precision.
[0262] Clause 5C. The device of any of clauses 1C to 4C, wherein all values of the step sizes used to search within the search area are greater than or equal to the motion vector precision.
[0263] Clause 6C. The device of any of clauses 1C-5C, wherein, for iteratively reducing the step size, the one or more processors are further configured to reduce the step size by a factor of 1 / 2.
[0264] Clause 7C. The device of any of Clauses 1C to 6C, wherein, to iteratively reduce the initial step size until the final step size is equal to the motion vector precision, the one or more processors are further configured to: search other reference block templates around the initial reference block template using the initial step size and a first search pattern to determine a first improved motion vector; identify a new initial reference block template based on the first improved motion vector; and search a second group of other reference block templates around the new initial reference block template using the initial step size and a second search pattern to determine a second improved motion vector.
[0265] Clause 8C. The device of any of clauses 1C to 7C, wherein the motion vector identifies a top-left sample of a reference block in the reference picture, and the search area is an area within 8 samples in the x-direction of the top-left sample and within 8 samples in the y-direction of the top-left sample.
[0266] Clause 9C. The device of any of clauses 1C-8C, wherein the motion vector precision and final step size are greater than 1 / 8 pel.
[0267] Clause 10C. The device of any of clauses 1C to 9C, wherein the inter prediction mode comprises AMVP mode, and determining the motion vector precision for the current block comprises receiving a syntax element in the bitstream indicating the motion vector precision.
[0268] Clause 11C. The device of any of clauses 1C to 10C, wherein the inter prediction mode comprises a merge mode, and determining the motion vector accuracy for the current block comprises determining the motion vector accuracy from candidates in a merge list.
[0269] Clause 12C. The device of any of clauses 1C to 11C, wherein for outputting the decoded version of the current picture, the one or more processors are further configured to output the decoded version of the current picture for display.
[0270] Clause 13C. The device of any of clauses 1C to 12C, wherein the device for decoding is configured to decode a current block of a current picture as part of performing an encoding process for the current picture, and wherein the one or more processors are further configured to store the decoded version of the current picture for use in encoding subsequent blocks of video data, to output the decoded version of the current picture.
[0271] Clause 14C. The device of any of clauses 1C to 13C, wherein the device comprises a wireless communication device, further comprising a receiver configured to receive encoded video data.
[0272] Clause 15C. The device of clause 14C, wherein the wireless communications device comprises a telephone handset, and the receiver is configured to demodulate the signal comprising the encoded video data in accordance with a wireless communications standard.
[0273] Clause 16C. The device of any of clauses 1C to 15C, further comprising a display configured to display the decoded video data.
[0274] Clause 17C. The device of any of clauses 1C to 16C, wherein the device comprises one or more of a computer, a mobile device, a broadcast receiver device, or a set-top box.
[0275] Clause 18C. The device of any of clauses 1C to 17C, wherein the device comprises a camera configured to capture video data.
[0276] Clause 19C. A method for decoding video data, the method comprising: determining that a current block of a current picture is coded in an inter-prediction mode; determining a motion vector for the current block based on the inter-prediction mode; determining a motion vector precision for the motion vector; identifying a current block template in the current picture; searching within a search area for a final reference block template corresponding to the current block template, wherein searching within the search area comprises identifying an initial reference block template based on the motion vector; searching other reference block templates around the initial reference block template using a step size set to the initial step size; and iteratively reducing the step size from the initial step size until the step size is set to a final step size equal to the motion vector precision; determining a predictive block for the current block based on the final reference block template; decoding the current picture based on the determined predictive block; and outputting a decoded version of the current picture.
[0277] Clause 20C. The method of clause 19C, wherein iteratively reducing the step size from the initial step size until the step size is set to a final step size equal to the motion vector precision comprises determining that the step size is equal to the motion vector precision, and terminating the iteratively reducing the step size in response to determining that the step size is equal to the motion vector precision.
[0278] Clause 21C. The method of any of clauses 19C to 20C, wherein iteratively reducing the initial step size until the final step size is equal to the motion vector precision comprises searching other reference block templates around the initial reference block template using the initial step size to determine a first improved motion vector; iteratively reducing the step size from the initial step size to a high precision step size; identifying a new initial reference block template based on the first improved motion vector; and searching a second group of other reference block templates around the new initial reference block template using the high precision step size to determine a second improved motion vector.
[0279] Clause 22C. The method of any of clauses 19C to 21C, wherein the initial step size is equal to n pels, and wherein iteratively reducing the step size from the initial step size until the step size is set to a final step size equal to the motion vector precision comprises reducing the step size from n pels to n / 2 pels.
[0280] Clause 23C. The method of any of clauses 19C to 22C, wherein all values of the step sizes used to search within the search area are greater than or equal to the motion vector precision.
[0281] Clause 24C. The method of any of clauses 19C to 23C, wherein iteratively reducing the step size comprises reducing the step size by a factor of 1 / 2.
[0282] Clause 25C. The method of any of clauses 19C to 24C, wherein iteratively reducing the initial step size until the final step size is equal to the motion vector precision comprises searching other reference block templates around the initial reference block template using the initial step size and a first search pattern to determine a first improved motion vector, identifying a new initial reference block template based on the first improved motion vector, and searching a second group of other reference block templates around the new initial reference block template using the initial step size and a second search pattern to determine a second improved motion vector.
[0283] Clause 26C. The method of any of clauses 19C to 25C, wherein the motion vector identifies a top-left sample of a reference block in the reference picture, and the search area is within 8 samples in the x-direction of the top-left sample and within 8 samples in the y-direction of the top-left sample.
[0284] Clause 27C. The method of any of clauses 19C-26C, wherein the motion vector precision and final step size are greater than 1 / 8 pel.
[0285] Clause 28C. Any of the methods of clauses 19C to 27C, wherein the inter prediction mode comprises AMVP mode, and determining the motion vector precision for the current block comprises receiving a syntax element in the bitstream indicating the motion vector precision.
[0286] Clause 29C. The method of any of clauses 19C to 28C, wherein the inter prediction mode comprises a merge mode, and determining the motion vector accuracy for the current block comprises determining the motion vector accuracy from candidates in a merge list.
[0287] Clause 30C. The method of any of clauses 19C to 29C, wherein outputting the decoded version of the current picture comprises outputting the decoded version of the current picture for display.
[0288] Clause 31C. The method of any of clauses 19C to 30C, wherein the decoding method is performed as part of a video encoding process, and wherein outputting the decoded version of the current picture comprises storing the decoded version of the current picture for use in encoding subsequent blocks of video data.
[0289] Clause 32C. A computer-readable storage medium storing instructions that, when executed by one or more processors, cause the one or more processors to: determine that a current block of a current picture is coded in an inter-prediction mode; determine a motion vector for the current block based on the inter-prediction mode; determine a motion vector accuracy for the motion vector; identify a current block template in the current picture; and search within a search area for a final reference block template corresponding to the current block template, wherein to search within the search area, the instructions cause the one or more processors to identify an initial reference block template based on the motion vector, search other reference block templates around the initial reference block template using a step size set to the initial step size, and iteratively reduce the step size from the initial step size until the step size is set to a final step size equal to the motion vector accuracy; determine a predictive block for the current block based on the final reference block template; decode the current picture based on the determined predictive block; and output a decoded version of the current picture.
[0290] Clause 33C. The computer-readable storage medium of Clause 32C, wherein to iteratively reduce the step size from the initial step size until the step size is set to a final step size equal to the motion vector precision, the one or more processors are further configured to: determine that the step size is equal to the motion vector precision; and, in response to determining that the step size is equal to the motion vector precision, terminate the iterative reduction of the step size.
[0291] Clause 34C. The computer-readable storage medium of any of Clauses 32C to 33C, wherein to iteratively reduce the initial step size until the final step size is equal to the motion vector precision, the one or more processors are further configured to: search other reference block templates around the initial reference block template using the initial step size to determine a first improved motion vector; iteratively reduce the step size from the initial step size to a high precision step size; identify a new initial reference block template based on the first improved motion vector; and search a second group of other reference block templates around the new initial reference block template using the high precision step size to determine a second improved motion vector.
[0292] Clause 35C. The computer-readable storage medium of any of Clauses 32C to 34C, wherein the initial step size is equal to n pels, and the one or more processors are further configured to reduce the step size from n pels to n / 2 pels to iteratively reduce the step size from the initial step size until the step size is set to a final step size equal to the motion vector precision.
[0293] Clause 36C. The computer-readable storage medium of any of clauses 32C to 35C, wherein all values of the step sizes used to search within the search area are greater than or equal to the motion vector precision.
[0294] Clause 37C. The computer-readable storage medium of any of clauses 32C to 36C, wherein, to iteratively reduce the step size, the one or more processors are further configured to reduce the step size by a factor of ½.
[0295] Clause 38C. The computer-readable storage medium of any of Clauses 32C to 37C, wherein to iteratively reduce the initial step size until the final step size is equal to the motion vector accuracy, the one or more processors are further configured to: search other reference block templates around the initial reference block template using the initial step size and a first search pattern to determine a first improved motion vector; identify a new initial reference block template based on the first improved motion vector; and search a second group of other reference block templates around the new initial reference block template using the initial step size and a second search pattern to determine a second improved motion vector.
[0296] Clause 39C. The computer-readable storage medium of any of clauses 32C to 38C, wherein the motion vector identifies a top-left sample of a reference block in the reference picture, and the search area is an area within 8 samples in the x-direction of the top-left sample and within 8 samples in the y-direction of the top-left sample.
[0297] Clause 40C. The computer-readable storage medium of any of clauses 32C to 39C, wherein the motion vector precision and final step size are greater than 1 / 8 pel.
[0298] Clause 41C. The computer-readable storage medium of any of clauses 32C to 40C, wherein the inter prediction mode comprises AMVP mode, and determining the motion vector precision for the current block comprises receiving a syntax element in the bitstream indicating the motion vector precision.
[0299] Clause 42C. The computer-readable storage medium of any of clauses 32C to 41C, wherein the inter prediction mode comprises a merge mode, and determining the motion vector accuracy for the current block comprises determining the motion vector accuracy from candidates in a merge list.
[0300] Clause 43C. The computer-readable storage medium of any of Clauses 32C to 42C, wherein, to output the decoded version of the current picture, the one or more processors are further configured to output the decoded version of the current picture for display.
[0301] Clause 44C. The computer-readable storage medium of any of clauses 32C to 43C, wherein the device for decoding is configured to decode a current block of a current picture as part of performing an encoding process for the current picture, and wherein the one or more processors are further configured to store the decoded version of the current picture for use in encoding subsequent blocks of video data, to output the decoded version of the current picture.
[0302] Clause 45C. A device for decoding video data, the device comprising: means for determining that a current block of a current picture is coded in an inter-prediction mode; means for determining a motion vector for the current block based on the inter-prediction mode; means for determining motion vector precision for the motion vector; means for identifying a current block template in the current picture; means for searching within a search area for a final reference block template corresponding to the current block template, the means for searching within the search area comprising: means for identifying an initial reference block template based on the motion vector; means for searching other reference block templates around the initial reference block template using a step size set to the initial step size; and means for iteratively reducing the step size from the initial step size until the step size is set to a final step size equal to the motion vector precision; means for determining a predictive block for the current block based on the final reference block template; means for decoding the current picture based on the determined predictive block; and means for outputting a decoded version of the current picture.
[0303] It should be appreciated that, depending on the example, some acts or events of any of the techniques described herein may be performed in a different sequence, may be added, combined, or may be omitted entirely (e.g., not all described acts or events may be necessary to practice the techniques). Moreover, in some examples, acts or events may be performed in parallel rather than sequentially, for example, through multithreaded processing, interrupt processing, or multiple processors.
[0304] 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. Computer-readable media may include computer-readable storage media, which correspond to tangible media such as data storage media, or communication media, including any medium that facilitates transfer of a computer program from one place to another, for example, according to a communication protocol. In this manner, computer-readable media may generally correspond to (1) tangible computer-readable storage media that are non-transitory, or (2) a communication medium such as a signal or carrier wave. Data storage media 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 implementing the techniques described in this disclosure. A computer program product may include a computer-readable medium.
[0305] 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 termed 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 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 discs (CDs), laser discs, optical discs, digital versatile discs (DVDs), floppy disks, and Blu-ray discs, 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.
[0306] The instructions may be executed by one or more processors, such as one or more DSPs, general-purpose microprocessors, ASICs, FPGAs, or other equivalent integrated or discrete logic circuitry. Accordingly, the terms "processor" and "processing circuitry," as used herein, may refer to any of the above structures or any other structure suitable for implementing the techniques described herein. Additionally, 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 combined codec. Also, the techniques may be implemented entirely within one or more circuits or logic elements.
[0307] The techniques of this disclosure may be implemented in a wide variety of devices or apparatuses, including a wireless handset, an integrated circuit (IC), or a set of ICs (e.g., a chipset). Various components, modules, or units are described in this disclosure to highlight functional aspects of devices configured to perform the disclosed techniques, but 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, in conjunction with suitable software and / or firmware.
[0308] Various examples are described. These and other examples are within the scope of the following claims. [Explanation of symbols]
[0309] 100 Video Encoding and Decoding System 102 Source Devices 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 Quadruple-Triple-Binary Tree (QTBT) Structure 132 Coding Tree Unit (CTU) Blocks 140, 142, and 144 146 Motion Vector Scaling Process 148 Current Templates 150 Current Pictures 152 Reference Templates 154 Reference Pictures 156 Current Picture 158, 160 Reference Pictures 162 Current Picture 164, 166 Reference Pictures 170, 172, 174, 176 samples Blocks 178 and 180 182, 184 points 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 (DPB) 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 Decoded Picture Buffer (DPB) 316 Motion Compensation Unit 317 DMVR unit 318 Intra Prediction Units 320 Coded Picture Buffer (CPB) memory
Claims
1. 1. A device for decoding video data, comprising: a memory configured to store the video data; and one or more processors implemented in circuitry, said one or more processors: determining that a current block of a current picture is coded in an inter prediction mode; determining a motion vector for the current block based on the inter prediction mode; determining a motion vector precision for the motion vector; identifying a current block template in the current picture; searching within a search area for a final reference block template corresponding to the current block template, wherein to search within the search area, the one or more processors: identifying an initial reference block template based on the motion vector; Searching other reference block templates around the initial reference block template using a step size set to an initial step size; further configured to iteratively reduce the step size from the initial step size until the step size is set to a final step size equal to the motion vector precision. To explore and determining a prediction block for the current block based on the final reference block template; decoding the current picture based on the determined predictive block; and outputting a decoded version of the current picture; to iteratively reduce the initial step size until the final step size is equal to the motion vector precision, the one or more processors searching the other reference block templates around the initial reference block template using the initial step size and a first search pattern to determine a first improved motion vector; Identifying a new initial reference block template based on the first refined motion vector; and further configured to search a second group of other reference block templates around the new initial reference block template using the initial step size and a second search pattern to determine a second improved motion vector. device.
2. A device for decoding video data, comprising: a memory configured to store the video data; and one or more processors implemented in circuitry, said one or more processors: determining that a current block of a current picture is coded in an inter prediction mode; determining a motion vector for the current block based on the inter prediction mode; determining a motion vector precision for the motion vector; identifying a current block template in the current picture; searching within a search area for a final reference block template corresponding to the current block template, wherein to search within the search area, the one or more processors: identifying an initial reference block template based on the motion vector; Searching other reference block templates around the initial reference block template using a step size set to an initial step size; further configured to iteratively reduce the step size from the initial step size until the step size is set to a final step size equal to the motion vector precision. To explore and determining a prediction block for the current block based on the final reference block template; decoding the current picture based on the determined predictive block; and outputting a decoded version of the current picture; the inter prediction mode comprises an AMVP mode, and determining the motion vector precision for the current block comprises receiving in a bitstream a syntax element indicating the motion vector precision. or The inter prediction mode comprises a merge mode, and determining the motion vector accuracy for the current block comprises determining the motion vector accuracy from candidates in a merge list. device.
3. the one or more processors to iteratively reduce the step size from the initial step size until the step size is set to the final step size equal to the motion vector precision; determining that the step size is equal to the motion vector precision; further configured to terminate the iterative reduction of the step size in response to determining that the step size is equal to the motion vector precision.
3. A device according to claim 1 or 2.
4. to iteratively reduce the initial step size until the final step size is equal to the motion vector precision, the one or more processors searching the other reference block templates around the initial reference block template using the initial step size to determine a first refined motion vector; Iteratively reducing the step size from the initial step size to a high precision step size; Identifying a new initial reference block template based on the first refined motion vector; and further configured to search a second group of other reference block templates around the new initial reference block template using the high precision step size to determine a second refined motion vector.
3. A device according to claim 1 or 2.
5. the one or more processors are further configured to reduce the step size from n pels to n / 2 pels to iteratively reduce the step size from the initial step size until the initial step size is equal to n pels and the step size is set to the final step size equal to the motion vector precision. or The device of claim 1 or 2, wherein, to iteratively reduce the step size, the one or more processors are further configured to reduce the step size by a factor of 1 / 2.
6. 3. The device of claim 1, wherein all values of the step size used for searching within the search area are greater than or equal to the motion vector precision.
7. 3. The device of claim 1, wherein the motion vector identifies a top-left sample of a reference block in a reference picture, and the search area is within 8 samples in the x-direction of the top-left sample and 8 samples in the y-direction of the top-left sample.
8. The device of claim 1 or 2, wherein the motion vector precision and the final step size are greater than 1 / 8 pel.
9. 3. The device of claim 1, wherein the one or more processors are further configured to output the decoded version of the current picture for display.
10. 3. The device of claim 1, wherein the device for decoding is configured to decode the current block of the current picture, and wherein the one or more processors are further configured to store the decoded version of the current picture to output the decoded version of the current picture.
11. 3. The device of claim 1 or 2, comprising a wireless communication device further comprising a receiver configured to receive encoded video data, optionally wherein the wireless communication device comprises a telephone handset, and wherein the receiver is configured to demodulate a signal comprising the encoded video data in accordance with a wireless communication standard.
12. 3. The device of claim 1 or 2, further comprising a display configured to display decoded video data, and further comprising one or more of a computer, a mobile device, a broadcast receiver device, or a set-top box, and / or a camera configured to capture the video data.
13. 1. A method for decoding video data, comprising: determining that a current block of a current picture is coded in an inter prediction mode; determining a motion vector for the current block based on the inter prediction mode; determining a motion vector precision for the motion vector; identifying a current block template in the current picture; searching within a search area for a final reference block template corresponding to the current block template, wherein the step of searching within the search area includes: identifying an initial reference block template based on the motion vector; searching other reference block templates around the initial reference block template using a step size set to an initial step size; and iteratively reducing the step size from the initial step size until the step size is set to a final step size equal to the motion vector precision; determining a prediction block for the current block based on the final reference block template; decoding the current picture based on the determined predicted block; outputting a decoded version of the current picture; to iteratively reduce the initial step size until the final step size is equal to the motion vector precision; searching the other reference block templates around the initial reference block template using the initial step size and a first search pattern to determine a first improved motion vector; identifying a new initial reference block template based on the first refined motion vector; searching a second group of other reference block templates around the new initial reference block template using the initial step size and a second search pattern to determine a second improved motion vector. method.
14. A method for decoding video data, comprising: determining that a current block of a current picture is coded in an inter prediction mode; determining a motion vector for the current block based on the inter prediction mode; determining a motion vector precision for the motion vector; identifying a current block template in the current picture; searching within a search area for a final reference block template corresponding to the current block template, wherein the step of searching within the search area includes: identifying an initial reference block template based on the motion vector; searching other reference block templates around the initial reference block template using a step size set to an initial step size; and iteratively reducing the step size from the initial step size until the step size is set to a final step size equal to the motion vector precision; determining a prediction block for the current block based on the final reference block template; decoding the current picture based on the determined predicted block; outputting a decoded version of the current picture; Equipped with the inter prediction mode comprises an AMVP mode, and determining the motion vector precision for the current block comprises receiving a syntax element in a bitstream indicating the motion vector precision. or The inter prediction mode comprises a merge mode, and determining the motion vector accuracy for the current block comprises determining the motion vector accuracy from candidates in a merge list. method.
15. 15. A computer-readable storage medium storing instructions that, when executed by one or more processors, cause the one or more processors to perform the method of claim 13 or 14. A computer-readable storage medium.
Citation Information
Patent Citations
Template-matching-based method and apparatus for encoding and decoding intra picture
US20170134726A1
Image encoding / decoding method and device, and recording medium in which bitstream is stored
US20210195227A1
Multi-pass decoder-side motion vector refinement
US63129221P0
Methods and apparatus for reduced complexity template matching prediction for video encoding and decoding
WO2011090783A1
Adaptive motion vector resolution signaling for video coding
WO2015106126A1