Advanced syntax control flag for template matching related coding tools in video coding
By introducing high-level syntax elements into video encoder and decoder, clearly indicating whether to enable template matching tools, the problem of decoding errors in the prior art is solved, and the efficiency and accuracy of video decoding are improved.
Patent Information
- Application Number
- CN202380050838.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2023-06-21
- Filing Date
- 2023-06-23
- Publication Date
- 2025-02-18
AI Technical Summary
Existing video decoders can cause decoding errors when processing video bitstreams containing template matching tools because these decoders are not configured to use these tools.
By introducing high-level syntax elements in the video encoder and decoder, explicitly indicate whether to enable the template matching tool. When the video encoder generates a bitstream, it signals these syntax elements to ensure that the decoder knows when to apply the template matching tool.
Avoid decoding problems caused by the decoder attempt to decode bitstreams generated by the unenabled template matching tool, and improves the efficiency and accuracy of video decoding.
Smart Images

Figure CN119487850A_ABST
Abstract
Description
[0001] This application claims priority to U.S. Patent Application No. 18 / 338,886, filed on June 21, 2023, and U.S. Provisional Patent Application No. 63 / 367,793, filed on July 6, 2022, the entire contents of which are incorporated by reference. U.S. Patent Application No. 18 / 338,886, filed on June 21, 2023, claims the benefit of U.S. Provisional Application No. 63 / 367,793, filed on July 6, 2022. Technical Field
[0002] The present disclosure relates to video encoding and video decoding. Background Art
[0003] Digital video capabilities may be incorporated into a wide variety of devices, including digital televisions, digital live 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 gaming consoles, cellular or satellite wireless telephones (so-called "smart phones"), video teleconferencing devices, video streaming devices, etc. Digital video devices implement video coding techniques, such as those described in the standards defined by MPEG-2, MPEG-4, ITU-T H.263, ITU-T H.264 / MPEG-4 (Part 10, Advanced Video Coding (AVC)), ITU-T H.265 / High Efficiency Video Coding (HEVC), ITU-T H.266 / Versatile Video Coding (VVC), and extensions of such standards, as well as proprietary video codecs / formats such as AOMedia Video 1 (AV1) developed by the Alliance for Open Media. By implementing such video coding techniques, a video device may more efficiently send, receive, encode, decode and / or store digital video information.
[0004] Video coding techniques include spatial (intra-picture) prediction and / or temporal (inter-picture) prediction to reduce or remove redundancy inherent in video sequences. For block-based video coding, a video slice (e.g., a video picture or a portion of a video picture) may be divided into video blocks, which may also be referred to as coding tree units (CTUs), coding units (CUs), and / or coding nodes. Video blocks in a slice after intra-coding (I) of a picture are encoded using spatial prediction relative to reference samples in neighboring blocks in the same picture. Video blocks in a slice after inter-coding (P or B) of a picture may use spatial prediction relative to reference samples in neighboring blocks in the same picture or temporal prediction relative to reference samples in other reference pictures. Pictures may be referred to as frames, and reference pictures may be referred to as reference frames. Summary of the invention
[0005] In general, the present disclosure describes techniques related to high-level syntax control for template matching related tools. The disclosed method can be applied to any of existing video codecs such as HEVC (High Efficiency Video Coding), VVC (Versatile Video Coding), Basic Video Coding (EVC), or effective decoding features in future video coding standards (e.g., ECM (Enhanced Compression Model)). ECM and other video codecs can implement various template matching tools. However, for specific types of video content or when targeting specific types of video decoders, it may not be advantageous to use one or more template matching tools in the template matching tool. For example, a less complex video decoder may not have the computing resources to use the template matching tool. However, the encoded bitstream does not include data indicating whether the template matching tool is enabled. If a video decoder attempts to decode a bitstream generated using a template matching tool that the video decoder is not equipped to use, this may cause decoding problems, such as decoding errors.
[0006] The technology of the present disclosure can solve this problem. For example, a video encoder can signal a syntax element indicating whether a template matching tool is enabled. If the template matching tool is enabled, the video encoder can apply the template matching tool to generate a prediction block for a current CU of video data. Similarly, a video decoder can obtain a syntax element from a bitstream including an encoded representation of the video data. Based on the value of the syntax element, the video decoder can apply the template matching tool to generate a prediction block for a current coding unit (CU) of the video data. Because the video encoder signals the syntax element, the decoding problem discussed above can be avoided.
[0007] In one example, the present disclosure describes a device for decoding video data, the device comprising: a memory comprising one or more storage media, the memory being configured to store video data; and one or more processors, the one or more processors being implemented in a circuit, the one or more processors being configured to: obtain syntax elements from a bitstream comprising an encoded representation of the video data; determine based on the syntax elements that a template matching tool is enabled; based on the template matching tool being enabled, apply the template matching tool to generate a prediction block for a current coding unit (CU) of the video data; and reconstruct the current CU based on the prediction block of the current CU.
[0008] In another example, the present disclosure describes a device for encoding video data, the device comprising: a memory comprising one or more storage media, the memory being configured to store video data; and one or more processors, the one or more processors being implemented in a circuit, and the one or more processors being configured to: signal a syntax element indicating whether a template matching tool is enabled in a bitstream comprising an encoded representation of the video data; based on the template matching tool being enabled, apply the template matching tool to generate a prediction block for a current decoding unit (CU) of the video data; and encode the current CU based on the prediction block of the current CU.
[0009] In another example, the present disclosure describes a method for decoding video data, the method comprising: obtaining syntax elements from a bitstream including an encoded representation of the video data; determining that a template matching tool is enabled based on the syntax elements; based on the template matching tool being enabled, applying the template matching tool to generate a prediction block for a current decoding unit (CU) of the video data; and reconstructing the current CU based on the prediction block of the current CU.
[0010] In another example, the present disclosure describes a method for encoding video data, the method comprising: signaling a syntax element indicating whether a template matching tool is enabled in a bitstream including an encoded representation of the video data; based on the template matching tool being enabled, applying the template matching tool to generate a prediction block for a current decoding unit (CU) of the video data; and encoding the current CU based on the prediction block of the current CU.
[0011] In one example, the present disclosure describes a method for decoding video data, the method comprising: obtaining syntax elements from a bitstream including an encoded representation of the video data; determining that a template matching tool is enabled based on the syntax elements; based on the template matching tool being enabled, applying the template matching tool to generate a prediction block for a current coding unit (CU) of the video data; and reconstructing the current CU based on the prediction block of the current CU.
[0012] In another example, the present disclosure describes a method for encoding video data, the method comprising: signaling a syntax element in a bitstream comprising an encoded representation of the video data, wherein the syntax element indicates that a template matching tool is enabled; based on the template matching tool being enabled, applying the template matching tool to generate a prediction block for a current coding unit (CU) of the video data; and encoding the current CU based on the prediction block of the current CU.
[0013] In another example, the present disclosure describes a device including one or more components for performing the method according to any one of the claims of the present disclosure.
[0014] In another example, a computer-readable storage medium is encoded with instructions that, when executed, cause a programmable processor to perform the method according to any one of the claims of the present disclosure.
[0015] The details of one or more examples are set forth in the accompanying drawings and the description below. Other features, objects, and advantages will be apparent from the description and drawings, and from the claims. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 is a block diagram illustrating an example video encoding and decoding system that may perform the techniques of this disclosure.
[0017] Figure 2A and Figure 2B is a conceptual diagram illustrating spatial neighboring motion vector (MV) candidates for merge mode and advanced motion vector prediction (AMVP) mode.
[0018] Figure 3A and Figure 3B is a conceptual diagram illustrating temporal motion vector predictor (TMVP) candidates and MV scaling.
[0019] Figure 4 is a conceptual diagram illustrating template matching on a search area around an initial motion vector.
[0020] Figure 5 This is a conceptual diagram illustrating a reference sample of a template in a template and a reference picture.
[0021] Figure 6 is a conceptual diagram illustrating a template of a current block having a sub-block motion using motion information of a sub-block of the current block and a reference sample of the template.
[0022] Figure 7 is a conceptual diagram illustrating edges on a template.
[0023] Figure 8 3 is a conceptual diagram illustrating the additional direction along the k×π / 8 diagonal angle.
[0024] Fig. 9 is a conceptual diagram illustrating an example template of TM-OBMC.
[0025] Fig.10 is a conceptual diagram illustrating an example intra-frame template matching search area.
[0026] Fig.11 is a conceptual diagram illustrating an intra block copy reference area according to a current coding unit (CU) position.
[0027] Fig.12 is a block diagram illustrating an example video encoder that may perform the techniques of this disclosure.
[0028] Fig.13 is a block diagram illustrating an example video decoder that may perform the techniques of this disclosure.
[0029] Fig.14 is a flowchart illustrating an example method for encoding a current block according to the techniques of this disclosure.
[0030] Fig.15 is a flowchart illustrating an example method for decoding a current block according to techniques of this disclosure.
[0031] Fig.16 is a flowchart illustrating example operation of a video encoder in accordance with techniques of this disclosure.
[0032] Fig.17 is a flow diagram illustrating example operation of a video decoder in accordance with techniques of this disclosure. DETAILED DESCRIPTION
[0033] A video coder (e.g., a video encoder or a video decoder) may use a template matching coding tool to generate a prediction block for a coding unit (CU) of video data. In the Enhanced Compression Model (ECM) proposal, there is no system design for high-level syntax to turn on and off the template matching coding tool. The present disclosure describes high-level syntax elements for enabling or disabling the template matching coding tool. The use of high-level syntax elements for enabling and disabling the template matching coding tool may enhance coding efficiency, accelerate encoding and / or decoding speed, and / or provide other advantages.
[0034] For example, a video encoder may signal a syntax element indicating whether a template matching tool is enabled in a bitstream including an encoded representation of video data. Based on the template matching tool being enabled, the video encoder may apply the template matching tool to generate a prediction block for a current CU of video data. The video encoder may encode the current CU based on the prediction block of the current CU. Similarly, a video decoder may obtain a syntax element from a bitstream including an encoded representation of video data. The video decoder may determine that the template matching tool is enabled based on the syntax element. Based on the template matching tool being enabled, the video decoder may apply the template matching tool to generate a prediction block for a current coding unit (CU) of video data. The video decoder may reconstruct the current CU based on the prediction block of the current CU. By signaling a syntax element indicating whether the template matching tool is enabled, it may be determined whether the video decoder is configured to decode the current CU or bitstream before the video decoder attempts to reconstruct the current CU or bitstream. Decoding errors may be avoided by avoiding attempts to decode a CU or bitstream that the video decoder cannot decode.
[0035] Figure 11 is a block diagram illustrating an example video encoding and decoding system 100 that can perform the techniques of the present disclosure. The techniques of the present disclosure generally relate to decoding (encoding and / or decoding) video data. Generally, video data includes any data used to process video. Therefore, video data may include unencoded raw video, encoded video, decoded (e.g., reconstructed) video, and video metadata, such as signaling data.
[0036] like Figure 1 As shown, system 100 includes a source device 102 that provides encoded video data to be decoded and displayed by a destination device 116. Specifically, source device 102 provides the encoded video data to destination device 116 via computer-readable medium 110. Source device 102 and destination device 116 may include any of a wide variety of devices, including desktop computers, notebook (i.e., laptop) computers, mobile devices, tablet computers, set-top boxes, handheld phones such as smartphones, televisions, cameras, display devices, digital media players, video game 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 may therefore be referred to as wireless communication devices.
[0037] exist Figure 1 In the example of , source device 102 includes video source 104, memory 106, video encoder 200 and output interface 108. Target device 116 includes input interface 122, video decoder 300, memory 120 and display device 118. According to the present disclosure, the video encoder 200 of source device 102 and the video decoder 300 of destination device 116 can be configured to apply the technology for template matching related decoding tools. Therefore, source device 102 represents an example of a video encoding device, and target device 116 represents an example of a video decoding device. In other examples, source device and target device may include other components or arrangements. For example, source device 102 may receive video data from an external video source such as an external camera. Similarly, target device 116 may be docked with an external display device instead of including an integrated display device.
[0038] like Figure 1The system 100 shown is only an example. In general, any digital video encoding and / or decoding device can perform techniques for template matching related decoding tools. The source device 102 and the target device 116 are only examples of such decoding devices, wherein the source device 102 generates decoded video data for sending to the target device 116. The present disclosure refers to a "decoding" device as a device that performs decoding (e.g., encoding and / or decoding) of data. Therefore, the video encoder 200 and the video decoder 300 represent examples of decoding devices, specifically, video encoders and video decoders, respectively. In some examples, the source device 102 and the target device 116 can operate in a substantially symmetrical manner, so that each of the source device 102 and the target device 116 includes a video encoding and decoding component. Therefore, the system 100 can support one-way or two-way video transmission between the source device 102 and the target device 116, for example, for video streaming, video playback, video broadcasting or video telephony.
[0039] Typically, video source 104 represents the source of video data (i.e., uncoded raw video data), and a series of pictures (also referred to as "frames") of the order of the video data are provided 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 camera, a video archive containing previously captured raw video, and / or a video feed interface for receiving video from a video content provider. As another alternative, video source 104 may generate computer graphics-based data as source video, or a combination of real-time video, archived video, and computer-generated video. In each case, video encoder 200 encodes captured, pre-captured, or computer-generated video data. Video encoder 200 may rearrange pictures from the received order (sometimes referred to as "display order") into a decoding order for decoding. Video encoder 200 may generate a bitstream including encoded video data. Source device 102 may then output the encoded video data onto computer-readable medium 110 via output interface 108 to be received and / or retrieved by, for example, input interface 122 of target device 116 .
[0040] The memory 106 of the source device 102 and the memory 120 of the target device 116 represent general purpose memories. The memory 106 and the memory 120 may include one or more storage media, such as RAM, ROM, EEPROM, CD-ROM or other optical disk storage, magnetic disk storage or other magnetic storage, flash memory, or any other medium that can be used to store data or program code. In some examples, the memories 106, 120 may store raw video data, for example, raw video from the video source 104 and raw decoded video data from the video decoder 300. Additionally or alternatively, the memories 106, 120 may store software instructions that can be executed by, for example, the video encoder 200 and the video decoder 300, respectively. Although the memory 106 and the memory 120 are shown separately from the video encoder 200 and the video decoder 300 in this example, it should be understood that the video encoder 200 and the video decoder 300 may also include internal memory for functionally similar or equivalent purposes. Additionally, memories 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 memories 106, 120 may be allocated as one or more video buffers, e.g., to store raw decoded and / or encoded video data.
[0041] The computer-readable medium 110 may represent any type of medium or device capable of transmitting the encoded video data from the source device 102 to the target device 116. In one example, the computer-readable medium 110 represents a communication medium that enables the source device 102 to directly transmit the encoded video data to the target device 116 in real time, for example, via a radio frequency network or a computer-based network. According to a communication standard such as a wireless communication protocol, the output interface 108 may modulate the transmission signal including the encoded video data, and the input interface 122 may demodulate the received transmission signal. The communication medium may include any wireless or wired communication medium, such as a radio frequency (RF) spectrum or one or more physical transmission lines. The communication medium may form a portion 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 a router, a switch, a base station, or any other equipment that may be useful for facilitating communication from the source device 102 to the destination device 116.
[0042] In some examples, source device 102 may output the encoded data from output interface 108 to storage device 112. Similarly, destination device 116 may access the encoded data from storage device 112 via input interface 122. Storage device 112 may include any of a variety of distributed or locally accessed data storage media, such as a hard drive, a Blu-ray disc, a DVD, a CD-ROM, flash memory, volatile or non-volatile memory, or any other suitable digital storage medium for storing encoded video data.
[0043] In some examples, source device 102 may output the encoded video data to file server 114 or another intermediate storage device that may store the encoded video data generated by source device 102. Target device 116 may access the stored video data from file server 114 via streaming or downloading.
[0044] The file server 114 may be any type of server device capable of storing encoded video data and sending the encoded video data to the target device 116. The file server 114 may represent a web server (e.g., for a website), a server configured to provide a file delivery protocol service (such as a file delivery protocol (FTP) or a 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 an enhanced MBMS (eMBMS) server, and / or a network attached storage (NAS) device. The file server 114 may additionally or alternatively implement one or more HTTP streaming protocols, such as dynamic adaptive streaming over HTTP (DASH), HTTP live streaming (HLS), real-time streaming protocol (RTSP), HTTP dynamic streaming, etc.
[0045] The target device 116 may access the encoded video data from the file server 114 through any standard data connection, including an Internet connection. This may include a wireless channel (e.g., a Wi-Fi connection), a wired connection (e.g., a digital subscriber line (DSL), a cable modem, etc.), or a combination of both, suitable for accessing the encoded video data stored on the file server 114. The input interface 122 may be configured to operate according to any one or more of the various protocols discussed above for retrieving or receiving media data from the file server 114 or other such protocols for retrieving media data.
[0046] Output interface 108 and input interface 122 may represent wireless transmitters / receivers, modems, wired networking components (e.g., Ethernet cards), wireless communication components that operate according to any of the various IEEE 802.11 standards, or other physical components. In examples where output interface 108 and input interface 122 include wireless components, output interface 108 and input interface 122 may be configured to communicate data (such as encoded video data) according to a cellular communication standard (such as 4G, 4G-LTE (Long Term Evolution), Advanced LTE, 5G, etc.). In some examples where output interface 108 includes a wireless transmitter, output interface 108 and input interface 122 may be configured to communicate data (such as encoded video data) according to other wireless standards (such as IEEE 802.11 specifications, IEEE 802.15 specifications (e.g., ZigBee 5G, etc.). TM ),Bluetooth TM Standards, etc.) to transfer data (such as encoded video data). In some examples, source device 102 and / or destination device 116 may include corresponding system-on-chip (SoC) devices. For example, source device 102 may include a SoC device for performing functionality belonging to video encoder 200 and / or output interface 108, and destination device 116 may include a SoC device for performing functionality belonging to video decoder 300 and / or input interface 122.
[0047] The techniques disclosed herein may be applied to video decoding to support any of a variety of multimedia applications, such as over-the-air television broadcasting, cable television transmission, satellite television transmission, Internet streaming video transmission (such as Dynamic Adaptive Streaming over HTTP (DASH)), digital video encoded onto a data storage medium, decoding of digital video stored on a data storage medium, or other applications.
[0048] The input interface 122 of the target device 116 receives an encoded video bitstream from the computer-readable medium 110 (e.g., a communication medium, a storage device 112, a file server 114, etc.). The encoded video bitstream may include signaling information defined by the video encoder 200 and also used by the video decoder 300, such as syntax elements with values describing characteristics and / or processing of video blocks or other decoding 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.
[0049] Despite Figure 1Not shown, but in some examples, the video encoder 200 and the video decoder 300 may be integrated with an audio encoder and / or an audio decoder and may include appropriate MUX-DEMUX units or other hardware and / or software to handle a multiplexed stream including both audio and video in a common data stream.
[0050] The video encoder 200 and the video decoder 300 may each be implemented as any of a variety of suitable encoder and / or decoder circuits, such as one or more microprocessors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field programmable gate arrays (FPGAs), discrete logic, software, hardware, firmware, or any combination thereof. When the technology is partially implemented in software, the device may store instructions for the software in an appropriate non-transitory computer-readable medium and execute the instructions in hardware using one or more processors to perform the technology of the present 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) in a corresponding device. A device including the video encoder 200 and / or the video decoder 300 may include an integrated circuit, a microprocessor, and / or a wireless communication device (such as a cellular phone).
[0051] The video encoder 200 and the 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 an extension thereof such as multi-view and / or scalable video coding extensions. Alternatively, the video encoder 200 and the 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). In other examples, the video encoder 200 and the video decoder 300 may operate according to a proprietary video codec / format such as AOMedia Video 1 (AV1), an extension of AV1, and / or a subsequent version of AV1 (e.g., AV2). In other examples, the video encoder 200 and the video decoder 300 may operate according to other proprietary formats or industry standards. However, the techniques of the present disclosure are not limited to any particular coding standard or format. In general, the video encoder 200 and the video decoder 300 may be configured to perform the techniques of the present disclosure in conjunction with any video coding technique that uses a template matching tool.
[0052] Typically, the video encoder 200 and the video decoder 300 may perform block-based decoding of a picture. The term "block" generally refers to a structure that includes data to be processed (e.g., to be encoded, decoded, or otherwise used in an encoding and / or decoding process). For example, a block may include a two-dimensional matrix of samples of luminance and / or chrominance data. Typically, the video encoder 200 and the video decoder 300 may decode video data represented in a YUV (e.g., Y, Cb, Cr) format. That is, instead of decoding red, green, and blue (RGB) data for samples of a picture, the video encoder 200 and the video decoder 300 may decode luminance components and chrominance components, wherein the chrominance components may include both red hue chrominance components and blue hue chrominance components. In some examples, the video encoder 200 converts the received RGB format data to a YUV representation before encoding, and the video decoder 300 converts the YUV representation to an RGB format. Alternatively, a pre-processing and post-processing unit (not shown) may perform these conversions.
[0053] The present disclosure may generally relate to the decoding (e.g., encoding and decoding) of a picture to include the process of encoding or decoding data of the picture. Similarly, the present disclosure may relate to the decoding of a block of a picture to include the process of encoding or decoding data for the block (e.g., prediction and / or residual decoding). The encoded video bitstream generally includes a series of values of syntax elements used to represent decoding decisions (e.g., decoding modes) and the partitioning of the picture into blocks. Therefore, references to the decoding of a picture or a block should generally be understood as the decoding values of the syntax elements that form the picture or block.
[0054] HEVC defines various blocks, including coding units (CUs), prediction units (PUs), and transform units (TUs). According to HEVC, a video decoder (such as the video encoder 200) divides a coding tree unit (CTU) into CUs according to a quadtree structure. That is, the video decoder divides the CTU and the CU into four equal, non-overlapping squares, and each node of the quadtree has zero or four child nodes. A node without child nodes may be referred to as a "leaf node", and the CU of such a leaf node may include one or more PUs and / or one or more TUs. The video decoder may further divide the PU and TU. For example, in HEVC, a residual quadtree (RQT) represents the division of a TU. In HEVC, a PU represents inter-frame prediction data, and a TU represents residual data. The intra-predicted CU includes intra-frame prediction information, such as an intra-frame mode indication.
[0055] As another example, the video encoder 200 and the video decoder 300 may be configured to operate according to VVC. According to VVC, a video decoder (such as the video encoder 200) divides a picture into a plurality of coding tree units (CTUs). The video encoder 200 may divide the CTU according to a tree structure (such as a quadtree-binary tree (QTBT) structure or a multi-type tree (MTT) structure). The QTBT structure removes the concept of multiple partition types, such as the separation between CU, PU, and TU of HEVC. The QTBT structure includes two levels: a first level divided according to quadtree partitions, and a second level divided according to binary tree partitions. The root node of the QTBT structure corresponds to the CTU. The leaf nodes of the binary tree correspond to coding units (CUs).
[0056] In the MTT partition structure, blocks can be partitioned using quadtree (QT) partitioning, binary tree (BT) partitioning, and one or more types of ternary tree (TT) (also known as ternary tree (TT)) partitioning. A ternary tree or ternary tree partition is a partition in which a block is divided into three sub-blocks. In some examples, the ternary tree or ternary tree partition divides the block into three sub-blocks without dividing the original block through the center. The partition types in MTT (e.g., QT, BT, and TT) can be symmetric or asymmetric.
[0057] When operating according to the AV1 codec, the video encoder 200 and the video decoder 300 may be configured to decode the video data in blocks. In AV1, the largest decoding block that can be processed is called a super block. In AV1, a super block can be 128×128 luma samples or 64×64 luma samples. However, in subsequent video coding formats (e.g., AV2), super blocks may be defined by different (e.g., larger) luma sample sizes. In some examples, the super block is the top layer of the block quadtree. The video encoder 200 may further divide the super block into smaller decoding blocks. The video encoder 200 may divide the super block and other decoding blocks into smaller blocks using square or non-square partitions. Non-square blocks may include N / 2×N blocks, N×N / 2 blocks, N / 4×N blocks, and N×N / 4 blocks. The video encoder 200 and the video decoder 300 may perform separate prediction and transform processing on each decoding block.
[0058] AV1 also defines tiles of video data. A tile is a rectangular array of super blocks that can be decoded independently of other tiles. That is, the video encoder 200 and the video decoder 300 can encode and decode coded blocks within a tile, respectively, without using video data from other tiles. However, the video encoder 200 and the video decoder 300 can perform filtering across tile boundaries. The size of the tiles can be uniform or non-uniform. Tile-based decoding can enable parallel processing and / or multi-threading specifically implemented by the encoder and decoder.
[0059] In some examples, the video encoder 200 and the video decoder 300 may use a single QTBT or MTT structure to represent each of the luma component and the chroma components, while in other examples, the video encoder 200 and the video decoder 300 may use two or more QTBT or MTT structures, such as one QTBT / MTT structure for the luma component and another QTBT / MTT structure for the two chroma components (or two QTBT / MTT structures for the respective chroma components).
[0060] The video encoder 200 and the video decoder 300 may be configured to use quadtree partitioning, QTBT partitioning, MTT partitioning, super block partitioning, or other partitioning structures.
[0061] In some examples, a CTU includes a coding tree block (CTB) of luma samples, two corresponding CTBs of chroma samples of a picture having three sample arrays, or a CTB of samples of a monochrome picture or a picture coded using three separate color planes and syntax structures for coding the samples. A CTB can be an N×N block of samples for some N value, such that one partition is to divide components into CTBs. A component is an array or a single sample from one of the three arrays (luminance and two chroma) that make up a 4:2:0, 4:2:2, or 4:4:4 color format picture, or an array or a single sample of an array that makes up a monochrome format picture. In some examples, a coding block is an M×N block of samples for some M and N values, such that one partition is to divide a CTB into coding blocks.
[0062] Blocks (e.g., CTUs or CUs) may be grouped in a picture in various ways. As an example, a brick may refer to a rectangular area of a CTU row within a particular tile in a picture. A tile may be a rectangular area of a CTU within a particular tile column and a particular tile row in a picture. A tile column refers to a rectangular area of a CTU having a height equal to the height of the picture and a width specified by a syntax element (e.g., such as in a picture parameter set). A tile row refers to a rectangular area of a CTU having a height specified by a syntax element (e.g., such as in a picture parameter set) and a width equal to the width of the picture.
[0063] In some examples, a tile may be divided into multiple bricks, each of which may include one or more CTU rows within the tile. Tiles that are not divided into multiple bricks may also be referred to as bricks. However, bricks that are true subsets of tiles may not be referred to as tiles. Bricks in a picture may also be arranged in slices. A slice may be an integer number of bricks of a picture that may be uniquely contained in a single network abstraction layer (NAL) unit. In some examples, a slice includes multiple complete tiles or a continuous sequence of complete bricks that include only one tile.
[0064] This disclosure may use "N×N" and "N by N" interchangeably to refer to the sample size of a block (such as a CU or other video block) in terms of the vertical and horizontal dimensions, for example, 16×16 samples or 16 by 16 samples. Typically, a 16×16 CU will have 16 samples in the vertical direction (y=16) and 16 samples in the horizontal direction (x=16). Similarly, an N×N CU typically has N samples in the vertical direction and N samples in the horizontal direction, where N represents a non-negative integer value. The samples in a CU may be arranged in rows and columns. In addition, a CU does not necessarily need to have the same number of samples in the horizontal direction as in the vertical direction. For example, a CU may include N×M samples, where M is not necessarily equal to N.
[0065] The video encoder 200 encodes video data representing prediction and / or residual information and other information for a CU. The prediction information indicates how to predict the CU in order to form a prediction block for the CU. The residual information generally represents the sample-by-sample difference between the samples of the CU before encoding and the prediction block.
[0066] In order to predict a CU, the video encoder 200 may generally form a prediction block of the CU by inter-frame prediction or intra-frame prediction. Inter-frame prediction generally refers to predicting a CU from data of a previously decoded picture, while intra-frame prediction generally refers to predicting a CU from previously decoded data of the same picture. In order to perform inter-frame prediction, the video encoder 200 may use one or more motion vectors to generate a prediction block. The video encoder 200 may generally perform a motion search to identify a reference block that closely matches the CU, for example, based on the difference between the CU and the reference block. The video encoder 200 may calculate a difference metric using the sum of absolute differences (SAD), the sum of squared differences (SSD), the mean absolute difference (MAD), the mean squared difference (MSD), or other such difference calculations to determine whether the reference block closely matches the current CU. In some examples, the video encoder 200 may use unidirectional prediction or bidirectional prediction to predict the current CU.
[0067] Some examples of VVC also provide an affine motion compensation mode, which can be considered an inter-prediction mode. In the affine motion compensation mode, the video encoder 200 can determine two or more motion vectors representing non-translational motion (such as zooming in or out, rotation, perspective motion, or other irregular motion types).
[0068] To perform intra prediction, the video encoder 200 may select an intra prediction mode to generate a prediction block. Some examples of VVC provide sixty-seven intra prediction modes, including various directional modes, as well as planar modes and DC modes. Typically, the video encoder 200 selects an intra prediction mode that describes neighboring samples of a current block (e.g., a block of a CU) from which to predict the samples of the current block. Assuming that the video encoder 200 decodes CTUs and CUs in raster scan order (from left to right, from top to bottom), such samples may typically be located above, above left, or to the left of the current block in the same picture as the current block.
[0069] The video encoder 200 encodes data representing the prediction mode of the current block. For example, for inter-frame prediction mode, the video encoder 200 may encode data indicating which of various available inter-frame prediction modes is used and motion information of the corresponding mode. For example, for unidirectional or bidirectional inter-frame prediction, the video encoder 200 may encode the motion vector using advanced motion vector prediction (AMVP) or merge mode. The video encoder 200 may use a similar mode to encode the motion vector for affine motion compensation mode.
[0070] AV1 includes two general techniques for encoding and decoding coded blocks of video data. The two general techniques are intra prediction (e.g., intra prediction or spatial prediction) and inter prediction (e.g., inter prediction or temporal prediction). In the context of AV1, when an intra prediction mode is used to predict a block of a current frame of video data, the video encoder 200 and the video decoder 300 do not use video data from other frames of the video data. For most intra prediction modes, the video encoder 200 encodes a block of the current frame based on the difference between the sample values in the current block and the prediction values generated from the reference samples in the same frame. The video encoder 200 determines the prediction values generated from the reference samples based on the intra prediction mode.
[0071] After prediction (such as intra-frame prediction or inter-frame prediction for a block), the video encoder 200 may calculate residual data for the block. The residual data (such as a residual block) represents the sample-by-sample difference between the block and a prediction block for the block, which is formed using a corresponding prediction mode. The video encoder 200 may apply one or more transforms to the residual block to produce transformed data in a transform domain rather than in a 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 after the first transform, such as a mode-dependent non-separable secondary transform (MDNSST), a signal-dependent transform, a Karhunen-Loeve transform (KLT), etc. The video encoder 200 generates transform coefficients after applying one or more transforms.
[0072] As noted above, after any transforms that produce 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 transform coefficients. For example, the video encoder 200 may round down 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 bit-by-bit right shift of the value to be quantized.
[0073] After quantization, the video encoder 200 may scan the transform coefficients to generate a one-dimensional vector from a two-dimensional matrix including the quantized transform coefficients. The scan may be designed to place the transform coefficients of higher energy (and therefore lower frequency) at the front of the vector and the transform coefficients of lower energy (and therefore higher frequency) at the back of the vector. In some examples, the video encoder 200 may scan the quantized transform coefficients using a predefined scan order 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 adaptive scanning. After scanning the quantized transform coefficients to form a 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 the values of the syntax elements describing the metadata associated with the encoded video data, which is used by the video decoder 300 when decoding the video data.
[0074] To perform CABAC, video encoder 200 may assign context within a context model to a symbol to be sent. The context may relate to, for example, whether neighboring values of the symbol are zero values. The probability determination may be based on the context assigned to the symbol.
[0075] The video encoder 200 may further generate syntax data, such as block-based syntax data, picture-based syntax data, and sequence-based syntax data, for example in a picture header, a block header, a slice header, or generate other syntax data such as a sequence parameter set (SPS), a picture parameter set (PPS), or a video parameter set (VPS) to the video decoder 300. The video decoder 300 may also decode such syntax data to determine how to decode the corresponding video data.
[0076] In this way, the video encoder 200 can generate a bitstream including encoded video data, for example, a syntax element describing the partition of a picture into blocks (e.g., CUs) and prediction and / or residual information for the blocks. Finally, the video decoder 300 can receive the bitstream and decode the encoded video data.
[0077] In general, the video decoder 300 performs a process that is the reverse of the process performed by the video encoder 200 to decode the encoded video data of the bitstream. For example, the video decoder 300 may use CABAC to decode the values of the syntax elements for the bitstream in a manner substantially similar to but reverse to the CABAC encoding process of the video encoder 200. The syntax elements may define partition information for partitioning a picture into CTUs and partitioning each CTU according to a corresponding partition structure such as a QTBT structure to define CUs of the CTUs. The syntax elements may further define prediction and residual information for a block of video data (e.g., a CU).
[0078] 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 reproduce a residual block for the block. The video decoder 300 uses the signaled prediction mode (intra-frame prediction or inter-frame prediction) and related prediction information (e.g., motion information for inter-frame prediction) to form a prediction block for the block. The video decoder 300 may then combine the prediction block and the residual block (on a sample-by-sample basis) to reproduce the original block. The video decoder 300 may perform additional processing, such as performing a deblocking process to reduce visual artifacts along the boundaries of the blocks.
[0079] The present disclosure may generally involve "signaling" certain information (such as syntax elements). The term "signaling" may generally refer to the communication of values of syntax elements and / or other data used to decode encoded video data. That is, video encoder 200 may signal values of syntax elements in a bitstream. Generally, signaling refers to generating values in a bitstream. As noted above, source device 102 may transmit the bitstream to destination device 116 in substantially real time or in non-real time (such as may occur when storing syntax elements to storage device 112 for later retrieval by destination device 116).
[0080] In HEVC, the largest coding unit in a slice is called a coding tree block (CTB) or coding tree unit (CTU). A CTB contains a quadtree whose nodes are coding units. In the HEVC main profile, the size of a CTB can range from 16×16 to 64×64 (but 8×8 CTB size is technically supported). A coding unit (CU) can have the same size as a CTB, as small as 8×8. Each coding unit is coded with one mode (e.g., inter or intra). When a CU is inter-coded, the CU can be further divided into 2 or 4 prediction units (PUs) or become only one PU when no further division is applied. When two PUs are present in one CU, they can be a half-sized rectangle or two rectangular sizes with 1 / 4 or 3 / 4 the size of the CU. When a CU is inter-coded, each PU has a set of motion information derived with a unique inter prediction mode.
[0081] In the HEVC standard, there are two inter-frame prediction modes, named merge (skipping special cases considered as merge) and advanced motion vector prediction (AMVP) mode for prediction units (PUs). In AMVP mode or merge mode, a motion vector (MV) candidate list is maintained for multiple motion vector predictors. The motion vector of the current PU and the reference index in merge mode are generated by taking a candidate from the MV candidate list. The MV candidate list contains up to 5 candidates for merge mode and only two candidates for AMVP mode. The merge candidate may contain a set of motion information, such as motion vectors corresponding to both reference picture lists (list 0 and list 1) and reference indexes. If the merge candidate is identified by the merge index, the reference picture used for the prediction of the current block and the associated motion vector are determined. On the other hand, in the AMVP mode for each potential prediction direction from list 0 or list 1, the reference index can be explicitly signaled to the MV candidate list together with the MV predictor (MVP) index, because the AMVP candidate only contains motion vectors. In AMVP mode, the predicted motion vector can be further refined. Candidates for both modes are similarly derived from the same spatial and temporal neighboring blocks.
[0082] Figure 2A and Figure 2B 2 is a conceptual diagram illustrating spatial neighboring MV candidates for merge mode and AMVP mode. The spatial MV candidate is a candidate for a specific PU (PU0) 250 from Figure 2A and Figure 2B The neighboring blocks shown are derived, but the method of generating candidates by block is different for merge and AMVP modes. Figure 2A and Figure 2B A neighboring PU (PU1) 252 is also shown.
[0083] In merge mode, you can use Figure 2A Up to four spatial MV candidates are derived in the order with numbers shown, and the order is as follows: left (0, A1), top (1, B1), top right (2, B0), bottom left (3, A0) and top left (4, B2), as shown in FIG. Figure 2A shown.
[0084] In AMVP mode, adjacent blocks are divided into two groups: the left group consisting of blocks 0 and 1, and the upper group consisting of blocks 2, 3, and 4, as shown in Figure 2B As shown. For each group, potential candidates among neighboring blocks that refer to the same reference picture as indicated by the signaled reference index have the highest priority to be selected to form the final candidate for the group. It is possible that none of the neighboring blocks contains a motion vector pointing to the same reference picture. Therefore, if such a candidate cannot be found, the video decoder (e.g., video encoder 200 or video decoder 300) can scale the first available candidate to form the final candidate, thereby compensating for the temporal distance difference.
[0085] In HEVC, the temporal motion vector predictor (TMVP) candidate (if enabled and available) is added to the MV candidate list after the spatial motion vector candidate. The motion vector derivation process for the TMVP candidate is the same for both merge mode and AMVP mode, however the target reference index for the TMVP candidate in merge mode is always set to 0.
[0086] Figure 3A and Figure 3B 350 is a conceptual diagram illustrating TMVP candidates and MV scaling. The primary block location 350 for TMVP candidate derivation for the current PU 352 (PU0) is the lower right block of the outer 354 of the collocated PU 356 (PU1), as shown in FIG. Figure 3A 352, to compensate for the deviation of the upper and left blocks used to generate spatial neighboring candidates. However, if the block is located outside the current CTB row or motion information is not available (e.g., as shown in block 358), the block is replaced by the center block 360 of the current PU 352.
[0087] The motion vector of the TMVP candidate is derived from the co-located PU of the co-located picture indicated in the slice level. The motion vector of the co-located PU is called the collocated MV. Similar to the temporal direct mode in AVC, to derive the TMVP candidate motion vector, the co-located MV may be scaled to compensate for the temporal distance difference, such as Figure 3A and Figure 3B shown.
[0088] Now let's discuss motion vector scaling. Assume that the value of a motion vector is proportional to the distance between pictures in presentation time. A motion vector associates two pictures, a reference picture and a picture containing a motion vector (i.e., a containing picture). When using a motion vector to predict another motion vector, the distance between the containing picture and the reference picture is calculated based on the picture order count (POC) value.
[0089] For a motion vector to be predicted, its associated containing picture and reference picture may both be different. Therefore, a new distance is calculated (based on POC). The motion vector is scaled based on these two POC distances. For spatially adjacent candidates, the containing pictures of the two motion vectors are the same, while the reference pictures are different. In HEVC, motion vector scaling is applied to both TMVP and AMVP for spatial and temporal adjacent candidates.
[0090] exist Figure 3B In the example of FIG. 3 , a current picture 370 has a current PU 372. A TMVP 374 of the current PU 372 indicates a position in a current reference picture 376. A current temporal distance 378 is a difference between the current picture 370 and the current reference picture 376. However, to derive the TMVP 374, the video coder may refer to a collocated PU 380 collocated with the current PU 372. A picture containing the collocated PU 380 may be referred to as a collocated picture 382. A motion vector of the collocated PU 380 may be referred to as a collocated MV 384. The collocated MV 384 may indicate a position in another reference picture (referred to as a collocated reference picture 386). The distance between the collocated picture 382 and the collocated reference picture 386 may be referred to as a collocated temporal distance 388. The collocated temporal distance 388 may be different from the current temporal distance 378. Therefore, the collocated MV 384 is scaled based on the collocated temporal distance 388 and the current temporal distance 378 to determine the TMVP 374.
[0091] Artificial motion vector candidate generation is now discussed. If the motion vector candidate list is incomplete, the video encoder 200 or the video decoder 300 may generate artificial motion vector candidates, and the artificial motion vector candidates may be inserted at the end of the list until the list has all candidates. In merge mode, there are two types of artificial MV candidates: combined candidates derived only for B slices, and zero candidates used only for AMVP if the first type does not provide enough artificial candidates.
[0092] For each pair of candidates that are already in the candidate lists and have the necessary motion information, a bidirectional combined motion vector candidate is derived by a combination of the motion vector of the first candidate of the picture in reference list 0 and the motion vector of the second candidate of the picture in reference list 1.
[0093] Now let's discuss the pruning process for candidate insertion. Candidates from different blocks may happen to be the same, which reduces the efficiency of merging / AMVP candidate lists. A pruning process is applied to solve this problem. The pruning process compares one candidate in the current candidate list with other candidates to avoid inserting the same candidate to a certain extent. To reduce complexity, only a limited number of comparisons are applied instead of comparing each potential pruning process with all other existing pruning processes.
[0094] Template Matching Advanced Motion Vector Prediction (TM-AMVP) and Template Matching Merge (TM-MRG) are now discussed. Template Matching (TM) is a decoder-side MV derivation method that refines the motion information of the current CU by finding the closest match between the template in the current picture (i.e., the top neighboring block and / or the left neighboring block of the current CU) and the block in the reference picture (i.e., the same size as the template). Template matching is applied to both AMVP and regular merge modes, which are called TM-AMVP and TM-MRG modes, respectively.
[0095] Figure 4 is a conceptual diagram illustrating template matching on a search area around an initial motion vector. Figure 4As illustrated, the current frame 400 includes a current CU 402. A left current template 404A and an upper current template 404B (collectively referred to as "current templates 404") are located to the left and above the current CU 402. An initial MV 406 of the current CU 402 may be determined. For example, the video encoder 200 may signal information indicating the initial MV to the video decoder 300. The video encoder 200 or the video decoder 300 searches for a better MV around a position indicated by the initial MV 406 of the current CU 402 within a search range 410 (e.g., a [-8, +8] pixel search range) within the reference frame 408. The template matching method in Chen et al., “Description of SDR, HDR and 360° video coding technology proposal by Qualcomm and Technicolor–low and high complexity versions”, Joint Video Exploration Team (JVET) of ITU-T SG 16 WP 3 and ISO / IEC JTC 1 / SC 29 / WG 11, 10th Meeting: San Diego, US, 10–20 April 2018, Document No. JVET-J0021 (hereinafter referred to as “JVET-J0021”) may be used with the following modifications: the search step size is determined based on the adaptive motion vector resolution (AMVR) mode, and in the merge mode, the TM may be cascaded with the bilateral matching process.
[0096] In TM-AMVP mode, MVP candidates are determined based on template matching error to select the MVP candidate that achieves the minimum difference between the current block template and the reference block template 412, and then TM is performed only on this specific MVP candidate for MV refinement. TM refines the MVP candidate by using an iterative diamond search, starting with full-pixel MVD accuracy (or 4 pixels for 4-pixel AMVR mode) within the [–8, +8] pixel search range. The AMVP candidate can be further refined by using a cross search with full-pixel MVD accuracy (or 4 pixels for 4-pixel AMVR mode) followed by half-pixels and quarter-pixels according to the AMVR mode specified in the table below. This search process ensures that the MVP candidate maintains the same MV accuracy as indicated by the AMVR mode after the TM process. During the search process, if the difference between the previous minimum cost and the current minimum cost in the iteration is less than a threshold (equal to the area of the block), the search process terminates.
[0097] Table 1. Search patterns for AMVR and merge patterns with AMVR
[0098]
[0099] In TM-MRG merge mode, a similar search method is applied to the merge candidates indicated by the merge index. As shown in Table 1, TM can be performed all the way to 1 / 8 pixel MVD accuracy or skip those exceeding half-pixel MVD accuracy, depending on whether an alternative interpolation filter is used based on the merge motion information (used when AMVR is in half-pixel mode). In addition, when TM mode is enabled, template matching can work as an independent process between block-based and sub-block-based bilateral matching (BM) methods or an additional MV refinement process, depending on whether BM can be enabled according to its enabling condition check.
[0100] Template matching is applied in geometry partition merge (GPM) mode, referred to as TM-GPM mode. When GPM is enabled for a CU, a CU-level flag is signaled to indicate whether TM is applied to both geometry partitions. TM is used to refine the motion information for each geometry partition. When TM is selected, a template is constructed using the left, top, or top-left neighboring samples, depending on the partition angle, as shown in Table 2. Then, the motion is refined by minimizing the difference between the current template and the template in the reference picture using the same search pattern of merge mode with the half-pixel interpolation filter disabled.
[0101] Table 2. Templates for the first and second geometric partitions, where A indicates the use of upper samples and L indicates the use of The left sample is used, and L+A means both the left sample and the upper sample are used. .
[0102] Partition Angle 0 2 3 4 5 8 11 12 13 14 First Division A A A A L+A L+A L+A L+A A A Second Division L+A L+A L+A L L L L L+A L+A L+A Partition Angle 16 18 19 20 21 24 27 28 29 30 First Division A A A A L+A L+A L+A L+A A A Second Division L+A L+A L+A L L L L L+A L+A L+A
[0103] The GPM candidate list can be constructed as follows:
[0104] 1. Directly derive interleaved list-0 MV candidates and list-1 MV candidates from the regular merge candidate list, where list-0 MV candidates have higher priority than list-1 MV candidates. Apply a pruning method with an adaptive threshold based on the current CU size to remove redundant MV candidates.
[0105] 2. Further derive interleaved List-1 MV candidates and List-0 MV candidates directly from the regular merge candidate list, where List-1 MV candidates have higher priority than List-0 MV candidates. The same pruning method with adaptive threshold is also applied to remove redundant MV candidates.
[0106] 3. Fill in zero MV candidates until the GPM candidate list is full.
[0107] Template matching with combined intra / inter prediction (TM-CIIP) is now discussed. In CIIP mode, prediction samples can be generated by weighting the inter prediction signal and the intra prediction signal using template matching to merge candidate predictions. This mode is called TM-CIIP. A TM-CIIP merge candidate list is constructed for the TM-CIIP mode. The merge candidates are refined by template matching. The CIIP-TM merge candidates are also reordered as regular merge candidates by the ARMC method. The maximum number of TM-CIIP merge candidates is equal to two. When the sequence level CIIP flag is enabled, the sequence level flag of TM-CIIP is present in the bitstream to determine whether TM-CIIP can be used at the decoding unit level.
[0108] We now discuss the adaptive reordering of merge candidates (ARMC). The merge candidates can be adaptively reordered using template matching (TM). The reordering method is applied to the regular merge mode, template matching (TM) merge mode, and affine merge mode (excluding SbTMVP candidates). For the TM merge mode, the merge candidates are reordered before the refinement process. ARMC can be disabled from the reconstruction process by turning off its sequence level flag.
[0109] After constructing the merge candidate list, the merge candidates are divided into several subgroups. For normal merge mode and TM merge mode, the subgroup size is set to 5. For affine merge mode, the subgroup size is set to 3. The merge candidates in each subgroup are reordered incrementally according to the cost value based on template matching. For simplicity, the merge candidates in the last subgroup rather than the first subgroup are not reordered. During the construction of the merge motion vector candidate list, all zero candidates from the ARMC reordering process are excluded.
[0110] The template matching cost of the merged candidate is measured by the sum of absolute differences (SAD) between the samples of the template of the current block and its corresponding reference samples. The template includes a set of reconstructed samples adjacent to the current block. The reference samples of the template are located by merging the motion information of the candidate.
[0111] When the merge candidate uses bidirectional prediction, the reference sample of the template of the merge candidate is also generated by bidirectional prediction, such as Figure 5 shown. Figure 5 is a conceptual diagram illustrating a reference sample of a template and a reference image. Figure 5In the example of , the current picture 500 includes a current block 502. The template is above and to the left of the current block 502. The merge candidates for the current block 502 may include list 0 motion information (506) identifying a reference picture in reference list 0 and list 1 motion information (508) identifying a reference picture in reference list 1. The list 0 motion information also includes an initial motion vector indicating a position in the reference picture 506. The list 1 motion information also includes an initial motion vector indicating a position in the reference picture 508. The video encoder 200 and the video decoder 300 may search an area around the position identified by the initial motion vector to identify reference blocks 510 and 512. The video encoder 200 and the video decoder 300 may identify the reference blocks 510, 512 based on a comparison of samples in the template 504 with reference samples in corresponding templates 514, 516 of the reference pictures 506, 508.
[0112] Figure 6 600 and a reference sample of the template. A current picture 602 includes the current block 600. A collocated picture 604 includes a collocated block 606. For a sub-block-based merge candidate having a sub-block size equal to Wsub×Hsub, the upper template includes several sub-templates 608 of size Wsub×1, and the left template includes several sub-templates 610 of size 1×Hsub. Figure 6 As shown, the motion information of the sub-blocks in the first row and the first column of the current block 600 is used to derive the reference samples of each sub-template.
[0113] Now discuss TMVP and non-adjacent merge candidate type reordering. Merge candidates of a single candidate type (e.g., TMVP or non-adjacent MVP (NA-MVP)) are reordered based on the ARMC TM cost value. The reordered candidates are then added to the merge candidate list. The TMVP candidate type adds more TMVP candidates with more temporal positions and different inter-frame prediction directions to perform reordering and selection. In addition, the NA-MVP candidate type is further extended to have more spatial non-adjacent positions. The target reference picture of the TMVP candidate can be selected from any of the reference pictures in the list according to the scaling factor. The selected reference picture is the picture with the scaling factor closest to 1.
[0114] We now discuss the geometric partition merging (GPM) partitioning mode reordering. In template matching based reordering for GPM partitioning modes, given the motion information of the current GPM block, the corresponding TM cost value of the GPM partitioning mode is calculated. Then, all GPM partitioning modes are reordered in ascending order based on the TM cost value. Instead of transmitting the GPM partitioning mode, an index is signaled that uses a Golomb-Rice code to indicate where the exact GPM partitioning mode is located in the reordering list.
[0115] The reordering method for the GPM partitioning mode is a two-step process performed after generating the corresponding reference templates for the two GPM partitions in the coding unit, as follows:
[0116] Extend the GPM partition edge into the reference templates of the two GPM partitions to obtain 64 reference templates, and calculate the corresponding TM cost for each of the 64 reference templates;
[0117] Re-sort the GPM partitioning modes in ascending order based on their TM cost values and mark the best 32 as usable partitioning modes.
[0118] The edges on the template extend from the edges of the current CU, such as Figure 7 As illustrated, the GPM mixing process is not used in the template area across the edge. Figure 7 is a conceptual diagram illustrating the edges on the template. Figure 7 In the example of , the current CU 700 has a top template 702 and a left template 704. The current CU 700 is divided by a GPM partition edge 706. The index is signaled after reordering in ascending order using the TM cost. The GPM partition mode reordering has its own sequence level flag to control whether the reordering is enabled. When the GPM partition mode is disabled, the GPM partition mode is not reordered for the entire sequence, and the syntax representing the GPM partition mode falls back to the original design as a VTM (which is a 6-bit binary code).
[0119] We now discuss candidate reordering for conventional merge modes with motion vector difference (MMVD) and affine MMVD. The MMVD offset is extended for both MMVD and affine MMVD modes. Additional refinement positions along the k×π / 8 diagonal angles are added, as Figure 8As shown, the number of directions is increased from 4 to 16. Second, all possible MMVD refinement positions (16×6) for each basis candidate are reordered based on the sum of absolute differences (SAD) cost between the template (the top row and left column of the current block) and its reference to each refinement position. Finally, the top 1 / 8 refinement positions with the smallest template SAD cost are kept as available positions and are therefore used for MMVD index decoding. The MMVD index is binarized by a Rice code with parameter equal to 2. Extended affine MMVD reordering, where additional refinement positions along k×π / 4 diagonal angles are added. After reordering the top 1 / 2 refinement positions with the smallest template, the SAD cost is kept. Figure 8 is a conceptual diagram illustrating the additional direction along the k×π / 8 diagonal angle. Figure 8 In the figure, the star symbol 800 represents the position in the reference system to which the basic motion vector of the MMVD points. Relative to the position of the star symbol 800, 16 circles (802A-802P) (black, shaded, blank) represent the directions in which the basic motion vector can be refined. There are 16 directions corresponding to 16 angles, respectively (as represented by {k×π / 8} for all k∈{0,1,…,15}). Specifically, they are {(±1,0), (0,±1), (-1,±1), (1,±1), (-1,±2), (1,±2), (-2,±1), (2,±1)} as supported in the MMVD mode of ECM. In addition, only the first half of the directions are supported in the affine MMVD of ECM. The final motion vector can be the basic motion vector plus the difference vector derived by multiplying the selected direction vector by the selected offset scalar.
[0120] Now let's discuss MVD sign prediction. In MVD sign prediction, possible MVD sign combinations are classified according to template matching cost, and the index corresponding to the true MVD sign is derived and context decoded. On the decoder side, the MVD sign is derived as follows:
[0121] 1. Analyze the magnitude of the MVD components.
[0122] 2. Parse the MVD sign prediction index for context decoding.
[0123] 3. Construct MV candidates by creating combinations between possible signs and absolute MVD values and adding the combinations to the MV predictor.
[0124] 4. Derive the MVD sign prediction cost for each derived MV based on the template matching cost and classification.
[0125] 5. Use the MVD sign prediction index to select the true MVD sign.
[0126] MVD sign prediction is applied to inter-AMVP, affine AMVP, MMVD, and affine MMVD modes. A sequence-level flag is used to determine whether MVD sign prediction is used in the bitstream. When the sequence-level flag is off, the MVD sign bit is signaled in the same way as VTM and is not reordered.
[0127] Reference picture reordering is now discussed. A block-level reference picture reordering method based on template matching can be used. For unidirectional prediction AMVP mode, the reference pictures in list 0 and list 1 are interleaved to generate a joint list. For each hypothesis of the reference pictures in the joint list, template matching is performed to calculate the cost. The joint list is reordered based on ascending order of template matching cost. The index of the selected reference picture in the reordered joint list is signaled in the bitstream. For bidirectional prediction AMVP mode, a list of reference picture pairs from list 0 and list 1 is generated and similarly reordered based on template matching cost. The index of the selected pair is signaled.
[0128] The sequence level flag is used to determine whether reference picture reordering is used in the bitstream. When this sequence level flag is off, the reference picture index is signaled in the same way as VTM and is not reordered.
[0129] Now we discuss template matching with overlapped block motion compensation (TM-OBMC). In the template matching-based overlapped block motion compensation (OBMC) scheme, instead of using weighted prediction directly, the prediction value of the CU boundary sample derivation method is determined according to the template matching cost, including using only the motion information of the current block, or using the motion information of the neighboring blocks and one of the hybrid modes.
[0130] Fig. 9 is a conceptual diagram of an example template illustrating TM-OBMC. In this scheme, for each top block having a size of 4×4 at the top boundary of CU 902 (i.e., each of blocks 900A, 900B, 900C, 900D), the upper template size (e.g., templates 904A, 904B, 904C, 904D) is equal to 4×1. If N neighboring blocks have the same motion information, the upper template size is enlarged to 4N×1 because the motion compensation operation can be processed at one time. For each left block having a size of 4×4 at the left CU boundary (i.e., blocks 900A, 900E, 900F, 900G), the left template (904E, 904F, 904G, 904H) size is equal to 1×4 or 1×4N (e.g., Fig. 9 depicted).
[0131] Specifically, in Fig. 9In the example of , for each 4×4 top block (ie, each of blocks 900A, 900B, 900C, 900D) or other group of N 4×4 blocks, the following steps are followed to derive prediction values for boundary samples.
[0132] Take block 900A as the current block and its above neighbor block AboveNeighbor_A as an example. The operation of the left block is performed in the same manner.
[0133] First, three template matching costs (Cost1, Cost2, Cost3) are measured by SAD between the reconstructed samples of the template and their corresponding reference samples derived by the MC process according to the following three types of motion information:
[0134] Cost 1 is calculated based on A's motion information.
[0135] Cost 2 is calculated based on the motion information of AboveNeighbor_A.
[0136] Cost 3 is calculated based on the weighted prediction of the motion information of A and AboveNeighbor_A, where the weighting factors are 3 / 4 and 1 / 4 respectively.
[0137] Second, choose a method to calculate the final prediction result of the boundary samples by comparing cost 1, cost 2 and cost 3.
[0138] The original motion compensation result using the motion information of the current block is represented as pixel 1, and the motion compensation result using the motion information of the neighboring block is represented as pixel 2. The final prediction result is represented as NewPixel.
[0139] - If cost 1 is minimal, then NewPixel(i,j) = pixel1(i,j).
[0140] - If (cost2 + (cost2>>2) + (cost2>>3)) <= cost1, use blending mode 1.
[0141] For luma blocks, the number of mixed pixel rows is 4.
[0142] NewPixel(i,0)=(26×Pixel1(i,0)+6×Pixel2(i,0)+16)>>5
[0143] NewPixel(i,1)=(7×Pixel1(i,1)+Pixel2(i,1)+4)>>3
[0144] NewPixel(i,2)=(15×Pixel1(i,2)+Pixel2(i,2)+8)>>4
[0145] NewPixel(i,3)=(31×Pixel1(i,3)+Pixel2(i,3)+16)>>5
[0146] For chroma blocks, the number of mixed pixel rows is 1.
[0147] NewPixel(i,0)=(26×Pixel1(i,0)+6×Pixel2(i,0)+16)>>5
[0148] - If cost1 <= cost2, use blending mode 2.
[0149] For luma blocks, the number of mixed pixel rows is 2.
[0150] NewPixel(i,0)=(15×Pixel1(i,0)+Pixel2(i,0)+8)>>4
[0151] NewPixel(i,1)=(31×Pixel1(i,1)+Pixel2(i,1)+16)>>5
[0152] For chroma blocks, the number of mixed pixel rows / columns is 1.
[0153] NewPixel(i,0)=(15×Pixel1(i,0)+Pixel2(i,0)+8)>>4
[0154] - Otherwise, use blend mode 3.
[0155] For luma blocks, the number of mixed pixel rows is 4.
[0156] NewPixel(i,1)=(7×Pixel1(i,1)+Pixel2(i,1)+4)>>3
[0157] NewPixel(i,2)=(15×Pixel1(i,2)+Pixel2(i,2)+8)>>4
[0158] NewPixel(i,3)=(31×Pixel1(i,3)+Pixel2(i,3)+16)>>5
[0159] For chroma blocks, the number of mixed pixel rows is 1.
[0160] NewPixel(i,0)=(7×Pixel1(i,0)+Pixel2(i,0)+4)>>3
[0161] Intra-frame template matching prediction (IntraTMP) is now described. IntraTMP is a special intra-frame prediction mode that copies the best prediction block from the reconstructed part of the current frame, whose L-shaped template matches the current template. For a predefined search range, the encoder searches for the template that is most similar to the current template in the reconstructed part of the current frame, and uses the corresponding block as the prediction block. The video encoder 200 then signals the use of this mode, and performs the same prediction operation at the decoder side.
[0162] Fig.10 is a conceptual diagram illustrating an example intra-frame template matching search area. SAD is used as a cost function. By comparing the L-shaped causal neighbors of the current block 1000 with Fig.10 The prediction signal is generated by matching another block in a predefined search area in the , where the predefined search area consists of:
[0163] R1: Current CTU
[0164] R2: Upper left CTU
[0165] R3: Upper CTU
[0166] R4: Left CTU
[0167] Within each of the regions R1, R2, R3, and R4, the video decoder 300 searches for a reference template having a minimum SAD with respect to the template of the current block 1000, and uses a block corresponding to the reference template (eg, the matching block 1002) as a prediction block.
[0168] The dimensions of all regions (SearchRange w, SearchRange h) are set to be proportional to the block dimensions (BlkW, BlkH) to have a fixed number of SAD comparisons per pixel. That is:
[0169] SearchRange_w=5*BlkW
[0170] SearchRange_h=5*BlkH
[0171] The intra template matching tool is enabled for CUs with width and height size less than or equal to 64. This maximum CU size for intra template matching may be configurable. When decoder-side intra mode derivation (DIMD) is not used for the current CU, the intra template matching prediction mode may be signaled at the CU level through a dedicated flag.
[0172] Intra Block Copy (IBC) with TM-AMVP (IBC-TM-AMVP) and IBC with TM-MRG (IBC-TM-MRG) are now discussed. Template matching is used in IBC for IBC merge mode and IBC AMVP mode, referred to as IBC-TM-AMVP and IBC-TM-MRG, respectively.
[0173] In IBC-TM-MRG, the merge list is modified compared to the merge list used by the conventional IBC merge mode so that candidates are selected according to a pruning method with motion distances between candidates, as in the conventional TM merge mode. The end zero motion implementation is replaced by motion vectors to the left (-W, 0), up (0, -H), and top-left (-W, -H), where W is the width of the current CU and H is its height. In addition, a template matching method is utilized to refine the selected candidates before the RDO or decoding process. The IBC-TM-MRG mode has competed with the conventional IBC merge mode and signals the TM merge flag.
[0174] In IBC-TM-AMVP mode, up to 3 candidates are selected from the IBC-TM-MRG merge list. Each of these 3 selected candidates is refined using a template matching method and classified according to their resulting template matching cost. Only the first 2 are then considered in the motion estimation process.
[0175] Fig.11 is a conceptual diagram illustrating the intra block copy reference region according to the current decoding CU position. Template matching refinement for both IBC-TM merge and AMVP mode is quite simple because IBC motion vectors are constrained to be (i) integers and (ii) within the reference region, as Fig.11 Error! Reference source not found. Specifically, Fig.11 In the example of , each small square corresponds to a CU. The square with a darker border surrounding a group of four CUs may correspond to a CTU. In some examples, each of the CTUs may have a size of 128×128, while each of the CUs may have a size of 64×64. In addition, Fig.11 The current CU 1100 is shown at different positions within the CTU. The shaded CU is the cause of the current CU 1100. Depending on the position of the current CU 1100, different CUs may be used for IBC. Fig.11 CUs marked with an "X" are not available for IBC.
[0176] In IBC-TM-MRG mode, all refinements are performed with integer precision, and in IBC-TM-AMVP mode, refinements are performed with integer precision or 4-pixel precision depending on the AMVR value. This refinement only accesses samples without interpolation. In both cases, the refined motion vectors and the template used at each refinement step must respect the constraints of the reference region.
[0177] In the ongoing development of the ECM Universal Test Software Platform, template matching prediction and related decoding tools that rely on template matching prediction are almost ubiquitous. Not every decoding tool has a systematic design at the high-level syntax to turn on and off template matching prediction and related decoding tools. Some decoding tools can cause the codec to have undefined behavior when a certain template matching related tool is disabled from the bitstream.
[0178] If not otherwise specified, the decoding tools referred to as "TM tools" hereinafter are from but not limited to the following tools: template matching related decoding tools (e.g., TM-AMVP, TM-MRG, ...) as described in the parts of this disclosure related to TM-AMVP and TM-MRG, TM-GPM, TM-CIIP, ARMC, TMCP and non-adjacent merge candidate type reordering, GPM partition mode reordering, candidate reordering for conventional MMVD and affine MMVD, MVD sign prediction, reference picture reordering, TM-OBMC, IntraTMP, IBC-TM-AMVP and IBC-TM-MRG.
[0179] Now discuss the advanced flag control for TM tools. According to the examples of the present disclosure, each TM tool (e.g., TM template matching advanced motion vector prediction (TM-AMVP) and template matching merge (TM-MRG), TM-GPM, TM-CIIP, ARMC, TMCP and non-adjacent merge candidate type reordering, GPM partition mode reordering, candidate reordering for conventional MMVD and affine MMVD, MVD sign prediction, reference picture reordering, TM-OBMC, IntraTMP, IBC-TM-AMVP and IBC-TM-MRG as described elsewhere in the present disclosure) may have its own sequence level, picture level, sub-picture level, slice level / or tile level flag to determine whether to apply the corresponding syntax and decoding / reconstruction process. When the corresponding flag indicates that the TM tool is not applied, the video decoder 300 may turn off the TM tool or roll back to the original syntax / decoding / reconstruction design, depending on which TM tool is used.
[0180] Some TM tools modify the original codec design and thus may need to be rolled back when the corresponding flag is turned off.
[0181] TM-AMVP: Falls back to the VTM that signals the AMVP flag and template match.
[0182] - GPM split mode reordering: Fall back to VTM, which uses binary code without context decoding to signal the GPM split mode.
[0183] • Candidate reordering for regular MMVD and affine MMVD: Fall back to direction index coding and offset index coding to represent the motion of merging candidates.
[0184] MVD Sign Prediction: Falls back to VTM to separate the decoding of the sign bits of the x and y components of the motion vector difference vector.
[0185] • Reference picture reordering: Fall back to the VTM to signal the reference index individually for each reference picture list.
[0186] Other TM tools may be new coding features and thus may be turned off when the corresponding flag is turned off (ie, the related syntax elements are no longer present in the bitstream and the corresponding decoding process is bypassed).
[0187] TM-MRG
[0188] TM-GPM
[0189] ·TM-CIIP
[0190] ·ARMC
[0191] TMVP and non-adjacent merge candidate type reordering
[0192] TM-OBMC
[0193] IntraTMP
[0194] IBC-TM-AMVP
[0195] ·IBC-TM-MRG
[0196] In some examples, several TM tools with similar functionality may share the same high-level flag to enable or disable them completely.
[0197] In some examples, TM-AMVP and IBC-TM-AMVP are both AMVP related tools and can share the same high-level flag for turning them on and off together. In other words, a single high-level flag can turn both TM-AMVP and IBC-TM-AMVP on and off.
[0198] • In some examples, TM-MRG and IBC-TM-MRG are both block-based merge modes and may share the same high-level flag for turning them on and off together.
[0199] In some examples, GPM partition mode reordering, candidate reordering for conventional MMVD and affine MMVD, MVD sign prediction, reference picture reordering, ARMC, TMVP, and non-adjacent merge candidate type reordering are TM-based ordering methods and may share the same high-level flag for switching them on and off together. In addition, MVD sign prediction may not be included because its template shape may not align with the other TM tools mentioned in this example.
[0200] In some examples, some TM tools may have dependencies that require certain functionality from another TM tool. For example, many tools rely on the same template samples as ARMC to calculate TM costs for reordering. Their advanced flags are considered to be present in the bitstream only when ARMC's advanced flag is enabled. Note that when a TM tool's advanced flag is not present in the bitstream, the corresponding TM tool is disabled.
[0201] • In some examples, the advanced flag of IBC-TM-AMVP is only present when the advanced flag of TM-AMVP at the same level (eg, sequence level, picture level, sub-picture level, slice level, and / or tile level) is enabled.
[0202] • In some examples, the advanced flag of the IBC-TM-MRG is only present when the advanced flag of the TM-MRG at the same level (eg, sequence level, picture level, sub-picture level, slice level, and / or tile level) is enabled.
[0203] • In some examples, the advanced flag of TM-CIIP is only present when CIIP is enabled and the advanced flag of TM-MRG at the same level (eg, sequence level, picture level, sub-picture level, slice level and / or tile level) is enabled.
[0204] In some examples, an advanced flag of N is present only when an advanced flag of ARMC at the same level (e.g., sequence level, picture level, sub-picture level, slice level, and / or tile level) is enabled, where N may be, but is not limited to, GPM partition mode reordering, candidate reordering for conventional MMVD and affine MMVD, MVD sign prediction, reference picture reordering, TMVP, and non-adjacent merge candidate type reordering.
[0205] In some examples, the TM tools may be characterized with different levels of decoding complexity, and thus may be controlled on and off together to provide a configurable set of coding tools in a constrained decoding environment. Typically, there are two types of MV refinement undertaken by template matching: (1) searching around a given initial motion vector to reduce the TM cost, and (2) searching within a motion vector candidate list to find the motion vector candidate that achieves the lowest TM cost. Two flags at each of the coding levels (e.g., sequence level, picture level, sub-picture level, slice level, and / or tile level) may be present in the bitstream to enable and disable the TM tools.
[0206] The first flag can enable or disable the decoding tools listed below:
[0207] TM-AMVP
[0208] TM-MRG
[0209] TM-GPM
[0210] ·TM-CIIP
[0211] IntraTMP
[0212] IBC-TM-AMVP
[0213] IBC-TM-MRG
[0214] The second flag can enable or disable the following decoding tools:
[0215] ·ARMC
[0216] TMVP and non-adjacent merge candidate type reordering
[0217] ·GPM split mode reordering
[0218] Candidate re-ranking for regular MMVD and affine MMVD
[0219] MVD sign prediction
[0220] Reorder reference images
[0221] TM-OBMC
[0222] In some examples, IntraTMP may not be included from the control of the first flag. In some examples, IntraTMP, IBC-TM-AMVP, and IBC-TM-MRG are not included in the list of decoding tools controlled by the first flag because IntraTMP, IBC-TM-AMVP, and IBC-TM-MRG are intra-frame decoding tools.
[0223] In some examples, an advanced flag (e.g., at the sequence level, picture level, sub-picture level, slice level, and / or tile level) can be signaled before those flags of the TM tool to indicate whether the TM tool is used. When the flag is on, the advanced flags of the TM tool follow the newly introduced advanced flags in the parsing order; otherwise, when the flag is off, all advanced flags of the TM tool are not present in the bitstream, and their flag values are set to off.
[0224] In some examples, IntraTMP from the control of this new flag may not be included. In some examples, IntraTMP, IBC-TM-AMVP, and IBC-TM-MRG from the control of this new flag may not be included. In some examples, this new flag, when enabled, also indicates whether high-level flags for bidirectional matching-based methods (e.g., DMVR and multi-pass DMVR) are present in the bitstream.
[0225] Thus, in some examples, the video encoder 200 may signal a syntax element in the bitstream. The second syntax element may be a sequence-level syntax element, a picture-level syntax element, a slice-level syntax element, or a tile-level syntax element. The second syntax element may indicate whether the bitstream includes one or more template matching tool syntax elements. Based on the syntax element, the video encoder 200 may signal one or more syntax elements in the bitstream indicating whether one or more template matching tools are enabled. In some such examples, the presence of syntax elements indicating whether intra-frame template matching prediction (intraTMP), intra-frame block copy template matching with advanced motion vector prediction (IBC-TM-AMVP), and intra-frame block copy template matching with merge mode (IBC-TM-AMVP) are enabled does not depend on the syntax element. Similarly, the video decoder 300 may obtain a second syntax element from the bitstream, wherein the second syntax element is a sequence-level syntax element, a picture-level syntax element, a slice-level syntax element, or a tile-level syntax element. The video decoder 300 may determine whether the bitstream includes one or more syntax elements (i.e., template matching tool syntax elements) indicating whether one or more template matching tools are enabled based on the syntax element. In some such examples, the presence of a syntax element indicating whether intra template matching prediction (intraTMP), intra block copy template matching with advanced motion vector prediction (IBC-TM-AMVP), and intra block copy template matching with merge mode (IBC-TM-AMVP) are enabled is not dependent on the syntax element.
[0226] In another example, when the advanced flag of IBC-TM-MRG is disabled in the bitstream, the pruning threshold used to determine whether the same motion vector component (i.e., x-direction or y-direction) of two motion vectors is similar is set to be equal to N (where N is a positive integer). When the absolute difference of the MV component between two MVs is less than N, this means that the MV motion components of the two MVs are similar. If each MV component of the two MVs is similar, the video encoder 200 and the video decoder 300 may prune one of the MVs during the construction of the IBC merge candidate list. Typically, N is set to be equal to 1 (which means that two MVs are considered similar when they are exactly the same as each other) or 0 (which means that similarity-based pruning is disabled).
[0227] In another example, the same concept can be applied to IBC-TM-AMVP. When the advanced flag of IBC-TM-AMVP is disabled in the bitstream, if each MV component of the two MVs is similar, the video encoder 200 and the video decoder 300 can prune one of the MVs during the construction of the IBC AMVP candidate list. Typically, N is set equal to 1 or 0.
[0228] Thus, in some examples, based on a syntax element indicating that intra block copy template matching merge mode (IBC-TM-MRG) or intra block copy template matching advanced motion vector prediction (IBC-TM-AMVP) is disabled, the video encoder 200 may set the pruning threshold to a value. The video encoder 200 may prune the first candidate from the list based on the difference between the motion vector component of the first candidate in the list and the motion vector component of the second candidate being less than the pruning threshold. The video encoder 200 may apply the template matching tool to generate the prediction block of the current CU including applying the template matching tool based on the candidates in the list to generate the prediction block of the current CU. Similarly, based on a syntax element indicating that intra block copy template matching merge mode (IBC-TM-MRG) or intra block copy template matching advanced motion vector prediction (IBC-TM-AMVP) is disabled, the video decoder 300 may set the pruning threshold to a value. The video decoder 300 may prune the first candidate from the list based on the difference between the motion vector component of the first candidate in the list and the motion vector component of the second candidate being less than the pruning threshold. The video decoder 300 may apply the template matching tool to generate the prediction block of the current CU including applying the template matching tool to generate the prediction block of the current CU based on the candidates in the list.
[0229] Fig.12 is a block diagram illustrating an example video encoder 200 that may perform the techniques of this disclosure. Fig.12It is provided for the purpose of explanation and should not be considered as limiting the techniques extensively illustrated and described in this disclosure. For the purpose of explanation, this disclosure describes a video encoder 200 according to 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 and video coding formats, such as AV1 and subsequent formats of the AV1 video coding format.
[0230] exist Fig.12 In the example of , the video encoder 200 includes a video data memory 230, a mode selection unit 202, a residual generation unit 204, a transform processing unit 206, a quantization unit 208, an inverse quantization unit 210, an inverse transform processing unit 212, a reconstruction unit 214, a filter unit 216, a decoded picture buffer (DPB) 218, and an entropy coding unit 220. Any or all of the video data memory 230, the mode selection unit 202, the residual generation unit 204, the transform processing unit 206, the quantization unit 208, the inverse quantization unit 210, the inverse transform processing unit 212, the reconstruction unit 214, the filter unit 216, the DPB 218, and the entropy coding unit 220 may be implemented in one or more processors or in a processing circuit. For example, the units of the video encoder 200 may be implemented as one or more circuits or logic elements as part of a hardware circuit, or as part of a processor, an ASIC, or an FPGA. In addition, the video encoder 200 may include additional or alternative processors or processing circuits to perform these and other functions.
[0231] Video data memory 230 may store video data to be encoded by components of video encoder 200. Video encoder 200 may receive video data from, for example, video source 104 ( Figure 1 ) receives video data stored in video data memory 230. DPB 218 can act as a reference picture memory, which stores reference video data for use when subsequent video data is predicted by video encoder 200. Video data memory 230 and DPB 218 can 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 can be provided by the same memory device or a separate memory device. In various examples, video data memory 230 can be on-chip with other components of video encoder 200 (as illustrated), or off-chip relative to those components.
[0232] In the present disclosure, references to the video data memory 230 should not be interpreted as limited to a memory inside the video encoder 200 (unless otherwise specified) or a memory outside the video encoder 200 (unless otherwise specified). Rather, references to the video data memory 230 should be understood as a reference memory that stores video data received by the video encoder 200 for encoding (e.g., video data for a current block to be encoded). Figure 1 Memory 106 may also provide temporary storage for outputs from various units of video encoder 200 .
[0233] Illustrated Fig.12 The various units of the video encoder 200 are provided to help understand the operations performed by the video encoder 200. The units may be implemented as fixed-function circuits, programmable circuits, or a combination thereof. Fixed-function circuits refer to circuits that provide specific functionality and are pre-set for the operations that can be performed. Programmable circuits refer to circuits that can be programmed to perform various tasks and provide flexible functionality in the operations that can be performed. For example, a programmable circuit can execute software or firmware that causes the programmable circuit to operate in a manner defined by the instructions of the software or firmware. Fixed-function circuits can execute software instructions (e.g., to receive parameters or output parameters), but the types of operations performed by fixed-function circuits are generally immutable. In some examples, one or more of the units in the unit may be different circuit blocks (fixed-function or programmable), and in some examples, one or more of the units in the unit may be integrated circuits.
[0234] The video encoder 200 may include an arithmetic logic unit (ALU), an elementary function unit (EFU), a digital circuit, an analog circuit, and / or a programmable core formed by a programmable circuit. In an example in which the operation of the video encoder 200 is performed using software executed by a programmable circuit, the memory 106 ( Figure 1 ) may store instructions (eg, object code) for software received and executed by the video encoder 200, or another memory (not shown) within the video encoder 200 may store such instructions.
[0235] The video data memory 230 is configured to store the received video data. The video encoder 200 may retrieve a picture 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 original video data to be encoded.
[0236] The mode selection unit 202 includes a motion estimation unit 222, a motion compensation unit 224, and an intra prediction unit 226. The mode selection unit 202 may include additional functional units for performing video prediction according to other prediction modes. As an example, the mode selection unit 202 may include a palette unit, an intra block copy unit (which may be part of the motion estimation unit 222 and / or the motion compensation unit 224), an affine unit, a linear model (LM) unit, etc. Fig.12 In the example of , motion estimation unit 222 includes template matching unit 228, which can implement template matching coding tools such as TM-AMVP, GPM partition mode reordering, candidate reordering for conventional MMVD and affine MMVD, MVD sign prediction, reference picture reordering, template matching merge mode, template matching GPM, template matching CIIP, adaptive reordering of merge candidates, TMVP and non-adjacent merge candidate type reordering, TM-OBMC, IntraTMP, IBC-TM-AMVP, and IBC-TM-AMVP. According to the techniques of the present disclosure, motion estimation unit 222 can signal one or more syntax elements to indicate whether one or more of the template matching tools are enabled.
[0237] The mode selection unit 202 generally coordinates multiple encoding passes to test combinations of encoding parameters and resulting rate-distortion values for such combinations. The encoding parameters may include the partitioning of CTUs into CUs, the prediction mode for a CU, the transform type for residual data of a CU, the quantization parameter for residual data of a CU, etc. The mode selection unit 202 may ultimately select an encoding parameter combination that has a better rate-distortion value than other tested combinations.
[0238] The video encoder 200 may divide the picture retrieved from the video data memory 230 into a series of CTUs, and pack one or more CTUs into a slice. The mode selection unit 202 may divide the CTUs of the picture according to a tree structure, such as an MTT structure, a QTBT structure, a super block structure, or the above-mentioned quadtree structure. As described above, the video encoder 200 may form one or more CUs by dividing the CTUs according to the tree structure. Such CUs may also be generally referred to as "video blocks" or "blocks".
[0239] In general, the mode selection unit 202 also controls its components (e.g., the motion estimation unit 222, the motion compensation unit 224, and the intra prediction unit 226) to generate a prediction block for the current block (e.g., the current CU, or in HEVC, the overlapping portion of the PU and TU). In order to inter-predict 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 decoded pictures stored in the DPB 218). Specifically, the motion estimation unit 222 may calculate a value representing how similar the potential reference block will be to the current block, for example, based on 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 differences between the current block and the reference block under consideration. The motion estimation unit 222 may identify the reference block with the lowest value produced by these calculations to indicate the reference block that best matches the current block.
[0240] The motion estimation unit 222 may form one or more motion vectors (MVs) that define the positioning of the reference block in the reference picture relative to the positioning of the 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, for unidirectional inter prediction, the motion estimation unit 222 may provide a single motion vector, while for bidirectional inter prediction, the motion estimation unit 222 may provide two motion vectors. The motion compensation unit 224 may then use the motion vectors to generate a prediction block. For example, the motion compensation unit 224 may use the motion vectors to retrieve data for the reference block. As another example, in the case where the motion vectors have fractional sample precision, the motion compensation unit 224 may interpolate the values of the prediction block according to one or more interpolation filters. In addition, for bidirectional inter prediction, the motion compensation unit 224 may retrieve data for two reference blocks identified by the corresponding motion vectors and combine the retrieved data, for example, by sample-by-sample averaging or weighted averaging.
[0241] When operating according to the AV1 video coding format, the motion estimation unit 222 and the motion compensation unit 224 may be configured to encode coding blocks of the video data (e.g., both luma coding blocks and chroma coding blocks) using translational motion compensation, affine motion compensation, overlapped block motion compensation (OBMC), and / or composite inter-intra prediction.
[0242] As another example, for intra prediction or intra prediction coding, the intra prediction unit 226 may generate a prediction block from samples neighboring the current block. For example, for directional mode, the intra prediction unit 226 may generally mathematically combine the values of neighboring samples and pad these calculated values across the current block in a defined direction to produce a prediction block. As another example, for DC mode, the intra prediction unit 226 may calculate an average of neighboring samples of the current block and generate a prediction block to include the resulting average for each sample of the prediction block.
[0243] When operating according to the AV1 video coding format, the intra prediction unit 226 may be configured to encode coding blocks of video data (e.g., both luma coding blocks and chroma coding blocks) using directional intra prediction, non-directional intra prediction, recursive filter intra prediction, chroma from luma (CFL) prediction, intra block copy (IBC), and / or palette mode. The mode selection unit 202 may include additional functional units to perform video prediction according to other prediction modes.
[0244] The mode selection unit 202 provides the prediction block to the residual generation unit 204. The residual generation unit 204 receives the uncoded original version of the current block from the video data memory 230 and receives the prediction block from the mode selection unit 202. The residual generation unit 204 calculates the sample-by-sample difference between the current block and the prediction block. The resulting sample-by-sample difference defines a residual block for the current block. In some examples, the residual generation unit 204 may also determine the difference between the sample values in the residual block to generate the residual block using residual differential pulse coding modulation (RDPCM). In some examples, the residual generation unit 204 may be formed using one or more subtractor circuits that perform binary subtraction.
[0245] In an example where the mode selection unit 202 divides the CU into PUs, each PU may be associated with a luma prediction unit and a corresponding chroma prediction unit. The video encoder 200 and the video decoder 300 may support PUs of various sizes. As noted above, the size of a CU may refer to the size of the luma coding block of the CU, and the size of a PU may refer to the size of the luma prediction unit of the PU. Assuming that the size of a particular CU is 2N×2N, the video encoder 200 may support PU sizes of 2N×2N or N×N for intra-prediction, and symmetric PU sizes of 2N×2N, 2N×N, N×2N, N×N, or similar for inter-prediction. The video encoder 200 and the video decoder 300 may also support asymmetric partitioning for PU sizes of 2N×nU, 2N×nD, nL×2N, and nR×2N for inter-prediction.
[0246] In examples where mode select unit 202 does not further divide a CU into PUs, each CU may be associated with a luma coding block and a corresponding chroma coding block. As above, the size of a CU may refer to the size of the luma coding block of the CU. Video encoder 200 and video decoder 300 may support CU sizes of 2N×2N, 2N×N, or N×2N.
[0247] 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 selection unit 202 generates a prediction block for the current block being encoded via a corresponding unit associated with the coding technique. In some examples (such as palette mode coding), mode selection unit 202 may not generate a prediction block, but instead generate syntax elements indicating the manner in which the block is reconstructed based on the selected palette. In such modes, mode selection unit 202 may provide these syntax elements to entropy encoding unit 220 for encoding.
[0248] As described above, the residual generation unit 204 receives video data for a current block and a corresponding prediction block. The residual generation unit 204 then generates a residual block for the current block. To generate the residual block, the residual generation unit 204 calculates the sample-by-sample difference between the prediction block and the current block.
[0249] The transform processing unit 206 applies one or more transforms to the residual block to generate a block of transform coefficients (referred to herein as a "transform coefficient block"). The transform processing unit 206 may apply various transforms to the residual block to form a transform coefficient block. For example, the 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, the transform processing unit 206 may perform a variety of transforms on the residual block, for example, a primary transform and a secondary transform (such as a rotation transform). In some examples, the transform processing unit 206 does not apply a transform to the residual block.
[0250] When operating according to AV1, the transform processing unit 206 may apply one or more transforms to the residual block to generate a block of transform coefficients (referred to herein as a "transform coefficient block"). The transform processing unit 206 may apply various transforms to the residual block to form a transform coefficient block. For example, the transform processing unit 206 may apply a horizontal / vertical transform combination, which may include a discrete cosine transform (DCT), an asymmetric discrete sine transform (ADST), a flipped ADST (e.g., an ADST in reverse order), and an identity transform (IDTX). When the identity transform is used, the transform is skipped in one of the vertical direction or the horizontal direction. In some examples, the transform process may be skipped.
[0251] Quantization unit 208 may quantize transform coefficients in a transform coefficient block to produce a quantized transform coefficient block. 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. Video encoder 200 (e.g., via mode selection unit 202) may adjust the degree of quantization applied to the transform coefficient block associated with the current block by adjusting the QP value associated with the CU. Quantization may cause a loss of information, and therefore, the quantized transform coefficients may have a lower precision than the original transform coefficients generated by transform processing unit 206.
[0252] The inverse quantization unit 210 and the 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. The reconstruction unit 214 may generate a reconstructed block corresponding to the current block (although potentially with some degree of distortion) based on the reconstructed residual block and the prediction block generated by the mode selection unit 202. For example, the reconstruction unit 214 may add samples of the reconstructed residual block to corresponding samples from the prediction block generated by the mode selection unit 202 to generate a reconstructed block.
[0253] Filter unit 216 may perform one or more filtering operations on the reconstructed block. For example, filter unit 216 may perform a deblocking operation to reduce blocking artifacts along the edges of the CU. In some examples, the operations of filter unit 216 may be skipped.
[0254] When operating according to AV1, filter unit 216 may perform one or more filtering operations on the reconstructed block. For example, filter unit 216 may perform a deblocking operation to reduce blocking artifacts along the edges of the CU. In other examples, filter unit 216 may apply a constrained directional enhancement filter (CDEF), which may be applied after deblocking and may include the application of a non-separable, non-linear, low-pass directional filter based on the estimated edge direction. Filter unit 216 may also include a loop recovery filter applied after CDEF, and may include a separable symmetric normalized Wiener filter or a dual self-guided filter.
[0255] The video encoder 200 stores the reconstructed blocks in the DPB 218. For example, in an example where the operation of the filter unit 216 is not performed, the reconstruction unit 214 may store the reconstructed blocks in the DPB 218. In an example where the operation of the filter unit 216 is performed, the filter unit 216 may store the filtered reconstructed blocks in the DPB 218. The motion estimation unit 222 and the motion compensation unit 224 may retrieve a reference picture formed by the reconstructed (and potentially filtered) blocks from the DPB 218 to perform inter-frame prediction on blocks of subsequently encoded pictures. In addition, the intra-frame prediction unit 226 may use the reconstructed blocks of the current picture in the DPB 218 to perform intra-frame prediction on other blocks in the current picture.
[0256] In general, the entropy coding unit 220 may entropy encode syntax elements received from other functional components of the video encoder 200. For example, the entropy coding unit 220 may entropy encode a quantized transform coefficient block from the quantization unit 208. As another example, the entropy coding unit 220 may entropy encode a prediction syntax element (e.g., motion information for inter prediction or intra mode information for intra prediction) from the mode selection unit 202. The entropy coding unit 220 may perform one or more entropy coding operations on the syntax element (the syntax element is another example of video data) to generate entropy encoded data. For example, the entropy coding 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 partitioning entropy (PIPE) coding operation, an exponential Golomb coding operation, or another type of entropy coding operation on the data. In some examples, the entropy coding unit 220 may operate in a bypass mode where the syntax element is not entropy encoded.
[0257] The video encoder 200 may output a bitstream including syntax elements of entropy coding required to reconstruct a block of a slice or a picture. Specifically, the entropy coding unit 220 may output a bitstream.
[0258] According to AV1, the entropy coding unit 220 may be configured as a symbol-to-symbol adaptive multi-symbol arithmetic decoder. The syntax elements in AV1 include an alphabet of N elements, and the context (e.g., a probability model) includes a set of N probabilities. The entropy coding unit 220 may store the probabilities as an n-bit (e.g., 15-bit) cumulative distribution function (CDF). The entropy coding unit 220 may perform recursive scaling using an update factor based on the size of the alphabet to update the context.
[0259] 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 the luma components and chroma components of a CU. In some examples, the luma coding blocks and chroma coding blocks are the luma components and chroma components of a PU.
[0260] In some examples, operations performed with respect to luma coding blocks do not need to be repeated for chroma coding blocks. As an example, operations to identify motion vectors (MVs) and reference pictures for luma coding blocks do not need to be repeated for MVs and reference pictures used to identify chroma blocks. Instead, the 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.
[0261] The video encoder 200 represents an example of a device that is configured to encode video data, the device comprising: a memory configured to store video data; and one or more processors implemented in a circuit and configured to signal syntax elements in a bitstream comprising an encoded representation of the video data. The syntax elements may be sequence-level syntax elements, picture-level syntax elements, slice-level syntax elements, or tile-level syntax elements. The syntax elements indicate whether the template matching tool is enabled. In addition, the one or more processors may be configured to apply the template matching tool to generate a prediction block for the current CU of the video data based on the template matching tool being enabled. The one or more processors may encode the current CU based on the prediction block of the current CU.
[0262] Fig.13 is a block diagram illustrating an example video decoder 300 that may perform the techniques of this disclosure. Fig.13 It is provided for the purpose of explanation and is not a limitation of the techniques extensively illustrated and described in this disclosure. For the purpose of explanation, this disclosure describes a video decoder 300 according to 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 decoding devices configured for other video decoding standards.
[0263] exist Fig.13In the example of , 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 in processing circuits. For example, the units of the video decoder 300 may be implemented as one or more circuits or logic elements as part of a hardware circuit, or as part of a processor, ASIC, or FPGA. In addition, the video decoder 300 may include additional or alternative processors or processing circuits to perform these and other functions.
[0264] The prediction processing unit 304 includes a motion compensation unit 316 and an intra prediction unit 318. The prediction processing unit 304 may include additional units to perform predictions according to other prediction modes. As an example, the prediction processing unit 304 may include a palette unit, an intra block copy unit (which may form part of the motion compensation unit 316), an affine unit, a linear model (LM) unit, etc. In other examples, the video decoder 300 may include more, fewer, or different functional components.
[0265] When operating according to AV1, the motion compensation unit 316 may be configured to decode coding blocks of video data (e.g., both luma coding blocks and chroma coding blocks) using translational motion compensation, affine motion compensation, OBMC, and / or composite inter-intra prediction, as described above. As described above, the intra prediction unit 318 may be configured to decode coding blocks of video data (e.g., both luma coding blocks and chroma coding blocks) using directional intra prediction, non-directional intra prediction, recursive filter intra prediction, CFL, intra block copy (IBC), and / or palette mode.
[0266] exist Fig.13In the example of , the motion compensation unit 316 includes a template matching unit 322, which implements template matching decoding tools such as TM-AMVP, GPM partition mode reordering, candidate reordering for conventional MMVD and affine MMVD, MVD sign prediction, reference picture reordering, template matching merge mode, template matching GPM, template matching CIIP, adaptive reordering of merge candidates, TMVP and non-adjacent merge candidate type reordering, TM-OBMC, IntraTMP, IBC-TM-AMVP and IBC-TM-AMVP. According to the technology of the present disclosure, the template matching unit 322 can obtain syntax elements from the bitstream. The template matching unit 322 can determine that the template matching tool is enabled based on the syntax element, and apply the template matching tool to generate a prediction block for the current CU.
[0267] CPB memory 320 may store video data, such as an encoded video bitstream, to be decoded by components of video decoder 300. For example, the video bitstream may be obtained from computer readable medium 110 ( Figure 1 ) obtains video data stored in CPB memory 320. CPB memory 320 may include a CPB that stores coded video data (e.g., syntax elements) from a coded video bitstream. In addition, CPB memory 320 may store video data other than syntax elements of decoded pictures, such as temporary data representing outputs from various units of video decoder 300. DPB 314 typically stores decoded pictures, which video decoder 300 may output and / or use as reference video data when decoding subsequent data or pictures of the coded 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 a separate memory device. In various examples, CPB memory 320 may be on-chip with other components of video decoder 300, or off-chip relative to those components.
[0268] Additionally or alternatively, in some examples, video decoder 300 may retrieve the video from memory 120 ( Figure 1 ) to retrieve the decoded video data. That is, memory 120 may utilize CPB memory 320 to store data as discussed above. Likewise, 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, memory 120 may store instructions to be executed by video decoder 300.
[0269] Illustrated Fig.13The various units shown in FIG. 3 are used to help understand the operations performed by the video decoder 300. The units may be implemented as fixed function circuits, programmable circuits, or a combination thereof. Fig.12 , fixed-function circuits refer to circuits that provide specific functionality and are pre-set for executable operations. Programmable circuits refer to circuits that can be programmed to perform various tasks and provide flexible functionality in the operations that can be performed. For example, a programmable circuit can execute software or firmware that causes the programmable circuit to operate in a manner defined by the instructions of the software or firmware. Fixed-function circuits can execute software instructions (for example, to receive parameters or output parameters), but the type of operation performed by the fixed-function circuit is generally immutable. 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.
[0270] The video decoder 300 may include an ALU, an EFU, a digital circuit, an analog circuit, and / or a programmable core formed by a programmable circuit. In an example where the operation of the video decoder 300 is performed by software executed on the programmable circuit, an on-chip or off-chip memory may store instructions (e.g., object code) of the software received and executed by the video decoder 300.
[0271] Entropy decoding unit 302 may receive encoded video data from the CPB and entropy decode the video data to reproduce syntax elements. Prediction processing unit 304, inverse quantization unit 306, inverse transform processing unit 308, reconstruction unit 310, and filter unit 312 may generate decoded video data based on syntax elements extracted from the bitstream.
[0272] Generally, the video decoder 300 reconstructs a picture block by block. The video decoder 300 may perform a reconstruction operation on each block individually (wherein a block currently being reconstructed (ie, decoded) may be referred to as a "current block").
[0273] The entropy decoding unit 302 may entropy decode syntax elements defining the quantized transform coefficients of the quantized transform coefficient block and 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 a degree of quantization and, likewise, a degree of inverse quantization to be applied by the inverse quantization unit 306. 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.
[0274] After inverse quantization unit 306 forms the transform coefficient block, inverse transform processing unit 308 may apply one or more inverse transforms to the transform coefficient block to generate a residual block associated with the current block. For example, 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 directional transform, or another inverse transform to the transform coefficient block.
[0275] In addition, prediction processing unit 304 generates a prediction block based on the prediction information syntax elements entropy decoded by entropy decoding unit 302. For example, in the case where the prediction information syntax elements indicate that the current block is inter-frame predicted, motion compensation unit 316 can generate a prediction block. In this case, the prediction information syntax elements can indicate a reference picture in DPB 314 from which to retrieve the reference block, and a motion vector that identifies the position of the reference block in the reference picture relative to the position of the current block in the current picture. Motion compensation unit 316 can generally generate ... Fig.12 )The inter-frame prediction process is performed in a manner substantially similar to that described in the accompanying drawings.
[0276] As another example, where the prediction information syntax element indicates that the current block is intra-predicted, the intra-prediction unit 318 may generate a prediction block according to the intra-prediction mode indicated by the prediction information syntax element. Similarly, the intra-prediction unit 318 may generally generate a prediction block according to the same method as that used with respect to the intra-prediction unit 226 ( Fig.12 The intra prediction process is performed in a substantially similar manner as described in . The intra prediction unit 318 may retrieve data of neighboring samples of the current block from the DPB 314.
[0277] The reconstruction unit 310 may reconstruct the current block using the prediction block and the residual block. For example, the reconstruction unit 310 may add samples of the residual block to corresponding samples of the prediction block to reconstruct the current block.
[0278] The filter unit 312 may perform one or more filtering operations on the reconstructed block. For example, the filter unit 312 may perform a deblocking operation to reduce blocking artifacts along the edges of the reconstructed block. The operations of the filter unit 312 may not necessarily be performed in all examples.
[0279] The video decoder 300 may store the reconstructed block in the DPB 314. For example, in examples where the operation of the filter unit 312 is not performed, the reconstruction unit 310 may store the reconstructed block in the DPB 314. In examples where the operation of the filter unit 312 is performed, the filter unit 312 may store the filtered reconstructed block in the DPB 314. As discussed above, the DPB 314 may provide reference information (such as samples of the current picture for intra-frame prediction and previously decoded pictures for subsequent motion compensation) to the prediction processing unit 304. In addition, the video decoder 300 may output a decoded picture (e.g., a decoded video) from the DPB 314 for use in, for example, Figure 1 Subsequent presentation on a display device such as display device 118.
[0280] In this way, the video decoder 300 represents an example of a video decoding device, which includes: a memory configured to store video data; and one or more processing units, which are implemented in a circuit and configured to obtain syntax elements from a bitstream including an encoded representation of the video data. The syntax elements may be sequence-level syntax elements, picture-level syntax elements, slice-level syntax elements, or tile-level syntax elements. One or more processors may determine whether the template matching tool is enabled based on the syntax elements. Based on the template matching tool being enabled, the one or more processors may apply the template matching tool to generate a prediction block for the current CU of the video data. One or more processors may reconstruct the current CU based on the prediction block of the current CU.
[0281] Fig.14 2 is a flowchart illustrating an example method for encoding a current block according to the technology of the present disclosure. The current block may include a current CU. Although relative to the video encoder 200 ( Figure 1 and Fig.12 ), but it should be understood that other devices may be configured to perform the same Fig.14 A similar approach to the one used in this paper.
[0282] In this example, video encoder 200 initially predicts a current block (1400). For example, video encoder 200 may form a prediction block for the current block. In some examples, video encoder 200 (e.g., template matching unit 228 of video encoder 200) may use template matching coding tools to form the prediction block. Video encoder 200 may signal one or more high-level syntax elements to indicate which template matching coding tools, if any, are enabled.
[0283] The video encoder 200 may calculate a residual block for the current block (1402). To calculate the residual block, the video encoder 200 may calculate the difference between the unencoded original block and the prediction block for the current block. The video encoder 200 may then transform the residual block and quantize the transform coefficients of the residual block (1404). Next, the video encoder 200 may scan the quantized transform coefficients of the residual block (1406). During or after the scan, the video encoder 200 may entropy encode the transform coefficients (1408). For example, the video encoder 200 may encode the transform coefficients using CAVLC or CABAC. The video encoder 200 may then output entropy encoded data for the block (1410).
[0284] Fig.15 1 is a flowchart illustrating an example method for decoding a current video data block according to the techniques of the present disclosure. The current block may include a current CU. Although relative to the video decoder 300 ( Figure 1 and Fig.13 ), but it should be understood that other devices may be configured to perform the same Fig.15 A similar approach to the one used in this paper.
[0285] The video decoder 300 may receive entropy coded data for a current block, such as entropy coded prediction information and entropy coded data for transform coefficients of a residual block corresponding to the current block (1500). The video decoder 300 may entropy decode the entropy coded data to determine prediction information for the current block and reproduce transform coefficients of the residual block (1502).
[0286] The video decoder 300 may predict the current block (1504), for example, using an intra prediction mode or an inter prediction mode as indicated by the prediction information of the current block, to calculate a prediction block for the current block. In some examples, the syntax element may include a high-level syntax element indicating whether one or more template matching coding tools are enabled. Based at least in part on determining that the template matching coding tool is enabled, the template matching unit 322 may apply the template matching coding tool to generate a prediction block for the current block. The video decoder 300 may inverse scan the reproduced transform coefficients (1506) to create a block of quantized transform coefficients. The video decoder 300 may then inverse quantize the transform coefficients and apply an inverse transform to the transform coefficients to produce a residual block (1508). The video decoder 300 may finally decode the current block by combining the prediction block and the residual block (1510).
[0287] Fig.16 is a flowchart illustrating an example operation of a video encoder 200 according to techniques of this disclosure. Fig.16In an example of , the video encoder 200 may signal a syntax element (1600) indicating whether a template matching tool is enabled in a bitstream including an encoded representation of the video data. The template matching tool may be one of: TM-AMVP, GPM partition mode reordering, candidate reordering for conventional MMVD and affine MMVD, MVD sign prediction, reference picture reordering, template matching merge mode, template matching GPM, template matching CIIP, adaptive reordering of merge candidates, TMVP and non-adjacent merge candidate type reordering, TM-OBMC, IntraTMP, IBC-TM-AMVP, or IBC-TM-AMVP.
[0288] Based on the template matching tool being enabled, template matching unit 228 of video encoder 200 may apply the template matching tool to generate a prediction block for a current CU of video data (1602). Template matching unit 228 may generate a prediction block using the template matching tool as described elsewhere in this disclosure.
[0289] The video encoder 200 may encode the current CU based on the prediction block of the current CU (1604). For example, the residual generation unit 204 may generate residual data based on the prediction block of the current CU and the original sample. The transform processing unit 206 may apply one or more transforms to the residual data to generate one or more transform blocks. The quantization unit 208 may quantize the transform coefficients of the one or more transform blocks. The entropy encoding unit 220 may apply entropy encoding to the syntax elements representing the quantized transform coefficients.
[0290] In some examples, the template matching tool is a first template matching tool, the syntax element is a first syntax element, and the video encoder 200 may signal a second syntax element indicating whether the second template matching tool is enabled. If so, the template matching unit 228 may use the second template matching tool to generate prediction blocks for different CUs. For example, the first template matching tool may be a template matching merge mode, and the second template matching tool is a template matching CIIP mode. In other examples, the first template matching tool is ARMC, and the second template matching tool is one of the following: GPM segmentation mode reordering, candidate reordering for conventional MMVD and affine MMVD, MVD sign prediction, reference picture reordering, TMVP or non-adjacent merge candidate type reordering.
[0291] Fig.17 is a flow chart illustrating an example operation of a video decoder 300 according to techniques of this disclosure. Fig.17 In the example of , video decoder 300 may obtain syntax elements from a bitstream that includes an encoded representation of video data ( 1700 ).
[0292] The video decoder 300 may determine, based on the syntax element, that a template matching tool is enabled (1702). The template matching tool may be one of: TM-AMVP, GPM partition mode reordering, candidate reordering for conventional MMVD and affine MMVD, MVD sign prediction, reference picture reordering, template matching merge mode, template matching GPM, template matching CIIP, adaptive reordering of merge candidates, TMVP and non-adjacent merge candidate type reordering, TM-OBMC, IntraTMP, IBC-TM-AMVP, or IBC-TM-AMVP.
[0293] Based on the template matching tool being enabled, template matching unit 322 of video decoder 300 may apply the template matching tool to generate a prediction block for the current CU of video data (1704). Template matching unit 322 may generate a prediction block using the template matching tool as described elsewhere in this disclosure.
[0294] The reconstruction unit 310 of the video decoder 300 may reconstruct the current CU based on the prediction block of the current CU ( 1706 ). For example, the reconstruction unit 310 may add samples of the prediction block to corresponding samples of the residual data generated by the inverse transform processing unit 308 .
[0295] In some examples, the template matching tool is a first template matching tool, the syntax element is a first syntax element, and the template matching unit 322 can determine whether the bitstream includes a syntax element indicating whether the second template matching tool is enabled based on the first syntax element. If so, the template matching unit 322 can use the second template matching tool to generate prediction blocks for different CUs. For example, the first template matching tool can be a template matching merge mode, and the second template matching tool is a template matching CIIP mode. In other examples, the first template matching tool is ARMC, and the second template matching tool is one of the following: GPM segmentation mode reordering, candidate reordering for conventional MMVD and affine MMVD, MVD sign prediction, reference picture reordering, TMVP, and non-adjacent merge candidate type reordering.
[0296] The following is a non-limiting list of provisions according to the techniques of the present disclosure.
[0297] Item 1A: A method for decoding video data comprises obtaining syntax elements from a bitstream including an encoded representation of the video data; determining, based on the syntax elements, that a template matching tool is enabled; based on the template matching tool being enabled, applying the template matching tool to generate a prediction block for a current coding unit (CU) of the video data; and reconstructing the current CU based on the prediction block of the current CU.
[0298] Clause 2A: A method according to clause 1A, wherein the template matching tool is one of the following: template matching advanced motion vector prediction (TM-AMVP), geometric partitioning mode (GPM) partitioning mode reordering, candidate reordering for normal merge mode with motion vector difference (MMVD) and affine MMVD, motion vector difference (MVD) sign prediction, reference picture reordering, template matching merge mode, template matching GPM, template matching combined inter-frame intra-frame prediction (CIIP), adaptive reordering of merge candidates, temporal motion vector prediction (TMVP) and non-adjacent merge candidate type reordering, template matching overlapped block motion compensation (TM-OBMC), intra-frame template matching prediction (IntraTMP), intra-frame block copy template matching advanced motion vector prediction (IBC-TM-AMVP) or intra-frame block copy template matching merge (IBC-TM-AMVP).
[0299] Clause 3A: The method of any of clauses 1A to 2A, wherein: the template matching tool is a first template matching tool, and the method further comprises determining whether a second template matching tool is enabled based on the syntax element.
[0300] Clause 4A: A method according to any one of clauses 1A to 3A, wherein: the template matching tool is a first template matching tool, the syntax element is a first syntax element, and the method further comprises determining, based on the first syntax element, whether the bitstream includes a syntax element indicating whether a second template matching tool is enabled.
[0301] Clause 5A: A method according to clause 1A, wherein: the syntax element is a first syntax element, wherein the first syntax element indicates whether a first set of one or more template matching tools are enabled, and the method further includes obtaining a second syntax element from the bitstream, wherein the second syntax element indicates whether a second set of one or more template matching tools are enabled, the first set of template matching tools involving searching an area around an initial motion vector, and the second set of template matching tools involving searching within a list of motion vector candidates.
[0302] Clause 6A: A method according to any one of clauses 1A to 5A, wherein: the syntax element is a first syntax element, the method further comprising: obtaining a second syntax element from the bitstream, wherein the syntax element is a sequence level syntax element, a picture level syntax element, a slice level syntax element or a tile level syntax element; and determining whether the bitstream includes a syntax element indicating whether a template matching tool is enabled based on the second syntax element.
[0303] Clause 7A: A method according to any one of clauses 1A to 6A, wherein: the method further includes: setting a pruning threshold to a value based on the syntax element indicating that intra block copy template matching merge mode (IBC-TM-MRG) or intra block copy template matching advanced motion vector prediction (IBC-TM-AMVP) is disabled; and pruning the first candidate from the list based on the difference between the motion vector component of the first candidate and the motion vector component of the second candidate being less than the pruning threshold, and applying the template matching tool to generate the prediction block of the current CU includes applying the template matching tool to generate the prediction block of the current CU based on the candidates in the list.
[0304] Clause 8A: A method according to any of clauses 1A to 7A, wherein the syntax element is a sequence level syntax element, a picture level syntax element, a slice level syntax element or a tile level syntax element.
[0305] Item 9A: A method for encoding video data comprises signaling a syntax element in a bitstream comprising an encoded representation of the video data; applying the template matching tool to generate a prediction block for a current coding unit (CU) of the video data based on the template matching tool being enabled; and encoding the current CU based on the prediction block of the current CU.
[0306] Clause 10A: A method according to clause 9A, wherein the template matching tool is one of the following: template matching advanced motion vector prediction (TM-AMVP), geometric partitioning mode (GPM) partitioning mode reordering, candidate reordering for normal merge mode with motion vector difference (MMVD) and affine MMVD, motion vector difference (MVD) sign prediction, reference picture reordering, template matching merge mode, template matching GPM, template matching combined inter-frame intra-frame prediction (CIIP), adaptive reordering of merge candidates, temporal motion vector prediction (TMVP) and non-adjacent merge candidate type reordering, template matching overlapped block motion compensation (TM-OBMC), intra-frame template matching prediction (IntraTMP), intra-frame block copy template matching advanced motion vector prediction (IBC-TM-AMVP) or intra-frame block copy template matching merge (IBC-TM-AMVP).
[0307] Clause 11A: The method of any of clauses 9A to 10A, wherein: the template matching tool is a first template matching tool and the syntax element further indicates whether a second template matching tool is enabled.
[0308] Clause 12A: A method according to any one of clauses 9A to 11A, wherein: the template matching tool is a first template matching tool, the syntax element is a first syntax element, and the method further comprises signaling a second syntax element indicating whether a second template matching tool is enabled based on the first syntax element.
[0309] Clause 13A: A method according to clause 9A, wherein: the syntax element is a first syntax element, wherein the first syntax element indicates whether a first set of one or more template matching tools are enabled, and the method further includes signaling a second syntax element in the bitstream, wherein the second syntax element indicates whether a second set of one or more template matching tools are enabled, the first set of template matching tools involving searching an area around an initial motion vector, and the second set of template matching tools involving searching within a list of motion vector candidates.
[0310] Clause 14A: A method according to any one of clauses 9A to 13A, wherein: the syntax element is a first syntax element, the method further comprising: signaling a second syntax element in the bitstream, wherein the syntax element is a sequence level syntax element, a picture level syntax element, a slice level syntax element or a tile level syntax element; and based on the second syntax element, signaling in the bitstream a syntax element indicating whether a template matching tool is enabled.
[0311] Clause 15A: A method according to any one of clauses 9A to 14A, wherein: the method further includes: setting a pruning threshold to a value based on the syntax element indicating that intra block copy template matching merge mode (IBC-TM-MRG) or intra block copy template matching advanced motion vector prediction (IBC-TM-AMVP) is disabled; and pruning the first candidate from the list based on the difference between the motion vector component of the first candidate and the motion vector component of the second candidate being less than the pruning threshold, and applying the template matching tool to generate the prediction block of the current CU includes applying the template matching tool to generate the prediction block of the current CU based on the candidates in the list.
[0312] Clause 16A: The method of any of clauses 9A to 15A, wherein the syntax element is a sequence level syntax element, a picture level syntax element, a slice level syntax element, or a tile level syntax element, and the syntax element indicates that a template matching tool is enabled.
[0313] Clause 17A: An apparatus for decoding video data, the apparatus comprising one or more means for performing the method of any of clauses 1A to 16A.
[0314] Clause 18A: The apparatus of clause 17A, wherein the one or more components comprise one or more processors implemented in circuitry.
[0315] Clause 19A: The apparatus of any of clauses 16A and 17A, further comprising: a memory to store the video data.
[0316] Clause 20A: The apparatus of any of clauses 17A to 19A, further comprising: a display configured to display the decoded video data.
[0317] Clause 21A: The device of any of clauses 17A to 20A, wherein the device comprises one or more of a camera, a computer, a mobile device, a broadcast receiver device, or a set-top box.
[0318] Clause 22A: The apparatus of any of clauses 17A to 21A, wherein the apparatus comprises a video decoder.
[0319] Clause 23A: The apparatus of any of clauses 17A to 22A, wherein the apparatus comprises a video encoder.
[0320] Clause 24A: A computer-readable storage medium having stored thereon instructions which, when executed, cause one or more processors to perform the method of any of clauses 1A to 16A.
[0321] Item 1B. A device for decoding video data, the device comprising: a memory, the memory comprising one or more storage media, the memory being configured to store the video data; and one or more processors, the one or more processors being implemented in a circuit, the one or more processors being configured to: obtain syntax elements from a bitstream comprising an encoded representation of the video data; determine, based on the syntax elements, that a template matching tool is enabled; based on the template matching tool being enabled, apply the template matching tool to generate a prediction block for a current decoding unit (CU) of the video data; and reconstruct the current CU based on the prediction block of the current CU.
[0322] Embodiment 2B. An apparatus as described in claim 1B, wherein the template matching tool is one of the following: template matching advanced motion vector prediction (TM-AMVP), geometric partitioning mode (GPM) partitioning mode reordering, candidate reordering for normal merge mode with motion vector difference (MMVD) and affine MMVD, motion vector difference (MVD) sign prediction, reference picture reordering, template matching merge mode, template matching GPM, template matching combined inter-frame intra-frame prediction (CIIP), adaptive reordering of merge candidates, temporal motion vector prediction (TMVP) and non-adjacent merge candidate type reordering, template matching overlapped block motion compensation (TM-OBMC), intra-frame template matching prediction (IntraTMP), intra-frame block copy template matching advanced motion vector prediction (IBC-TM-AMVP) or intra-frame block copy template matching merge (IBC-TM-AMVP).
[0323] Clause 3B. A device according to any one of clauses 1B to 2B, wherein: the template matching tool is a first template matching tool, the syntax element is a first syntax element, and the one or more processors are further configured to determine whether the bitstream includes a second syntax element indicating whether a second template matching tool is enabled based on the first syntax element.
[0324] Clause 4B. The apparatus of clause 3B, wherein the first template matching tool is a template matching merge mode and the second template matching tool is a template matching combined intra / inter prediction (CIIP) mode.
[0325] Clause 5B. An apparatus according to clause 3B, wherein: the first template matching tool is an adaptive reordering of merge candidates (ARMC), and the second template matching tool is one of the following: geometric partitioning mode (GPM) partitioning mode reordering, candidate reordering of regular merge mode with motion vector difference (MMVD) and affine MMVD, motion vector difference (MVD) sign prediction, reference picture reordering, temporal motion vector prediction (TMVP) or non-adjacent merge candidate type reordering.
[0326] Clause 6B. A device according to any one of clauses 1B to 5B, wherein: the syntax element is a first syntax element, and the one or more processors are further configured to: obtain a second syntax element from the bitstream, wherein the second syntax element is a sequence level syntax element, a picture level syntax element, a slice level syntax element or a tile level syntax element; and determine whether the bitstream includes one or more template matching tool syntax elements indicating whether one or more template matching tools are enabled based on the second syntax element, wherein the template matching tool syntax elements include the first syntax element.
[0327] Clause 7B. An apparatus according to clause 6B, wherein the presence of a syntax element indicating whether intra template matching prediction (intraTMP), intra block copy template matching with advanced motion vector prediction (IBC-TM-AMVP), and intra block copy template matching with merge mode (IBC-TM-AMVP) are enabled does not depend on the second syntax element.
[0328] Clause 8B. A device according to any one of clauses 1B to 6B, wherein: the one or more processors are further configured to: set a pruning threshold to a value based on the syntax element indicating that intra block copy template matching merge mode (IBC-TM-MRG) or intra block copy template matching advanced motion vector prediction (IBC-TM-AMVP) is disabled; and prune the first candidate from the list based on the difference between the motion vector component of the first candidate and the motion vector component of the second candidate in the list being less than the pruning threshold, and wherein in order to apply the template matching tool to generate the prediction block of the current CU, the one or more processors are configured to apply the template matching tool to generate the prediction block of the current CU based on the candidates in the list.
[0329] Clause 9B. The apparatus of any of Clauses 1B to 8B, further comprising a display configured to display the decoded video data.
[0330] Clause 10B. A device for encoding video data, the device comprising: a memory, the memory comprising one or more storage media, the memory being configured to store the video data; and one or more processors, the one or more processors being implemented in a circuit, and the one or more processors being configured to: signal a syntax element indicating whether a template matching tool is enabled in a bitstream comprising an encoded representation of the video data; based on the template matching tool being enabled, apply the template matching tool to generate a prediction block for a current decoding unit (CU) of the video data; and encode the current CU based on the prediction block of the current CU.
[0331] Clause 11B. An apparatus according to clause 10B, wherein the template matching tool is one of the following: template matching advanced motion vector prediction (TM-AMVP), geometric partitioning mode (GPM) partitioning mode reordering, candidate reordering for normal merge mode with motion vector difference (MMVD) and affine MMVD, motion vector difference (MVD) sign prediction, reference picture reordering, template matching merge mode, template matching GPM, template matching combined inter-frame intra-frame prediction (CIIP), adaptive reordering of merge candidates, temporal motion vector prediction (TMVP) and non-adjacent merge candidate type reordering, template matching overlapped block motion compensation (TM-OBMC), intra-frame template matching prediction (IntraTMP), intra-frame block copy template matching advanced motion vector prediction (IBC-TM-AMVP) or intra-frame block copy template matching merge (IBC-TM-AMVP).
[0332] Clause 12B. A device according to any one of clauses 10B to 11B, wherein: the template matching tool is a first template matching tool, the syntax element is a first syntax element, and the one or more processors are further configured to signal a second syntax element indicating whether a second template matching tool is enabled based on the first syntax element.
[0333] Clause 13B. The apparatus of clause 12B, wherein the first template matching tool is a template matching merge mode and the second template matching tool is a template matching combined intra / inter prediction (CIIP) mode.
[0334] Clause 14B. An apparatus according to clause 12B, wherein: the first template matching tool is an adaptive reordering of merge candidates (ARMC), and the second template matching tool is one of the following: geometric partitioning mode (GPM) partitioning mode reordering, candidate reordering of regular merge mode with motion vector difference (MMVD) and affine MMVD, motion vector difference (MVD) sign prediction, reference picture reordering, temporal motion vector prediction (TMVP) or non-adjacent merge candidate type reordering.
[0335] Clause 15B. A device according to any one of clauses 10B to 14B, wherein: the syntax element is a first syntax element, and the one or more processors are further configured to signal a second syntax element in the bitstream, the second syntax element indicating whether the bitstream includes one or more template matching tool syntax elements, the second syntax element is a sequence level syntax element, a picture level syntax element, a slice level syntax element or a tile level syntax element, and the one or more template matching tool syntax elements include the first syntax element.
[0336] Clause 16B. An apparatus according to clause 15B, wherein the presence of a syntax element indicating whether intra template matching prediction (intraTMP), intra block copy template matching with advanced motion vector prediction (IBC-TM-AMVP), and intra block copy template matching with merge mode (IBC-TM-AMVP) are enabled does not depend on the second syntax element.
[0337] Clause 17B. A device according to any one of clauses 10B to 16B, wherein: the one or more processors are further configured to: set a pruning threshold to a value based on that intra block copy template matching merge mode (IBC-TM-MRG) or intra block copy template matching advanced motion vector prediction (IBC-TM-AMVP) is disabled; and prune the first candidate from the list based on that the difference between the motion vector component of the first candidate and the motion vector component of the second candidate in the list is less than the pruning threshold, and wherein in order to apply the template matching tool to generate the prediction block of the current CU, the one or more processors are further configured to apply the template matching tool to generate the prediction block of the current CU based on the candidates in the list.
[0338] Clause 18B. The device of any of clauses 10B to 17B, wherein the device comprises one or more of a camera, a computer, a mobile device, a broadcast receiver device, or a set-top box.
[0339] Clause 19B. A method for decoding video data, the method comprising: obtaining syntax elements from a bitstream including an encoded representation of the video data; determining that a template matching tool is enabled based on the syntax elements; applying the template matching tool to generate a prediction block for a current decoding unit (CU) of the video data based on the template matching tool being enabled; and reconstructing the current CU based on the prediction block of the current CU.
[0340] Clause 20B. A method according to clause 19B, wherein the template matching tool is one of the following: template matching advanced motion vector prediction (TM-AMVP), geometric partitioning mode (GPM) partitioning mode reordering, candidate reordering for normal merge mode with motion vector difference (MMVD) and affine MMVD, motion vector difference (MVD) sign prediction, reference picture reordering, template matching merge mode, template matching GPM, template matching combined inter-frame intra-frame prediction (CIIP), adaptive reordering of merge candidates, temporal motion vector prediction (TMVP) and non-adjacent merge candidate type reordering, template matching overlapped block motion compensation (TM-OBMC), intra-frame template matching prediction (IntraTMP), intra-frame block copy template matching advanced motion vector prediction (IBC-TM-AMVP) or intra-frame block copy template matching merge (IBC-TM-AMVP).
[0341] Clause 21B. A method according to any one of clauses 19B to 20B, wherein: the template matching tool is a first template matching tool, the syntax element is a first syntax element, and the method further includes determining, based on the first syntax element, whether the bitstream includes a syntax element indicating whether a second template matching tool is enabled.
[0342] Clause 22B. A method according to any one of clauses 19B to 21B, wherein: the syntax element is a first syntax element, the method further comprising: obtaining a second syntax element from the bitstream, wherein the second syntax element is a sequence level syntax element, a picture level syntax element, a slice level syntax element or a tile level syntax element; and determining whether the bitstream includes one or more template matching tool syntax elements indicating whether one or more template matching tools are enabled based on the second syntax element, wherein the template matching tool syntax elements include the first syntax element.
[0343] Clause 23B. A method according to clause 22B, wherein the presence of syntax elements indicating intra template matching prediction (intraTMP), intra block copy template matching with advanced motion vector prediction (IBC-TM-AMVP), and intra block copy template matching with merge mode (IBC-TM-AMVP) does not depend on the second syntax element.
[0344] Clause 24B. A method according to any one of clauses 19B to 23B, wherein: the method further includes: setting a pruning threshold to a value based on the syntax element indicating that intra block copy template matching merge mode (IBC-TM-MRG) or intra block copy template matching advanced motion vector prediction (IBC-TM-AMVP) is disabled; and pruning the first candidate from the list based on the difference between the motion vector component of the first candidate and the motion vector component of the second candidate being less than the pruning threshold, and applying the template matching tool to generate the prediction block of the current CU includes applying the template matching tool to generate the prediction block of the current CU based on the candidates in the list.
[0345] Clause 25B. A method for encoding video data, the method comprising: signaling a syntax element indicating whether a template matching tool is enabled in a bitstream including an encoded representation of the video data; applying the template matching tool to generate a prediction block for a current decoding unit (CU) of the video data based on the template matching tool being enabled; and encoding the current CU based on the prediction block of the current CU.
[0346] Clause 26B. A method according to clause 25B, wherein the template matching tool is one of the following: template matching advanced motion vector prediction (TM-AMVP), geometric partitioning mode (GPM) partitioning mode reordering, candidate reordering for normal merge mode with motion vector difference (MMVD) and affine MMVD, motion vector difference (MVD) sign prediction, reference picture reordering, template matching merge mode, template matching GPM, template matching combined inter-frame intra-frame prediction (CIIP), adaptive reordering of merge candidates, temporal motion vector prediction (TMVP) and non-adjacent merge candidate type reordering, template matching overlapped block motion compensation (TM-OBMC), intra-frame template matching prediction (IntraTMP), intra-frame block copy template matching advanced motion vector prediction (IBC-TM-AMVP) or intra-frame block copy template matching merge (IBC-TM-AMVP).
[0347] Clause 27B. A method according to any one of clauses 25B to 26B, wherein: the template matching tool is a first template matching tool, the syntax element is a first syntax element, and the method further comprises signaling a second syntax element indicating whether a second template matching tool is enabled based on the first syntax element.
[0348] Clause 28B. A method according to clause 27B, wherein: the first template matching tool is an adaptive reordering of merge candidates (ARMC), and the second template matching tool is one of the following items: geometric partitioning mode (GPM) partitioning mode reordering, candidate reordering of regular merge mode with motion vector difference (MMVD) and affine MMVD, motion vector difference (MVD) sign prediction, reference picture reordering, temporal motion vector prediction (TMVP) or non-adjacent merge candidate type reordering.
[0349] Clause 30B. A method according to any one of clauses 25B to 29B, wherein: the syntax element is a first syntax element, and the method further includes signaling a second syntax element in the bitstream, the second syntax element indicating whether the bitstream includes one or more template matching tool syntax elements, the second syntax element is a sequence level syntax element, a picture level syntax element, a slice level syntax element or a tile level syntax element, and the one or more template matching tool syntax elements include the first syntax element.
[0350] Clause 31B. A method according to any one of clauses 25B to 29B, wherein: the method further includes: setting a pruning threshold to a value based on that intra block copy template matching merge mode (IBC-TM-MRG) or intra block copy template matching advanced motion vector prediction (IBC-TM-AMVP) is disabled; and pruning the first candidate from the list based on that the difference between the motion vector component of the first candidate and the motion vector component of the second candidate in the list is less than the pruning threshold, and applying the template matching tool to generate the prediction block of the current CU includes applying the template matching tool to generate the prediction block of the current CU based on the candidates in the list.
[0351] It should be appreciated that, according to examples, certain actions or events of any of the techniques described herein may be performed in a different order, may be added, combined, or omitted entirely (e.g., not all actions or events described are necessary to implement the technique). In addition, in some examples, actions or events may be performed concurrently (e.g., by multithreading, interrupt handling, or multiple processors) rather than sequentially.
[0352] In one or more examples, the described functionality may be implemented in hardware, software, firmware, or any combination thereof. If implemented in software, the functionality may be stored as one or more instructions or codes on a computer-readable medium or sent via a computer-readable medium and executed by a hardware-based processing unit. A computer-readable medium may include a computer-readable storage medium (which corresponds to a tangible medium such as a data storage medium) or a communication medium, which includes, for example, any medium that facilitates the transfer of a computer program from one place to another according to a communication protocol. Thus, a computer-readable medium may generally correspond to (1) a non-transient tangible computer-readable storage medium, or (2) a communication medium such as a signal or carrier wave. A data storage medium may be any available medium that can be accessed by one or more computers or one or more processors to retrieve instructions, codes, and / or data structures for implementing the techniques described in the present disclosure. A computer program product may include a computer-readable medium.
[0353] By way of example and not limitation, such computer-readable storage media may include RAM, ROM, EEPROM, CD-ROM or other optical disk storage devices, magnetic disk storage devices or other magnetic storage devices, flash memory, or any other medium that can be used to store the desired program code in the form of instructions or data structures and can be accessed by a computer. Moreover, any connection is appropriately referred to as a computer-readable medium. For example, if the instruction is sent from a website, server or other remote source using a coaxial cable, fiber optic cable, twisted pair, digital subscriber line (DSL) or wireless technology (such as infrared, radio and microwave), the coaxial cable, fiber optic cable, twisted pair, DSL or wireless technology (such as infrared, radio and microwave) is included in the definition of the medium. However, it should be understood that computer-readable storage media and data storage media do not include connections, carrier waves, signals or other transient media, but are instead directed to non-transient tangible storage media. As used herein, disks and optical disks include compact discs (CDs), laser optical disks, optical optical disks, digital versatile discs (DVDs), floppy disks and blue-ray discs, wherein disks usually reproduce data magnetically, while optical disks reproduce data optically using lasers. Combinations of the above should also be included within the scope of computer-readable media.
[0354] 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 circuits. Therefore, the terms "processor" and "processing circuit" as used herein may refer to any of the aforementioned structures or any other structure suitable for implementing the techniques described herein. In addition, in some aspects, the functionality described herein may be provided within dedicated hardware and / or software modules configured for encoding and decoding, or incorporated into a combined codec. In addition, these techniques may be fully implemented in one or more circuits or logic elements.
[0355] The techniques of the present disclosure may be implemented in a 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 the present disclosure to emphasize functional aspects of devices configured to perform the disclosed techniques, but do not necessarily require implementation by different hardware units. Specifically, as described above, the various units may be combined in a codec hardware unit, or the various units may be provided by a collection of interoperable hardware units (including one or more processors as described above) in combination with appropriate software and / or firmware.
[0356] Various examples have been described. These and other examples are within the scope of the following claims.
Claims
1. A device for decoding video data, the device comprising: A memory, the memory comprising one or more storage media, the memory being configured to store the video data; and One or more processors, the one or more processors being implemented in circuitry, the one or more processors being configured to: obtaining syntax elements from a bitstream comprising an encoded representation of the video data; Determining based on the syntax element that a template matching tool is enabled; Based on the template matching tool being enabled, applying the template matching tool to generate a prediction block for a current coding unit (CU) of the video data; as well as The current CU is reconstructed based on the prediction block of the current CU.
2. The apparatus of claim 1, wherein the template matching tool is one of: Template Matching Advanced Motion Vector Prediction (TM-AMVP), Geometric Partitioning Mode (GPM) partitioning mode reordering, Candidate reordering for regular merge mode with motion vector difference (MMVD) and affine MMVD, Motion vector difference (MVD) sign prediction, Reference pictures reordered, Template matching merge mode, Template matching GPM, Template matching combined inter-frame intra-frame prediction (CIIP), Adaptive reordering of merge candidates, Temporal Motion Vector Prediction (TMVP) and non-adjacent merge candidate type reordering, Template Matching Overlapped Block Motion Compensation (TM-OBMC), Intra-frame template matching prediction (IntraTMP), Intra Block Copy Template Matching Advanced Motion Vector Prediction (IBC-TM-AMVP), or Intra Block Copy Template Matching Merging (IBC-TM-AMVP).
3. The apparatus according to claim 1, wherein: The template matching tool is a first template matching tool, The syntax element is a first syntax element, and The one or more processors are further configured to determine, based on the first syntax element, whether the bitstream includes a second syntax element indicating whether a second template matching tool is enabled.
4. The apparatus of claim 3, wherein the first template matching tool is a template matching merge mode, and the second template matching tool is a template matching combined intra / inter prediction (CIIP) mode.
5. The apparatus according to claim 3, wherein: The first template matching tool is an adaptive re-ordering of merge candidates (ARMC), and The second template matching tool is one of: geometric partitioning mode (GPM) partitioning mode reordering, candidate reordering for normal merge mode with motion vector difference (MMVD) and affine MMVD, motion vector difference (MVD) sign prediction, reference picture reordering, temporal motion vector prediction (TMVP) or non-adjacent merge candidate type reordering.
6. The apparatus of claim 1, wherein: The syntax element is a first syntax element, The one or more processors are further configured to: obtaining a second syntax element from the bitstream, wherein the second syntax element is a sequence level syntax element, a picture level syntax element, a slice level syntax element, or a tile level syntax element; as well as A determination is made based on the second syntax element whether the bitstream includes one or more template matching tool syntax elements indicating whether one or more template matching tools are enabled, wherein the template matching tool syntax elements include the first syntax element.
7. The apparatus of claim 6, wherein the presence of a syntax element indicating whether intra template matching prediction (intraTMP), intra block copy template matching with advanced motion vector prediction (IBC-TM-AMVP), and intra block copy template matching with merge mode (IBC-TM-AMVP) are enabled does not depend on the second syntax element.
8. The apparatus of claim 1, wherein: The one or more processors are further configured to: setting a pruning threshold to a value based on the syntax element indicating that intra block copy template matching merge mode (IBC-TM-MRG) or intra block copy template matching advanced motion vector prediction (IBC-TM-AMVP) is disabled; as well as pruning the first candidate from the list based on a difference between a motion vector component of the first candidate and a motion vector component of a second candidate in the list being less than the pruning threshold, and In order to apply the template matching tool to generate the prediction block of the current CU, the one or more processors are configured to apply the template matching tool to generate the prediction block of the current CU based on the candidates in the list.
9. The device of claim 1, further comprising a display configured to display the decoded video data.
10. A device for encoding video data, the device comprising: A memory, the memory comprising one or more storage media, the memory being configured to store the video data; and One or more processors, the one or more processors being implemented in circuitry, the one or more processors being configured to: signaling, in a bitstream comprising an encoded representation of said video data, a syntax element indicating whether a template matching tool is enabled; Based on the template matching tool being enabled, applying the template matching tool to generate a prediction block for a current coding unit (CU) of the video data; as well as The current CU is encoded based on the prediction block of the current CU.
11. The apparatus of claim 10, wherein the template matching tool is one of: Template Matching Advanced Motion Vector Prediction (TM-AMVP), Geometric Partitioning Mode (GPM) partitioning mode reordering, Candidate reordering for regular merge mode with motion vector difference (MMVD) and affine MMVD, Motion vector difference (MVD) sign prediction, Reference pictures reordered, Template matching merge mode, Template matching GPM, Template matching combined inter-frame intra-frame prediction (CIIP), Adaptive reordering of merge candidates, Temporal Motion Vector Prediction (TMVP) and non-adjacent merge candidate type reordering, Template Matching Overlapped Block Motion Compensation (TM-OBMC), Intra-frame template matching prediction (IntraTMP), Intra Block Copy Template Matching Advanced Motion Vector Prediction (IBC-TM-AMVP), or Intra Block Copy Template Matching Merging (IBC-TM-AMVP).
12. The apparatus of claim 10, wherein: The template matching tool is a first template matching tool, The syntax element is a first syntax element, and The one or more processors are further configured to signal, based on the first syntax element, a second syntax element indicating whether a second template matching tool is enabled.
13. The apparatus of claim 12, wherein the first template matching tool is a template matching merge mode, and the second template matching tool is a template matching combined intra / inter prediction (CIIP) mode.
14. The apparatus of claim 12, wherein: The first template matching tool is an adaptive re-ordering of merge candidates (ARMC), and The second template matching tool is one of: geometric partitioning mode (GPM) partitioning mode reordering, candidate reordering for normal merge mode with motion vector difference (MMVD) and affine MMVD, motion vector difference (MVD) sign prediction, reference picture reordering, temporal motion vector prediction (TMVP) or non-adjacent merge candidate type reordering.
15. The apparatus of claim 10, wherein: The syntax element is a first syntax element, and The one or more processors are further configured to signal a second syntax element in the bitstream, The second syntax element indicates whether the bitstream includes one or more template matching tool syntax elements, The second syntax element is a sequence level syntax element, a picture level syntax element, a slice level syntax element or a tile level syntax element, and The one or more template matching tool syntax elements include the first syntax element.
16. The apparatus of claim 15, wherein the presence of a syntax element indicating whether intra template matching prediction (intraTMP), intra block copy template matching with advanced motion vector prediction (IBC-TM-AMVP), and intra block copy template matching with merge mode (IBC-TM-AMVP) are enabled does not depend on the second syntax element.
17. The apparatus of claim 10, wherein: The one or more processors are further configured to: Intra block copy template matching merge mode (IBC-TM-MRG) or intra block copy template matching advanced motion vector prediction (IBC-TM-AMVP) is disabled, setting the pruning threshold to a value; as well as pruning the first candidate from the list based on a difference between a motion vector component of the first candidate and a motion vector component of a second candidate in the list being less than the pruning threshold, and In order to apply the template matching tool to generate the prediction block of the current CU, the one or more processors are further configured to apply the template matching tool to generate the prediction block of the current CU based on the candidates in the list.
18. The device of claim 10, wherein the device comprises one or more of a camera, a computer, a mobile device, a broadcast receiver device, or a set-top box.
19. A method for decoding video data, the method comprising: obtaining syntax elements from a bitstream comprising an encoded representation of the video data; Determining based on the syntax element that a template matching tool is enabled; Based on the template matching tool being enabled, applying the template matching tool to generate a prediction block for a current coding unit (CU) of the video data; as well as The current CU is reconstructed based on the prediction block of the current CU.
20. The method of claim 19, wherein the template matching tool is one of: Template Matching Advanced Motion Vector Prediction (TM-AMVP), Geometric Partitioning Mode (GPM) partitioning mode reordering, Candidate reordering for regular merge mode with motion vector difference (MMVD) and affine MMVD, Motion vector difference (MVD) sign prediction, Reference pictures reordered, Template matching merge mode, Template matching GPM, Template matching combined inter-frame intra-frame prediction (CIIP), Adaptive reordering of merge candidates, Temporal Motion Vector Prediction (TMVP) and non-adjacent merge candidate type reordering, Template Matching Overlapped Block Motion Compensation (TM-OBMC), Intra-frame template matching prediction (IntraTMP), Intra Block Copy Template Matching Advanced Motion Vector Prediction (IBC-TM-AMVP), or Intra Block Copy Template Matching Merging (IBC-TM-AMVP).
21. The method of claim 19, wherein: The template matching tool is a first template matching tool, The syntax element is a first syntax element, and The method also includes determining, based on the first syntax element, whether the bitstream includes a syntax element indicating whether a second template matching tool is enabled.
22. The method of claim 19, wherein: The syntax element is a first syntax element, The method further comprises: Obtaining a second syntax element from the bitstream, wherein the second syntax element is a sequence level syntax element, a picture level syntax element, a slice level syntax element, or a tile level syntax element; and A determination is made based on the second syntax element whether the bitstream includes one or more template matching tool syntax elements indicating whether one or more template matching tools are enabled, wherein the template matching tool syntax elements include the first syntax element.
23. The method of claim 22, wherein the presence of syntax elements indicating intra template matching prediction (intraTMP), intra block copy template matching with advanced motion vector prediction (IBC-TM-AMVP), and intra block copy template matching with merge mode (IBC-TM-AMVP) is not dependent on the second syntax element.
24. The method of claim 19, wherein: The method further comprises: setting a pruning threshold to a value based on the syntax element indicating that intra block copy template matching merge mode (IBC-TM-MRG) or intra block copy template matching advanced motion vector prediction (IBC-TM-AMVP) is disabled; and pruning the first candidate from the list based on a difference between a motion vector component of the first candidate and a motion vector component of a second candidate in the list being less than the pruning threshold, and Applying the template matching tool to generate the prediction block of the current CU includes applying the template matching tool to generate the prediction block of the current CU based on candidates in the list.
25. A method for encoding video data, the method comprising: signaling, in a bitstream comprising an encoded representation of said video data, a syntax element indicating whether a template matching tool is enabled; Based on the template matching tool being enabled, applying the template matching tool to generate a prediction block for a current coding unit (CU) of the video data; as well as The current CU is encoded based on the prediction block of the current CU.
26. The method of claim 25, wherein the template matching tool is one of: Template Matching Advanced Motion Vector Prediction (TM-AMVP), Geometric Partitioning Mode (GPM) partitioning mode reordering, Candidate reordering for regular merge mode with motion vector difference (MMVD) and affine MMVD, Motion vector difference (MVD) sign prediction, Reference pictures reordered, Template matching merge mode, Template matching GPM, Template matching combined inter-frame intra-frame prediction (CIIP), Adaptive reordering of merge candidates, Temporal Motion Vector Prediction (TMVP) and non-adjacent merge candidate type reordering, Template Matching Overlapped Block Motion Compensation (TM-OBMC), Intra-frame template matching prediction (IntraTMP), Intra Block Copy Template Matching Advanced Motion Vector Prediction (IBC-TM-AMVP), or Intra Block Copy Template Matching Merging (IBC-TM-AMVP).
27. The method of claim 25, wherein: The template matching tool is a first template matching tool, The syntax element is a first syntax element, and The method also includes signaling, based on the first syntax element, a second syntax element indicating whether a second template matching tool is enabled.
28. The method of claim 27, wherein: The first template matching tool is an adaptive re-ordering of merge candidates (ARMC), and The second template matching tool is one of: geometric partitioning mode (GPM) partitioning mode reordering, candidate reordering for normal merge mode with motion vector difference (MMVD) and affine MMVD, motion vector difference (MVD) sign prediction, reference picture reordering, temporal motion vector prediction (TMVP) or non-adjacent merge candidate type reordering.
29. The method of claim 25, wherein: The syntax element is a first syntax element, The method further comprises signaling a second syntax element in the bitstream, The second syntax element indicates whether the bitstream includes one or more template matching tool syntax elements, The second syntax element is a sequence level syntax element, a picture level syntax element, a slice level syntax element or a tile level syntax element, and The one or more template matching tool syntax elements include the first syntax element.
30. The method of claim 25, wherein: The method further comprises: Based on intra block copy template matching merge mode (IBC-TM-MRG) or intra block copy template matching advanced motion vector prediction (IBC-TM-AMVP) being disabled, setting the pruning threshold to a value; and pruning the first candidate from the list based on a difference between a motion vector component of the first candidate and a motion vector component of a second candidate in the list being less than the pruning threshold, and Applying the template matching tool to generate the prediction block of the current CU includes applying the template matching tool to generate the prediction block of the current CU based on candidates in the list.