Improved template matching in inter prediction mode
Patent Information
- Application Number
- JP2023560893
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2022-03-22
- Filing Date
- 2022-03-23
- Publication Date
- 2025-03-18
AI Technical Summary
Existing video coding techniques do not effectively utilize template matching improvements in inter-prediction modes such as combined inter/intra prediction (CIIP), geometric segmentation mode (GPM), and multiple hypothesis prediction (MHP), limiting video coding gains.
Implement template matching improvements in CIIP, GPM, and MHP modes by enabling template matching for current blocks, generating motion vectors, and reconstructing blocks based on predicted values to enhance video coding efficiency.
Enhances video coding efficiency by extending template matching benefits to inter-prediction modes, improving motion vector accuracy and reducing redundancy in video sequences.
Smart Images

Figure 00000000_0000_ABST
Abstract
Description
[Technical field]
[0001] This application claims priority to U.S. Patent Application No. 17 / 655,895, filed March 22, 2022, and U.S. Provisional Patent Application No. 63 / 173,834, filed April 12, 2021, and U.S. Provisional Patent Application No. 63 / 176,798, filed April 19, 2021, the entire contents of each of which are incorporated herein by reference. U.S. Patent Application No. 17 / 655,895 claims the benefit of U.S. Provisional Patent Application No. 63 / 173,834, filed April 12, 2021, and U.S. Provisional Patent Application No. 63 / 176,798, filed April 19, 2021.
[0002] TECHNICAL FIELD This disclosure relates to video encoding and decoding. [Background technology]
[0003] Digital video capabilities may be incorporated into a wide range of devices, including digital televisions, digital direct broadcast systems, wireless broadcast systems, personal digital assistants (PDAs), laptop or desktop computers, tablet computers, e-book readers, digital cameras, digital recording devices, digital media players, video game devices, video game consoles, cellular or satellite radiotelephones, so-called "smartphones," video teleconferencing devices, video streaming devices, etc. Digital video devices implement video coding techniques such as those described in standards defined by MPEG-2, MPEG-4, ITU-T H.263, ITU-T H.264 / MPEG-4, Part 10, Advanced Video Coding (AVC), ITU-TH.265 / High Efficiency Video Coding (HEVC), ITU-T H.266 / Versatile Video Coding (VVC), and extensions to such standards, as well as proprietary video codecs / formats such as AOMedia Video 1 (AV1) developed by the Alliance for Open Media. By implementing such video coding techniques, video devices may more efficiently transmit, receive, encode, decode, and / or store digital video information.
[0004] Video coding techniques include spatial (intra-picture) prediction and / or temporal (inter-picture) prediction to reduce or remove redundancy inherent in video sequences. For block-based video coding, a video slice (e.g., a video picture or a portion of a video picture) may be partitioned into video blocks, which may also be referred to as coding tree units (CTUs), coding units (CUs), and / or coding nodes. Video blocks in an intra-coded (I) slice of a picture are encoded using spatial prediction with respect to reference samples in neighboring blocks in the same picture. Video blocks in an inter-coded (P or B) slice of a picture may use spatial prediction with respect to reference samples in neighboring blocks in the same picture or temporal prediction with respect to reference samples in other reference pictures. A picture may be referred to as a frame, and a reference picture may be referred to as a reference frame. [Prior art documents] [Patent documents]
[0005] [Patent Document 1] U.S. Provisional Application No. 63 / 167,480 [Patent Document 2] U.S. Provisional Application No. 63 / 173,861 [Patent Document 3] U.S. Provisional Application No. 63 / 173,949 [Non-patent literature]
[0006] [Non-Patent Document 1] J. Chen, Y. Ye, and S.-H. Kim, "Algorithm description for Versatile Video Coding and Test Model 9 (VTM9)," JVET-R2002, April 2020. [Non-Patent Document 2] Chen et al., "Description of SDR, HDR and 360o 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 JCT 1 / SC 29 / WG 11, 10th Meeting: San Diego, April 10-20, 2018. [Non-Patent Document 3] Chang et al., “Compression efficiency methods beyond VVC,” Joint Video Experts Team (JVET) of ITU-T SG 16 WP 3 and ISO / IEC JCT 1 / SC 29 / WG 11, 21st meeting held remotely, January 6-15, 2021. [Non-Patent Document 4] Zhao et al., "Non-CE: Weighted intra and inter prediction mode," Joint Video Experts Team (JVET) of ITU-T SG 16 WP 3 and ISO / IEC JTC 1 / SC 29 / WG 11, 15th Meeting: Gothenburg, 3-12 July 2019, JVET-O0537. Summary of the Invention [Means for solving the problem]
[0007] Generally, this disclosure describes techniques for using template matching (TM) improvements in inter-prediction modes such as hybrid inter / intra prediction (CIIP), geometric partition mode (GPM), or multiple hypothesis prediction (MHP). In this manner, video coding gains associated with improved TM can be extended to inter-prediction modes such as CIIP, GPM, and MHP, as some examples, providing practical applications that improve the operation of video coding techniques.
[0008] In one example, the present disclosure describes a method for decoding video data, the method including the steps of determining that a current block is inter-predicted in a composite inter-intra prediction (CIIP) mode or a geometric partitioning mode (GPM), determining that template matching is enabled for the current block, generating a motion vector for the current block based on the template matching, determining a predictive block for the current block based on the motion vector according to the CIIP mode or the GPM, and reconstructing the current block based on the predictive block.
[0009] In one example, the disclosure describes a device for decoding video data, the device comprising: a memory configured to store the video data; and processing circuitry configured to determine that a current block of the video data is inter-predicted in a composite inter-intra prediction (CIIP) mode or a geometric partitioning mode (GPM), determine that template matching is enabled for the current block, generate a motion vector for the current block based on the template matching, determine a predictive block for the current block based on the motion vector according to the CIIP mode or the GPM, and reconstruct the current block based on the predictive block.
[0010] In one example, this disclosure describes a computer-readable storage that stores instructions that, when executed, cause one or more processors to determine that a current block is inter-predicted in a composite inter-intra prediction (CIIP) mode or a geometric partitioning mode (GPM), determine that template matching is enabled for the current block, generate a motion vector for the current block based on the template matching, determine a predictive block for the current block based on the motion vector according to the CIIP mode or the GPM, and reconstruct the current block based on the predictive block.
[0011] In one example, the present disclosure describes a method for encoding video data, the method including the steps of determining that a current block should be inter-predicted in a composite inter-intra prediction (CIIP) mode or a geometric partitioning mode (GPM), determining that template matching should be enabled for the current block, generating a motion vector for the current block based on the template matching, determining a predictive block for the current block based on the motion vector according to the CIIP mode or the GPM, and signaling information indicating a residual between the predictive block and the current block.
[0012] In one example, the disclosure describes a device for encoding video data, the device comprising: a memory configured to store the video data; and a processing circuitry configured to determine that a current block should be inter-predicted in a composite inter-intra prediction (CIIP) mode or a geometric partitioning mode (GPM), determine that template matching should be enabled for the current block, generate a motion vector for the current block based on the template matching, determine a predictive block for the current block based on the motion vector according to the CIIP mode or the GPM, and signal information indicating a residual between the predictive block and the current block.
[0013] The details of one or more examples are set forth in the accompanying drawings and the description below. Other features, objects, and advantages will become apparent from the description, drawings, and claims. [Brief description of the drawings]
[0014] [Figure 1] FIG. 1 is a block diagram illustrating an example video encoding and decoding system in which techniques of this disclosure may be implemented. [Diagram 2] 1 is a block diagram illustrating an example video encoder that may implement the techniques of this disclosure. [Diagram 3] 1 is a block diagram illustrating an example video decoder that may implement the techniques of this disclosure. [Figure 4] 1 is a flowchart illustrating an example method for encoding a current block, in accordance with techniques of this disclosure. [Diagram 5] 5 is a flowchart illustrating an example method for decoding a current block, in accordance with techniques of this disclosure. [Figure 6] FIG. 2 is a conceptual diagram illustrating an example of template matching performed on a search area around an initial motion vector (MV). [Figure 7] 1 is a flowchart illustrating an example of enhanced combined inter / intra prediction (CIIP) using combined position-dependent predictive coding (PDPC). [Figure 8A] FIG. 1 is a conceptual diagram showing examples of different partitions for the geometric partition mode (GPM). [Figure 8B] 11 is a table showing an example of merge indexes for determining motion vectors for GPM. [Figure 9A] FIG. 1 is a conceptual diagram showing an example of a four-parameter affine model. [Figure 9B] FIG. 1 is a conceptual diagram showing an example of a six-parameter affine mode. [Figure 10] FIG. 2 is a conceptual diagram illustrating an example of an affine motion vector field for each sub-block. [Figure 11] 1 is a flowchart illustrating an example of encoding video data. [Figure 12] 11 is a flowchart illustrating an example of decoding video data. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0015] As described in more detail, template matching (TM) refinement is a technique that a video decoder uses to refine a motion vector for a current block by finding the closest match in a template. For example, the video decoder may determine an initial motion vector for the current block. The initial motion vector may define a search area, also referred to as a search range, in a reference picture. The search area may be a rectangular area around a sample in the reference picture pointed to by the initial motion vector. The video decoder may compare a reference template (e.g., a template in a reference picture) in the search area with a current template (e.g., a template in a current picture that includes the current block) to determine a reference template that substantially matches (e.g., has a minimum difference in sample values with) the current template. The video decoder may determine a motion vector for the current block based on the determined reference template. For example, the motion vector may point to the determined reference template in the reference picture.
[0016] In some techniques, TM improvements are not available for certain inter-prediction modes, such as hybrid inter / intra prediction (CIIP), geometric partition mode (GPM), or multiple hypothesis prediction (MHP), and therefore the video coding gains of TM may not be available for such inter-prediction modes.
[0017] This disclosure describes example techniques for enabling TM improvements for inter-prediction modes such as CIIP, GPM, and MHP. In this manner, video coding gains using TM improvements may be available for CIIP, GPM, and MHP. Although examples are described with respect to CIIP, GPM, and MHP, the example techniques may be applicable to one or more, but not all, of CIIP, GPM, and MHP. Also, CIIP, GPM, and MHP are non-limiting examples of inter-prediction modes.
[0018] For example, the video decoder may determine that the current block is inter predicted in CIIP mode or GPM, such as based on information signaled in the bitstream indicating the inter prediction mode of the current block. The video decoder may also determine that template matching is enabled for the current block, such as based on a coding unit (CU) level syntax element (e.g., a flag) that indicates that template matching is enabled for the current block.
[0019] In such an example, the video decoder may generate a motion vector for the current block based on template matching. For example, in the case of a CIIP mode, the video decoder may generate a motion vector using template matching to determine an inter predictor (e.g., a block in a different picture than the picture that includes the current block). The video decoder may also determine an intra predictor based on samples in the same picture as the current block. The video decoder may combine the inter predictor and the intra predictor to generate a predictive block for the current block.
[0020] As another example, for GPM, the video decoder may partition a current block into a first partition and a second partition. The video decoder may generate a first motion vector for the first partition using template matching and generate a second motion vector for the second partition using template matching. The video decoder may determine a first prediction partition based on the first motion vector and a second prediction partition based on the second motion vector. The video decoder may combine the first prediction partition and the second prediction partition to determine a predictive block.
[0021] The video decoder may reconstruct the current block based on the predictive block. For example, the video decoder may receive information indicating a residual between the current block and the predictive block (e.g., a sample value difference between luma and chroma values) and combine the residual with the predictive block to reconstruct the current block.
[0022] 1 is a block diagram illustrating an example video encoding and decoding system 100 that may implement the techniques of this disclosure. The techniques of this disclosure are generally directed to coding (encoding and / or decoding) video data. In general, video data includes any data for processing video. Thus, video data may include raw uncoded video, coded video, decoded (e.g., reconstructed) video, and video metadata, such as signaling data.
[0023] As shown in Figure 1, system 100 includes a source device 102 that provides encoded video data to be decoded and displayed by a destination device 116, in this example. Specifically, source device 102 provides the video data to destination device 116 via a computer-readable medium 110. Source device 102 and destination device 116 may comprise any of a wide range of devices, including desktop computers, notebook (i.e., laptop) computers, mobile devices, tablet computers, set-top boxes, telephone handsets such as smartphones, televisions, cameras, display devices, digital media players, video game consoles, video streaming devices, broadcast receiver devices, and the like. In some cases, source device 102 and destination device 116 may be equipped for wireless communication and therefore may be referred to as wireless communication devices.
[0024] In the example of FIG. 1, source device 102 includes a video source 104, memory 106, video encoder 200, and output interface 108. Destination device 116 includes an input interface 122, a video decoder 300, memory 120, and a display device 118. According to this disclosure, the video encoder 200 of source device 102 and the video decoder 300 of destination device 116 may be configured to apply techniques for template matching extensions to CIIP, GPM, and MHP inter-prediction modes. Thus, source device 102 represents an example of a video encoding device, and destination device 116 represents an example of a video decoding device. In other examples, the source device and destination device may include other components or arrangements. For example, source device 102 may receive video data from an external video source, such as an external camera. Similarly, destination device 116 may interface with an external display device rather than including an integrated display device.
[0025] System 100 as shown in FIG. 1 is only an example. In general, any digital video encoding and / or decoding device may implement techniques for template matching extensions to CIIP, GPM, and MHP inter-prediction modes. Source device 102 and destination device 116 are only examples of coding devices, such that source device 102 generates coded video data for transmission to destination device 116. This disclosure refers to devices that perform coding (encoding and / or decoding) of data as "coding" devices. Thus, video encoder 200 and video decoder 300 represent examples of coding devices, specifically, video encoders and video decoders, respectively. In some examples, source device 102 and destination device 116 may operate substantially symmetrically, such that each of source device 102 and destination device 116 includes video encoding and decoding components. Thus, system 100 may support one-way or two-way video transmission between source device 102 and destination device 116, for example, video streaming, video playback, video broadcasting, or video telephony.
[0026] In general, video source 104 represents a source of video data (i.e., raw, unencoded video data) and provides a sequential series of pictures (also called “frames”) of the video data to video encoder 200, which encodes the data for the pictures. Video source 104 of source device 102 may include a video capture device, such as a video camera, a video archive containing previously captured raw video, and / or a video feed interface for receiving video from a video content provider. As a further alternative, video source 104 may generate computer graphics-based data as source video, or a combination of live video, archived video, and computer-generated video. In each case, video encoder 200 encodes the captured video data, pre-captured video data, or computer-generated video data. Video encoder 200 may reorder the pictures from the order in which they were received (sometimes called “display order”) into a coding order for coding. Video encoder 200 may generate a bitstream including the encoded video data. The source device 102 may then output the encoded video data onto a computer-readable medium 110 via an output interface 108, for receipt and / or retrieval by, for example, an input interface 122 of a destination device 116.
[0027] The memory 106 of the source device 102 and the memory 120 of the destination device 116 represent general-purpose memories. In some examples, the memories 106, 120 may store raw video data, e.g., raw video from the video source 104 and raw decoded video data from the video decoder 300. Additionally or alternatively, the memories 106, 120 may store software instructions executable by the video encoder 200 and the video decoder 300, respectively, for example. Although the memories 106 and 120 are shown separately from the video encoder 200 and the video decoder 300 in this example, it should be understood that the video encoder 200 and the video decoder 300 may also include internal memories for functionally similar or equivalent purposes. Additionally, the memories 106, 120 may store encoded video data, e.g., the output from the video encoder 200 and the input to the video decoder 300. In some examples, portions of the memories 106, 120 may be allocated as one or more video buffers, e.g., for storing raw decoded video data and / or encoded video data.
[0028] The computer-readable medium 110 may represent any type of medium or device capable of transporting encoded video data from the source device 102 to the destination device 116. In one example, the computer-readable medium 110 represents a communication medium that allows the source device 102 to transmit encoded video data directly to the destination device 116 in real time, for example, via a radio frequency network or a computer-based network. The output interface 108 may modulate a transmission signal including the encoded video data, and the input interface 122 may demodulate a received transmission signal according to a communication standard, such as a wireless communication protocol. The communication medium may comprise any wireless or wired communication medium, such as a radio frequency (RF) spectrum or one or more physical transmission lines. The communication medium may form part of a packet-based network, such as a local area network, a wide area network, or a global network such as the Internet. The communication medium may include routers, switches, base stations, or any other equipment that may be useful to facilitate communication from the source device 102 to the destination device 116.
[0029] 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.
[0030] In some examples, source device 102 may output the encoded video data to a file server 114 or another intermediate storage device, which may store the encoded video data generated by source device 102. Destination device 116 may access the stored video data from file server 114 via streaming or download.
[0031] The file server 114 may be any type of server device capable of storing encoded video data and transmitting the encoded video data to a destination device 116. The file server 114 may represent a web server (e.g., for a website), a server configured to provide file transfer protocol services (such as File Transfer Protocol (FTP) or File Delivery over Unidirectional Transport (FLUTE) protocol), a Content Delivery Network (CDN) device, a Hypertext Transfer Protocol (HTTP) server, a Multimedia Broadcast Multicast Service (MBMS) or enhanced MBMS (eMBMS) server, and / or a Network Attached Storage (NAS) device. The file server 114 may additionally or alternatively implement one or more HTTP streaming protocols, such as Dynamic Adaptive Streaming over HTTP (DASH), HTTP Live Streaming (HLS), Real Time Streaming Protocol (RTSP), HTTP Dynamic Streaming, etc.
[0032] Destination device 116 may access the encoded video data from file server 114 through any standard data connection, including an Internet connection. This may include a wireless channel (e.g., a Wi-Fi connection), a wired connection (e.g., a digital subscriber line (DSL), a cable modem, etc.), or a combination of both suitable for accessing encoded video data stored on file server 114. Input interface 122 may be configured to operate according to any one or more of the various protocols discussed above for retrieving or receiving media data from file server 114, or other such protocols for retrieving media data.
[0033] The output interface 108 and the input interface 122 may represent a wireless transmitter / receiver, a modem, a wired networking component (e.g., an Ethernet card), a wireless communication component operating according to any of the various IEEE 802.11 standards, or other physical components. In examples in which the output interface 108 and the input interface 122 comprise wireless components, the output interface 108 and the input interface 122 may be configured to transfer data, such as encoded video data, according to a cellular communication standard, such as 4G, 4G-LTE (Long Term Evolution), LTE Advanced, 5G, etc. In some examples in which the output interface 108 comprises a wireless transmitter, the output interface 108 and the input interface 122 may be configured to transfer data, such as encoded video data, according to other wireless standards, such as the IEEE 802.11 specification, the IEEE 802.15 specification (e.g., ZigBee™), the Bluetooth™ standard, etc. In some examples, the source device 102 and / or the destination device 116 may include respective system-on-chip (SoC) devices. For example, the source device 102 may include a SoC device for implementing functionality attributed to the video encoder 200 and / or the output interface 108, and the destination device 116 may include a SoC device for implementing functionality attributed to the video decoder 300 and / or the input interface 122.
[0034] The techniques of this disclosure may be applied to video coding supporting any of a variety of multimedia applications, such as over-the-air television broadcast, cable television transmission, satellite television transmission, Internet streaming video transmission such as Dynamic Adaptive Streaming over HTTP (DASH), digital video encoded on a data storage medium, decoding of digital video stored on a data storage medium, or other applications.
[0035] An input interface 122 of the destination device 116 receives an encoded video bitstream from a 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 having values that describe characteristics and / or processing of video blocks or other coded units (e.g., slices, pictures, groups of pictures, sequences, etc.). The display device 118 displays decoded pictures of the decoded video data to a user. The display device 118 may represent any of a variety of display devices, such as a liquid crystal display (LCD), a plasma display, an organic light emitting diode (OLED) display, or another type of display device.
[0036] Although not shown in FIG. 1, in some examples, the video encoder 200 and the video decoder 300 may each be integrated with an audio encoder and / or an audio decoder and may include appropriate MUX-DEMUX units, or other hardware and / or software, to process multiplexed streams that include both audio and video in a common data stream.
[0037] The video encoder 200 and the video decoder 300 may each be implemented as any of a variety of suitable encoder and / or decoder circuit configurations, such as one or more microprocessors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field programmable gate arrays (FPGAs), discrete logic, software, hardware, firmware, or any combination thereof. When the techniques are implemented partially in software, a device may store instructions for the software on a suitable non-transitory computer-readable medium and execute the instructions in hardware using one or more processors to implement the techniques of this disclosure. Each of the video encoder 200 and the video decoder 300 may be included in one or more encoders or decoders, any of which may be integrated as part of a combined encoder / decoder (CODEC) in the respective device. A device including the video encoder 200 and / or the video decoder 300 may comprise an integrated circuit, a microprocessor, and / or a wireless communication device such as a cellular phone.
[0038] The video encoder 200 and the video decoder 300 may operate according to a video coding standard, such as ITU-T H.265, also referred to as High Efficiency Video Coding (HEVC), or an extension thereof, such as a multiview and / or scalable video coding extension. 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 referred to as Versatile Video Coding (VVC). In other examples, the video encoder 200 and the video decoder 300 may operate according to a native video codec / format, such as AOMedia Video 1 (AV1), an extension of AV1, and / or a successor version of AV1 (e.g., AV2). In other examples, the video encoder 200 and the video decoder 300 may operate according to other native formats or industry standards. However, the techniques of this 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 implement the techniques of this disclosure with any video coding technique that uses template matching.
[0039] In general, the video encoder 200 and the video decoder 300 may perform block-based coding of pictures. The term “block” generally refers to a structure that includes data to be processed (e.g., encoded, decoded, or otherwise used in an encoding and / or decoding process). For example, a block may include a two-dimensional matrix of luma and / or chroma data samples. In general, the video encoder 200 and the video decoder 300 may code video data represented in a YUV (e.g., Y, Cb, Cr) format. That is, rather than coding red, green, and blue (RGB) data for a sample of a picture, the video encoder 200 and the video decoder 300 may code a luma component and a chroma component, which may include both red and blue chroma components. In some examples, the video encoder 200 converts received RGB formatted data to a YUV representation prior to encoding, and the video decoder 300 converts the YUV representation to an RGB format. Alternatively, pre-processing and post-processing units (not shown) may perform these conversions.
[0040] This disclosure may generally refer to coding (e.g., encoding and decoding) a picture to include the process of encoding or decoding data for a picture. Similarly, this disclosure may refer to coding a block of a picture as including the process of encoding or decoding data for the block, e.g., predictive and / or residual coding. A coded video bitstream generally includes a set of values for syntax elements that represent coding decisions (e.g., coding modes) and partitioning of a picture into blocks. Thus, references to coding a picture or a block should be understood generally as coding values for the syntax elements that form the picture or block.
[0041] HEVC defines various blocks, including coding units (CUs), prediction units (PUs), and transform units (TUs). According to HEVC, a video coder (such as video encoder 200) partitions coding tree units (CTUs) into CUs according to a quadtree structure. That is, the video coder partitions CTUs and CUs into four equal non-overlapping squares, and each node of the quadtree has either zero or four child nodes. A node without child nodes may be called a "leaf node", and a CU of such a leaf node may include one or more PUs and / or one or more TUs. A video coder may further partition PUs and TUs. For example, in HEVC, a residual quadtree (RQT) represents a partition of TUs. In HEVC, a PU represents inter-predicted data, and a TU represents residual data. An intra-predicted CU includes intra-prediction information, such as an intra-mode indication.
[0042] As another example, the video encoder 200 and the video decoder 300 may be configured to operate according to VVC. According to VVC, a video coder (such as the video encoder 200) partitions a picture into multiple coding tree units (CTUs). The video encoder 200 may partition the CTUs according to a tree structure, such as a quad-tree binary tree (QTBT) structure or a multi-type tree (MTT) structure. The QTBT structure eliminates the concept of multiple partition types, such as the separation between CUs, PUs, and TUs in HEVC. The QTBT structure includes two levels, a first level partitioned according to a quad-tree partition, and a second level partitioned according to a binary tree partition. The root node of the QTBT structure corresponds to a CTU. The leaf nodes of the binary tree correspond to coding units (CUs).
[0043] In the MTT partitioning structure, blocks may be partitioned using quad tree (QT) partitioning, binary tree (BT) partitioning, and one or more types of triple tree (TT) (also called ternary tree (TT)) partitioning. A triple tree partitioning or ternary tree partitioning is a partitioning in which a block is split into three sub-blocks. In some examples, a triple tree partitioning or ternary tree partitioning divides a block into three sub-blocks without splitting the original block through the center. The partition types in MTT (e.g., QT, BT, and TT) may be symmetric or asymmetric.
[0044] When operating according to the AV1 codec, the video encoder 200 and the video decoder 300 may be configured to code the video data in blocks. In AV1, the largest coding block that may be processed is called a superblock. In AV1, a superblock may be either 128×128 luma samples or 64×64 luma samples. However, in successor video coding formats (e.g., AV2), a superblock may be defined by a different (e.g., larger) luma sample size. In some examples, a superblock is the top level of a block quadtree. The video encoder 200 may further partition the superblock into smaller coding blocks. The video encoder 200 may partition the superblock and other coding blocks into smaller blocks using square or non-square partitions. The non-square blocks may include N / 2×N, N×N / 2, N / 4×N, and N×N / 4 blocks. The video encoder 200 and the video decoder 300 may perform a separate prediction and transform process for each of the coding blocks.
[0045] AV1 also defines tiles of video data. A tile is a rectangular array of superblocks that may be coded independently of other tiles. That is, video encoder 200 and video decoder 300 may encode and decode coding blocks within a tile, respectively, without using video data from other tiles. However, video encoder 200 and video decoder 300 may perform filtering across tile boundaries. Tiles may be uniform or non-uniform in size. Tile-based coding may enable parallel processing and / or multi-threading for encoder and decoder implementations.
[0046] In some examples, the video encoder 200 and the video decoder 300 may use a single QTBT or MTT structure to represent each of the luma and chroma components, while in other examples, the video encoder 200 and the video decoder 300 may use two or more QTBT or MTT structures, such as one QTBT / MTT structure for the luma component and another QTBT / MTT structure for both chroma components (or two QTBT / MTT structures for each chroma component).
[0047] Video encoder 200 and video decoder 300 may be configured to use quadtree partitioning, QTBT partitioning, MTT partitioning, superblock partitioning, or other partition structures.
[0048] In some examples, the CTU includes a coding tree block (CTB) of luma samples, two corresponding CTBs of chroma samples for a picture with three sample arrays, or a CTB of samples for a monochrome picture, or a picture coded using three separate color planes and syntax structures used to code the samples. The CTB can be an N×N block of samples for some value of N such that the division of the components into the CTB is partitioned. A component is an array or a single sample from one of three arrays (luma and two chromas) that create a picture in 4:2:0, 4:2:2, or 4:4:4 color format, or an array or a single sample of an array that creates a picture in monochrome format. In some examples, the coding block is an M×N block of samples for some value of M and N such that the division of the CTB into the coding block is partitioned.
[0049] Blocks (e.g., CTUs or CUs) may be grouped in various ways within a picture. As an example, a brick may refer to a rectangular region of a CTU row within a particular tile in a picture. A tile may be a rectangular region of a CTU within a particular tile column and a particular tile row in a picture. A tile column refers to a rectangular region of a CTU with a height equal to the height of the picture and a width specified by a syntax element (e.g., in a picture parameter set). A tile row refers to a rectangular region of a CTU with a height specified by a syntax element (e.g., in a picture parameter set) and a width equal to the width of the picture.
[0050] In some examples, a tile may be partitioned into multiple bricks, each of which may include one or more CTU rows within the tile. A tile that is not partitioned into multiple bricks may also be referred to as a brick. However, a brick that is a true subset of a tile may not be referred to as a tile. Bricks within a picture may also be arranged as slices. A slice may be an integer number of bricks of a picture that may be contained exclusively in a single Network Abstraction Layer (NAL) unit. In some examples, a slice includes either several complete tiles or only a series of contiguous complete bricks of a tile.
[0051] This disclosure may use "NxN" and "N by N" interchangeably, e.g., 16x16 samples or 16 by 16 samples, to refer to the sample dimensions of a block (such as a CU or other video block) in terms of vertical and horizontal dimensions. In general, a 16x16 CU has 16 samples in the vertical direction (y=16) and 16 samples in the horizontal direction (x=16). Similarly, an NxN CU generally has N samples in the vertical direction and N samples in the horizontal direction, where N represents a non-negative integer value. Samples in a CU may be arranged as rows and columns. Moreover, a CU does not necessarily have to have the same number of samples in the horizontal direction as in the vertical direction. For example, a CU may comprise NxM samples, where M is not necessarily equal to N.
[0052] The video encoder 200 encodes video data for a CU that represents prediction and / or residual information, as well as other information. The prediction information indicates how the CU will be predicted to form a predictive block for the CU. The residual information generally represents sample-by-sample differences between samples of the CU and samples of the predictive block prior to encoding.
[0053] To predict a CU, the video encoder 200 may generally form a predictive block for the CU through inter prediction or intra prediction. Inter prediction generally refers to predicting a CU from data of a previously coded picture, and intra prediction generally refers to predicting a CU from previously coded data of the same picture. To perform inter prediction, the video encoder 200 may generate a predictive block using one or more motion vectors. The video encoder 200 may generally perform a motion search to identify a reference block that closely matches the CU with respect to the difference between the CU and the reference block, for example. The video encoder 200 may calculate a difference metric using a sum of absolute differences (SAD), sum of squared differences (SSD), mean absolute difference (MAD), mean squared difference (MSD), or other such difference calculation to determine whether the reference block closely matches the current CU. In some examples, the video encoder 200 may predict the current CU using unidirectional prediction or bidirectional prediction.
[0054] Some examples of VVC also provide an affine motion compensation mode, which may be considered an inter-prediction mode. In an affine motion compensation mode, the video encoder 200 may determine two or more motion vectors that represent non-translational motion, such as zooming in or out, rotation, perspective motion, or other irregular motion types.
[0055] To perform intra prediction, the video encoder 200 may select an intra prediction mode to generate a predictive block. Some examples of VVC provide 67 intra prediction modes, including various orientation modes, as well as a planar mode and a DC mode. In general, the video encoder 200 selects an intra prediction mode that describes neighboring samples relative to a current block (e.g., a block of a CU) from which to predict samples of the current block. Such samples may generally be above, above and to the left, or to the left of the current block, in the same picture as the current block, assuming that the video encoder 200 codes CTUs and CUs in raster scan order (left to right, top to bottom).
[0056] Video encoder 200 encodes data representing a prediction mode for the current block. For example, in the case of an inter prediction mode, video encoder 200 may encode data representing which of various available inter prediction modes is used, as well as motion information for the corresponding mode. In the case of unidirectional or bidirectional inter prediction, for example, video encoder 200 may encode motion vectors using an advanced motion vector prediction (AMVP) mode or a merge mode. Video encoder 200 may use a similar mode to encode motion vectors for an affine motion compensation mode.
[0057] AV1 includes two common techniques for encoding and decoding coding blocks of video data. The two common techniques are intra prediction (e.g., intra-frame prediction or spatial prediction) and inter prediction (e.g., inter-frame prediction or temporal prediction). In the context of AV1, when predicting a block of a current frame of video data using an intra prediction mode, 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 the block of the current frame based on a difference between a sample value in the current block and a predicted value generated from a reference sample in the same frame. The video encoder 200 determines the predicted value generated from the reference sample based on the intra prediction mode.
[0058] Following prediction, such as intra- or inter-prediction, of a block, the video encoder 200 may calculate residual data for the block. The residual data, such as a residual block, represents sample-by-sample differences between the block and a predictive block for that block formed using a corresponding prediction mode. The video encoder 200 may apply one or more transforms to the residual block to generate transform data in a transform domain rather than the sample domain. For example, the video encoder 200 may apply a discrete cosine transform (DCT), an integer transform, a wavelet transform, or a conceptually similar transform to the residual video data. Additionally, the video encoder 200 may apply a secondary transform, such as a mode-dependent non-separable secondary transform (MDNSST), a signal-dependent transform, a Karhunen-Loeve transform (KLT), etc., following the initial transform. The video encoder 200 generates transform coefficients following application of the one or more transforms.
[0059] As mentioned above, following any transformation to generate transform coefficients, the video encoder 200 may perform quantization of the transform coefficients. Quantization generally refers to a process in which transform coefficients are quantized to possibly reduce the amount of data used to represent the transform coefficients, providing further compression. By performing a quantization process, the video encoder 200 may reduce the bit depth associated with some or all of the transform coefficients. For example, the video encoder 200 may round an n-bit value to an m-bit value during quantization, where n is greater than m. In some examples, to perform quantization, the video encoder 200 may perform a bitwise right shift of the value to be quantized.
[0060] Following quantization, the video encoder 200 may scan the transform coefficients to generate a one-dimensional vector from the two-dimensional matrix including the quantized transform coefficients. The scan may be designed to place transform coefficients of higher energy (and therefore lower frequency) at the front of the vector and transform coefficients of lower energy (and therefore higher frequency) at the rear of the vector. In some examples, the video encoder 200 may utilize a default scan order to scan the quantized transform coefficients to generate the serialized vector and then entropy encode the quantized transform coefficients of the vector. In other examples, the video encoder 200 may perform an adaptive scan. After scanning the quantized transform coefficients to form the one-dimensional vector, the video encoder 200 may entropy encode the one-dimensional vector, for example, according to context-adaptive binary arithmetic coding (CABAC). The video encoder 200 may also entropy encode values for syntax elements describing metadata associated with the encoded video data for use by the video decoder 300 in decoding the video data.
[0061] To implement CABAC, the video encoder 200 may assign a context in a context model to a symbol to be transmitted. The context may relate, for example, to whether neighboring values of the symbol are zero-valued or not. The probability decision may be based on the context assigned to the symbol.
[0062] Video encoder 200 may further generate syntax data, such as block-based syntax data, picture-based syntax data, and sequence-based syntax data to video decoder 300, for example in a picture header, a block header, a slice header, or other syntax data, such as a sequence parameter set (SPS), a picture parameter set (PPS), or a video parameter set (VPS). Video decoder 300 may similarly decode such syntax data to determine how to decode corresponding video data.
[0063] In this manner, video encoder 200 may generate coded video data, e.g., a bitstream including syntax elements that describe partitions of a picture into blocks (e.g., CUs) and predictive and / or residual information for the blocks. Finally, video decoder 300 may receive the bitstream and may decode the coded video data.
[0064] In general, video decoder 300 performs an inverse process to that performed by video encoder 200 to decode encoded video data of a bitstream. For example, video decoder 300 may decode values for syntax elements of a bitstream using CABAC in a manner substantially similar to, but reciprocal to, the CABAC encoding process of video encoder 200. The syntax elements may specify partition information for the partition of a picture into CTUs and the partition of each CTU according to a corresponding partition structure, such as a QTBT structure, to specify CUs of the CTUs. The syntax elements may further specify prediction and residual information for blocks (e.g., CUs) of video data.
[0065] The residual information may be represented, for example, by quantized transform coefficients. The video decoder 300 may dequantize and inverse transform the quantized transform coefficients of the block to reconstruct a residual block for the block. The video decoder 300 may form a predictive block for the block using the signaled prediction mode (intra-prediction or inter-prediction) and associated prediction information (e.g., motion information for inter-prediction). The video decoder 300 may then combine the predictive block and the residual block (sample by sample) to reconstruct the original block. The video decoder 300 may perform additional processing, such as performing a deblocking process to reduce visual artifacts along block boundaries.
[0066] This disclosure may generally refer to "signaling" certain information, such as syntax elements. The term "signaling" may generally refer to communication of values for syntax elements and / or other data used to decode encoded video data. That is, video encoder 200 may signal values for syntax elements in a bitstream. In general, signaling refers to generating values in a bitstream. As mentioned above, source device 102 may transport the bitstream to destination device 116 in substantially real-time or not in real-time, as may be done when storing syntax elements in storage device 112 for later retrieval by destination device 116.
[0067] As mentioned above, Versatile Video Coding (VVC), J. Chen, Y. Ye, and S.-H. Kim, "Algorithm description for Versatile Video Coding and Test Model 9 (VTM9)," JVET-R2002, April 2020, i.e., the latest video coding standard, was developed by the Joint Video Experts Team (JVET) of ITU-T and ISO / IEC to achieve substantial compression capabilities beyond HEVC for a wide range of applications. The VVC specification was finalized in July 2020 and published by both ITU-T and ISO / IEC.
[0068] The VVC specification specifies normative bitstream and picture formats, high-level syntax (HLS) and coding unit level syntax, and parsing and decoding processes. VVC also specifies profile / tier / level (PTL) restrictions, byte stream formats, hypothetical reference decoders, and supplemental enhancement information (SEI) in annexes. The techniques described in this disclosure can be applied to further improve state-of-the-art video codecs, such as VVC or AV1.
[0069] In the following, template matching (TM) prediction is described. Template matching (TM) is a decoder-side motion vector (MV) derivation method for improving the motion information of a current CU by finding the closest match between a template in a current picture (i.e., the neighboring block above and / or to the left of the current CU) and a block in a reference picture (i.e., the same size as the template).
[0070] As shown in FIG. 6, a better MV will be searched (e.g., by the video decoder 300) around the initial motion of the current CU in a search range (e.g., search area) of [-8, +8] pels. Using the AMVP candidate selected based on the initial matching error, the MVP (motion vector predictor) for the AMVP candidate is improved by template matching. Using the merge candidate indicated by the signaled merge index, the merged MVs of the merge candidates corresponding to L0 (reference picture list 0) and L1 (reference picture list 1) are independently improved by template matching, and then the less accurate MV is improved again using the better MV as a priority. Reference picture list 0 and reference picture list 1 refer to the reference picture lists constructed by the video encoder 200 and the video decoder 300 for identifying the reference pictures used for inter prediction.
[0071] In the following, we describe the cost function in template matching. When the motion vector points to a fractional sample position, motion compensated interpolation is used. To reduce the complexity, bilinear interpolation is used instead of the usual 8-tap DCT-IF interpolation for both template matching to generate the template on the reference picture. The matching cost C of template matching is given by C=SAD+w*(|MVx-MV s x|+|MVy-MV s y|).
[0072] In the above formula, w is a weighting factor that can be set to an integer such as 0, 1, 2, 3, or 4, and MV and MV s Let,denote the currently tested MV and the initial MV (e.g., the MVP candidate in AMVP mode, or the merged motion in merge mode), respectively.,The SAD is used as the matching cost for template matching.
[0073] When TM is used, motion is improved by using only luma samples. The derived motion is used for both luma and chroma for MC (motion compensated) inter prediction. After the MV is determined, the final MC is performed using an 8-tap interpolation filter for luma and a 4-tap interpolation filter for chroma.
[0074] In the following, a search method in template matching is described. MV refinement is a pattern-based MV search using a criterion of template matching cost and a hierarchical structure. Two search patterns are supported for MV refinement: diamond search and cross search. The hierarchical structure specifies an iterative process for MV refinement, starting at a coarse MVD precision (e.g., 1 / 4-pel) and ending at a fine precision (e.g., 1 / 8-pel). The MV is directly searched at quarter luma sample MVD precision using the diamond pattern, followed by quarter luma sample MVD precision using the cross pattern, and then eighth luma sample MVD refinement using the cross pattern. The search range (e.g., search area) of MV refinement is set equal to (-8, +8) luma samples around the initial MV. When the current block is bi-predictive (e.g., bi-predicted), both MVs are refined independently, and then the best one of them (in terms of matching cost) is set as the priority for further refinement of the other MV using the BCW weight value.
[0075] Specifically, the template matching proposed in JVET-J0021 and JVET-U0100 is applied to AMVP and merge modes in those proposals. JVET-J0021 is a joint publication of Chen et al., "Description of SDR, HDR and 360 o "video coding technology proposed by Qualcomm and Technicolor - low and high complexity versions," Joint Video Exploration Team (JVET) of ITU-T SG 16 WP 3 and ISO / IEC JCT 1 / SC 29 / WG 11, 10th meeting: San Diego, April 10-20, 2018, JVET-J0021. JVET-U0100 refers to Chang et al., "Compression efficiency methods beyond VVC," Joint Video Experts Team (JVET) of ITU-T SG 16 WP 3 and ISO / IEC JCT 1 / SC 29 / WG 11, 21st meeting held remotely, January 6-15, 2021, JVET-U0100.
[0076] Typically the merge candidate list is constructed with the following candidates in order: a. Spatial MVP from spatial neighbor CUs: The first four available candidates are selected in the following order: above neighbor CU (A), left neighbor CU (L), above-right neighbor CU (AR), below-left neighbor CU (LB), above-left neighbor CU (LA). b. Temporal MVP from collocated CU: Only one candidate is added. c. History-based MVP: The motion information of previously coded blocks is stored in a table and used as the MVP for the current CU. d. Pairwise Average MVP: Pairwise average candidates are generated by averaging predefined pairs of candidates in the existing regular merge candidate list. e.Zero MV.
[0077] When TM is applied in merge mode, a separate TM merge candidate list is constructed by improving the MVP of regular merge candidates based on template matching.
[0078] Thus, in one or more examples, for TM matching, the video decoder 300 may determine an initial motion vector 606 for the current block 600 based on motion information in a merge candidate list (e.g., a TM merge candidate list based on template matching enabled for the current block). The video decoder 300 may determine a search area 608 in the reference picture based on the initial motion vector 606 (e.g., a rectangular area whose length and width are [-8, 8] pels as shown).
[0079] The video decoder 300 may determine a reference template within the search area 608. As an example, FIG. 6 shows reference templates 610 and 612. The video decoder 300 may determine which reference template within the search area 608 substantially matches (e.g., has a lowest value of a cost function) with the current templates 602 and 604 in the current picture that includes the current block 600. The video decoder 300 may determine a motion vector for the current block based on the determined reference template according to template matching techniques.
[0080] As described in more detail below, example techniques of this disclosure describe the use of template matching in CIIP mode and GPM. For example, in CIIP, the video decoder 300 may determine an inter predictor, and the video decoder 300 may use template matching techniques to determine a motion vector that identifies the inter predictor. For GPM, the video decoder 300 may partition a current block into a first partition and a second partition. The video decoder 300 may use template matching techniques to determine a motion vector for the first partition and for the second partition.
[0081] In the following, we will describe the combined inter / intra prediction (CIIP). In VVC, when a CU is coded in merge mode, an additional flag is signaled to indicate whether the combined inter / intra prediction (CIIP) mode applies to the current CU. CIIP prediction combines an inter predictor with an intra predictor. The inter predictor P in CIIP mode inter is derived using the same inter prediction process that is normally applied to the merge mode, and the intra predictor P intra is derived following a normal intra prediction process using planar mode. The intra and inter predictors are then combined using weighted averaging. Zhao et al., "Non-CE: Weighted intra and inter prediction mode," Joint Video Experts Team (JVET) of ITU-T SG 16 WP 3 and ISO / IEC JTC 1 / SC 29 / WG 11, 15th Meeting: Gothenburg, 3-12 July 2019, JVET-O0537, proposed an extended CIIP to apply the Position-Dependent Prediction Combined (PDPC) mode to the normal merge mode. This CIIP-PDPC combines the inter predictor with the top reconstructed sample R(x,-1) and the left reconstructed sample R(-1,y), where (x,y) are the coordinates relative to the top-left most sample in the current CU, defined to be (0,0).
[0082] A flowchart of prediction of CIIP using PDPC mode can be shown in Figure 7, where WT and WL are weights that depend on the sample position in the block defined in PDPC. In some examples, the weights for CIIP using planar mode and CIIP using PDPC mode are different.
[0083] For example, as shown in Figure 7, the video decoder 300 may determine an intra-prediction block using a planar mode (700). If PDPC is enabled, the video decoder 300 may determine an intra-predictor using PDPC.
[0084] The video decoder 300 may determine motion vector information for the current block. For example, the video decoder 300 may build a merge candidate list including motion vector information of spatially and temporally neighboring blocks. The video decoder 300 may receive an index into the merge candidate list and determine the motion vector information (e.g., the MV data of FIG. 7) based on the index. The video decoder 300 may determine an inter predictor based on the motion vector information (704).
[0085] The video decoder 300 may then combine the intra and inter predictors (706). For example, Figure 7 shows example equations and weights that the video decoder 300 may apply to combine the intra and inter predictors. The result may be a predictive block that the video decoder 300 uses to reconstruct the current block.
[0086] According to examples described in this disclosure, template matching may be enabled for a current block that is inter predicted in a CIIP mode. For example, the video decoder 300 may determine that the current block is inter predicted in a CIIP mode based on information signaled in the bitstream. In addition, the video decoder 300 may determine that template matching is enabled for the current block, such as based on a CU-level syntax element (e.g., a flag) that indicates that template matching is enabled for the current block.
[0087] The video decoder 300 may generate a motion vector for the current block based on template matching. For example, the video decoder 300 may determine an initial motion vector for the current block based on motion information in a merge candidate list. The video decoder 300 may receive an index into the merge candidate list that identifies motion information (e.g., motion vector information). To generate a motion vector for the current block based on template matching, the video decoder 300 may determine a search area in a reference picture based on the initial motion vector, determine a reference template in the search area that substantially matches a current template in the current picture that includes the current block, and determine a motion vector for the current block based on the determined reference template.
[0088] In the case of the CIIP mode, the video decoder 300 may determine a predictive block for the current block based on a motion vector according to the CIIP mode. For example, the video decoder 300 may determine an inter predictor based on the generated motion vector and an intra predictor based on samples neighboring the current block. The video decoder 300 may combine the inter predictor and the intra predictor to determine a predictive block (e.g., as shown in FIG. 7).
[0089] In the following, the geometric partition mode (GPM) is described. In VVC, the geometric partition mode is supported for inter prediction. The geometric partition mode is signaled using a CU level flag as a kind of merge mode, along with other merge modes including normal merge mode, MMVD mode, CIIP mode, and sub-block merge mode. A total of 64 partitions are signaled for each possible CU size w×h=2. m ×2 n For m, n∈{3...6}, except for 8 × 64 and 64 × 8. When this mode is used, the CU is split into two parts by a geometrically arranged line shown in Figure 8A.
[0090] The location of the split line is mathematically derived from the angle and offset parameters of a particular partition. Each part of a geometric partition (e.g., each partition) in a CU is inter-predicted using its own motion. In some examples, only uni-prediction is allowed per partition, i.e., each part has one motion vector and one reference index. The uni-prediction motion for each partition is derived as follows:
[0091] The uni-predictive candidate list is directly derived from the merge candidate list constructed as in the merge mode, as shown in Figure 8B. Let n be the index of the uni-predictive motion in the geometric uni-predictive candidate list. The LX motion vector of the nth merge candidate, where X is equal to the parity (even or odd) of n, is used as the nth uni-predictive motion vector for the geometric partition mode. These motion vectors are marked with "x" in Figure 8B. In the case where there is no corresponding LX motion vector of the nth extended merge candidate, the L(1-X) motion vector of the same candidate is used instead as the uni-predictive motion vector for the geometric partition mode.
[0092] If a geometric partition mode is used for the current CU, a geometric partition index (angle and offset) indicating the partition mode of the geometric partition, and two merge indices (one for each partition) are further signaled. The number of maximum GPM candidate sizes is explicitly signaled in the SPS, which specifies the syntax binarization for the GPM merge index. After predicting each part of the geometric partition, the sample values along the edge of the geometric partition are adjusted using a blending process with adaptive weights.
[0093] According to examples described in this disclosure, template matching may be enabled for a current block that is inter predicted in GPM. For example, the video decoder 300 may determine that the current block is inter predicted in GPM based on information signaled in the bitstream. In addition, the video decoder 300 may determine that template matching is enabled for the current block, such as based on a CU level syntax element (e.g., a flag) that indicates that template matching is enabled for the current block.
[0094] The video decoder 300 may generate a motion vector (e.g., at least one motion vector) for the current block based on template matching. For example, the video decoder 300 may partition the current block into a first partition and a second partition. The video decoder 300 may generate the motion vector (e.g., at least one motion vector) by generating a first motion vector for the first partition of the current block. The video decoder 300 may also generate a second motion vector for the second partition of the current block based on the template matching and based on a determination that template matching is enabled for the current block.
[0095] There may be various ways in which the video decoder 300 may determine a first motion vector for a first partition based on template matching and a second motion vector for a second partition based on template matching. As an example, the video decoder 300 may perform the example operations described above with respect to FIG. 6 twice, once for the first partition and once more for the second partition.
[0096] For example, to generate a motion vector for the current block based on template matching, the video decoder 300 may be configured to determine a first initial motion vector for the first partition based on first motion information in the merge candidate list, determine a first search area in the first reference picture based on the first initial motion vector, determine a first reference template in the first search area that substantially matches the first current template of the first partition, and determine a first motion vector for the first partition based on the determined first reference template.
[0097] The video decoder 300 may also determine a second initial motion vector for the second partition based on the second motion information in the merge candidate list, determine a second search area in the second reference picture based on the second initial motion vector, determine a second reference template in the second search area that substantially matches the second current template of the second partition, and determine a second motion vector for the second partition based on the determined second reference template.
[0098] In the case of the GPM, the video decoder 300 may determine a prediction block for a current block based on a motion vector according to the GPM. For example, the video decoder 300 may determine a prediction block based on a first motion vector or based on a first motion vector and a second motion vector, where the first motion vector and the second motion vector are generated using template matching. As an example, the video decoder 300 may determine a first prediction partition based on the first motion vector, determine a second prediction partition based on the second motion vector, and combine the first prediction partition and the second prediction partition to determine a prediction block.
[0099] In the following, affine prediction is described. In some techniques, only translational motion model is applied for motion compensation prediction (MCP). Meanwhile, in the real world, there are many kinds of motion, for example, zoom in / out, rotation, perspective motion, and other irregular motion. In VTM-6, block-based affine transformation motion compensation prediction is applied. As shown in Figure 9A and Figure 9B, the affine motion field of a block is described by the motion information of two control points (also called four-parameter model) in Figure 9A, or three control points motion vectors (also called six-parameter model) in Figure 9B.
[0100] For a four-parameter affine motion model, the motion vector at a sample location (x,y) within a block is given by
[0101]
number
[0102] It is derived as:
[0103] For a 6-parameter affine motion model, the motion vector at a sample location (x,y) within a block is given by
[0104]
number
[0105] It is derived as:
[0106] In the above explanation of the four and six parameters, (mv 0x ,mv 0y ) is the motion vector of the upper left corner control point, and (mv 1x ,mv 1y ) is the motion vector of the control point in the upper right corner, and (mv 2x ,mv 2y ) is the motion vector of the bottom-left corner control point.
[0107] To simplify the motion compensation prediction, a block-based affine transformation prediction is applied. To derive the motion vector of each 4×4 luma sub-block, the motion vector of the center sample of each sub-block is calculated according to the above formula and rounded to 1 / 16 fractional precision, as shown in FIG. 10. Then, a motion compensation interpolation filter is applied to generate a prediction of each sub-block with the derived motion vector. The sub-block size of the chroma components is also set to be 4×4. The MV of a 4×4 chroma sub-block is calculated as the average of the MVs of the four corresponding 4×4 luma sub-blocks.
[0108] According to the techniques of this disclosure, template matching (TM) improvements are applied to inter-modes such as CIIP, GPM, and MHP. To indicate whether such TM improvements are applied, a flag may be introduced and signaled in the bitstream, for example, on a block-by-block basis. That is, the video decoder 300 may determine that template matching is enabled for a current block by receiving a CU-level syntax element (e.g., a flag) indicating that template matching is enabled for the current block.
[0109] In another example, a combination of flags may be introduced: one set of flags is signaled in a parameter set such as VPS, SPS, PPS, etc. to indicate whether TM improvements are implemented for inter-modes; a second set of flags is signaled in a picture or slice header to indicate whether TM improvements are implemented for a picture or slice; a third set of flags is signaled on a block-by-block basis to indicate whether TM improvements are applied to a block; the signaling of the second set of flags may depend on whether TM improvements are enabled in the first set of flags; the signaling of the third set of flags may depend on whether TM improvements are enabled in the first set of flags and / or the second set of flags.
[0110] For example, this disclosure describes a video coder (e.g., video encoder 200 or video decoder 300) configured to code (e.g., encode or decode) one or more syntax elements indicating that template matching (also referred to as template matching improvement) is enabled for a block that is inter predicted in at least one of a combined inter / intra prediction (CIIP), geometric partition mode (GPM), or multiple hypothesis prediction (MHP) inter prediction mode, and to code the block using template matching. As an example, to code the one or more syntax elements, the video decoder 300 may be configured to parse and decode the one or more syntax elements, and to code the block, the video decoder 300 may be configured to decode the block. As another example, to code the one or more syntax elements, the video encoder 200 may encode and signal one or more syntax elements, and to code the block, the video encoder 200 may be configured to encode the block.
[0111] In some examples, the one or more syntax elements include a flag indicating that template matching is enabled. In some examples, the one or more syntax elements include one or a combination of a first set of flags indicating that template matching is enabled for an inter mode, a second set of flags indicating that template matching improvement is enabled for a picture or slice that includes the block, and at least a third flag indicating that template matching improvement is enabled for the block.
[0112] TM improvements may be context coded, and the flag context may be shared across different inter modes or may be inter mode specific, for example, one context is allocated for coding TM improvement flags for CIIP mode, another context is allocated for coding TM improvement flags for GMP mode, and yet another context is allocated for signaling TM improvement flags for MHP.
[0113] For example, the block in the above example may be a first block, and the one or more syntax elements may be a first set of one or more syntax elements. The video coder may be configured to code a second set of one or more syntax elements indicating that template matching improvement is enabled for a second block that is inter predicted in at least one of a CIIP, GPM, or HMP inter prediction mode. The first block may be inter predicted in at least one of a CIIP, GPM, or HMP inter prediction mode, and the second block may be inter predicted in at least another one of the CIIP, GPM, or HMP inter prediction modes.
[0114] The video coder may be configured to context-based code a first set of one or more syntax elements and context-based code a second set of one or more syntax elements. In one example, a context for coding at least one of the first set of one or more syntax elements is the same as a context for coding at least one of the second set of one or more syntax elements. In one example, a context for coding at least one of the first set of one or more syntax elements is different from a context for coding at least one of the second set of one or more syntax elements.
[0115] Each inter mode (e.g., inter prediction mode) may have other parameters associated with it (e.g., associated with the inter prediction mode), and these parameters are signaled in the bitstream, e.g., MV candidate indexes.
[0116] The parameters may be context coded, and one set of contexts may be used when TM improvement is disabled (TM improvement flag is 0) and another set of contexts may be used when TM improvement is enabled (TM improvement flag is 1). In some examples, the contexts may be split (i.e., separated) based on the TM improvement flag for only the first few bins of the inter mode parameters after binarization, and the contexts for other subsequent bins are shared between the cases when TM improvement is applied and when it is not applied. In some examples, the inter mode parameters are signaled using the same set of contexts regardless of the TM improvement.
[0117] For example, in the above example, the block may be considered as the first block. The video coder may be configured to context-based code one or more parameters associated with an inter-prediction mode in which the first block is inter-predicted, and code the second block in at least one of a CIIP, GPM, or MHP inter-prediction mode, with template matching improvement disabled. In this example, the inter-prediction modes for the first block and the second block may be the same. The video coder may context-based code one or more parameters associated with an inter-prediction mode in which the second one is inter-predicted.
[0118] In some examples, a context associated with context-based coding one or more parameters for a first block is different from a context associated with context-based coding one or more parameters for a second block. In some examples, a context associated with context-based coding one or more parameters for a first block is the same as a context associated with context-based coding one or more parameters for a second block. In some examples, a context associated with context-based coding a first set of bins for one or more parameters for a first block is the same as a context associated with context-based coding a first set of bins for one or more parameters for a second block, and a context associated with context-based coding at least one bin in the second set of bins for one or more parameters for the first block is different from a context associated with context-based coding at least one bin in the second set of bins for one or more parameters for the second block.
[0119] The example techniques described in this disclosure may be applied individually or in any combination.
[0120] In the following, CIIP using template matching is described. In this disclosure, new CIIP modes are described to combine intra mode with either normal merge mode or TM merge mode. In one example, four CIIP modes are proposed as follows: a. Multiplane mode and normal merge mode, b. Combined PDPC mode and normal merge mode; c. Composite Plane Mode and TM Merge Mode; d. Combined PDPC mode and TM merge mode.
[0121] For example, in one or more examples described in this disclosure, video encoder 200 and video decoder 300 may support a CIIP mode including a composite planar mode and a template matching (TM) merge mode, and may support a CIIP mode including a composite PDPC mode and a TM merge mode. For example, video encoder 200 and video decoder 300 may determine that a current block is inter predicted in a CIIP mode (e.g., a CIIP mode including a composite planar mode and a TM merge mode or a CIIP mode including a composite PDPC mode and a TM merge mode). For example, video encoder 200 may signal, and video decoder 300 may receive, one syntax element indicating that a current block is inter predicted in a CIIP mode, and video encoder 200 may signal, and video decoder 300 may receive, a CU level syntax element (e.g., a flag) indicating that template matching is enabled for the current block.
[0122] Video encoder 200 and video decoder 300 may generate a motion vector for the current block based on template matching. For example, video encoder 200 and video decoder 300 may determine an initial motion vector for the current block based on the motion information in the merge candidate list. Video encoder 200 may signal, and video decoder 300 may receive, an index into the merge candidate list.
[0123] For template matching, the video encoder 200 and the video decoder 300 may determine a search area in a reference picture based on an initial motion vector. The video encoder 200 and the video decoder 300 may determine a reference template in the search area that substantially matches a current template in the current picture that includes the current block. The video encoder 200 and the video decoder 300 may determine a motion vector for the current block based on the determined reference template.
[0124] The video encoder 200 and the video decoder 300 may determine a predictive block for a current block according to a CIIP mode. For example, the video encoder 200 and the video decoder 300 may determine an inter predictor based on a generated motion vector. The video encoder 200 and the video decoder 300 may determine an intra predictor based on samples neighboring the current block (e.g., according to a planar mode or a PDPC mode). The video encoder 200 and the video decoder 300 may combine the inter predictor and the intra predictor to determine a predictive block.
[0125] The video encoder 200 may signal residual information indicating a difference between the predictive block and the current block. The video decoder 300 may receive the residual information indicating the residual between the current block and the predictive block and combine the residual and the predictive block to reconstruct the current block.
[0126] In some examples, CIIP mode (a) and CIIP mode (c) may share a first set of weighting factors, and CIIP mode (b) and CIIP mode (d) may share a second set of weighting factors. If CIIP is enabled for this CU, an index with one of binarizations 0, 10, 110, 111 is signaled to indicate which CIIP mode is used. In some examples, a TM merge flag is signaled to indicate whether a TM merge mode is used to generate an inter predictor for this CIIP mode, and a PDPC flag is also signaled to indicate whether a PDPC mode is used to generate an intra predictor for this CIIP mode. Some example techniques include signaling a CIIP flag if the TM merge flag is true, and further signaling a PDPC flag if the CIIP flag is true.
[0127] In some examples, there are three different merge lists, as shown below. A normal merge candidate list with aP candidates TM merge candidate list with bQ candidates CIIP TM merge candidate list with cR candidates
[0128] In some examples, P, Q, and R should be equal to or greater than 1. In list (b), the video encoder 200 or video decoder 300 first generates Q initial regular merging candidates, and then the MV of each candidate is improved by either TM or combined BDMVR and TM, as proposed in JVET-U0100. In the proposed list (c), the video encoder 200 or video decoder 300 first generates R initial regular merging candidates, and then the MV of each candidate is improved by TM. In some examples, at least two of P, Q, and R may be the same value.
[0129] For example, for template matching, video encoder 200 and video decoder 300 may construct a merge candidate list. Video encoder 200 may signal, and video decoder 300 may receive, information indicating an index into the merge candidate list. Video decoder 300 may determine an initial motion vector based on the index into the merge candidate list. For example, video encoder 200 may determine an initial motion vector and determine an index into the merge candidate list based on the location of the initial motion vector in the merge candidate list. For a CIIP mode with template matching enabled, the number of candidates in the merge candidate list is R candidates. P and Q refer to the number of candidates in the merge candidate list when CIIP mode is not enabled.
[0130] As an example, assume that the current block is a first block and the current block is inter-predicted in CIIP mode with template matching enabled. In this example, video encoder 200 and video decoder 300 may construct a first merge candidate list having a first number of candidates (e.g., R candidates). A second merge candidate list for a second block that is inter-predicted in CIIP mode with template matching disabled includes a second number of candidates (e.g., P candidates). The first number of candidates is different from the second number of candidates. As another example, a second merge candidate list for a second block that is not inter-predicted in CIIP mode includes a second number of candidates (e.g., P or Q candidates).
[0131] The candidate indices of lists (a) and (b) are coded using abbreviated unary binarization, and the first M bins are context coding. In some examples, the candidate indices of the CIIP TM merge candidates in list (c) are signaled using abbreviated unary binarization. One example is that when R=6, 0, 10, 110, 1110, 11110, and 11111 are used as binarizations for candidate indices 0, 1, 2, 3, 4, and 5. In some examples, the first M bins of the CIIP TM merge candidates are context coding, and share the same context normally used in the candidate index coding for merge list (a). In some examples, the first M bins of the CIIP TM merge candidates are context coding, and share the same context normally used in the candidate index coding for TM merge list (b). In some examples, the first M bins of the CIIP TM merge candidates are context coding, and the context is different from the context used in the candidate index coding for list (a) and list (b).
[0132] That is, as part of receiving the information indicating an index into the merge candidate list, the video decoder 300 may be configured to determine a context for the first M bins of the information, where the context for the first M bins is the same as the context for the M bins for the index into the second merge candidate list. In this example, the first merge candidate list is a merge candidate list for a current block that is inter predicted in CIIP mode with template matching enabled. The second merge candidate list is a hypothesis list that would be generated for a second block that is inter predicted in CIIP mode with template matching disabled (e.g., normal inter prediction) or for a block that is not inter predicted using CIIP mode (e.g., normal inter prediction with template matching). The context for decoding the first M bins for the index into the first merge candidate list and the second merge candidate list may be the same. The video decoder 300 may context-based decode the information based on the determined context.
[0133] In some examples, the two CIIP modes may be (1) composite plane mode and normal merge mode, and (2) composite plane mode and TM merge mode. If CIIP is enabled for this CU, a TM merge flag is signaled to indicate whether TM merge mode is used to generate an inter predictor for this CIIP mode.
[0134] In some examples, the two CIIP modes may be (1) composite plane mode and normal merge mode, and (2) composite PDPC mode and TM merge mode. If CIIP is enabled for this CU, a CIIP mode flag is signaled to indicate which CIIP mode is used.
[0135] In some examples, the two CIIP modes may be (1) a combined PDPC mode and a normal merge mode, and (2) a combined PDPC mode and a TM merge mode. If CIIP is enabled for this CU, a TM merge flag is signaled to indicate whether the TM merge mode is used to generate an inter predictor for this CIIP mode.
[0136] In the following, GPM using template matching is described. In this disclosure, template matching (TM) improvement is applied to GPM mode. The improvement is applied to motion vector candidates. A flag may be signaled to indicate whether the TM improvement is applied.
[0137] Deriving motion vector (MV) candidates in GPM mode may include two steps: deriving merge MV candidates and deriving unidirectional MV candidates from merge MV candidates for the GPM partition.
[0138] The template matching improvement can be applied at different GPM MV construction stages. For example, the GPM MV candidate construction is left unmodified. Leaving the GPM MV candidates unmodified can give the GPM mode the advantage of having the same MV candidate construction process regardless of the TM improvement flag.
[0139] Then, the TM refinement is applied to the unidirectional GPM MV candidate using the current block and the reference block template for the matching process. The refined MV can be used as a candidate to form the GPM prediction.
[0140] In one example, TM refinement is performed only on GPM partitions that have neighboring blocks because TM refinement requires reconstructed neighbor templates. In one example, MVs are derived for each GPM partition using reconstructed CU neighbor samples, even if the partition is not adjacent to those samples.
[0141] For example, assume that the current block is inter-predicted in GPM. In this example, video encoder 200 and video decoder 300 may partition the current block into a first partition and a second partition. As described above, video encoder 200 and video decoder 300 may be configured to generate a motion vector for the current block based on template matching. For GPM, to generate a motion vector for the current block, video encoder 200 and video decoder 300 may generate a first motion vector for the first partition based on template matching. In one or more examples, video encoder 200 and video decoder 300 may generate a second motion vector for the second partition based on template matching and based on a determination that template matching is enabled for the current block.
[0142] As an example, for a GPM with template matching, the video decoder 300 may determine a first initial motion vector for the first partition based on the first motion information in the merge candidate list (e.g., based on receiving a first index in the merge candidate list). The video decoder 300 may determine a first search area in the first reference picture based on the first initial motion vector, determine a first reference template in the first search area that substantially matches the first current template of the first partition, and determine a first motion vector for the first partition based on the determined first reference template. Similarly, the video decoder 300 may determine a second initial motion vector for the second partition based on the second motion information in the merge candidate list (e.g., based on receiving a second index in the merge candidate list). The video decoder 300 may determine a second search area in the second reference picture based on the second initial motion vector, determine a second reference template in the second search area that substantially matches the second current template for the second partition, and determine a second motion vector for the second partition based on the determined second reference template.
[0143] For GPM, the video encoder 200 and the video decoder 300 may determine a first prediction partition based on a first motion vector and a second prediction partition based on a second motion vector. The video encoder 200 and the video decoder 300 may combine the first prediction partition and the second prediction partition to determine a predictive block for the current block. The video encoder 200 may signal residual information indicating a difference in sample values between the predictive block and the current block. The video decoder 300 may receive the residual information indicating a residual between the current block and the predictive block and combine the residual and the predictive block to reconstruct the current block.
[0144] In some examples, the TM refinement is implemented only for a specific subset of GPM split modes. For example, some specific splits are bent to the bottom right of the CU with an offset, resulting in a subsection at the bottom right of the CU. The signaling of the GPM split modes or TM merge flags can be modified accordingly to reduce signaling overhead.
[0145] In some examples, a TM improvement process can be performed on the merge MV candidate before constructing the GPM unidirectional MV candidate, in one example by using parity. The TM improvement applied to the merge MV candidate can be the same as the TM improvement process applied in the merge mode. In this case, the merge MV derivation process can be shared between the merge mode and the GPM mode, and the total number of TM improvement steps can be reduced. After the TM improvement process, the unidirectional GPM candidate is derived.
[0146] In some examples, the TM improvement is performed for a particular MV candidate, for example, based on the MV candidate index. For example, the TM improvement is applied to every other MV candidate, or to MV candidates with an MV candidate index greater than a threshold. In one example, the threshold may be equal to half the number of MV candidates. In this case, a TM improvement flag may not be required, since whether the TM improvement process is applied depends on the MV candidate index.
[0147] In some examples, a first flag may be signaled to indicate whether a TM improvement is applied to the current GPM coded block. If the first flag is true, a second flag is signaled to indicate whether a TM improvement is applied to the first GPM partition, and a third flag is signaled to indicate whether a TM improvement is applied to the second GPM partition. If the first flag is false, the second and third flags are not signaled and are inferred to be false, i.e., TM is not applied. In some examples, if the first flag is true and the second flag is false, the third flag is not signaled and is inferred to be true, i.e., TM is applied to the second partition.
[0148] In some examples, a first flag may be signaled to indicate whether a TM improvement is applied to the current GPM coded block. If the first flag is true, the TM improvement may be applied. For each GPM partition, whether the TM improvement is applied is determined by a merge index. For example, if the merge index is less than a threshold, the TM improvement is applied. In another example, if the merge index is greater than a threshold, the TM improvement is applied. In some examples, the merge list may be different from the merge list when the first flag is false. In some examples, the merge list is constructed by picking a subset of candidates from the merge list used when the first flag is false. Some sorting of the candidates may be applied. The sorting may be based on the TM cost of the merge candidates.
[0149] In some examples, when both the first and second GPM coded blocks do not apply template matching, the merge indexes of the two GPM coded blocks are not allowed to be the same. When one of the two GPM coded blocks applies template matching and the other does not, the merge indexes of the two GPM coded blocks can be the same. When both of the two GPM coded blocks apply template matching, the merge indexes are allowed to be the same when the MVs of the two coded blocks after template matching are different.
[0150] In the following, we describe MHP using template matching. In U.S. Provisional Application No. 63 / 167,480, filed March 29, 2021, the merge mode can be applied to additional hypotheses in multiple hypothesis prediction. In some examples, the same merge candidate list as in GPM is used.
[0151] In this disclosure, template matching (TM) refinements are also applied to the GPM mode. The refinements may be applied to motion vector candidates.
[0152] In one method, similar to that described in U.S. Provisional Application No. 63 / 167,480 (e.g., related to AMVR), a flag may be signaled to indicate whether TM improvements are applied. The merge modes in MHP share the same merge candidate list, and the methods described in U.S. Provisional Application No. 63 / 167,480, such as those described for AMVR, can be applied to the merge mode of MHP for additional hypotheses.
[0153] In some examples, only TM-enhanced merge candidates are used for the MHP merge mode. The same examples (e.g., AMVR description) in U.S. Provisional Application No. 63 / 167,480 can be applied. For example, the same TM-enhanced merge candidate list as in GPM is used for the MHP merge mode.
[0154] The following describes TM merge candidates. This disclosure describes an example for exchanging a spatial MVP from a top neighbor CU and a spatial MVP from a left neighbor CU in a TM merge candidate list when the following condition is true: a. The maximum number of TM merge candidates is greater than 1 b. The slice is a B slice. c. The MV information of the upper neighbor CU and the MV information of the left neighbor CU are available. d. The upper neighbor CU is coded by unidirectional inter prediction. e. The left neighbor CU is coded by bidirectional inter prediction.
[0155] If the spatial neighboring CU is above (A) or to the left (L), the spatial neighboring CU is coded by unidirectional inter prediction, the LIC flag is not enabled for this spatial neighboring CU, and in some examples, the MVP of the spatial neighboring block is converted from unidirectional inter predictive coding to bidirectional inter predictive coding during TM merge list construction. Specifically, the conversion is as follows: a. If a reference picture in the first reference picture list is used for a spatial neighboring block and the motion vector is defined as MV1, then bidirectional prediction is established for the spatial neighboring block by using the first entry of the second reference picture list and setting the motion vector MV2 to be −MV1. b. If a reference picture in the second reference picture list is used for the neighboring block and the motion vector is defined as MV2, then bidirectional prediction is established for the spatial neighboring block by using the first entry in the first reference picture list and setting the motion vector MV1 to be -MV2.
[0156] In some examples, the spatial MVP from the left neighbor CU may be examined before the spatial MVP from the above neighbor CU. An example technique may swap the spatial MVP from the left neighbor CU and the spatial MVP from the above neighbor CU in the candidate list if the following condition is true: a. The maximum number of TM merge candidates is greater than 1 b. The slice is a B slice. c. The MV information of the upper neighbor CU and the MV information of the left neighbor CU are available. d. The left neighbor CU is coded by unidirectional inter prediction. e. The upper neighbor CU is coded by bidirectional inter prediction.
[0157] These techniques are not limited to the left neighbor CU and the top neighbor CU, but may be applied to any two different spatial neighbor CUs. For example, the left neighbor CU and the top neighbor CU in this subsection can be replaced by the top-right neighbor CU and the bottom-left neighbor CU.
[0158] In another example, the exchange of spatial MVPs from the top neighbor CU and the left neighbor CU can be applied to both the normal merge candidate list and the TM merge candidate list.
[0159] In another example, M spatial MVPs from M neighboring CUs in the normal merge candidate list and the TM merge candidate list, respectively, are reordered during list construction to cause MVPs using bi-prediction to be placed in earlier entries in the separate lists.
[0160] In another example, M spatial MVPs from M adjacent CUs in the normal merge candidate list and N spatial MVPs from N adjacent CUs in the TM merge candidate list are reordered during list construction to cause MV candidates using bi-prediction to be placed in earlier entries in separate lists, respectively, where M is not equal to N.
[0161] In the following, GPM using affine and template matching is described. In some examples, the motion field of each GPM partition can be represented by using an affine model. Similar to the GPM candidates generated from the translation model-based merge candidates, the video encoder 200 and the video decoder 300 may generate a candidate list based on the affine model merge candidates. Given an affine candidate list, the following is an exemplary technique for converting this list into a GPM candidate list (hereafter referred to as an affine-based GPM merge candidate list). a. For each affine merge candidate in the affine candidate list, if it has uni-predictive affine CPMVs (control point motion vectors), then these CPMVs are inserted directly, in order, into the affine-based GPM candidate list entry; otherwise, if it has bi-predictive CPMVs, then there are several ways to handle this case: i. Some example techniques take the L0 (reference picture list 0 or list 0) CPMV and drop the CPMV of the other reference picture list. ii. Some example techniques take the L1 (reference picture list 1 or list 1) CPMV and drop the CPMV of the other reference picture list. iii. Some example techniques take CPMV with a BCW weight of 0.5 or greater. iv. Some exemplary techniques take CPMV with a BCW weight of 0.5 or less. v. Some example techniques take an L0 CPMV with even candidate indices (e.g., 0, 2, 4, ...) in the affine merge candidate list and an L1 CPMV with odd candidate indices (e.g., 1, 3, 5, ...) in the affine candidate list. vi. Some example techniques take an L1 CPMV with even candidate indices (e.g., 0, 2, 4, ...) in the affine merge candidate list and an L0 CPMV with odd candidate indices (e.g., 1, 3, 5, ...) in the affine candidate list. b. In addition to the above-mentioned construction process of the affine-based GPM merging candidate list, each candidate in this list, if the candidate has a 4-parameter affine model, can be converted to a 6-parameter model by using the same conversion disclosed in U.S. Provisional Application No. 63 / 173,861, filed on April 12, 2021, and U.S. Provisional Application No. 63 / 173,949, filed on April 12, 2021.
[0162] When a GPM partition is represented by using an affine model, the motion field of the partition is filled by using the sub-block MVs derived by using the CPMV of the GPM partition. Although the CPMV can derive the sub-block MVs for the complete CU, only the sub-block MVs located within the area of the GPM partition are considered and embedded into the motion field of the GPM partition. For each sub-block located in the mixed area of a GPM coded CU, the sub-block has two MVs, one from the first GPM partition and the other from the second GPM partition, and the same storage rules as in the translation model based GPM are applied. Within a sub-block, if both MVs are from different reference picture lists, both are stored in the motion field of the sub-block, otherwise, if both MVs are from the same reference list, the following example technique may be applied. Some example techniques always store the MV from the first GPM partition and drop the MV from the other. b. Some example techniques always store the MV from the second GPM partition and drop the other MV.
[0163] Some methods that can be applied to indicate the use of affine-based GPM modes may be as follows: Some example techniques signal a CU-level flag to indicate that both GPM partitions are represented by using an affine model. b. Some example techniques signal a flag separately for each GPM partition to indicate the use of the affine-based GPM merge mode, so that video encoder 200 and video decoder 300 can determine which GPM partitions have an affine motion model and which do not. When both flags are true, the motion fields of both GPM partitions can be represented by using an affine motion model. When one flag is true and the other is false, the motion field of only one GPM partition (with flag equal to true, as described above) is represented by the affine motion model, and the motion field of the other partition is represented by the translational motion model. When both flags are false, the GPM infers motion in the same way that VVC does. c. Some example techniques may signal a CU level flag to indicate that at least one motion field of the GPM partition is represented by using an affine model. When the first flag is true, a second flag is signaled to indicate whether the first GPM partition is one whose motion field is represented by using an affine motion model. If this second flag is false, the motion field of the second GPM partition is always represented by an affine motion model, otherwise, if this second flag is true, a third flag is signaled to indicate whether the second GPM partition has an affine motion model. d. Some example techniques signal a CU level flag to indicate that at least one motion field of the GPM partition is represented by using an affine model. A second flag is signaled to indicate whether a first partition of the GPM has an affine or a second partition has an affine. In some examples, only one partition of the GPM represents its motion field by using an affine motion model and the other represents its motion field by using a translational motion model.
[0164] Furthermore, when both motion fields of two GPM partitions are represented by using an affine model, two different merge indexes are signaled for the two GPM partitions, respectively, with each merge index pointing to an entry in the affine-based GPM merge candidate list. When there is only a single GPM partition whose motion field is represented by using an affine motion model, the merge index of that (e.g., the GPM partition) is signaled, which points to an entry in the affine-based GPM merge candidate list, and the other merge index of the other GPM partition is signaled, which points to an entry in the translation model-based GPM merge candidate list. In some examples, the two merge candidate indexes do not always need to be different from each other, because they (e.g., the two merge candidate indexes) point to different merge candidate lists. When none of the GPM partitions represents its motion field by using an affine motion model, the GPM index is signaled in the same manner as VVC does.
[0165] In some examples, the MV and CPMV of the GPM partition may be improved by using template matching. When the motion field of the GPM partition is represented by using a translational motion model, the template matching applied may be the same as that described above in the description of the GPM using template matching. When the motion field of the GPM partition is represented by using an affine model, the template matching-based method described in U.S. Provisional Application No. 63 / 173,861, filed on April 12, 2021, and U.S. Provisional Application No. 63 / 173,949, filed on April 12, 2021, may be applied to improve the CPMV before it is used to derive the sub-block MV of this GPM partition. As described above in the GPM using template matching, a first flag may be signaled to indicate whether the CPMV of the GPM using the affine model is improved by template matching. In another embodiment, a second flag is signaled to indicate whether the CPMV of the first GPM partition is improved by template matching, and a third flag is signaled to indicate whether the CPMV of the second GPM partition is improved by template matching. In some examples, the second flag and the third flag are signaled if the first flag is true. If the first flag is true and the second flag is false, the third flag is not signaled and is inferred to be true.
[0166] In some examples, assume that the first and second GPM coding blocks both apply affine CPMV to the GPM candidate list. If the first and second GPM coding blocks do not apply template matching, the merge indexes of two GPMs using affine coding blocks are not allowed to be the same. When one of the two GPMs using affine coding blocks applies template matching and the other does not, the merge indexes of two GPMs using affine coding blocks may be the same. When both of the two GPMs using affine coding blocks apply template matching, the merge indexes are allowed to be the same when the CPMVs of the two coding blocks after template matching are different.
[0167] In some examples, any motion candidate in the translational model-based GPM merge candidate list may be converted to be represented by using an affine model through a template matching method specified in the translational model to affine model model conversion in U.S. Provisional Application No. 63 / 173,861, filed on April 12, 2021, and U.S. Provisional Application No. 63 / 173,949, filed on April 12, 2021. When the motion information of the GPM motion partition is inferred from the translational motion model GPM merge candidate list and template matching is assumed to be enabled, normal template matching and affine-based template matching (described in U.S. Provisional Application No. 63 / 173,861, filed on April 12, 2021, and U.S. Provisional Application No. 63 / 173,949, filed on April 12, 2021) are separately applied to the initial motion information of the GPM partition. The refinement result of the one with the lowest template matching cost is used to replace the initial motion information of the GPM partition.
[0168] In some examples, similar to the above example, any motion candidate in the affine-based GPM merge candidate list may be converted to be represented by using a translation model when all of its CPMVs are identical to each other. When the motion information of the GPM motion partition is inferred from the affine-based GPM merge candidate list and template matching is assumed to be enabled, normal template matching and affine-based template matching (described in U.S. Provisional Application No. 63 / 173,861, filed April 12, 2021, and U.S. Provisional Application No. 63 / 173,949, filed April 12, 2021) are applied separately to the initial motion information of the GPM partition. The refinement result of the one with the lowest template matching cost is used to replace the initial motion information of the GPM partition.
[0169] 2 is a block diagram illustrating an example video encoder 200 that may implement the techniques of this disclosure. FIG. 2 is provided for purposes of illustration and should not be considered a limitation of the techniques as broadly illustrated and described in this disclosure. For purposes of illustration, this disclosure describes 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 implemented by video encoding devices configured according to other video coding standards and video coding formats, such as AV1 and successors to the AV1 video coding format.
[0170] 2, the video encoder 200 includes a video data memory 230, a mode selection unit 202, a residual generation unit 204, a transform processing unit 206, a quantization unit 208, an inverse quantization unit 210, an inverse transform processing unit 212, a reconstruction unit 214, a filter unit 216, a decoded picture buffer (DPB) 218, and an entropy coding unit 220. Any or all of the video data memory 230, the mode selection unit 202, the residual generation unit 204, the transform processing unit 206, the quantization unit 208, an inverse quantization unit 210, an inverse transform processing unit 212, a reconstruction unit 214, a filter unit 216, a DPB 218, and an entropy coding unit 220 may be implemented in one or more processors or in processing circuitry. 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 circuitry or as part of a processor, an ASIC, or an FPGA. Moreover, video encoder 200 may include additional or alternative processors or processing circuitry for performing these and other functions.
[0171] The video data memory 230 may store video data to be encoded by the components of the video encoder 200. The video encoder 200 may receive video data stored in the video data memory 230, for example, from the video source 104 (FIG. 1). The DPB 218 may act as a reference picture memory, storing reference video data for use in predicting subsequent video data by the video encoder 200. The video data memory 230 and the DPB 218 may be formed by any of a variety of memory devices, such as dynamic random access memory (DRAM), including synchronous DRAM (SDRAM), magnetoresistive RAM (MRAM), resistive RAM (RRAM), or other types of memory devices. The video data memory 230 and the DPB 218 may be provided by the same memory device or separate memory devices. In various examples, the video data memory 230 may be on-chip with other components of the video encoder 200, as shown, or may be off-chip relative to those components.
[0172] In this disclosure, references to video data memory 230 should not be construed as limited to memory internal to video encoder 200, unless specifically described as such, or to memory external to video encoder 200, unless specifically described as such. Rather, references to video data memory 230 should be understood as a reference memory that stores video data that video encoder 200 receives for encoding (e.g., video data for a current block to be encoded). Memory 106 of FIG. 1 may also provide temporary storage of outputs from various units of video encoder 200.
[0173] The various units in FIG. 2 are shown to aid in understanding the operations performed by the video encoder 200. The units may be implemented as fixed-function circuits, programmable circuits, or a combination thereof. A fixed-function circuit refers to a circuit that provides a specific functionality, and the operations that may be performed are pre-defined. A programmable circuit refers to a circuit that may be programmed to perform various tasks, and provides flexible functionality in the operations that may be performed. For example, a programmable circuit may execute software or firmware that causes the programmable circuit to operate in a manner defined by the software or firmware instructions. Although a fixed-function circuit may execute software instructions (e.g., to receive parameters or output parameters), the type of operations that the fixed-function circuit performs is generally invariant. In some examples, one or more of the units may be different circuit blocks (fixed function or programmable), and in some examples, one or more of the units may be an integrated circuit.
[0174] The video encoder 200 may include an arithmetic logic unit (ALU), an elementary function unit (EFU), digital circuits, analog circuits, and / or a programmable core formed from programmable circuits. In examples in which the operations of the video encoder 200 are implemented using software executed by programmable circuits, the memory 106 (FIG. 1) may store instructions (e.g., object code) of the software that the video encoder 200 receives and executes, or another memory (not shown) within the video encoder 200 may store such instructions.
[0175] The video data memory 230 is configured to store the received video data. The video encoder 200 may retrieve pictures of the video data from the video data memory 230 and provide the video data to the residual generation unit 204 and the mode selection unit 202. The video data in the video data memory 230 may be raw video data to be encoded.
[0176] The mode selection unit 202 includes a motion estimation unit 222, a motion compensation unit 224, and an intra prediction unit 226. The mode selection unit 202 may include additional functional units for performing video prediction according to other prediction modes. By way of example, the mode selection unit 202 may include a palette unit, an intra block copy unit (which may be part of the motion estimation unit 222 and / or the motion compensation unit 224), an affine unit, a linear model (LM) unit, etc.
[0177] The mode selection unit 202 typically coordinates multiple encoding passes to test combinations of encoding parameters and the resulting rate-distortion values for such combinations. The encoding parameters may include partitioning of the CTU into CUs, prediction modes for the CUs, transform types for the residual data of the CUs, quantization parameters for the residual data of the CUs, etc. The mode selection unit 202 may ultimately select a combination of encoding parameters that has a better rate-distortion value than the other tested combinations.
[0178] Video encoder 200 may partition a picture retrieved from video data memory 230 into a series of CTUs and may encapsulate one or more CTUs within a slice. Mode selection unit 202 may partition the CTUs of a picture according to a tree structure, such as the MTT structure, QTBT structure, superblock structure, or quadtree structure described above. As described above, video encoder 200 may form one or more CUs from partitioning the CTUs according to the tree structure. Such a CU may also be generally referred to as a "video block" or "block."
[0179] 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 a current block (e.g., the current CU, or in HEVC, the overlapping portion of the PU and TU). In the case of inter prediction of the current block, the motion estimation unit 222 may perform a motion search to determine one or more closely matching reference blocks in one or more reference pictures (e.g., one or more previously coded pictures stored in the DPB 218). Specifically, the motion estimation unit 222 may calculate a value representing how similar a potential reference block is to the current block according to, for example, a sum of absolute differences (SAD), a sum of squared differences (SSD), a mean absolute difference (MAD), a mean squared difference (MSD), etc. The motion estimation unit 222 may generally perform these calculations using a sample-by-sample difference between the current block and the reference block under consideration. Motion estimation unit 222 may determine the reference block having the lowest value resulting from these calculations, which indicates the reference block that most closely matches the current block.
[0180] The motion estimation unit 222 may form one or more motion vectors (MVs) that define the position of a reference block in a reference picture relative to the position of a current block in a current picture. The motion estimation unit 222 may then provide the motion vectors to the motion compensation unit 224. For example, in the case of unidirectional inter prediction, the motion estimation unit 222 may provide a single motion vector, while in the case of bidirectional inter prediction, the motion estimation unit 222 may provide two motion vectors. The motion compensation unit 224 may then generate a predictive block using the motion vectors. For example, the motion compensation unit 224 may retrieve data of the reference block using the motion vectors. As another example, in the case of a motion vector having fractional sample accuracy, the motion compensation unit 224 may interpolate values for the predictive block according to one or more interpolation filters. Furthermore, in the case of bidirectional inter prediction, the motion compensation unit 224 may retrieve data for the two reference blocks identified by the respective motion vectors and combine the retrieved data, for example, by sample-wise averaging or weighted averaging.
[0181] 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 video data (e.g., both luma and chroma coding blocks) using translational motion compensation, affine motion compensation, overlapped block motion compensation (OBMC), and / or mixed inter-intra prediction.
[0182] As another example, for intra prediction or intra predictive coding, the intra prediction unit 226 may generate a predictive block from samples neighboring the current block. For example, for a directional mode, the intra prediction unit 226 may generally mathematically combine values of neighboring samples and project these calculated values in a defined direction across the current block to generate a predictive block. As another example, for a DC mode, the intra prediction unit 226 may calculate an average of neighboring samples for the current block and generate a predictive block to include the resulting average for each sample of the predictive block.
[0183] 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 and chroma coding blocks) using directional intra prediction, omnidirectional intra prediction, recursive filter intra prediction, chroma from luma (CFL) prediction, intra block copy (IBC), and / or color palette modes. The mode selection unit 202 may include additional functional units for performing video prediction according to other prediction modes.
[0184] The mode selection unit 202 provides the prediction block to the residual generation unit 204. The residual generation unit 204 receives a raw, uncoded version of the current block from the video data memory 230 and receives the prediction block from the mode selection unit 202. The residual generation unit 204 calculates sample-by-sample differences between the current block and the prediction block. The resulting sample-by-sample differences define a residual block for the current block. In some examples, the residual generation unit 204 may also determine differences between sample values in the residual block to generate the residual block using residual differential pulse code modulation (RDPCM). In some examples, the residual generation unit 204 may be formed using one or more subtractor circuits that perform binary subtraction.
[0185] In an example where the mode selection unit 202 partitions a CU into PUs, each PU may be associated with a luma prediction unit and a corresponding chroma prediction unit. The video encoder 200 and the video decoder 300 may support PUs having various sizes. As indicated above, the size of a CU may refer to the size of the luma coding block of the CU, and the size of a PU may refer to the size of the luma prediction unit of the PU. Assuming that the size of a particular CU is 2N×2N, the video encoder 200 may support a PU size of 2N×2N or N×N for intra prediction, and a symmetric PU size of 2N×2N, 2N×N, N×2N, N×N, or similar for inter prediction. The video encoder 200 and the video decoder 300 may also support asymmetric partitioning for PU sizes of 2N×nU, 2N×nD, nL×2N, and nR×2N for inter prediction.
[0186] In examples where the mode selection unit 202 does not further partition the CUs into PUs, each PU may be associated with a luma coding block and a corresponding chroma coding block. As above, the size of a CU may refer to the size of the luma coding block of the CU. The video encoder 200 and the video decoder 300 may support CU sizes of 2N×2N, 2N×N, or N×2N.
[0187] For other video coding techniques, such as intra block copy mode coding, affine mode coding, and linear model (LM) mode coding, as some examples, the mode selection unit 202 generates a predictive block for the current block being coded via a respective unit associated with the coding technique. In some examples, such as palette mode coding, the mode selection unit 202 may not generate a predictive block, but instead generate syntax elements that indicate how to reconstruct the block based on a selected palette. In such modes, the mode selection unit 202 may provide these syntax elements to be coded to the entropy coding unit 220.
[0188] As described above, the residual generation unit 204 receives video data for a current block and a corresponding predictive block. The residual generation unit 204 then generates a residual block for the current block. To generate the residual block, the residual generation unit 204 calculates sample-by-sample differences between the predictive block and the current block.
[0189] Transform processing unit 206 applies one or more transforms to the residual block to generate a block of transform coefficients (referred to herein as a "transform coefficient block"). Transform processing unit 206 may apply various transforms to the residual block to form the transform coefficient block. For example, transform processing unit 206 may apply a discrete cosine transform (DCT), a directional transform, a Karhunen-Loeve transform (KLT), or a conceptually similar transform to the residual block. In some examples, transform processing unit 206 may perform multiple transforms, e.g., a linear transform and a secondary transform, such as a rotation transform, on the residual block. In some examples, transform processing unit 206 does not apply a transform to the residual block.
[0190] When operating according to AV1, 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"). Transform processing unit 206 may apply various transforms to the residual block to form the transform coefficient block. For example, transform processing unit 206 may apply a horizontal / vertical transform combination that may include a discrete cosine transform (DCT), an asymmetric discrete sine transform (ADST), an inverse ADST (e.g., ADST in reverse order), and an identity transform (IDTX). When using an identity transform, the transform is skipped in one of the vertical or horizontal directions. In some examples, the transform process may be skipped.
[0191] The quantization unit 208 may quantize the transform coefficients in the transform coefficient block to generate a quantized transform coefficient block. The quantization unit 208 may quantize the transform coefficients of the transform coefficient block according to a quantization parameter (QP) value associated with the current block. The video encoder 200 (e.g., via the mode selection unit 202) may adjust the degree of quantization applied to the transform coefficient block associated with the current block by adjusting the QP value associated with the CU. Quantization may result in loss of information, and thus the quantized transform coefficients may have less precision than the original transform coefficients generated by transform processing unit 206.
[0192] The inverse quantization unit 210 and the inverse transform processing unit 212 may apply inverse quantization and inverse transform to the quantized transform coefficient block, respectively, to reconstruct a residual block from the transform coefficient block. The reconstruction unit 214 may generate a reconstructed block that corresponds to the current block (possibly with some distortion) based on the reconstructed residual block and the predictive block generated by the mode selection unit 202. For example, the reconstruction unit 214 may add samples of the reconstructed residual block to corresponding samples from the predictive block generated by the mode selection unit 202 to generate the reconstructed block.
[0193] Filter unit 216 may perform one or more filter operations on the reconstructed block. For example, filter unit 216 may perform a deblocking operation to reduce blockiness artifacts along the edges of a CU. In some examples, the operations of filter unit 216 may be skipped.
[0194] When operating according to AV1, filter unit 216 may perform one or more filter operations on the reconstructed blocks. For example, filter unit 216 may perform a deblocking operation to reduce blockiness artifacts along the edges of a CU. In another example, filter unit 216 may apply a constrained directional enhancement filter (CDEF), which may be applied after deblocking and may include application of a non-separable, nonlinear, low-pass directional filter based on the estimated edge direction. Filter unit 216 may also include a loop restoration filter applied after CDEF, which may include a separable symmetric normalized Wiener filter or a dual autoinduction filter.
[0195] The video encoder 200 stores the reconstructed blocks in the DPB 218. For example, in examples where the operations of the filter unit 216 are not performed, the reconstruction unit 214 may store the reconstructed blocks in the DPB 218. In examples where the operations of the filter unit 216 are 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 reference pictures formed from the reconstructed (and possibly filtered) blocks from the DPB 218 to inter predict blocks of a later-encoded picture. In addition, the intra prediction unit 226 may use the reconstructed blocks in the DPB 218 of the current picture to intra predict other blocks in the current picture.
[0196] In general, the entropy encoding unit 220 may entropy encode syntax elements received from other functional components of the video encoder 200. For example, the entropy encoding unit 220 may entropy encode quantized transform coefficient blocks from the quantization unit 208. As another example, the entropy encoding unit 220 may entropy encode predictive syntax elements (e.g., motion information for inter prediction or intra mode information for intra prediction) from the mode selection unit 202. The entropy encoding unit 220 may perform one or more entropy encoding operations on syntax elements, which are another example of video data, to generate entropy encoded data. For example, the entropy encoding unit 220 may perform a context-adaptive variable length coding (CAVLC) operation, a CABAC operation, a variable-to-variable (V2V) length coding operation, a syntax-based context-adaptive binary arithmetic coding (SBAC) operation, a probability interval partitioned entropy (PIPE) coding operation, an exponential-Golomb coding operation, or another type of entropy coding operation on the data. In some examples, the entropy encoding unit 220 may operate in a bypass mode in which syntax elements are not entropy coded.
[0197] The video encoder 200 may output a bitstream that includes entropy coding syntax elements needed to reconstruct blocks of a slice or picture. In particular, the entropy coding unit 220 may output the bitstream.
[0198] According to AV1, the entropy coding unit 220 may be configured as a symbol-to-symbol adaptive multi-symbol arithmetic coder. A syntax element in AV1 includes an alphabet of N elements, and a context (e.g., a probability model) includes a set of N probabilities. The entropy coding unit 220 may store the probabilities as n-bit (e.g., 15-bit) cumulative distribution functions (CDFs). The entropy coding unit 220 may perform recursive scaling with an update factor based on the alphabet size to update the context.
[0199] The operations described above are described with respect to blocks. Such descriptions should be understood as being operations for luma coding blocks and / or chroma coding blocks. As described above, in some examples, the luma coding blocks and chroma coding blocks are luma and chroma components of a CU. In some examples, the luma coding blocks and chroma coding blocks are luma and chroma components of a PU.
[0200] 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 for determining motion vectors (MVs) and reference pictures for luma coding blocks do not need to be repeated to determine MVs and reference pictures for chroma blocks. Rather, MVs for luma coding blocks may be scaled to determine MVs for chroma blocks, and the reference pictures may be the same. As another example, the intra prediction process may be the same for luma coding blocks and chroma coding blocks.
[0201] Video encoder 200 represents an example of a device configured to encode video data, including a memory configured to store video data and one or more processing units implemented in a circuit configuration, the one or more processing units configured to code one or more syntax elements indicating that template matching improvement is enabled for a block that is inter predicted in at least one of a combined inter / intra prediction (CIIP), geometric partition mode (GPM), or multiple hypothesis prediction (MHP) inter prediction mode, and to code the block using the template matching improvement. For example, to code the one or more syntax elements, video encoder 200 may be configured to encode and signal the one or more syntax elements. To code the block, video encoder 200 may encode the block.
[0202] As an example, video encoder 200 may determine that a current block should be inter-predicted in a composite inter-intra prediction (CIIP) mode or a geometric partitioning mode (GPM). For example, mode selection unit 202 may determine cost functions for different prediction modes and determine that a cost function associated with a CIIP mode or GPM for the current block is lowest. Video encoder 200 may also determine that template matching should be enabled for the current block. For example, mode selection unit 202 may determine cost functions for encoding the current block with and without enabling template matching and determine that a cost function for inter-predicting the current block in a CIIP mode or GPM with enabling template matching is lowest.
[0203] Video encoder 200 may generate a motion vector for the current block based on template matching. For example, video encoder 200 may build a merge candidate list. Video encoder 200 may determine an initial motion vector based on motion vector information in the merge candidate list. Video encoder 200 may generate the motion vector by applying template matching based on the initial motion vector to generate the motion vector. Video encoder 200 may also signal information indicating an index into the merge candidate list that identifies the motion vector information.
[0204] Video encoder 200 may determine a predictive block for a current block based on a motion vector according to a CIIP mode or GPM. For example, for a CIIP mode, video encoder 200 may generate a predictive block based on an intra predictor and an inter predictor (e.g., combine an intra predictor and an inter predictor). For a GPM, video encoder 200 may generate a first prediction partition for a first partition of the current block based on a first motion vector generated based on template matching, and generate a second prediction partition for a second partition of the current block based on a second motion vector generated based on template matching. Video encoder 200 may combine the first prediction partition and the second prediction partition to determine a predictive block.
[0205] Video encoder 200 may signal information indicating the residual between the predictive block and the current block. For example, video encoder 200 may determine residual values (e.g., differences) on a sample-by-sample basis for samples in the predictive block and the current block. Video encoder 200 may transform and quantize the residual values and signal the resulting information.
[0206] 3 is a block diagram illustrating an example video decoder 300 that can implement the techniques of this disclosure. FIG. 3 is provided for purposes of illustration and not to limit the techniques as broadly illustrated and described in this disclosure. For purposes of illustration, this disclosure describes a video decoder 300 according to VVC (ITU-T H.266 under development) and HEVC (ITU-T H.265) techniques. However, the techniques of this disclosure may be implemented by video coding devices configured according to other video coding standards.
[0207] In the example of FIG. 3, the video decoder 300 includes a coded picture buffer (CPB) memory 320, an entropy decoding unit 302, a prediction processing unit 304, an inverse quantization unit 306, an inverse transform processing unit 308, a reconstruction unit 310, a filter unit 312, and a decoded picture buffer (DPB) 314. Any or all of the CPB memory 320, the entropy decoding unit 302, the prediction processing unit 304, the inverse quantization unit 306, the inverse transform processing unit 308, the reconstruction unit 310, the filter unit 312, and the DPB 314 may be implemented in one or more processors or processing circuitry. For example, the units of the video decoder 300 may be implemented as one or more circuits or logic elements as part of hardware circuitry, or as part of a processor, ASIC, or FPGA. Additionally, the video decoder 300 may include additional or alternative processors or processing circuitry for performing these and other functions.
[0208] The prediction processing unit 304 includes a motion compensation unit 316 and an intra prediction unit 318. The prediction processing unit 304 may include additional units for performing prediction according to other prediction modes. By way of example, the prediction processing unit 304 may include a palette unit, an intra block copy unit (which may form part of the motion compensation unit 316), an affine unit, a linear model (LM) unit, etc. In other examples, the video decoder 300 may include more, fewer, or different functional components.
[0209] When operating according to AV1, the motion compensation unit 316 may be configured to decode coding blocks of video data (e.g., both luma and chroma coding blocks) using translational motion compensation, affine motion compensation, OBMC, and / or mixed inter-intra prediction, as described above. The intra prediction unit 318 may be configured to decode coding blocks of video data (e.g., both luma and chroma coding blocks) using directional intra prediction, omnidirectional intra prediction, recursive filter intra prediction, CFL, intra block copy (IBC), and / or color palette mode, as described above.
[0210] The CPB memory 320 may store video data, such as an encoded video bitstream, to be decoded by components of the video decoder 300. The video data stored in the CPB memory 320 may be obtained, for example, from the computer-readable medium 110 (FIG. 1). The CPB memory 320 may include a CPB that stores encoded video data (e.g., syntax elements) from the encoded video bitstream. The CPB memory 320 may also store video data other than syntax elements of a coded picture, such as temporary data representing output from various units of the video decoder 300. The DPB 314 generally stores decoded pictures that the video decoder 300 may output and / or use as reference video data when decoding subsequent data or pictures of the encoded video bitstream. The CPB memory 320 and the DPB 314 may be formed by any of a variety of memory devices, such as DRAM, including SDRAM, MRAM, RRAM, or other types of memory devices. The CPB memory 320 and the DPB 314 may be provided by the same memory device or separate memory devices. In various examples, the CPB memory 320 may be on-chip with other components of the video decoder 300, or may be off-chip relative to those components.
[0211] Additionally or alternatively, in some examples, video decoder 300 may retrieve coded video data from memory 120 (FIG. 1). That is, memory 120 may store data as described above using CPB memory 320. Similarly, memory 120 may store instructions to be executed by video decoder 300 when some or all of the functionality of video decoder 300 is implemented in software to be executed by processing circuitry of video decoder 300.
[0212] The various units shown in FIG. 3 are illustrated to aid in understanding the operations performed by the video decoder 300. The units may be implemented as fixed-function circuits, programmable circuits, or a combination thereof. As with FIG. 2, fixed-function circuits refer to circuits that provide specific functionality, and the operations that may be performed are pre-defined. Programmable circuits refer to circuits that may be programmed to perform various tasks, and provide flexible functionality in the operations that may be performed. For example, a programmable circuit may execute software or firmware that causes the programmable circuit to operate in a manner defined by the software or firmware instructions. Although a fixed-function circuit may execute software instructions (e.g., to receive parameters or output parameters), the types of operations that the fixed-function circuit performs are generally unchanged. 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.
[0213] The video decoder 300 may include a programmable core formed from ALUs, EFUs, digital circuits, analog circuits, and / or programmable circuits. In examples in which the operations of the video decoder 300 are performed by software executing on programmable circuits, on-chip or off-chip memory may store instructions (e.g., object code) of the software that the video decoder 300 receives and executes.
[0214] The entropy decoding unit 302 may receive the encoded video data from the CPB and entropy decode the video data to recover the syntax elements. The prediction processing unit 304, the inverse quantization unit 306, the inverse transform processing unit 308, the reconstruction unit 310, and the filter unit 312 may generate decoded video data based on the syntax elements extracted from the bitstream.
[0215] In general, the video decoder 300 reconstructs a picture on a block-by-block basis. The video decoder 300 may perform a reconstruction operation on each block individually (wherein the block currently being reconstructed, i.e., decoded, may be referred to as the “current block”).
[0216] The entropy decoding unit 302 may entropy decode syntax elements that specify the quantized transform coefficients of the quantized transform coefficient block as well as transform information, such as a quantization parameter (QP) and / or a transform mode indication. The inverse quantization unit 306 may use the QP associated with the quantized transform coefficient block to determine the degree of quantization and, similarly, the degree of inverse quantization that the inverse quantization unit 306 should apply. The inverse quantization unit 306 may, for example, perform a bitwise left shift operation to inverse quantize the quantized transform coefficients. The inverse quantization unit 306 may thereby form a transform coefficient block including the transform coefficients.
[0217] After the inverse quantization unit 306 forms the transform coefficient block, the inverse transform processing unit 308 may apply one or more inverse transforms to the transform coefficient block to generate a residual block associated with the current block. For example, the inverse transform processing unit 308 may apply an inverse DCT, an inverse integer transform, an inverse Karhunen-Loeve transform (KLT), an inverse rotational transform, an inverse transform, or another inverse transform to the transform coefficient block.
[0218] Further, prediction processing unit 304 generates a prediction block according to the prediction information syntax element entropy decoded by entropy decoding unit 302. For example, if the prediction information syntax element indicates that the current block is inter-predicted, motion compensation unit 316 may generate a prediction block. In this case, the prediction information syntax element may indicate a reference picture in DPB 314 from which to retrieve a reference block, as well as a motion vector that identifies the location of the reference block in the reference picture relative to the location of the current block in the current picture. Motion compensation unit 316 may generally perform an inter-prediction process in a manner substantially similar to that described with respect to motion compensation unit 224 (FIG. 2).
[0219] As another example, if the prediction information syntax element indicates that the current block is intra predicted, the intra prediction unit 318 may generate a predictive block according to the intra prediction mode indicated by the prediction information syntax element. Again, the intra prediction unit 318 may generally perform an intra prediction process in a manner substantially similar to that described with respect to the intra prediction unit 226 (FIG. 2). The intra prediction unit 318 may retrieve data of neighboring samples for the current block from the DPB 314.
[0220] The reconstruction unit 310 may reconstruct the current block using the predictive block and the residual block. For example, the reconstruction unit 310 may add samples of the residual block to corresponding samples of the predictive block to reconstruct the current block.
[0221] Filter unit 312 may perform one or more filter operations on the reconstructed block. For example, filter unit 312 may perform a deblocking operation to reduce blockiness artifacts along the edges of the reconstructed block. The operations of filter unit 312 are not necessarily performed in all instances.
[0222] The video decoder 300 may store the reconstructed blocks in the DPB 314. For example, in examples where the operations of the filter unit 312 are not performed, the reconstruction unit 310 may store the reconstructed blocks in the DPB 314. In examples where the operations of the filter unit 312 are performed, the filter unit 312 may store the filtered reconstructed blocks in the DPB 314. As described above, the DPB 314 may provide reference information to the prediction processing unit 304, such as samples of the current picture for intra prediction and previously decoded pictures for subsequent motion compensation. Moreover, the video decoder 300 may output decoded pictures (e.g., decoded video) from the DPB 314 for later presentation on a display device, such as the display device 118 of FIG. 1.
[0223] Thus, the video decoder 300 represents an example of a video decoding device that includes a memory configured to store video data and one or more processing units implemented in circuitry, where the one or more processing units are configured to code one or more syntax elements indicating that template matching improvement is enabled for a block that is inter predicted in at least one of a combined inter / intra prediction (CIIP), geometric partition mode (GPM), or multiple hypothesis prediction (MHP) inter prediction mode, and to code the block using the template matching improvement. For example, to code the one or more syntax elements, the video decoder 300 may be configured to parse and decode the one or more syntax elements. To code the block, the video decoder 300 may decode the block.
[0224] For example, video decoder 300 may determine that the current block is inter-predicted in a composite inter-intra prediction (CIIP) mode or a geometric partition mode (GPM). For example, video decoder 300 may receive a syntax element indicating whether the current block is inter-predicted in a CIIP mode or may receive a syntax element indicating whether the current block is inter-predicted in a GPM.
[0225] According to one or more examples described in this disclosure, the video decoder 300 may determine that template matching is enabled for a current block. For example, the video decoder 300 may receive a CU-level syntax element indicating that template matching is enabled for a current block. That is, template matching is enabled for a current block that is inter predicted in CIIP mode or GPM.
[0226] The video decoder 300 may generate a motion vector for the current block based on template matching. For example, the video decoder 300 may build a merge candidate list and receive information indicating an index into the merge candidate list. The video decoder 300 may determine an initial motion vector based on the index into the merge candidate list. In such an example, to generate the motion vector, the video decoder 300 may apply template matching based on the initial motion vector to generate the motion vector.
[0227] As an example, for CIIP mode, to generate a motion vector for the current block based on template matching, video decoder 300 may determine an initial motion vector for the current block based on the motion information in the merge candidate list, determine a search area in the reference picture based on the initial motion vector, and determine a reference template in the search area that substantially matches a current template in the current picture that includes the current block. Video decoder 300 may determine the motion vector for the current block based on the determined reference template.
[0228] For GPM, to generate a motion vector for the current block based on template matching, video decoder 300 may determine a first initial motion vector for the first partition based on first motion information in the merge candidate list, determine a first search area in the first reference picture based on the first initial motion vector, determine a first reference template in the first search area that substantially matches a first current template of the first partition (e.g., a difference in sample values in the template is less than a threshold), and determine a first motion vector for the first partition based on the determined first reference template. Video decoder 300 may also determine a second initial motion vector for the second partition based on second motion information in the merge candidate list, determine a second search area in the second reference picture based on the second initial motion vector, determine a second reference template in the second search area that substantially matches a second current template of the second partition, and determine a second motion vector for the second partition based on the determined second reference template.
[0229] The video decoder 300 may determine a prediction block for a current block based on a motion vector according to a CIIP mode or a GPM. For example, in the case of a CIIP mode, the video decoder 300 may determine an inter predictor based on a generated motion vector, determine an intra predictor based on samples neighboring the current block, and combine the inter predictor and the intra predictor to determine a prediction block. In the case of a GPM, the video decoder 300 may determine a first prediction partition based on a first motion vector, determine a second prediction partition based on a second motion vector, and combine the first prediction partition and the second prediction partition to determine a prediction block.
[0230] In one or more examples, the video decoder 300 may reconstruct the current block based on the predictive block. For example, the video decoder 300 may receive information indicating a residual between the current block and the predictive block, and may combine the residual and the predictive block to reconstruct the current block.
[0231] 4 is a flowchart illustrating an example method for encoding a current block according to the techniques of this disclosure. The current block may include a current CU. Although described with respect to video encoder 200 (FIGS. 1 and 2), it should be understood that other devices may be configured to perform a method similar to that of FIG.
[0232] In this example, video encoder 200 first predicts a current block (350). For example, video encoder 200 may form a predictive block for the current block. According to one or more examples described in this disclosure, video encoder 200 may form a predictive block for the current block using template matching techniques, such as when the current block is inter-predicted in CIIP mode or GPM.
[0233] Video encoder 200 may then calculate a residual block for the current block (352). To calculate the residual block, video encoder 200 may calculate a difference between the original uncoded block and a predictive block for the current block. Video encoder 200 may then transform the residual block and quantize the transform coefficients of the residual block (354). Video encoder 200 may then scan the quantized transform coefficients of the residual block (356). During or following the scan, video encoder 200 may entropy code the transform coefficients (358). For example, video encoder 200 may code the transform coefficients using CAVLC or CABAC. Video encoder 200 may then output entropy coded data for the block (360).
[0234] 5 is a flowchart illustrating an example method for decoding a current block of video data in accordance with the techniques of this disclosure. The current block may include a current CU. Although described with respect to video decoder 300 (FIGS. 1 and 3), it should be understood that other devices may be configured to perform a method similar to that of FIG.
[0235] The video decoder 300 may receive entropy coded data for the current block, such as entropy coded prediction information and entropy coded data of transform coefficients of a residual block corresponding to the current block (370). The video decoder 300 may entropy decode the entropy coded data to determine prediction information for the current block and to reconstruct the transform coefficients of the residual block (372). The video decoder 300 may predict the current block, e.g., using an intra prediction mode or an inter prediction mode as indicated by the prediction information for the current block, to calculate a predictive block for the current block (374). For example, according to one or more examples described in this disclosure, the video decoder 300 may calculate a predictive block for the current block using template matching techniques, such as when the current block is inter predicted in CIIP mode or GPM.
[0236] The video decoder 300 may then inverse scan the reconstructed transform coefficients to create a block of quantized transform coefficients (376). The video decoder 300 may then dequantize the transform coefficients and apply an inverse transform to the transform coefficients to generate a residual block (378). The video decoder 300 may finally decode the current block by combining the predictive block and the residual block (380).
[0237] 11 is a flow chart illustrating an example of encoding video data. The example of FIG. 11 is described in terms of processing circuitry, which includes a video encoder 200.
[0238] The processing circuitry may be configured to determine (1100) that a current block should be inter-predicted in a combined inter-intra prediction (CIIP) mode or a geometric partitioning mode (GPM). For example, the mode selection unit 202 may determine cost functions for different prediction modes and determine that a cost function associated with a CIIP mode or GPM for the current block is lowest. The processing circuitry may also determine (1102) that template matching should be enabled for the current block. For example, the mode selection unit 202 may determine cost functions for encoding the current block with and without template matching enabled and determine that a cost function for inter-predicting the current block in a CIIP mode or GPM with template matching enabled is lowest.
[0239] The processing circuitry may generate a motion vector for the current block based on the template matching (1104). For example, the processing circuitry may build a merge candidate list. The processing circuitry may determine an initial motion vector based on the motion vector information in the merge candidate list. The processing circuitry may generate the motion vector by applying template matching based on the initial motion vector to generate the motion vector. The processing circuitry may also signal information indicating an index into the merge candidate list that identifies the motion vector information.
[0240] In one or more examples, the processing circuitry may be configured to determine (1106) a predictive block for the current block based on the motion vector according to a CIIP mode or a GPM. For example, for a CIIP mode, the processing circuitry may generate a predictive block based on an intra predictor and an inter predictor (e.g., combine the intra predictor and the inter predictor). For a GPM, the processing circuitry may generate a first prediction partition for a first partition of the current block based on a first motion vector generated based on template matching, and generate a second prediction partition for a second partition of the current block based on a second motion vector generated based on template matching. The processing circuitry may combine the first prediction partition and the second prediction partition to determine a predictive block.
[0241] The processing circuitry may signal information indicative of a residual between the predictive block and the current block (1108). For example, the processing circuitry may determine residual values (e.g., differences) on a sample-by-sample basis for samples in the predictive block and the current block. The processing circuitry may transform and quantize the residual values and signal the resulting information.
[0242] 12 is a flow chart illustrating an example of decoding video data. The example of FIG. 12 is described in terms of processing circuitry, which includes a video decoder 300.
[0243] The processing circuitry may be configured to determine (1200) that a current block is inter predicted in a combined inter-intra prediction (CIIP) mode or a geometric partitioning mode (GPM). For example, the processing circuitry may receive a syntax element indicating that the current block is inter predicted in a CIIP mode or a GPM. The processing circuitry may also determine that template matching is enabled for the current block (1202). For example, the processing circuitry may receive a coding unit (CU) level syntax element indicating that template matching is enabled for the current block.
[0244] The processing circuitry may generate a motion vector for the current block based on the template matching (1204). For example, the processing circuitry may construct a merge candidate list. The processing circuitry may receive information indicating an index into the merge candidate list and determine an initial motion vector based on the index into the merge candidate list. To generate the motion vector, the processing circuitry may apply template matching based on the initial motion vector to generate the motion vector.
[0245] In one or more examples, the processing circuitry may be configured to determine (1206) a predictive block for a current block based on a motion vector according to a CIIP mode or a GPM. For example, for a CIIP mode, the processing circuitry may generate a predictive block based on an intra predictor and an inter predictor (e.g., combine the intra predictor and the inter predictor). The inter predictor may have been generated using template matching. For a GPM, the processing circuitry may generate a first prediction partition for a first partition of the current block based on a first motion vector generated based on template matching, and generate a second prediction partition for a second partition of the current block based on a second motion vector generated based on template matching. The processing circuitry may combine the first prediction partition and the second prediction partition to determine a predictive block.
[0246] The processing circuitry may reconstruct the current block based on the predicted block (1208). For example, the processing circuitry may receive information indicating a residual between the current block and the predicted block and combine the residual and the predicted block to reconstruct the current block.
[0247] Below are described example techniques that may be used separately or in any combination. The techniques of this disclosure should not be construed as limited to the following clauses.
[0248] Clause 1. A method of coding video data, comprising: coding one or more syntax elements indicating that template matching improvement is enabled for a block that is inter predicted in at least one of a combined inter / intra prediction (CIIP), geometric partition mode (GPM), or multiple hypothesis prediction (MHP) inter prediction mode; and coding the block using the template matching improvement.
[0249] Clause 2. The method of clause 1, wherein coding one or more syntax elements comprises parsing and decoding one or more syntax elements, and coding the block comprises decoding the block.
[0250] Clause 3. The method of clause 1, wherein coding one or more syntax elements comprises encoding and signaling one or more syntax elements, and coding the block comprises encoding the block.
[0251] Clause 4. The method of any of clauses 1 to 3, wherein one or more syntax elements include a flag indicating that template matching improvement is enabled.
[0252] Clause 5. The method of any of clauses 1-3, wherein the one or more syntax elements include one or a combination of a first set of flags indicating that template matching improvement is enabled for an inter mode, a second set of flags indicating that template matching improvement is enabled for a picture or slice that includes the block, and at least a third flag indicating that template matching improvement is enabled for the block.
[0253] Clause 6. The method of any one of clauses 1 to 5, wherein the step of coding the one or more syntax elements comprises the step of context-based coding the one or more syntax elements.
[0254] Clause 7. The method of any of clauses 1-5, wherein the block comprises a first block, and the one or more syntax elements comprise a first set of one or more syntax elements, and the method further comprises coding a second set of one or more syntax elements indicating that template matching improvement is enabled for a second block that is inter predicted in at least one of CIIP, GPM, or HMP inter prediction modes, wherein the first block is inter predicted in at least one of CIIP, GPM, or HMP inter prediction modes and the second block is inter predicted in at least another one of CIIP, GPM, or HMP inter prediction modes, and wherein coding the one or more syntax elements comprises context based coding the first set of one or more syntax elements, and coding the second set of one or more syntax elements comprises context based coding the second set of one or more syntax elements, and a context for coding at least one of the first set of one or more syntax elements is the same as a context for coding at least one of the second set of one or more syntax elements.
[0255] Clause 8. The method of any of clauses 1-5, wherein the block comprises a first block, and the one or more syntax elements comprise a first set of one or more syntax elements, and the method further comprises coding a second set of one or more syntax elements indicating that template matching improvement is enabled for a second block that is inter predicted in at least one of CIIP, GPM, or HMP inter prediction modes, wherein the first block is inter predicted in at least one of CIIP, GPM, or HMP inter prediction modes and the second block is inter predicted in at least another one of CIIP, GPM, or HMP inter prediction modes, and wherein coding the one or more syntax elements comprises context based coding the first set of one or more syntax elements, and coding the second set of one or more syntax elements comprises context based coding the second set of one or more syntax elements, and a context for coding at least one of the first set of one or more syntax elements is different from a context for coding at least one of the second set of one or more syntax elements.
[0256] Clause 9. The method of any of clauses 1-8, wherein the blocks include a first block, and the method further includes the steps of context-based coding one or more parameters associated with an inter-prediction mode in which the first block is inter-predicted, and coding the second block in at least one of CIIP, GPM, or MHP inter-prediction modes with template matching improvement disabled, where the inter-prediction modes for the first block and the second block are the same, and context-based coding one or more parameters associated with an inter-prediction mode in which the second is inter-predicted, where a context associated with the context-based coding of the one or more parameters for the first block is different from a context associated with the context-based coding of the one or more parameters for the second block.
[0257] Clause 10. The method of any of clauses 1-8, wherein the blocks include a first block, and the method further includes the steps of context-based coding one or more parameters associated with an inter-prediction mode in which the first block is inter-predicted, coding a second block in at least one of a CIIP, GPM, or MHP inter-prediction mode with template matching improvement disabled, where the inter-prediction modes for the first block and the second block are the same, and context-based coding one or more parameters associated with an inter-prediction mode in which the second is inter-predicted, where a context associated with the context-based coding of the one or more parameters for the first block is the same as a context associated with the context-based coding of the one or more parameters for the second block.
[0258] Clause 11. The method of any of clauses 1-8, wherein the blocks include a first block, and the method further includes the steps of context-based coding one or more parameters associated with an inter-prediction mode in which the first block is inter-predicted, and coding the second block in at least one of a CIIP, GPM, or MHP inter-prediction mode with template matching improvement disabled, where the inter-prediction modes for the first block and the second block are the same, and context-based coding one or more parameters associated with an inter-prediction mode in which the second one is inter-predicted, where a context associated with context-based coding a first set of bins for the one or more parameters for the first block is the same as a context associated with context-based coding the first set of bins for the one or more parameters for the second block and a context associated with context-based coding at least one bin in the second set of bins for the one or more parameters for the first block is different from a context associated with context-based coding at least one bin in the second set of bins for the one or more parameters for the second block.
[0259] Clause 12. A device for coding video data, comprising a memory configured to store the video data and one or more processors configured to perform the methods of any one of clauses 1 to 11 or a combination thereof.
[0260] Clause 13. The device of clause 12, further comprising a display configured to display the decoded video data.
[0261] Clause 14. The device of any of clauses 12 and 13, wherein the device comprises one or more of a camera, a computer, a mobile device, a broadcast receiver device, or a set-top box.
[0262] Clause 15. A device according to any one of clauses 12 to 14, wherein the device comprises a video decoder.
[0263] Clause 16. The device of any of clauses 12 to 14, wherein the device comprises a video encoder.
[0264] Clause 17. A computer-readable storage medium having stored thereon instructions that, when executed, cause one or more processors to perform the method of any of clauses 1 to 11.
[0265] Clause 18. A device for coding video data, comprising means for implementing the method of any of clauses 1 to 11.
[0266] Clause 19. A method for decoding video data, comprising the steps of determining that a current block is inter-predicted in a composite inter-intra prediction (CIIP) mode or a geometric partitioning mode (GPM), determining that template matching is enabled for the current block, generating a motion vector for the current block based on the template matching, determining a predictive block for the current block based on the motion vector according to the CIIP mode or the GPM, and reconstructing the current block based on the predictive block.
[0267] Clause 20. The method of clause 19, further comprising the steps of: constructing a merge candidate list; receiving information indicating an index into the merge candidate list; and determining an initial motion vector based on the index into the merge candidate list, wherein generating a motion vector comprises applying template matching based on the initial motion vector to generate the motion vector.
[0268] Clause 21. The method of clause 20, wherein the current block is a first block, the current block being inter predicted in a CIIP mode, and constructing the merge candidate list includes constructing a first merge candidate list having a first number of candidates, and a second merge candidate list for a second block being inter predicted in a CIIP mode with template matching disabled includes a second number of candidates, and the first number of candidates is different from the second number of candidates.
[0269] Clause 22. The method of clause 21, wherein receiving information indicating the index includes determining a context for a first M bins of the information, wherein the context for the first M bins is the same as a context for the M bins for the index into the second merge candidate list, and context-based decoding the information based on the determined context.
[0270] Clause 23. The method of clause 19, wherein the current block is inter predicted in the GPM, the method further comprising partitioning the current block into a first partition and a second partition, wherein generating a motion vector comprises generating a first motion vector for the first partition of the current block based on template matching, and determining a predictive block for the current block comprises determining a predictive block for the current block based on the first motion vector.
[0271] Clause 24. The method of clause 23, further comprising generating a second motion vector for a second partition of the current block based on template matching and based on a determination that template matching is enabled for the current block, and determining a predictive block comprises determining a predictive block for the current block based on the first motion vector and the second motion vector.
[0272] Clause 25. The method of clauses 19-22, wherein the current block is inter predicted in a CIIP mode, and the step of generating a motion vector for the current block based on template matching includes the steps of determining an initial motion vector for the current block based on motion information in the merge candidate list, determining a search area in a reference picture based on the initial motion vector, determining a reference template in the search area that substantially matches a current template in the current picture that includes the current block, and determining a motion vector for the current block based on the determined reference template, and the step of determining a predictive block includes the steps of determining an inter predictor based on the generated motion vector, determining an intra predictor based on samples neighboring the current block, and combining the inter predictor and the intra predictor to determine a predictive block.
[0273] Clause 26. The current block is inter predicted in the GPM, and the method further includes partitioning the current block into a first partition and a second partition, and generating a motion vector for the current block based on template matching includes determining a first initial motion vector for the first partition based on first motion information in the merge candidate list, determining a first search area in the first reference picture based on the first initial motion vector, determining a first reference template in the first search area that substantially matches a first current template of the first partition, and determining a first motion vector for the first partition based on the determined first reference template, and the method further includes determining a second motion information in the merge candidate list. 25. The method of clauses 19, 23, and 24, further comprising: determining a second initial motion vector for the second partition based on the information; determining a second search area in the second reference picture based on the second initial motion vector; determining a second reference template in the second search area that substantially matches the second current template for the second partition; and determining a second motion vector for the second partition based on the determined second reference template, wherein determining the predictive block comprises determining a first prediction partition based on the first motion vector, determining a second prediction partition based on the second motion vector, and combining the first prediction partition and the second prediction partition to determine the predictive block.
[0274] Clause 27. The method of any of clauses 19-26, wherein determining that template matching is enabled for the current block includes receiving a coding unit (CU) level syntax element indicating that template matching is enabled for the current block.
[0275] Clause 28. The method of any of clauses 19 to 27, wherein the step of reconstructing the current block based on the predicted block includes the steps of receiving information indicating a residual between the current block and the predicted block, and combining the residual and the predicted block to reconstruct the current block.
[0276] Clause 29. A device for decoding video data, comprising: a memory configured to store the video data; and processing circuitry configured to: determine that a current block of the video data is inter-predicted in a composite inter-intra prediction (CIIP) mode or a geometric partitioning mode (GPM); determine that template matching is enabled for the current block; generate a motion vector for the current block based on the template matching; determine a predictive block for the current block based on the motion vector in accordance with the CIIP mode or the GPM; and reconstruct the current block based on the predictive block.
[0277] Clause 30. The device of clause 29, wherein the processing circuitry is configured to construct a merge candidate list, receive information indicating an index into the merge candidate list, and determine an initial motion vector based on the index into the merge candidate list, and to generate the motion vector, the processing circuitry is configured to apply template matching based on the initial motion vector to generate the motion vector.
[0278] Clause 31. The device of clause 30, wherein the current block is a first block, the current block being inter predicted in a CIIP mode, and to construct the merge candidate list, the processing circuitry is configured to construct a first merge candidate list having a first number of candidates, and a second merge candidate list for a second block that is inter predicted in a CIIP mode with template matching disabled includes a second number of candidates, and the first number of candidates is different from the second number of candidates.
[0279] Clause 32. The device of clause 31, wherein to receive the information indicating the index, the processing circuitry is configured to determine a context for a first M bins of the information, where the context for the first M bins is the same as a context for the M bins for the index into the second merge candidate list, and context-based decode the information based on the determined context.
[0280] Clause 33. The device of clause 29, wherein the current block is inter predicted in the GPM, and the processing circuitry is configured to partition the current block into a first partition and a second partition, and to generate a motion vector, the processing circuitry is configured to generate a first motion vector for the first partition of the current block based on template matching, and to determine a predictive block for the current block, the processing circuitry is configured to determine a predictive block for the current block based on the first motion vector.
[0281] Clause 34. The device of clause 33, wherein the processing circuitry is configured to generate a second motion vector for a second partition of the current block based on the template matching and based on a determination that template matching is enabled for the current block, and to determine a predictive block, the processing circuitry is configured to determine a predictive block for the current block based on the first motion vector and the second motion vector.
[0282] Clause 35. The device of any of clauses 29-32, wherein the current block is inter predicted in a CIIP mode, and, to generate a motion vector for the current block based on template matching, the processing circuitry is configured to: determine an initial motion vector for the current block based on motion information in the merge candidate list, determine a search area in a reference picture based on the initial motion vector, determine a reference template in the search area that substantially matches a current template in the current picture that includes the current block, and determine a motion vector for the current block based on the determined reference template; and, to determine a predictive block, the processing circuitry is configured to determine an inter predictor based on the generated motion vector, determine an intra predictor based on samples neighboring the current block, and combine the inter predictor and the intra predictor to determine a predictive block.
[0283] Clause 36. A current block is inter predicted in the GPM, and a processing circuitry is configured to partition the current block into a first partition and a second partition, and to generate a motion vector for the current block based on template matching, the processing circuitry is configured to: determine a first initial motion vector for the first partition based on first motion information in a merge candidate list; determine a first search area in a first reference picture based on the first initial motion vector; determine a first reference template in the first search area that substantially matches a first current template of the first partition; and determine a first motion vector for the first partition based on the determined first reference template; and the processing circuitry is configured to: determine a second motion information in the merge candidate list; 35. The device of any of clauses 29, 33, and 34. wherein the device is configured to: determine a second initial motion vector for the second partition based on the information; determine a second search area in the second reference picture based on the second initial motion vector; determine a second reference template in the second search area that substantially matches the second current template for the second partition; and determine a second motion vector for the second partition based on the determined second reference template; and, to determine the predictive block, the processing circuitry is configured to determine a first prediction partition based on the first motion vector, determine a second prediction partition based on the second motion vector, and combine the first prediction partition and the second prediction partition to determine the predictive block.
[0284] Clause 37. The device of any of clauses 29-36, wherein to determine that template matching is enabled for the current block, the processing circuitry is configured to receive a coding unit (CU) level syntax element indicating that template matching is enabled for the current block.
[0285] Clause 38. The device of any of clauses 29-37, wherein, to reconstruct the current block based on the predicted block, the processing circuitry is configured to receive information indicating a residual between the current block and the predicted block, and to combine the residual and the predicted block to reconstruct the current block.
[0286] Clause 39. The device of any of clauses 29-38, further comprising a display configured to display the decoded video data.
[0287] Clause 40. The device of any of clauses 29 to 39, wherein the device comprises one or more of a camera, a computer, a mobile device, a broadcast receiver device, or a set-top box.
[0288] Clause 41. A computer-readable storage storing instructions that, when executed, cause one or more processors to determine that a current block is inter-predicted in a combined inter-intra prediction (CIIP) mode or a geometric partitioning mode (GPM), determine that template matching is enabled for the current block, generate a motion vector for the current block based on the template matching, determine a predictive block for the current block based on the motion vector in accordance with the CIIP mode or the GPM, and reconstruct the current block based on the predictive block.
[0289] Clause 42. The computer-readable storage medium of clause 41, further comprising instructions to cause the one or more processors to build a merge candidate list, receive information indicating an index into the merge candidate list, and determine an initial motion vector based on the index into the merge candidate list, wherein the instructions to cause the one or more processors to generate a motion vector include instructions to cause the one or more processors to apply template matching based on the initial motion vector to generate the motion vector.
[0290] Clause 43. A method for encoding video data, comprising: determining that a current block should be inter-predicted in a composite inter-intra prediction (CIIP) mode or a geometric partitioning mode (GPM); determining that template matching should be enabled for the current block; generating a motion vector for the current block based on the template matching; determining a predictive block for the current block based on the motion vector according to the CIIP mode or the GPM; and signaling information indicating a residual between the predictive block and the current block.
[0291] Clause 44. The method of clause 43, further comprising the steps of: constructing a merge candidate list; and determining an initial motion vector based on motion vector information in the merge candidate list, wherein generating a motion vector comprises applying template matching based on the initial motion vector to generate a motion vector, and the method further comprises signaling information indicating an index into the merge candidate list that identifies the motion vector information.
[0292] Clause 45. A device for encoding video data, comprising: a memory configured to store the video data; and a processing circuitry configured to: determine that a current block should be inter-predicted in a composite inter-intra prediction (CIIP) mode or a geometric partitioning mode (GPM); determine that template matching should be enabled for the current block; generate a motion vector for the current block based on the template matching; determine a predictive block for the current block based on the motion vector according to the CIIP mode or the GPM; and signal information indicating a residual between the predictive block and the current block.
[0293] Clause 46. The device of clause 45, wherein the processing circuitry is configured to construct a merge candidate list and determine an initial motion vector based on motion vector information in the merge candidate list, and to generate the motion vector, the processing circuitry is configured to apply template matching based on the initial motion vector to generate the motion vector, and the processing circuitry is configured to signal information indicating an index into the merge candidate list that identifies the motion vector information.
[0294] It should be appreciated that, depending on the example, some acts or events of any of the techniques described herein may be performed in a different sequence, may be added, combined, or excluded entirely (e.g., not all acts or events described are necessary to the practice of the techniques). Furthermore, in some examples, acts or events may be performed simultaneously rather than sequentially, for example, through multithreaded processing, interrupt processing, or multiple processors.
[0295] In one or more examples, the described functions may be implemented in hardware, software, firmware, or any combination thereof. If implemented in software, the functions may be stored on or transmitted via a computer-readable medium as one or more instructions or code and executed by a hardware-based processing unit. The computer-readable medium may include a computer-readable storage medium, which corresponds to a tangible medium, such as a data storage medium, or a communication medium, which includes any medium that facilitates transfer of a computer program from one place to another, for example according to a communication protocol. In this manner, the computer-readable medium may generally correspond to (1) a tangible computer-readable storage medium that is non-transitory, or (2) a communication medium, such as a signal or carrier wave. The data storage medium may be any available medium that can be accessed by one or more computers or one or more processors to retrieve instructions, code, and / or data structures for implementation of the techniques described in this disclosure. A computer program product may include a computer-readable medium.
[0296] By way of example and not limitation, such computer-readable storage media may comprise RAM, ROM, EEPROM, CD-ROM or other optical disk storage, magnetic disk storage or other magnetic storage devices, flash memory, or any other medium that may be used to store desired program code in the form of instructions or data structures and that may be accessed by a computer. Also, any connection is properly referred to as a computer-readable medium. For example, if instructions are transmitted from a website, server, or other remote source using coaxial cable, fiber optic cable, twisted pair, digital subscriber line (DSL), or wireless technologies such as infrared, radio, and microwave, the coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwave are included within the definition of the medium. However, it should be understood that computer-readable storage media and data storage media do not include connections, carrier waves, signals, or other transitory media, but instead cover non-transitory tangible storage media. As used herein, disk and disc include compact disc (CD), laser disc, optical disc, digital versatile disc (DVD), floppy disk, and Blu-ray disc, where disks typically reproduce data magnetically and discs reproduce data optically using lasers. Combinations of the above should also be included within the scope of computer readable media.
[0297] The instructions may be executed by one or more processors, such as one or more DSPs, general-purpose microprocessors, ASICs, FPGAs, or other equivalent integrated or discrete logic circuitry. Thus, the terms "processor" and "processing circuitry" as used herein may refer to any of the above structures or any other structures suitable for implementing the techniques described herein. In addition, in some aspects, the functionality described herein may be provided within dedicated hardware and / or software modules configured for encoding and decoding, or may be incorporated into a combined codec. Also, the techniques may be fully implemented in one or more circuits or logic elements.
[0298] The techniques of the present disclosure may be implemented in a wide variety of devices or apparatuses, including wireless handsets, integrated circuits (ICs) or sets of ICs (e.g., chipsets). Various components, modules, or units are described in the present disclosure to highlight functional aspects of devices configured to implement the disclosed techniques, but they do not necessarily require realization by different hardware units. Rather, as described above, the various units may be combined in a codec hardware unit or may be provided by a collection of interoperable hardware units including one or more processors as described above, along with appropriate software and / or firmware.
[0299] Various examples have been described. These and other examples are within the scope of the following claims. [Explanation of symbols]
[0300] 100 Video Encoding and Decoding System 102 Source Device 104 Video Sources 106 Memory 108 Output Interface 110 Computer-readable medium 112 Storage Devices 114 File Server 116 Destination Device 118 Display Devices 120 Memory 122 Input Interface 200 Video Encoder 202 Mode Selection Unit 204 Residual Generation Unit 206 Conversion Processing Unit 208 Quantization Units 210 Inverse Quantization Unit 212 Inverse Transformation Processing Unit 214 Reconstruction Unit 216 Filter unit 218 Decoded Picture Buffer (DPB) 220 Entropy Coding Unit 222 Motion Estimation Unit 224 Motion Compensation Unit 226 intra prediction units 230 Video Data Memory 300 Video Decoder 302 Entropy Decoding Unit 304 Prediction Processing Unit 306 Inverse Quantization Unit 308 Inverse Transformation Processing Unit 310 Reconstruction Unit 312 Filter unit 314 Decoded Picture Buffer (DPB) 316 Motion Compensation Unit 318 Intra Prediction Units 320 Coded Picture Buffer (CPB) Memory
Claims
1. 1. A method for decoding video data, comprising the steps of: determining that a current block is inter predicted in a combined inter-intra prediction (CIIP) mode or a geometric partition mode (GPM); determining that template matching is enabled for the current block; generating a motion vector for the current block based on template matching; determining a prediction block for the current block based on the motion vector according to the CIIP mode or the GPM; and reconstructing the current block based on the predicted block.
2. building a merge candidate list; receiving information indicating an index into the merge candidate list; determining an initial motion vector based on the index into the merge candidate list; The method of claim 1 , wherein generating the motion vector comprises applying template matching based on the initial motion vector to generate the motion vector.
3. the current block is a first block, the current block is inter predicted in CIIP mode; constructing the merging candidate list includes constructing a first merging candidate list having a first number of candidates; a second merge candidate list for a second block that is inter predicted in a CIIP mode with template matching disabled includes a second number of candidates; The method of claim 2 , wherein the first number of candidates is different from the second number of candidates.
4. The step of receiving information indicating the index includes: determining a context for a first M bins of the information, the context for the first M bins being the same as a context for the M bins for indexing into the second merge candidate list; and context-based decoding the information based on the determined context.
5. The current block is inter predicted in GPM; The method further includes partitioning the current block into a first partition and a second partition; generating the motion vector includes generating a first motion vector for the first partition of the current block based on template matching; determining the predictive block for the current block includes determining the predictive block for the current block based on the first motion vector; Optionally, generating a second motion vector for the second partition of the current block based on template matching and based on the determination that template matching is enabled for the current block; The method of claim 1 , wherein determining the predictive block comprises determining the predictive block for the current block based on the first motion vector and the second motion vector.
6. the current block is inter predicted in CIIP mode; generating the motion vector for the current block based on template matching, determining an initial motion vector for the current block based on motion information in a merge candidate list; determining a search area in a reference picture based on the initial motion vector; determining a reference template in the search area that substantially matches a current template in a current picture that includes the current block; determining the motion vector for the current block based on the determined reference template; The step of determining the predicted block comprises: determining an inter predictor based on the generated motion vector; determining an intra predictor based on samples neighboring the current block; and combining the inter predictor and the intra predictor to determine the predictive block.
7. The current block is inter predicted in GPM; The method further includes partitioning the current block into a first partition and a second partition; generating the motion vector for the current block based on template matching, determining a first initial motion vector for the first partition based on a first motion information in the merge candidate list; determining a first search area in a first reference picture based on the first initial motion vector; determining a first reference template in the first search area that substantially matches a first current template for the first partition; determining a first motion vector for the first partition based on the determined first reference template; The method comprises: determining a second initial motion vector for the second partition based on second motion information in the merge candidate list; determining a second search area in a second reference picture based on the second initial motion vector; determining a second reference template in the second search area that substantially matches a second current template for the second partition; determining a second motion vector for the second partition based on the determined second reference template; The step of determining the predicted block comprises: determining a first prediction partition based on the first motion vector; determining a second prediction partition based on the second motion vector; and combining the first prediction partition and the second prediction partition to determine the prediction block.
8. 2. The method of claim 1, wherein determining that template matching is enabled for the current block comprises receiving a coding unit (CU) level syntax element indicating that template matching is enabled for the current block.
9. The step of reconstructing the current block based on the predicted block comprises: receiving information indicative of a residual between the current block and the predicted block; and combining the residual and the prediction block to reconstruct the current block.
10. 1. A device for decoding video data, comprising: a memory configured to store the video data; and a processing circuit configuration, the processing circuit configuration comprising: determining that the current block of video data is inter predicted in a composite inter-intra prediction (CIIP) mode or a geometric partition mode (GPM); determining that template matching is enabled for the current block; generating a motion vector for the current block based on template matching; determining a prediction block for the current block based on the motion vector according to the CIIP mode or the GPM; and reconstructing the current block based on the predicted block.
11. The device of claim 10, further configured to execute a method according to any one of claims 2 to 9.
12. a display configured to display the decoded video data; and / or 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.
13. A computer readable storage medium storing instructions which, when executed, cause one or more processors to perform the method of any one of claims 1 to 10.
14. 1. A method for encoding video data, comprising the steps of: determining that a current block should be inter predicted in a combined inter-intra prediction (CIIP) mode or a geometric partitioning mode (GPM); determining that template matching should be enabled for the current block; generating a motion vector for the current block based on template matching; determining a prediction block for the current block based on the motion vector according to a CIIP mode or a GPM; and signaling information indicative of a residual between the predicted block and the current block.
15. 1. A device for encoding video data, comprising: a memory configured to store the video data; and a processing circuit configuration, the processing circuit configuration comprising: Determining that a current block is to be inter predicted in a combined inter-intra prediction (CIIP) mode or a geometric partitioning mode (GPM); determining that template matching should be enabled for the current block; generating a motion vector for the current block based on template matching; determining a prediction block for the current block based on the motion vector according to a CIIP mode or a GPM; and signaling information indicative of a residual between the predicted block and the current block.