Search region and template matching cost for template matching tool in video coding

By expanding the search area and using block vectors to determine additional search areas, the problems of high computational complexity and limited search area in existing video decoding technologies are solved, achieving more efficient video decoding.

CN121942201APending Publication Date: 2026-04-28QUALCOMM INC
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
QUALCOMM INC
Filing Date
2024-10-04
Publication Date
2026-04-28

AI Technical Summary

Technical Problem

Existing video decoding technologies suffer from high computational complexity and limited search areas in template matching, making it impossible to effectively determine the best prediction block.

Method used

By expanding the search region and using block vectors to determine additional search regions, and combining predefined search regions and block vectors to determine the prediction block for the current block, computational complexity is reduced and the accuracy of prediction blocks is improved.

Benefits of technology

Without significantly increasing processing complexity or time, it improves the efficiency and accuracy of video decoding and enables better identification of predicted blocks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121942201A_ABST
    Figure CN121942201A_ABST
Patent Text Reader

Abstract

A method of decoding video data includes: determining a predefined search area predefined based on a size of a current block within a current picture; determining one or more block vectors; determining one or more additional search regions based on the one or more block vectors; determining a prediction block of the current block based on the predefined search region and the one or more additional search regions; and reconstructing the current block based on the prediction block.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application claims priority to U.S. Patent Application No. 18 / 905,763, filed October 3, 2024, and U.S. Provisional Patent Application No. 63 / 588,576, filed October 6, 2023, the entire contents of each of which are incorporated herein by reference. U.S. Patent Application No. 18 / 905,763, filed October 3, 2024, claims the benefit of U.S. Provisional Patent Application No. 63 / 588,576, filed October 6, 2023. Technical Field

[0002] This disclosure relates to video encoding and video decoding. Background Technology

[0003] Digital video capabilities can be incorporated into a wide variety of devices, including digital televisions, digital live broadcast systems, wireless broadcasting systems, personal digital assistants (PDAs), laptops or desktop computers, tablets, e-book readers, digital cameras, digital recording devices, digital media players, video game devices, video game consoles, cellular or satellite wireless phones (so-called "smartphones"), video conferencing equipment, video streaming devices, and more. Digital video devices implement video decoding technologies, such as those defined by MPEG-2, MPEG-4, ITU-T H.263, ITU-T H.264 / MPEG-4 (Part 10, Advanced Video Decoding (AVC)), ITU-T H.265 / High Efficiency Video Decoding (HEVC), ITU-T H.266 / Variety Video Decoding (VVC) and extensions to these standards, as well as proprietary video codecs / formats such as AOMedia Video1 (AV1) developed by the Open Media Alliance. By implementing such video decoding technologies, video devices can more efficiently send, receive, encode, decode, and / or store digital video information.

[0004] Video decoding 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 decoding, video slices (e.g., video pictures or portions of video pictures) can be divided into video blocks, which may also be referred to as decoding tree units (CTUs), decoding units (CUs), and / or decoding nodes. Video blocks in a slice after intra-frame decoding (I) of a picture are encoded using spatial prediction relative to reference samples in adjacent blocks within the same picture. Video blocks in a slice after inter-frame decoding (P or B) of a picture can use spatial prediction relative to reference samples in adjacent blocks within the same picture or temporal prediction relative 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. Summary of the Invention

[0005] Generally, this disclosure describes techniques for template matching in video decoding. In template matching, a video decoder (e.g., a video encoder or video decoder) determines a template (e.g., a reference template) within a search range (e.g., a search region) and determines the corresponding cost associated with the appropriate template for video decoding (e.g., determining the predicted block for the current block). This disclosure describes example techniques for determining the search region and cost in a manner that allows for a larger search region while reducing the impact of computational complexity associated with larger search regions and cost calculations. In this way, the example techniques can improve the overall operation of video decoding techniques by integrating them into practical applications of template matching in video decoding.

[0006] In one or more examples, the video encoder and video decoder may determine a predefined search region based on the size of the current block. The video encoder and video decoder may also determine one or more additional search regions based on one or more block vectors, where the block vectors identify samples in the same image as the current block. The block vectors may be block vector predictors of the current block, such as the block vectors of neighboring blocks of the current block.

[0007] Video encoders and decoders can perform template matching within a predefined search region and one or more additional search regions to determine the predicted block for the current block. Utilizing block vectors to increase the search region can identify a higher probability of predicted blocks that facilitate efficient encoding or decoding without significantly increasing processing complexity or time.

[0008] In one example, this disclosure describes a method for decoding video data, the method comprising: determining a predefined search region based on the size of a current block within a current image; determining one or more block vectors; determining one or more additional search regions based on the one or more block vectors; determining a predicted block of the current block based on the predefined search region and the one or more additional search regions; and reconstructing the current block based on the predicted block.

[0009] In one example, this disclosure describes an apparatus for decoding video data, the apparatus comprising: one or more memories configured to store the video data; and processing circuitry coupled to the one or more memories, wherein the processing circuitry is configured to: determine a predefined search region based on the size of a current block within a current image; determine one or more block vectors; determine one or more additional search regions based on the one or more block vectors; determine a predicted block of the current block based on the predefined search region and the one or more additional search regions; and reconstruct the current block based on the predicted block.

[0010] In one example, this disclosure describes an apparatus for encoding video data, the apparatus comprising: one or more memories configured to store the video data; and processing circuitry coupled to the one or more memories, wherein the processing circuitry is configured to: determine a predefined search region based on the size of a current block within a current image; determine one or more block vectors; determine one or more additional search regions based on the one or more block vectors; determine a predicted block of the current block based on the predefined search region and the one or more additional search regions; and encode the current block based on the predicted block.

[0011] Details of one or more examples are set forth in the accompanying drawings and the following description. Other features, objects, and advantages will be apparent from the description, drawings, and claims. Attached Figure Description

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

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

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

[0015] Figure 4 This is a flowchart illustrating an example method for encoding the current block according to the technology of this disclosure.

[0016] Figure 5 This is a flowchart illustrating an example method for decoding the current block according to the technology of this disclosure.

[0017] Figure 6 This is a conceptual diagram illustrating an example of an intra-frame template matching search region.

[0018] Figure 7 This is a conceptual diagram illustrating template matching over the search region surrounding the initial motion vector.

[0019] Figure 8 This is a conceptual diagram illustrating the template and a reference sample of the template in a reference image.

[0020] Figure 9 This is a conceptual diagram illustrating an example template and a reference sample of a block with sub-block motion information that uses the motion information of the current block's sub-blocks.

[0021] Figures 10A to 10DThis is a conceptual diagram illustrating an example of an intra-block copy (IBC) reference area that depends on the current decoding unit (CU) location.

[0022] Figure 11A This is a conceptual diagram illustrating an axis region placed outside the search scope.

[0023] Figure 11B This is a conceptual diagram illustrating a portion of the axis area placed within the search range.

[0024] Figure 12A This is a conceptual diagram illustrating an example of a rectangular block vector region surrounding a candidate for merging.

[0025] Figure 12B This is a conceptual diagram illustrating an example of a cross-shaped block vector region surrounding a merge candidate.

[0026] Figure 13 This is a conceptual diagram illustrating an example partition of a cross-shaped block vector search region to the center and lobes.

[0027] Figure 14 This is a conceptual diagram illustrating an example of a region used for calculating the sum of absolute differences (SAD) of subsamples.

[0028] Figure 15 This is a flowchart illustrating the example operation method. Detailed Implementation

[0029] This disclosure relates to various methods (e.g., template types, fusion) defined for use in template matching (TM) related tools. The disclosed methods can be applied to any of existing video codecs such as HEVC (High Efficiency Video Decoding), VVC (Multi-Functional Video Decoding), and EVC (Essential Video Decoding), or can be efficient decoding tools in future video decoding standards (e.g., ECM (Enhanced Compression Model)).

[0030] Template matching is a video decoding tool that allows a video decoder (e.g., a video encoder or video decoder) to determine a better predictor block than a predictor block determined without template matching. Other examples of template matching can be used, and using template matching to determine a predictor block is one example. For inter-frame prediction where template matching is used, the predictor block may be based on samples from another image. For intra-frame prediction or intra-block copying (IBC) where template matching is used, the predictor block may be based on samples from the same image.

[0031] In template matching, the video decoder determines the search area (e.g., the search region) and identifies templates within that region (e.g., a reference template). For example, the video decoder may use an initial motion vector or block vector to identify locations within an image (e.g., the motion vector is the reference image, and the block vector is the same image). For template matching in intra-frame prediction (e.g., IntraTM), there may not be a vector to identify a location within an image, and other techniques may be used to identify that location.

[0032] A video decoder can determine a search region relative to an identified location. In one example, a reference template can be a sample within the search region that is adjacent to a reference block (e.g., identified by an initial motion vector or block vector, or identified using other techniques). The video decoder can determine a current template (e.g., based on samples adjacent to the current block). The video decoder can determine a cost based on the reference template and the current template. The video decoder can then modify the initial vector or block vector or identify another location and repeat the process of determining the reference template and the corresponding cost. The video decoder can set the motion vector based on the reference template that results in the lowest cost. The video decoder can then determine the prediction block for the current block based on the motion vector. For intra-frame prediction, the video decoder can determine the prediction block without needing motion vectors or block vectors.

[0033] This disclosure describes an example of expanding the search range (e.g., the search region) to incorporate an additional region. By expanding the search region, the video decoder may be able to identify better prediction blocks (e.g., prediction blocks that are predictors of the current block) compared to techniques that limit the size of the search region. However, increasing the size of the search region may increase the amount of computation (e.g., increase the number of generated reference templates and increase the amount of cost computation). In one or more examples, this disclosure describes example techniques for increasing the search region and example ways of determining the cost in a way that balances computational complexity with the decoding gain achieved from identifying better motion vectors or block vectors (e.g., where the motion vectors or block vectors identify samples used to generate better prediction blocks).

[0034] Although template matching is described as a way to refine motion vectors or block vectors (such as for determining prediction blocks or as part of intra-frame prediction), the example techniques are not limited to this. Typically, example techniques can be utilized in various video decoding tools that leverage template matching (TM), such as IntraTM, InterTM, Adaptive Reordering with Merge Candidates with Template Matching (ARMC-TM), Geometric Partitioning Pattern Template Matching (GPM-TM), and Intra-Block Copy Template Matching (IBC-TM), to name a few.

[0035] As described in more detail, in some examples, the video decoder may be configured to determine a search region for template matching based on at least one of the width or height of the current block. In some examples, the video decoder may be configured to determine a search region for template matching that extends from the current block at least vertically or horizontally along a corresponding search axis. In some examples, the video decoder may be configured to determine the search region for template matching based on one or more block vectors of one or more blocks adjacent to the current block.

[0036] In some examples, the video decoder may be configured to determine the cost of a template (e.g., a reference template) based on a portion of the template smaller than the entire template. In some examples, the video decoder may be configured to determine the cost based on at least one of a filtered reference template (e.g., a filtered reference template) and a filtered current template (e.g., a filtered current template). In some examples, the video decoder may be configured to determine the cost based on a first portion of the reference template and a first portion of the current template, and discard the first reference template to determine the predicted block for the current block based on the cost being greater than a threshold.

[0037] In some examples, the video decoder may use a combination of the example techniques described above to determine the search area (e.g., the techniques for determining the search area may be combined as needed, or different parts of the techniques may be combined as needed). In some examples, the video decoder may use a combination of the example techniques described above to determine the cost (e.g., the techniques for determining the cost may be combined as needed, or different parts of the techniques may be combined as needed). Moreover, example techniques for determining the search area and example techniques for determining the cost may be combined (e.g., one or a combination of these techniques may be used to determine the search area, and one or a combination of these techniques may be used to determine the cost).

[0038] As described above, the video decoder can expand the search region. For example, a predefined search region may exist based on the size of the current block within the current image. The video decoder can determine one or more additional search regions (e.g., in addition to the predefined search region) based on one or more block vectors. Examples of block vectors could be the block vectors of adjacent blocks. Determining the prediction block only within the predefined search region may not lead to determining the best available prediction block, as the best available prediction block may be in a different region. Utilizing block vectors to expand the search region (e.g., determining additional search regions based on block vectors) can lead to determining better prediction blocks compared to relying solely on the predefined search region. Moreover, because the additional search regions are based on block vectors, the size of the search region can be small enough to negligibly increase processing latency.

[0039] Figure 1This is a block diagram illustrating an example video encoding and decoding system 100 capable of performing the techniques of this disclosure. The techniques of this disclosure generally involve decoding (encoding and / or decoding) video data. Typically, video data includes any data used for processing video. Therefore, video data may include unencoded raw video, encoded video, decoded (e.g., reconstructed) video, and video metadata, such as signaling data.

[0040] like Figure 1 As shown, in this example, system 100 includes a source device 102 that provides encoded video data to be decoded and displayed by a destination device 116. Specifically, source device 102 provides video data to destination device 116 via computer-readable medium 110. Source device 102 and destination device 116 can be or may include any of a wide range of devices, such as desktop computers, laptop computers, mobile devices, tablet computers, set-top boxes, mobile phones (such as smartphones), televisions, cameras, display devices, digital media players, video game consoles, video streaming devices, broadcast receiver devices, etc. In some cases, source device 102 and destination device 116 may be configured for wireless communication and are therefore referred to as wireless communication devices.

[0041] exist Figure 1 In the example, 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, video decoder 300, memory 120, and display device 118. According to this disclosure, the video encoder 200 of source device 102 and the video decoder 300 of destination device 116 can be configured to apply techniques for template matching. Thus, source device 102 represents an example of a video encoding device, while destination device 116 represents an example of a video decoding device. In other examples, the source device and destination device may include other components or 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.

[0042] like Figure 1The system 100 shown is merely an example. Typically, any digital video encoding and / or decoding device can perform techniques for template matching. Source device 102 and destination device 116 are merely examples of such decoding devices, where source device 102 generates decoded video data for transmission to destination device 116. This disclosure refers to a “decoding” device as a device that performs the decoding (e.g., encoding and / or decoding) of data. Thus, video encoder 200 and video decoder 300 represent examples of decoding devices, specifically, a video encoder and a video decoder, respectively. In some examples, source device 102 and destination device 116 may operate in a substantially symmetrical manner, such that each of source device 102 and destination device 116 includes video encoding and decoding components. Therefore, system 100 may support one-way or two-way video transmission between source device 102 and destination device 116, for example, for video streaming, video playback, video broadcasting, or video telephony.

[0043] Typically, video source 104 represents the source of video data (i.e., unencoded raw video data) and provides a sequential series of pictures (also referred to as "frames") of video data to video encoder 200, which encodes the data for the pictures. Video source 104 of source device 102 may include video capture devices such as cameras, video archives containing previously captured raw video, and / or video feed interfaces for receiving video from video content providers. Alternatively, 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, pre-captured, or computer-generated video data. Video encoder 200 may rearrange the pictures from the received order (sometimes referred to as "display order") to a decoding order for decoding. Video encoder 200 may generate a bitstream comprising the encoded video data. The source device 102 can then output the encoded video data to a computer-readable medium 110 via the output interface 108 for reception and / or retrieval by, for example, the input interface 122 of the destination device 116.

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

[0045] Computer-readable medium 110 may represent any type of medium or device capable of transmitting encoded video data from source device 102 to destination device 116. In one example, computer-readable medium 110 represents a communication medium that enables source device 102 to directly transmit encoded video data to destination device 116 in real time, for example, via a radio frequency network or a computer-based network. According to a communication standard such as a wireless communication protocol, output interface 108 may modulate the transmitted signal including the encoded video data, and input interface 122 may demodulate the received transmitted signal. The communication medium may include any wireless or wired communication medium, such as 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 a router, switch, base station, or any other equipment that may be useful for facilitating communication from source device 102 to destination device 116.

[0046] In some examples, source device 102 can output encoded data from output interface 108 to storage device 112. Similarly, destination device 116 can access encoded data from storage device 112 via input interface 122. Storage device 112 may include any data storage medium of various distributed or locally accessed data storage media, such as hard disk drives, Blu-ray discs, DVDs, CD-ROMs, flash memory, volatile or non-volatile memory, or any other suitable digital storage medium for storing encoded video data.

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

[0048] File server 114 can be any type of server device capable of storing encoded video data and sending the encoded video data to destination device 116. File server 114 may represent a web server (e.g., for a website), a server configured to provide file transfer protocol services (such as File Transfer Protocol (FTP) or FLUTE-based file delivery protocol), a Content Delivery Network (CDN) device, a Hypertext Transfer Protocol (HTTP) server, a Multimedia Broadcast Multicast Service (MBMS) or Enhanced MBMS (eMBMS) server, and / or a Network Attached Storage (NAS) device. File server 114 may additionally or alternatively implement one or more HTTP streaming protocols, such as HTTP-based Dynamic Adaptive Streaming (DASH), HTTP Live Streaming (HLS), Real-Time Streaming Protocol (RTSP), HTTP Dynamic Streaming, etc.

[0049] Destination device 116 can access encoded video data from file server 114 via any standard data connection, including an internet connection. This may include a wireless channel (e.g., Wi-Fi connection), a wired connection (e.g., digital subscriber line (DSL), cable modem, etc.), or a combination of both, suitable for accessing encoded video data stored on file server 114. Input interface 122 can be configured to operate according to any 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.

[0050] Output interface 108 and input interface 122 can 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 where output interface 108 and input interface 122 include wireless components, output interface 108 and input interface 122 can be configured to transmit data such as encoded video data according to cellular communication standards such as 4G, 4G-LTE (Long Term Evolution), Advanced LTE, 5G, etc. In some examples where output interface 108 includes a wireless transmitter, output interface 108 and input interface 122 can be configured according to other wireless standards such as the IEEE 802.11 specification, the IEEE 802.15 specification (e.g., ZigBee), etc.™ ),Bluetooth ™ Standards are used to transmit data such as encoded video data. In some examples, source device 102 and / or destination device 116 may include corresponding system-on-chip (SoC) devices. For example, source device 102 may include an SoC device for performing functions belonging to video encoder 200 and / or output interface 108, and destination device 116 may include an SoC device for performing functions belonging to video decoder 300 and / or input interface 122.

[0051] The technology disclosed herein can be applied to video decoding to support any multimedia application in a variety of multimedia applications, such as over-the-air television broadcasting, cable television transmission, satellite television transmission, internet streaming video transmission (such as HTTP-based Dynamic Adaptive Streaming (DASH)), digital video encoded onto data storage media, decoding of digital video stored on data storage media, or other applications.

[0052] The input interface 122 of the destination device 116 receives an encoded video bitstream from a computer-readable medium 110 (e.g., a communication medium, storage device 112, 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 ​​describing the characteristics and / or processing of video blocks or other decoded units (e.g., slices, pictures, picture groups, sequences, etc.). The display device 118 displays a decoded picture of the decoded video data to the 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.

[0053] Despite Figure 1Not shown, but in some examples, both the video encoder 200 and the video decoder 300 may be integrated with the audio encoder and / or audio decoder (e.g., audio codec), 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. Example audio codecs may include AAC, AC-3, AC-4, ALAC, ALS, AMBE, AMR, AMR-WB (G.722.2), AMR-WB+, aptX (various versions), ATRAC, BroadVoice (BV16, BV32), CELT, Enhanced AC-3 (E-AC-3), EVS, FLAC, G.711, G.722, G.722.1, G.722.2 (AMR-WB), G.723.1, G.726, G.728, G.729, G.729.1, GSM-FR, HE-AAC, iLBC, iSAC, LA Lyra, Monkey's Audio, MP1, MP2 (MPEG-1, 2 Audio Layer II), MP3, Musepack, Nellymoser Asao, OptimFROG, Opus, Sac, Satin, SBC, SILK, Siren 7, Speex, SVOPC, True Audio (TTA), TwinVQ, USAC, Vorbis (Ogg), WavPack and Windows Media Aud.

[0054] Both the video encoder 200 and the video decoder 300 can be implemented as any of a variety of suitable encoder and / or decoder circuits comprising a processing system, such as one or more microprocessors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), discrete logic, software, hardware, firmware, or any combination thereof. When the technology is implemented in part in software, the device may store instructions for the software in a suitable non-transitory computer-readable medium and execute the instructions in hardware using one or more processors to perform the technology of this disclosure. Each of the video encoder 200 and the video decoder 300 may be included in one or more encoders or decoders, either of which may be integrated as part of a combined encoder / decoder (CODEC) in the respective device. Devices including the video encoder 200 and / or the video decoder 300 may implement the video encoder 200 and / or the video decoder 300 in processing circuitry such as integrated circuits and / or microprocessors. Such devices may be wireless communication devices (such as cellular phones) or any other type of device described herein.

[0055] The video encoder 200 and video decoder 300 may operate according to a video decoding standard such as ITU-T H.265 (also known as High Efficiency Video Decoding (HEVC)) or extensions thereof such as Multi-View and / or Scalable Video Decoding Extensions. Alternatively, the video encoder 200 and video decoder 300 may operate according to other proprietary or industry standards such as ITU-T H.266 (also known as Multi-Functional Video Decoding (VVC)). In other examples, the video encoder 200 and video decoder 300 may operate according to proprietary video codecs / formats such as AOMedia Video 1 (AV1), extensions to AV1, and / or subsequent versions of AV1 (e.g., AV2)). In other examples, the video encoder 200 and video decoder 300 may operate according to other proprietary formats or industry standards. However, the techniques disclosed herein are not limited to any particular decoding standard or format. Generally, the video encoder 200 and video decoder 300 may be configured to perform the techniques of this disclosure in combination with any video decoding technique using template matching. For example, video encoder 200 and video decoder 300 may be configured to use the example techniques described in this disclosure to determine search areas and / or determine costs associated with templates (e.g., reference templates).

[0056] Typically, video encoder 200 and video decoder 300 perform block-based decoding of images. The term "block" generally refers to a structure that includes data to be processed (e.g., encoded, decoded, or otherwise used during encoding and / or decoding). For example, a block may include a two-dimensional matrix of samples of luminance and / or chrominance data. Typically, video encoder 200 and video decoder 300 decode video data represented in YUV (e.g., Y, Cb, Cr) format. That is, instead of decoding the red, green, and blue (RGB) data used for images, video encoder 200 and video decoder 300 decode the luminance and chrominance components, where the chrominance components may include both red hue chrominance components and blue hue chrominance components. In some examples, video encoder 200 converts the received RGB format data to a YUV representation before encoding, and video decoder 300 converts the YUV representation to RGB format. Alternatively, preprocessing and postprocessing units (not shown) may perform these conversions.

[0057] This disclosure generally relates to the decoding (e.g., encoding and decoding) of images to include processes of encoding or decoding data of the image. Similarly, this disclosure may relate to the decoding of blocks of images to include processes of encoding or decoding data used for the blocks (e.g., prediction and / or residual decoding). Encoded video bitstreams typically include a series of values ​​for syntax elements representing decoding decisions (e.g., decoding modes) and the partitioning of images into blocks. Therefore, references to the decoding of images or blocks should generally be understood as the decoded values ​​of the syntax elements that form the images or blocks.

[0058] HEVC defines various blocks, including decoding units (CUs), prediction units (PUs), and transform units (TUs). According to HEVC, a video decoder (such as a video encoder 200) divides the decoding tree unit (CTU) into CUs based on a quadtree structure. That is, the video decoder divides the CTU and CU into four equal, non-overlapping squares, and each node of the quadtree has zero or four child nodes. Nodes without child nodes are called "leaf nodes," and the CU of such leaf nodes may include one or more PUs and / or one or more TUs. The video decoder may further divide the PUs and TUs. For example, in HEVC, a residual quadtree (RQT) represents the partitioning of the TU. In HEVC, the PU represents inter-frame prediction data, while the TU represents residual data. The CU after intra-frame prediction includes intra-frame prediction information, such as intra-frame mode indication.

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

[0060] In the MTT partitioning structure, blocks can be divided using quadtree (QT) partitioning, binary tree (BT) partitioning, and one or more types of ternary tree (TT) partitioning (also known as triplet tree (TT)). A ternary tree or triplet tree partition is a partition in which a block is divided into three sub-blocks. In some examples, a ternary tree or triplet tree partition divides a block into three sub-blocks without dividing the original block through the center. Partition types in MTT (e.g., QT, BT, and TT) can be symmetric or asymmetric.

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

[0062] AV1 also defines video data tiles. A tile is a rectangular array of superblocks that can be decoded independently of other tiles. That is, the video encoder 200 and video decoder 300 can encode and decode the decoding blocks within a tile separately without using video data from other tiles. However, the video encoder 200 and video decoder 300 can perform filtering across tile boundaries. The tile size can be uniform or non-uniform. Tile-based decoding enables parallel processing and / or multithreading in the encoder and decoder implementations.

[0063] 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 the two chroma components (or two QTBT / MTT structures for the respective chroma components).

[0064] The video encoder 200 and the video decoder 300 can be configured to use quadtree partitioning, QTBT partitioning, MTT partitioning, superblock partitioning or other partitioning structures.

[0065] In some examples, a CTU includes a decoded tree block (CTB) of luminance samples, two corresponding CTBs of chrominance samples of an image with three sample arrays, or a CTB of samples of an image decoded using three separate color planes and a syntax structure for decoding the samples. A CTB can be an NxN sample block of some value N, such that a partitioning method divides the components into CTBs. A component is an array or a single sample from one of the three arrays (luminance and two chrominance) constituting a 4:2:0, 4:2:2, or 4:4:4 color format image, or an array or a single sample constituting an array or array constituting a monochrome format image. In some examples, a decoded block is an MxN sample block of values ​​M and N, such that a partitioning method divides the CTB into decoded blocks.

[0066] Blocks (e.g., CTUs or CUs) can be grouped in various ways within an image. As an example, a brick can refer to a rectangular area of ​​a row of CTUs within a specific tile in an image. A tile can be a rectangular area of ​​CTUs within a specific tile column and a specific tile row in an image. A tile column refers to a rectangular area of ​​a CTU having a height equal to the height of the image and a width specified by syntax elements (e.g., such as in an image parameter set). A tile row refers to a rectangular area of ​​a CTU having a height specified by syntax elements (e.g., such as in an image parameter set) and a width equal to the width of the image.

[0067] In some examples, a tile can be divided into multiple bricks, each brick comprising one or more CTU rows within the tile. A tile that is not divided into multiple bricks can also be called a brick. However, bricks that are a true subset of a tile cannot be called a tile. Bricks in an image can also be arranged in slices. A slice can be an integer number of bricks in an image that can be uniquely contained within a single Network Abstraction Layer (NAL) unit. In some examples, a slice comprises multiple complete tiles or a consecutive sequence of complete bricks comprising only one tile.

[0068] This disclosure uses "NxN" and "N by N" interchangeably to refer to the sample size of a block (such as a CU or other video block) in the vertical and horizontal dimensions, for example, 16x16 samples or 16 by 16 samples. Generally, a 16x16 CU will have 16 samples in the vertical direction (y=16) and 16 samples in the horizontal direction (x=16). Similarly, an NxNCU typically 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 can be arranged in rows and columns. Furthermore, a CU does not necessarily need to have the same number of samples in the horizontal direction as it does in the vertical direction. For example, a CU may include NxM samples, where M is not necessarily equal to N.

[0069] The video encoder 200 encodes video data for use in predicting and / or residual information, as well as other information, for the CU. The prediction information indicates how the CU should be predicted to form a prediction block of the CU. The residual information typically represents the sample-by-sample difference between a sample of the CU before encoding and the prediction block.

[0070] To predict a CU, the video encoder 200 typically forms a predicted block of the CU through inter-frame prediction or intra-frame prediction. Inter-frame prediction typically refers to predicting the CU from data in a previously decoded image, while intra-frame prediction typically refers to predicting the CU from data in a previously decoded image within the same frame. To perform inter-frame prediction, the video encoder 200 can use one or more motion vectors to generate the predicted block. The video encoder 200 can typically perform a motion search to identify a reference block that closely matches the CU, for example, based on the differences between the CU and a reference block. The video encoder 200 can use sum of absolute differences (SAD), sum of squared differences (SSD), mean absolute difference (MAD), mean squared difference (MSD), or other such difference calculations to compute a difference metric to determine whether the reference block closely matches the current CU. In some examples, the video encoder 200 can use unidirectional or bidirectional prediction to predict the current CU.

[0071] Some examples of VVC also provide an affine motion compensation mode, which can be viewed as an inter-frame prediction mode. In affine motion compensation mode, the video encoder 200 can determine two or more motion vectors representing non-translational motion, such as zooming in or out, rotation, perspective motion, or other irregular motion types.

[0072] To perform intra-frame prediction, the video encoder 200 can select an intra-frame prediction mode to generate prediction blocks. Some examples of VVC provide sixty-seven intra-frame prediction modes, including various directional modes, as well as planar and DC modes. Typically, the video encoder 200 selects an intra-frame prediction mode that describes the neighboring samples of the current block (e.g., the block of the CU), from which it predicts samples for the current block. Assuming the video encoder 200 decodes the CTU and CU in raster scan order (from left to right, from top to bottom), such samples are typically located above, to the upper left, or to the left of the current block within the same frame as the current block.

[0073] The video encoder 200 encodes data representing the prediction mode of the current block. For example, for inter-frame prediction modes, the video encoder 200 may encode data indicating which of the various available inter-frame prediction modes is used, as well as the motion information for the corresponding mode. For example, for unidirectional or bidirectional inter-frame prediction, the video encoder 200 may encode motion vectors using Advanced Motion Vector Prediction (AMVP) or merging modes. The video encoder 200 may use similar modes to encode motion vectors used for affine motion compensation modes.

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

[0075] After prediction (such as intra-frame or inter-frame prediction for a block), the video encoder 200 can compute residual data for the block. The residual data (such as residual blocks) represents the sample-wise difference between predicted blocks formed using the corresponding prediction mode. The video encoder 200 can apply one or more transforms to the residual blocks to produce transformed data in the transform domain rather than the sample domain. For example, the video encoder 200 can apply Discrete Cosine Transform (DCT), integer transform, wavelet transform, or conceptually similar transforms to the residual video data. Additionally, the video encoder 200 can apply a second transform after the first transform, such as Mode Correlated Inseparable Second Transform (MDNSST), Signal Correlation Transform, Karhunen-Loeve Transform (KLT), etc. The video encoder 200 produces transform coefficients after applying one or more transforms.

[0076] As noted above, after any transform that produces the transform coefficients, the video encoder 200 may perform quantization on the transform coefficients. Quantization generally refers to a process in which the transform coefficients are quantized to reduce the amount of data used to represent them, thereby providing further compression. By performing the quantization process, the video encoder 200 may reduce the bit depth associated with some or all of the transform coefficients. For example, the video encoder 200 may round an n-bit value down 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 on the value to be quantized.

[0077] After quantization, the video encoder 200 can scan the transform coefficients to generate a one-dimensional vector from a two-dimensional matrix containing the quantized transform coefficients. The scan can be designed to place higher-energy (and therefore lower-frequency) transform coefficients before the vector and lower-energy (and therefore higher-frequency) transform coefficients after the vector. In some examples, the video encoder 200 can utilize a predefined scan order to scan the quantized transform coefficients to produce a serialized vector, and then entropy-encode the quantized transform coefficients of that vector. In other examples, the video encoder 200 can perform an adaptive scan. After scanning the quantized transform coefficients to form a one-dimensional vector, the video encoder 200 can entropy-encode the one-dimensional vector, for example, according to context-adaptive binary arithmetic decoding (CABAC). The video encoder 200 can also entropy-encode the values ​​of syntax elements describing metadata associated with the encoded video data, which is used by the video decoder 300 when decoding the video data.

[0078] To perform CABAC, the video encoder 200 can assign context within a context model to the symbols to be transmitted. Context may involve, for example, whether the neighboring values ​​of a symbol are zero. Probability determination can be based on the context assigned to the symbols.

[0079] The video encoder 200 may further generate syntax data for the video decoder 300, such as block-based syntax data, image-based syntax data, and sequence-based syntax data, for example, in image headers, block headers, and slice headers, or generate other syntax data such as sequence parameter sets (SPS), image parameter sets (PPS), or video parameter sets (VPS). The video decoder 300 may also decode such syntax data to determine how to decode the corresponding video data.

[0080] In this way, the video encoder 200 can generate a bitstream that includes encoded video data, such as syntax elements describing the partitioning of images into blocks (e.g., CUs) and prediction and / or residual information for the blocks. Finally, the video decoder 300 can receive the bitstream and decode the encoded video data.

[0081] Typically, the video decoder 300 performs the reverse process of the video encoder 200 to decode the encoded video data of the bitstream. For example, the video decoder 300 can use CABAC to decode the values ​​of syntax elements used for the bitstream in a manner substantially similar to but reversed by the CABAC encoding process of the video encoder 200. Syntax elements can define partitioning information for dividing a picture into CTUs and defining the CUs of each CTU according to a corresponding partitioning structure such as a QTBT structure. Syntax elements can further define prediction and residual information for video data blocks (e.g., CUs).

[0082] The residual information can be represented, for example, by quantized transform coefficients. The video decoder 300 can inversely quantize and inverse transform the quantized transform coefficients of the block to reconstruct the residual block for the block. The video decoder 300 uses a signaling prediction mode (intra-frame prediction or inter-frame prediction) and associated prediction information (e.g., motion information for inter-frame prediction) to form a prediction block for the block. The video decoder 300 can then combine the prediction block and the residual block (on a sample-by-sample basis) to reconstruct the original block. The video decoder 300 can perform additional processing, such as performing a deblocking process to reduce visual artifacts along the block boundaries.

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

[0084] As described above, video decoding standards include ITU-T H.261, ISO / IEC MPEG-1 Visual, ITU-T H.262 or ISO / IEC MPEG-2 Visual, ITU-T H.263, ISO / IEC MPEG-4 Visual, and ITU-T H.264 (also known as ISO / IEC MPEG-4 AVC), including its Scalable Video Decoding (SVC) and Multi-View Video Decoding (MVC) extensions.

[0085] In addition, High Efficiency Video Decoding (HEVC), or ITU-T H.265 HEVC, including its extensions, Multi-View Extension (MV-HEVC), and Scalable Extension (SHVC), has been developed by the Joint Collaborating Group on Video Decoding (JCT-VC) and the Joint Collaborating Group on 3D Video Decoding Extensions of the ITU-T Video Decoding Experts Group (VCEG) and the ISO / IEC Moving Picture Experts Group (MPEG) (JCT-3V). The latest HEVC draft specification (hereinafter referred to as HEVC WD) is available at http: / / phenix.int-evry.fr / jct / doc_end_user / documents / 14_Vienna / wg11 / JCTVC-N1003-v1.zip

[0086] ITU-T VCEG (Q6 / 16) and ISO / IEC MPEG (JTC 1 / SC 29 / WG 11) investigated the potential need for standardization of future video decoding technologies with compression capabilities significantly exceeding those of the current HEVC standard, including its current and recent extensions for screen content decoding and high dynamic range decoding. The groups collaborated on this exploration in a joint project known as the Joint Video Exploration Team (JVET) to evaluate compression technology designs proposed by experts in the field. The latest version of the reference software, VVC Test Model 10 (VTM 10), is available for download at: https: / / vcgit.hhi.fraunhofer.de / jvet / VVCSoftware_VTM

[0087] The draft specification for Multifunctional Video Decoder (VVC) can be found in JVET-T2001. The algorithm description for Multifunctional Video Decoder and Test Model 10 (VTM 10.0) can be found in JVET-T2002.

[0088] The following describes IntraTM (Intra Template Matching). IntraTM prediction (also known as Intra TMP) is a special intra prediction mode that copies the best prediction block from the reconstructed portion of the current frame, whose L-shaped, left-hand, or top-hand template matches the current template. For a predefined search range (e.g., a search region), the video encoder 200 searches for the template most similar to the current template in the reconstructed portion of the current frame (image) and uses the corresponding block as the prediction block. The video encoder 200 then signals the use of this mode, and the video decoder 300 performs the same prediction operation on the decoder side.

[0089] Figure 6 This is a conceptual diagram illustrating an example of an intra-frame template matching search region. It compares the L-shaped, left-hand, or top-hand causal neighbors of the current block 600 with... Figure 6 The prediction signal (e.g., the prediction block) is generated by matching another block in a predefined search region, which consists of the following: R1: the upper CTU, R2: the left CTU below the current block 600, R3: the left CTU above the current block 600 plus the upper left portion of the current CTU, R4: the top portion of the current CTU, R5: the lower left portion of the current CTU, and R6: the upper right portion of the current CTU.

[0090] The L-shaped template includes the left, top, and upper left template sections, collectively referred to as the reference template. The cost function can be the sum of absolute differences (SAD).

[0091] Within each region, the video decoder searches for the template with the minimum SAD relative to the current template and uses its corresponding block as the prediction block. In this technique, the dimensions of all regions (SearchRange_w, SearchRange_h) are set to be proportional to the block size (BlkW, BlkH) to have a fixed number of SAD comparisons per pixel. That is: SearchRange_w = max(a BlkW, MinRange) and SearchRange_h = max (a BlkH,MinRange), where " " is a constant that controls the gain / complexity tradeoff, and MinRange is the minimum linear search region size. In fact, " "Equals 5, MinRange=64."

[0092] therefore, Figure 6 An example of a predefined search region based on the size of the current block (e.g., current block 600) is illustrated. For instance, the size of current block 600 (e.g., width (BlkW) and height (BlkH)) and the possible positions of current block 600 can indicate the locations of zones R1 through R6. However, the positions of zones R1 through R6 can be predefined based on the size of current block 600. For example, R1 is above CTU, and the position of R1 relative to the size of current block 600 is predefined. The same applies to the other zones R2 through R6.

[0093] Intra-template matching tools are enabled for CUs with a width and height of 64 or less. The maximum CU size used for intra-template matching is configurable. When DIMD is not used for the current CU, the intra-template matching prediction mode is signaled at the CU level via a dedicated flag.

[0094] In some examples, the search area (also referred to as the search region) Figure 6 The template matching search (R1 to R6) is subsampled by an integer factor of 3. This reduces the template matching search by a factor of 9. After finding the best match, a multi-stage refinement process is performed, in which another template matching search is performed around the best match with a reduced search range, which is limited to the regions from sets R1, R2, R3, R4, R5, and R6 where the best match was found in the first stage. The refined search range is fixed at 1.

[0095] In one or more examples, in terms of decoding efficiency, the predicted signal (e.g., the predicted block) is determined based on a search utilizing a predefined search region (such as...). Figure 6The example shown may not necessarily lead to the best predicted block. That is, there may exist another block located outside the predefined search area that better approximates the current block 600 compared to the block within the predefined search area.

[0096] However, searching for blocks that better approximate the current block 600, including the entire image of the current block 600, can increase processing latency. In one or more examples, the video encoder 200 and decoder 300 may be configured to determine one or more additional search regions (e.g., in addition to predefined search regions) based on one or more block vectors (e.g., vectors pointing to samples in the same image as the current block 600). In this way, the video encoder 200 and video decoder 300 do not need to search the entire current image for blocks that better approximate the current block 600, but can instead define additional search regions in which there is a higher probability of a block that better approximates the current block 600. For example, the block vector used to determine the additional search regions could be a block vector predictor of the current block, such as the block vectors of adjacent (e.g., neighboring) blocks.

[0097] Inter-frame template matching (InterTM) is described below. InterTM is a decoder-side MV derivation method that refines the motion information of the current CU 702 in the current frame 700 (e.g., current image 700) by finding the closest match between a template in the current image (i.e., the top and / or left adjacent block of the current CU) and a block in a reference image (i.e., of the same size as the template). For example, Figure 7 The example shows the current template 704 formed by the upper template 704A and the left template 704B. Figure 7 A reference template in reference frame 706 (e.g., reference picture 706) is also illustrated.

[0098] like Figure 7 As illustrated, a better MV is searched around the initial motion of the current CU within a search range of [-8, +8] pixels. The template matching method in JVET-J0021, “Description of SDR, HDR and 360° video coding technology proposal by Qualcomm and Technicolor - low and high complexity versions”, is used with the following modifications: the search step size is determined based on the AMVR (Advanced Motion Vector Resolution) mode, and InterTM can be cascaded with the bilateral matching process in the merge mode.

[0099] In AMVP (Advanced Motion Vector Prediction) mode, MVP (Motion Vector Predictor) candidates are determined based on template matching error to select the MVP candidate that achieves the minimum difference between the current block template (e.g., current template 704) and the reference block template (e.g., the reference template in reference frame 706). InterTM is then performed only for that specific MVP candidate for MV refinement. InterTM refines the MVP candidate by using an iterative diamond search, starting with full-pixel MVD precision (or 4 pixels in 4-pixel AMVR mode) within a search range of [-8, +8] pixels. The AMVP candidate can be further refined by using a cross search with full-pixel MVD precision (or 4 pixels in 4-pixel AMVR mode), followed by half-pixels and quarter-pixels sequentially according to the AMVR mode specified in Table 1. This search process ensures that the MVP candidate maintains the same MV precision as indicated by the AMVR mode after the TM process. During the search process, if the difference between the previous minimum cost and the current minimum cost in the iteration is less than a threshold (equal to the area of ​​the block), the search process terminates.

[0100] Table 1. Search patterns for AMVR and merged patterns with AMVR.

[0101]

[0102] In merge mode, a similar search method is applied to the merge candidates indicated by the merge index. As shown in Table 1, depending on whether an alternative interpolation filter is used based on the motion information of the merge (used when AMVR is in half-pixel mode), InterTM can perform up to 1 / 8 pixel MVD accuracy or skip those accuracies beyond half-pixel MVD accuracy. When TM mode is enabled, template matching can work as a separate process between block-based and sub-block-based bilateral matching (BM) methods or as an additional MV refinement process, depending on whether BM can be enabled according to the BM enablement criteria.

[0103] The following describes adaptive reordering of merge candidates with template matching (ARMC-TM). Merge candidates are adaptively reordered using template matching (TM). The reordering method is applied to the regular merge pattern, the TM merge pattern, and the affine merge pattern (excluding SbTMVP candidates). For the TM merge pattern, the merge candidates are reordered before the refinement process.

[0104] First, an initial merge candidate list is constructed based on a given inspection order such as spatial, TMVP (Temporal Motion Vector Predictor), non-adjacent, HMVP (History-Based Motion Vector Predictor), paired, and virtual merge candidates. Then, the candidates in the initial list are divided into several subgroups. For Template Matching (TM) merge mode and Adaptive DMVR (Decoder-Side Motion Vector Refinement) mode, each merge candidate in the initial list is first refined using TM / multi-pass DMVR. The merge candidates in each subgroup are reordered to generate a reordered merge candidate list, and the reordering is based on the cost value based on template matching. The index of the selected merge candidate in the reordered merge candidate list is signaled to the video decoder 300. For simplicity, merge candidates in the last subgroup, but not the first subgroup, are not reordered. During the construction of the merged motion vector candidate list, all zero candidates from the ARMC reordering process are excluded. For regular merge mode and TM merge mode, the subgroup size is set to 5. For affine merge mode, the subgroup size is set to 3.

[0105] For cost calculation, the template matching cost value of merging candidates during the reordering process is measured by the SAD between the samples of the template in the current block and the corresponding reference samples of those samples. For example, Figure 8 Examples include the current block 802 in the current image 800 which has the current template 803, the reference block 806 in the reference image in reference list 0 which has the reference template 810, and the reference block 804 in the reference image in reference list 1 which has the reference template 812.

[0106] Template 803 includes a set of reconstructed samples adjacent to the current block 802. Reference samples for template 806 or 812 are located using motion information from the merging candidates. When merging candidates utilize bidirectional prediction, reference samples for template 806 or 812 of the merging candidates are also generated using bidirectional prediction, such as... Figure 8 As shown.

[0107] For refining the initial merge candidate list, when using multi-pass DMVR to derive the refined motion to the initial merge candidate list, only the first pass of the multi-pass DMVR (i.e., PU level) is applied during reordering. When using template matching to derive the refined motion, the template size is set to equal to 1. When the block is flat (block width greater than twice the height) or narrow (height greater than twice the width), only the top or left template is used during TM motion refinement. TM is expanded to perform 1 / 16 pixel MVD precision. The first four merge candidates are reordered using the refined motion in TM merge mode.

[0108] For a sub-block-based merge candidate with a sub-block size equal to Wsub × Hsub, the above template includes several sub-templates of size Wsub × 1, and the left template includes several sub-templates of size 1 × Hsub. For example... Figure 9 As shown, the motion information of the sub-blocks in the first row and first column of the current block 802 is used to derive the reference sample for each sub-template.

[0109] During the reordering process, if the cost difference between a candidate and its predecessor is less than λ, for example, |D1-D2|<λ, the candidate is considered redundant, where D1 and D2 are the costs obtained during the first ARMC ordering, and λ is the Lagrange parameter used in the RD criterion at the encoder side.

[0110] The algorithm is defined as follows: Determine the minimum cost difference between a candidate and its predecessor among all candidates in the list. If the minimum cost difference is greater than or equal to λ, the list is considered sufficiently diverse, and reordering stops. If the minimum cost difference is less than λ, the candidate is considered redundant, and it is moved to another position in the list. This other position is the first position where the candidate is sufficiently diverse compared to its predecessor. After a finite number of iterations (if the minimum cost difference is not less than λ), the algorithm stops.

[0111] This algorithm is applied to conventional, TM, BM, and affine merging modes. A similar algorithm is applied to merging MMVD and symbolic MVD prediction methods, both of which also use ARMC for reordering.

[0112] The value of λ is set to be equal to the rate-distortion criterion used by the video encoder 200 for selecting the best merging candidate for the low-latency configuration at the encoder side, and equal to the λ value corresponding to another QP (quantization parameter) used for the random access configuration. A set of λ values ​​corresponding to each signaled QP offset is provided in the SPS (Sequence Parameter Set) or in the slice header for QP offsets not present in the SPS.

[0113] To extend to AMVP mode, the ARMC design also applies to AMVP mode, where AMVP candidates are reordered based on TM cost values. For template matching in Advanced Motion Vector Prediction (TM-AMVP) mode, an initial AMVP candidate list is constructed, then refined from the TM to construct a refined AMVP candidate list. Additionally, MVP candidates with TM cost values ​​greater than a threshold equal to five times the cost of the first MVP candidate are skipped. In some examples, when orbital motion compensation is enabled, MV candidates may be pruned to account for orbital offset.

[0114] The following describes the Geometric Partitioning Mode (GPM) with Template Matching (TM). Template Matching is applied to GPM. When GPM mode is enabled for a CU, a CU-level flag is signaled to indicate whether TM is applied to the two geometric partitions. TM is used to refine the motion information of each geometric partition. When TM is selected, a template is constructed using the left, top, or top-left adjacent samples, as shown in Table 2, depending on the partition angle. Then, with the half-pixel interpolation filter disabled, the motion is refined by minimizing the difference between the current template and the template in the reference image, using the same search pattern of the merging mode.

[0115] Table 2. Templates for the first and second geometric partitions, where A indicates the use of top samples, L indicates the use of left samples, and L+A indicates the use of both left and top samples.

[0116]

[0117] The GPM candidate list is constructed as follows: Interleaved lists -0 and -1 MV candidates are derived directly from the regular merged candidate list, with -0 MV candidates having higher priority than -1 MV candidates. A pruning method with an adaptive threshold based on the current CU size is applied to remove redundant MV candidates. Interleaved lists -1 and -0 MV candidates are further derived directly from the regular merged candidate list, with -1 MV candidates having higher priority than -0 MV candidates. The same pruning method with an adaptive threshold is also applied to remove redundant MV candidates. Zero MV candidates are filled until the GPM candidate list is full.

[0118] GPM-MMVD and GPM-TM can be enabled for only one GPM CU. This is done by first signaling the GPM-MMVD syntax. When both GPM-MMVD control flags are false (i.e., GPM-MMVD is disabled for both GPM partitions), the GPM-TM flag is signaled to indicate whether template matching should be applied to both GPM partitions. Otherwise (if at least one GPM-MMVD flag is true), the GPM-TM flag is presumed to be false.

[0119] The following describes intra-block copying (IBC) with template matching. Template matching is used in both IBC merge mode and IBC AMVP mode.

[0120] Compared to the merge list used in the regular IBC merge mode, the IBC-TM merge list is modified to select candidates based on a pruning method, where there is a motion distance between candidates, as in the regular TM merge mode. The zero-motion termination is replaced by motion vectors to the left (-W, 0), up (0, -H), and top left (-W, -H), where W is the width of the current CU and H is its height.

[0121] In IBC-TM merging mode, the selected candidates are refined using template matching before the RDO (Rate Distortion Optimization) or decoding process. IBC-TM merging mode competes with the regular IBC merging mode and signals the TM merging flag.

[0122] In the IBC-TM AMVP mode, up to three candidates can be selected from the IBC-TM merge list. Each of these three selected candidates is refined using a template matching method, and they are categorized based on their resulting template matching cost values. Then, during motion estimation, typically only the first two selected candidates are considered.

[0123] For both IBC-TM merging and AMVP modes, template matching refinement is based on the constraint that the IBC motion vector is (i) an integer and (ii) within the reference region, such as... Figures 10A to 10D As shown. Figures 10A to 10D The positions of current blocks 1000A to 1000D are illustrated. In IBC-TM merge mode, all thinning can be performed with integer precision, and in IBC-TM AMVP mode, thinning can be performed with integer or 4-pixel precision based on the AMVR value. This thinning only accesses samples without interpolation. In both cases, the motion vectors refined in each thinning step and the template used must adhere to the constraints of the reference region.

[0124] Template matching techniques can present certain problems. The search range used for IntraTMP in ECM (also known as the regular search range or predefined search region) is a rectangle with dimensions proportional to the current block size (excluding unavailable regions). This design fails to guarantee optimal candidate capture, leaving many useful candidates outside the range (e.g., regions), while simple search range (e.g., region) expansion increases computational complexity without achieving a good trade-off with compression ratio. Furthermore, current ECM designs implement both narrow and long search ranges, e.g., half a size of 64×160 (for a block size of 8×32). This design ignores a portion of fairly close and efficient candidates, while the more distant parts of the search range do not provide as many optimal candidates. Since any change that leads to search range expansion increases the number of TM cost value calculations, computational simplification can be beneficial to compensate for the increased complexity.

[0125] This disclosure describes various techniques for defining improved search ranges within a frame (e.g., an image) for use with TM-based tools. Elements of the described techniques may be used independently or in any combination. Furthermore, unless specifically indicated, offsets hereinafter specify the amount of offset from the current block to a reference block. For example, a reference block with top-left coordinates (4; 4) has an offset of (-4; -8) relative to the current block with top-left coordinates (8; 12).

[0126] Improvements to the search region (e.g., search range) are described below. For example, techniques for changing the search region are disclosed. These techniques can be applied to any search involving the search region, such as IntraTMP, InterTM, ARMC-TM, GPM-TM, and IBC-TM. The techniques disclosed in this disclosure are used on the decoder side (e.g., by video decoder 300), however, they can be used on the encoder side (e.g., by video encoder 200, such as for reconstructing a portion of the loop or otherwise).

[0127] Regarding the search region size dependency, in ECM, the search region size is derived from the block size: SearchRangeW=max(a⋅BlkW,MinSR), and SearchRangeH=max(a⋅BlkH,MinSR).

[0128] In one or more examples of the techniques described in this disclosure, the search region size may depend on both the width and height of the current block. In one example, the search region is square-shaped, and its size is linear over the larger size of the block: SearchRangeW = SearchRangeH = a⋅max(BlkW, BlkH). In another example, a minimum size constraint on the search region may be enforced: SearchRangeW = SearchRangeH = max(a⋅max(BlkW, BlkH), MinSR). In another example, a maximum size constraint on the search region may be enforced: SearchRangeW = SearchRangeH = min(a⋅max(BlkW, BlkH), MaxSR). In yet another example, the minimum and maximum constraints may be combined.

[0129] Therefore, in one or more examples, a video decoder (e.g., video encoder 200 or video decoder 300) may be configured to determine a search region for template matching based on at least one of the width or height of the current block, determine a prediction block based on the search region, and decode (e.g., encode or decode) the current block based on the prediction block.

[0130] In other words, in one or more examples, the video encoder 200 and video decoder 300 may determine a predefined search region based on the size of the current block within the current image. In some examples, the predicted block of the current block is within this predefined search region, and the video encoder 200 and video decoder 300 may determine the predicted block within the predefined search region based on template matching techniques. However, according to one or more examples described in this disclosure, the video encoder 200 and video decoder 300 may determine additional search regions based on block vectors, and determine the predicted block based on the predefined search region and one or more additional search regions. That is, the video encoder 200 and video decoder 300 may perform template matching techniques (e.g., determine template matching cost values) for blocks within the predefined search region and one or more additional search regions.

[0131] For the axis search region, in ECM, all available candidates within the rectangular range with horizontal offsets within the range [-SearchRangeW; +SearchRangeW] and vertical offsets within the range [-SearchRangeH; +SearchRangeH] are considered, while candidates with horizontal offsets less than -SearchRangeW or vertical offsets less than -SearchRangeH are not considered. Given a block with a top-left positioning (X, Y), the rectangular search region has a top-left positioning of (X -SearchRangeW, Y - SearchRangeH), a bottom-left positioning of (X - SearchRangeW, Y +SearchRangeH), and a top-right positioning of (X + SearchRangeW, Y - SearchRangeH).

[0132] In one or more examples of the techniques described in this disclosure, the left boundary of the rectangular search range described above may be extended from -SearchRangeW to -SearchRangeAxisW, where SearchRangeAxisW is greater than SearchRangeW.

[0133] Similarly, the top boundary of the rectangular search range described above can be expanded from -SearchRangeH to -SearchRangeAxisH, where SearchRangeAxisH is greater than SearchRangeH.

[0134] In one example, the horizontal search region of range [-SearchRangeAxisW, -SearchRangeW-1] may be partially skipped from the search, excluding certain portions. For example, video encoder 200 and video decoder 300 may search within the search region, excluding portions of blocks with vertical offsets limited to a threshold T_H in absolute value. In one example, the vertical search region of range [-SearchRangeAxisH, -SearchRangeH-1] is partially skipped, excluding portions of blocks with horizontal offsets limited to a threshold T_W in absolute value. In one example, correspondingly, T_W and T_H may be smaller numbers compared to SearchRangeAxisW and SearchRangeAxisH.

[0135] In another example, the rectangular search range described above can be expanded by the following two rectangles: a block whose absolute vertical offset does not exceed the threshold T_H and whose absolute horizontal offset is within the range [-SearchRangeAxisW; -SearchRangeW-1]; and a block whose absolute horizontal offset does not exceed the threshold T_W and whose absolute vertical offset is within the range [-SearchRangeAxisH; -SearchRangeH-1].

[0136] In one example, the horizontal axis region is centered at the vertical position of XXX. Then, the search area for the horizontal axis region is defined as the upper-left position at (-SearchRangeAxisW, XXX - H) and the lower-right position at (-SearchRangeW-1, XXX + H). Where H... 2 represents the height of the horizontal axis region. XXX lies within the range [Y - SearchRangeH + H, Y + SearchRangeH - H]. In one example, XXX equals 0.

[0137] In one example, the vertical axis region is centered at the horizontal position of YYY. Then, the search area for the vertical axis region is defined as the upper-left position at (YYY - W, -SearchRangeAxisH) and the lower-right position at (YYY + W, -SearchRangeH-1). Where W... 2 represents the width of the vertical axis region. YYY falls within the range [X - SearchRangeW + W, X + SearchRangeW - W]. In one example, YYY equals 0.

[0138] In one example, T_W and T_H are correspondingly less than SearchRangeAxisW and SearchRangeAxisH. In another example, T_W and T_H are set to be equal to a certain constant T. In yet another example, T_W and T_H are chosen to be proportional to the block width and height. In yet another example, T_W and T_H are additionally restricted to be no less than the value T_min and / or no greater than the value T_max.

[0139] In one example, this can be achieved by adding elements that are completely located in the context described above and Figure 11B The expansion is achieved by using two regions (called axis regions) outside the rectangular search range shown. For example, Figure 11A Examples are shown of the horizontal and vertical zones (zones 1 to 6) located outside the standard range of the CTU 1100A. Figure 11B Examples are shown of the horizontal and vertical zones (zones 1 to 6) within the standard range of the CTU 1100B.

[0140] In another example, the added region, referred to as the axis region, can be defined as including a portion of a rectangular search range, while the division of that rectangular range into the search region should be adjusted accordingly to avoid region interception within that region (e.g., Figure 11A In this example, the search area along the vertical axis is then defined as the top-left location at (YYY - W, -SearchRangeAxisH) and the bottom-right location at (YYY + W, -BlkH). Where W... 2 is the width of the vertical axis region, and SearchRangeAxisH is the height of the vertical axis region. In this example, the search area of ​​the horizontal axis region is then defined as the top-left position at (-SearchRangeAxisW, XXX - H) and the bottom-right position at (-BlkW, XXX + H), where SearchRangeAxisW is the width of the horizontal axis region, and H... 2 represents the height of the horizontal axis region.

[0141] In one example, the axis region is checked after the region within the rectangular search range. In another example, the axis region is checked before one or more regions within the rectangular search range.

[0142] Therefore, in one or more examples, a video decoder (e.g., video encoder 200 or video decoder 300) can be configured to determine a search region for template matching, which extends at least vertically or horizontally from the current block to a corresponding search axis, determine a prediction block based on the search region, and decode (e.g., encode or decode) the current block based on the prediction block. That is, Figure 11A and Figure 11BExamples are given in addition to predefined search areas (such as...) Figure 6 The video encoder 200 and video decoder 300 can use template matching techniques to search for examples of additional search regions outside of those predefined search regions to determine the prediction block of the current block.

[0143] The foregoing description provides an example of how video encoder 200 and video decoder 300 can search for one or more additional search regions to determine predicted blocks. As described in more detail, according to one or more examples described in this disclosure, video encoder 200 and video decoder 300 can determine one or more block vectors and determine one or more additional search regions based on these block vectors. Block vectors can be block vector predictors, such as block vectors of adjacent (e.g., neighboring) blocks. Block vectors can identify samples that are in the same image as the current image.

[0144] To further expand the search area around the selected block vector, the video encoder 200 and video decoder 300 can select block vectors and perform searches in specific neighborhoods around those block vectors. In one example, the selected block vector could be a block vector predictor of the current block, such as a neighboring block vector or a merged candidate block vector.

[0145] For example, video encoder 200 and video decoder 300 can determine a predefined search region based on the size of the current block within the current image. An example of a predefined search region is... Figure 6 The regions R1 to R6 are illustrated in the figure. The video encoder 200 and the video decoder 300 may also determine one or more block vectors (e.g., determine the block vector predictor of the current block from the block vectors of neighboring blocks), and determine one or more additional search regions based on one or more block vectors.

[0146] Video encoder 200 and video decoder 300 may determine a predicted block for the current block based on a predefined search region and one or more additional search regions. As an example, video encoder 200 and video decoder 300 may determine a template matching cost value between the current template of the current block and the corresponding templates of predicted blocks in the predefined search region and one or more additional search regions. For example, video encoder 200 and video decoder 300 may start with a first predicted block within a predefined search region or one or more additional search regions and determine a template for the first predicted block (e.g., the template may be based on samples around a first reference block). Video encoder 200 and video decoder 300 may determine a first template matching cost value between the first reference block and the current block by comparing (e.g., determining SAD values ​​or other techniques described in this disclosure) the template of the first reference block and the current template of the current block.

[0147] Video encoder 200 and video decoder 300 may repeat this operation for other prediction blocks in a predefined search region and one or more additional search regions to determine multiple template matching cost values. Additionally, in some examples, video encoder 200 and video decoder 300 may perform a refinement operation, whereby they determine additional prediction blocks based on prediction blocks in the predefined search region and one or more additional search regions. Video encoder 200 and video decoder 300 may also determine template matching cost values ​​for these additional prediction blocks. That is, the template matching cost value of the prediction block before refinement may be considered a first template matching cost value, and the template matching cost value of these additional prediction blocks may be referred to as a second template matching cost value. Video encoder 200 and video decoder 300 may determine the prediction block for the current block based on the first and second template matching cost values.

[0148] For example, video encoder 200 and video decoder 300 can determine a prediction block with the lowest template matching cost value. Video encoder 200 and video decoder 300 can determine additional prediction blocks based on neighboring samples of the prediction block with the lowest template matching cost value.

[0149] Video encoder 200 and video decoder 300 may determine a prediction block based on a template matching cost value (e.g., the template matching cost value of a prediction block searched within a predefined search region and one or more additional search regions). As an example, video encoder 200 and video decoder 300 may determine a prediction block as associated with the lowest template matching cost value. As another example, video encoder 200 and video decoder 300 may construct a candidate list of prediction blocks arranged based on corresponding template matching cost values ​​(e.g., from the lowest template matching cost value to the highest template matching cost value). Video encoder 200 may signal and video decoder 300 may receive an index identifying the prediction block in the candidate list.

[0150] The search region can be expanded by using candidates as center locations and one or more predefined shape regions surrounding these center locations. Candidates can be derived from the IBC merge list of the current block. One or more candidates can be used as center locations to define the added search region. That is, each candidate can be a block vector from the IBC merge list of the current block. A first block vector can point to the center location of a first additional search region, a second block vector can point to the center location of a second additional search region, and so on. Therefore, to determine one or more additional search regions, the video encoder 200 and the video decoder 300 can determine a corresponding center sample identified by each of the one or more block vectors, and determine a corresponding predefined shape region surrounding each center sample. As described in more detail, the predefined shape region can include either a rectangular shape or a cross shape.

[0151] For example, in one example, the added search region may have a rectangular shape and include blocks with an absolute horizontal offset from the center not exceeding SearchRangeBV_W and an absolute vertical offset from the center not exceeding SearchRangeBV_H. Figure 12A ).For example, Figure 12A The rectangular block vector (BV) region surrounding the merged candidate 1200A is illustrated.

[0152] In another example, the added search area may have a cross shape, which is part of the rectangle described in the previous example, including blocks with an absolute horizontal offset of no more than T_W from the center or an absolute vertical offset of no more than T_H from the center. Figure 12B ).For example, Figure 12B An example is shown of the cross-shaped block vector (BV) region surrounding the merge candidate 1200B.

[0153] In one example, the parameters SearchRangeBV_W, SearchRangeBV_H, T_W, and T_H can be set to constants. In another example, these parameters may depend on the block width and height. In yet another example, the added search region is divided into several sub-regions, one of which can be considered the master sub-region. First, the master sub-region is checked. If no candidate is obtained from that region, all other sub-regions of that region are skipped. In one example, if all candidates in the master sub-region have a TM cost value greater than a threshold, the entire region can be skipped. In one example, this threshold is set to the maximum TM cost value in the current candidate list.

[0154] As an example, one of the one or more additional search regions may include a primary sub-region and other sub-regions. To determine the template matching cost value, the video encoder 200 and video decoder 300 may determine the template matching cost value between the current template and the corresponding template of the prediction block in the primary sub-region. Based on the fact that no template matching cost value among the template matching cost values ​​between the current template and the corresponding template of the prediction block in the primary sub-region meets a threshold, the video encoder 200 and video decoder 300 may determine the template matching cost value between the current template and the corresponding template of the prediction block in other sub-regions. In this way, the complexity and processing latency associated with inspecting the additional search regions as a whole can be minimized.

[0155] In one example, the added area in the cross shape is divided into a central square area and four lobes ( Figure 13 (), where the central square area is the primary sub-region. For example, Figure 13 Center 1300 and lobes 1302A to 1302D are illustrated. In yet another example, if a candidate in the current search region is located in the overlapping area of ​​the current search region and one of the previous search regions, the candidate can be forcibly excluded.

[0156] Therefore, in one or more examples, a video decoder (e.g., video encoder 200 or video decoder 300) may be configured to determine one or more block vectors of one or more blocks adjacent to the current block, determine a search region for template matching based on the determined one or more block vectors, determine a prediction block based on the search region, and decode (e.g., encode or decode) the current block based on the prediction block. The search region for template matching may be a search region other than a predefined search region predefined based on the size of the current block.

[0157] The following describes an example technique for optimizing TM cost value calculation. This example technique can be applied to any type of search involving template matching. Additionally, different TM cost value functions can be used at different stages of a multi-stage search.

[0158] For subsampled TM cost values, to reduce the number of operations at the TM cost value calculation site, only a portion of the template is available for cost calculation. Additionally, a multiplier factor equal to the ratio between the entire region and the region used can be applied to the calculated cost. In one example, only a few rows of the template used to derive the TM cost value are selected for cost derivation; for example, the template may be subsampled before cost calculation. The cost derived from an incomplete template (e.g., excluding some samples or sampled rows, or in cases where the template is subsampled) is called the subsampled TM cost value, and when the cost is derived using the complete template, it is called the complete TM cost value. In another example, within each template row, only a portion of that row is used for cost calculation.

[0159] In another example, the template portion used for TM cost value calculation is selected according to the checkerboard pattern, thereby interweaving the used and unused areas in the template. Figure 14 Examples of this pattern are provided. For example, in Figure 14 In this context, only zones 1400A to 1400J can be used for TM cost value calculation, where zones 1400A to 1400J are adjacent to block 1402 (e.g., the current block or the reference block). That is, zones 1400A to 1400J can be at least one of the zones in the current template or the reference template.

[0160] In another example, the subsampled TM cost value is used only at specific search stages. For instance, the subsampled TM cost value is used only in the first stage, while the full TM cost value is used in other stages.

[0161] Therefore, in one or more examples, a video decoder (e.g., video encoder 200 or video decoder 300) may be configured to determine a template for template matching to decode the current block, determine the cost of the template based on a portion of the template smaller than the whole template (e.g., only for zone 1400), determine a predicted block for the current block based on the cost of the template, and decode (e.g., encode or decode) the current block based on the predicted block.

[0162] For the low-pass filtered TM cost value (LP-TM cost value), a preliminary low-pass filtering operation is applied to the reference template and the current template before the TM cost value is calculated. In another example, the filter is applied to the reference template and the current template after subtracting the reference sample value from the current sample value, but before extracting the absolute value of the result. In one example, to reduce the number of usability checks during filtering, padding is unconditionally applied to all points outside the template. In another example, the template is divided into several blocks, and filtering is performed independently in each of these blocks, with padding unconditionally applied to all points located outside these blocks. In another implementation, the LP-TM cost value is used at specific search stages (e.g., at the sparse search stage), while the unfiltered TM cost value is used in other stages.

[0163] Therefore, in one or more examples, a video decoder (e.g., video encoder 200 or video decoder 300) may be configured to filter at least one of a reference template and a current template to perform template matching for decoding the current block to generate at least one of a filtered reference template or a filtered current template, determine a cost based on the filtered reference template and the filtered current template, determine a predicted block for the current block based on the cost, and decode (e.g., encode or decode) the current block based on the predicted block.

[0164] To reduce the number of operations in early TM cost value calculations (e.g., TM-SAD calculations) for candidates with high TM cost values, the template can be divided into several parts that are processed independently of each other. In one example, the total TM cost value is the sum of the costs of its individual parts. A threshold is defined for each of these parts. In one example, if the cost calculated in any part exceeds the threshold selected for that part, the cost calculation can be terminated (and the candidate discarded). In one example, the individual threshold for a template part is set to the current maximum TM cost value in the list multiplied by a factor equal to the area ratio of those template parts.

[0165] Therefore, in one or more examples, a video decoder (e.g., video encoder 200 or video decoder 300) may be configured to divide a first reference template and a current template into multiple parts, the multiple parts including a first part of the reference template smaller than the whole of the reference template and a first part of the current template smaller than the whole of the current template, determine a cost based on the first part of the reference template and the first part of the current template, discard a first reference template used to determine a predicted block of the current block based on a cost greater than a threshold, determine a predicted block of the current block based on a second reference template, and decode (e.g., encode or decode) the current block based on the predicted block.

[0166] As described above, the example techniques can be used with video encoder 200 or video decoder 300. For example, in the example above, decoding the current block may include decoding the current block. Video decoder 300 may be configured to receive residual information indicating the difference between the current block and the prediction block, and to add the residual information to the prediction block to generate the current block.

[0167] As another example, decoding the current block may include decoding the current block as part of a reconstruction loop in the video encoding process. For example, video encoder 200 may include a reconstruction loop in which it reconstructs the current block after encoding it. Video encoder 200 may perform example techniques as part of this reconstruction loop. However, in some examples, video encoder 200 may perform example techniques as part of encoding the current block.

[0168] Figure 2 This is a block diagram illustrating an example video encoder 200 that can perform the techniques of this disclosure. Figure 2 This disclosure is provided for illustrative purposes and should not be construed as a limitation on the techniques extensively illustrated and described herein. For illustrative purposes, this disclosure describes the video encoder 200 in accordance with the techniques of VVC and HEVC. However, the techniques of this disclosure can be performed by video encoding devices configured for other video decoding standards and video decoding formats, such as AV1 and subsequent formats of AV1 video decoding.

[0169] exist Figure 2 In the example, 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, mode selection unit 202, residual generation unit 204, transform processing unit 206, quantization unit 208, inverse quantization unit 210, inverse transform processing unit 212, reconstruction unit 214, filter unit 216, DPB 218, and entropy coding unit 220 may be implemented in one or more processors or in processing circuitry. For example, the units of the video encoder 200 may be implemented as one or more circuit or logic elements as part of hardware circuitry, or as part of a processor, ASIC, or FPGA. Furthermore, the video encoder 200 may include additional or alternative processors or processing circuitry to perform these and other functions.

[0170] Video data storage 230 is an example of a storage system capable of storing video data to be encoded by components of video encoder 200. Video encoder 200 can receive data from, for example, video source 104 (…). Figure 1 The video data memory 230 receives video data stored in the video data memory 230. The DPB 218 is an example of a memory system that can act as a reference picture memory, storing reference video data for use when the video encoder 200 predicts subsequent video data. The video data memory 230 and DPB 218 can each be formed from any of one or more memory devices or memory cells, 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 DPB 218 can be provided by the same memory device or separate memory devices. In various examples, the video data memory 230 can be on-chip (as illustrated) with other components of the video encoder 200, or off-chip relative to those components.

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

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

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

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

[0175] The mode selection unit 202 includes a motion estimation unit 222, a motion compensation unit 224, and an intra-frame prediction unit 226. The mode selection unit 202 may include additional functional units for performing video prediction based on other prediction modes. As an example, the mode selection unit 202 may include a palette unit, an intra-frame block copying 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.

[0176] Mode selection unit 202 typically coordinates multiple coding channels to test combinations of coding parameters and the resulting rate-distortion values ​​for such combinations. Coding parameters may include the CTU-CU partitioning, the prediction mode for the CU, the transformation type of the residual data for the CU, the quantization parameters of the residual data for the CU, etc. Mode selection unit 202 can ultimately select a combination of coding parameters that has a better rate-distortion value compared to other tested combinations.

[0177] The video encoder 200 can divide an image retrieved from the video data storage 230 into a series of CTUs and encapsulate one or more CTUs within a slice. The mode selection unit 202 can divide the image's CTUs according to the tree structure described above (such as an MTT structure, QTBT structure, superblock structure, or the quadtree structure described above). As described above, the video encoder 200 can form one or more CUs by dividing the CTUs according to the tree structure. Such CUs are also commonly referred to as "video blocks" or "blocks".

[0178] Typically, mode selection unit 202 also controls its components (e.g., motion estimation unit 222, motion compensation unit 224, and intra-frame prediction unit 226) to generate predicted blocks for the current block (e.g., the current CU, or, in HEVC, the overlapping portion of PU and TU). To perform inter-frame prediction for the current block, motion estimation unit 222 may perform a motion search to identify one or more closely matching reference blocks in one or more reference pictures (e.g., one or more previously decoded pictures stored in DPB 218). Specifically, motion estimation unit 222 may calculate values ​​representing the similarity between a potential reference block and the current block, for example, based on sum of absolute differences (SAD), sum of squared differences (SSD), mean absolute difference (MAD), mean squared difference (MSD), etc. Motion estimation unit 222 may typically perform these calculations using sample-by-sample differences between the current block and the reference blocks under consideration. Motion estimation unit 222 may identify reference blocks with the lowest values ​​produced by these calculations to indicate the reference block that best matches the current block.

[0179] Motion estimation unit 222 can generate one or more motion vectors (MVs) that define the location of a reference block in a reference image relative to the location of the current block in the current image. Motion estimation unit 222 can then provide the motion vectors to motion compensation unit 224. For example, for unidirectional inter-frame prediction, motion estimation unit 222 can provide a single motion vector, while for bidirectional inter-frame prediction, motion estimation unit 222 can provide two motion vectors. Motion compensation unit 224 can then use the motion vectors to generate a prediction block. For example, motion compensation unit 224 can use the motion vectors to retrieve data for the reference block. As another example, if the motion vectors have fractional-sample accuracy, motion compensation unit 224 can interpolate the values ​​of the prediction block according to one or more interpolation filters. Furthermore, for bidirectional inter-frame prediction, motion compensation unit 224 can retrieve data for two reference blocks identified by corresponding motion vectors and combine the retrieved data, for example, by per-sample averaging or weighted averaging.

[0180] When operating according to the AV1 video decoding format, the motion estimation unit 222 and the motion compensation unit 224 can be configured to encode the decoded blocks of video data (e.g., both luma and chroma decoded blocks) using translational motion compensation, affine motion compensation, overlap block motion compensation (OBMC), and / or composite inter-intra-frame prediction.

[0181] As another example, for intra-prediction or intra-prediction decoding, intra-prediction unit 226 may generate a prediction block from samples adjacent to the current block. For example, for directional mode, intra-prediction unit 226 may typically mathematically combine the values ​​of adjacent samples and fill these calculated values ​​across the current block in a defined direction to produce a prediction block. As another example, for DC mode, intra-prediction unit 226 may calculate the average of the adjacent samples of the current block and generate a prediction block to include the resulting average for each sample of the prediction block.

[0182] When operating according to the AV1 video decoding format, the intra-frame prediction unit 226 can be configured to encode decoded blocks of video data (e.g., both luma and chroma decoded blocks) using directional intra-frame prediction, non-directional intra-frame prediction, recursive filter intra-frame prediction, luma-chroma (CFL) prediction, intra-block copying (IBC), and / or palette modes. The mode selection unit 202 may include additional functional units for performing video prediction based on other prediction modes.

[0183] Mode selection unit 202 provides a prediction block to residual generation unit 204. Residual generation unit 204 receives an uncoded raw version of the current block from video data memory 230 and a prediction block from mode selection unit 202. Residual generation unit 204 calculates the sample-by-sample difference between the current block and the prediction block. The resulting sample-by-sample difference defines the residual block for the current block. In some examples, residual generation unit 204 may also determine the differences between sample values ​​in the residual block to generate the residual block using residual differential pulse decoding modulation (RDPCM). In some examples, residual generation unit 204 may be formed using one or more subtractor circuits performing binary subtraction.

[0184] In the example where mode selection unit 202 divides a CU into PUs, each PU can be associated with a luma prediction unit and a corresponding chroma prediction unit. Video encoder 200 and video decoder 300 can support PUs of various sizes. As noted above, the size of a CU can refer to the size of the luma decoding block of the CU, while the size of a PU can refer to the size of the luma prediction unit of the PU. Assuming a particular CU size is 2Nx2N, video encoder 200 can support PU sizes of 2Nx2N or NxN for intra-frame prediction, and symmetric PU sizes of 2Nx2N, 2NxN, Nx2N, NxN, or similar for inter-frame prediction. Video encoder 200 and video decoder 300 can also support asymmetric partitioning for PU sizes of 2NxnU, 2NxnD, nLx2N, and nRx2N for inter-frame prediction.

[0185] In an example where mode selection unit 202 does not further divide the CU into PUs, each CU can be associated with a luminance decoding block and a corresponding chrominance decoding block. As mentioned above, the size of the CU can refer to the size of the luminance decoding block of the CU. The video encoder 200 and the video decoder 300 can support CU sizes of 2Nx2N, 2NxN, or Nx2N.

[0186] For other video decoding techniques, such as intra-block copy mode decoding, affine mode decoding, and linear model (LM) mode decoding, as some examples, mode selection unit 202 generates a prediction block of the current block being encoded via a corresponding unit associated with the decoding technique. In some examples (such as palette mode decoding), mode selection unit 202 may not generate a prediction block, but instead generate syntax elements indicating how the block is reconstructed based on a selected palette. In such modes, mode selection unit 202 may provide these syntax elements to entropy coding unit 220 for encoding.

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

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

[0189] 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 combination of horizontal / vertical transforms, which may include the Discrete Cosine Transform (DCT), the Asymmetric Discrete Sine Transform (ADST), the Reversed ADST (e.g., ADST in reverse order), and the Identity Transform (IDTX). When using the Identity Transform, the transform is skipped in either the vertical or horizontal direction. In some examples, transform processing may be skipped entirely.

[0190] Quantization unit 208 quantizes the transform coefficients in a transform coefficient block to produce a quantized transform coefficient block. Quantization unit 208 quantizes the transform coefficients of the transform coefficient block according to the quantization parameter (QP) value associated with the current block. Video encoder 200 (e.g., via mode selection unit 202) can adjust the degree of quantization applied to the transform coefficient block associated with the current block by adjusting the QP value associated with the CU. Quantization may cause information loss, and therefore, the quantized transform coefficients may have lower accuracy compared to the original transform coefficients produced by transform processing unit 206.

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

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

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

[0194] The video encoder 200 stores reconstructed blocks in the DPB 218. For example, in an example where the filter unit 216 is not operated, the reconstruction unit 214 may store reconstructed blocks in the DPB 218. In an example where the filter unit 216 is operated, the filter unit 216 may store filtered reconstructed blocks in the DPB 218. The motion estimation unit 222 and the motion compensation unit 224 may retrieve reference images formed by the reconstructed (and potentially filtered) blocks from the DPB 218 to perform inter-frame prediction for blocks of subsequent encoded images. Additionally, the intra-frame prediction unit 226 may use the reconstructed blocks of the current image in the DPB 218 to perform intra-frame prediction for other blocks in the current image.

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

[0196] The video encoder 200 can output a bitstream that includes the entropy coding syntax elements required to reconstruct slices or blocks of images. Specifically, the entropy coding unit 220 can output a bitstream.

[0197] According to AV1, entropy coding unit 220 can be configured as a symbol-to-symbol adaptive multi-symbol arithmetic decoder. The syntax elements in AV1 consist of an N-element alphabet, and the context (e.g., a probability model) consists of a set of N probabilities. Entropy coding unit 220 can store the probabilities as an n-bit (e.g., 15-bit) cumulative distribution function (CDF). Entropy coding unit 220 can perform recursive scaling using an update factor based on the alphabet size to update the context.

[0198] The operations described above are relative to blocks. This description should be understood as operations applied to luma decoding blocks and / or chroma decoding blocks. As described above, in some examples, the luma decoding block and chroma decoding block are the luma and chroma components of the CU. In some examples, the luma decoding block and chroma decoding block are the luma and chroma components of the PU.

[0199] In some examples, it is not necessary to repeat the operations performed relative to the luma decoder for the chroma decoder block. As an example, the operations for identifying the motion vector (MV) and reference image of the luma decoder block do not need to repeat the MV and reference image used to identify the chroma block. Instead, the MV used for the luma decoder block can be scaled to determine the MV used for the chroma block, and the reference image can be the same. As another example, the intra-frame prediction process can be the same for both the luma and chroma decoders.

[0200] Video encoder 200 represents an example of a device configured to encode video data. The device includes: a memory configured to store the video data; and one or more processing units implemented in circuitry and configured to perform the example techniques described in this disclosure. For example, video encoder 200 may be configured to determine a search region for template matching based on at least one of the width or height of a current block, to determine a search region for template matching extending at least vertically or horizontally from the current block to a corresponding search axis, or to determine one or more block vectors of one or more blocks adjacent to the current block, and to determine a search region for template matching based on the determined one or more block vectors, or a combination thereof.

[0201] As another example, the video encoder 200 may be configured to determine the cost of a template based on a portion of the template smaller than the whole template, filter at least one of a reference template and a current template to perform template matching for decoding the current block to generate at least one of a filtered reference template or a filtered current template, and determine the cost based on at least one of the filtered reference template and the filtered current template, or divide a first reference template and a current template into multiple parts, including a first part of the reference template smaller than the whole of the reference template and a first part of the current template smaller than the whole of the current template, and determine the cost based on the first part of the reference template and the first part of the current template, or a combination thereof.

[0202] As another example, the video encoder 200 may determine a predefined search region based on the size of the current block within the current image, determine one or more block vectors, determine one or more additional search regions based on the one or more block vectors, determine a predicted block of the current block based on the predefined search region and one or more additional search regions, and encode the current block based on the predicted block.

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

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

[0205] 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 that perform predictions based on other prediction modes. As an example, the prediction processing unit 304 may include a palette unit, an intra-block copying 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.

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

[0207] CPB memory 320 is an example of a memory system capable of storing video data (such as encoded video bitstreams) to be decoded by components of video decoder 300. For example, it can be stored from computer-readable medium 110 ( Figure 1 The video data stored in the CPB memory 320 is obtained. The CPB memory 320 may include a CPB that stores encoded video data (e.g., syntax elements) from the encoded video bitstream. Furthermore, the CPB memory 320 may store video data other than the syntax elements of the decoded image, such as temporary data representing the output from various units of the video decoder 300. The DPB 314 is an example of a memory system that typically stores a decoded image that the video decoder 300 can output, and / or uses as reference video data when decoding subsequent data or images from the encoded video bitstream. The CPB memory 320 and the DPB 314 may each be formed from any of various memory devices or memory cells, 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 off-chip relative to those components.

[0208] Additionally or alternatively, in some examples, the video decoder 300 may be from the memory 120 ( Figure 1 The decoded video data can be retrieved from the memory. In other words, memory 120 can utilize CPB memory 320 to store data as discussed above. Similarly, when some or all of the functionality of video decoder 300 is implemented in software to be executed by the processing circuitry of video decoder 300, memory 120 can store instructions to be executed by video decoder 300.

[0209] Examples Figure 3 The various units shown help to understand the operations performed by the video decoder 300. The units can be implemented as fixed-function circuits, programmable circuits, or a combination thereof. Similar to... Figure 2 Fixed-function circuits are circuits that provide specific functionality and are pre-configured for the operations they can perform. Programmable circuits are circuits that can be programmed to perform various tasks and provide flexible functionality for the operations they can perform. For example, a programmable circuit can execute software or firmware that causes the programmable circuit to operate in a manner defined by the instructions of the software or firmware. Fixed-function circuits can execute software instructions (e.g., to receive or output parameters), but the type of operation performed by a fixed-function circuit is typically immutable. In some examples, one or more units in a cell may be different circuit blocks (fixed-function or programmable), and in some examples, one or more units in a cell may be integrated circuits.

[0210] The video decoder 300 may include an ALU, EFU, digital circuitry, analog circuitry, and / or a programmable core formed by programmable circuitry. In an example where the operation of the video decoder 300 is performed by software executed on programmable circuitry, on-chip or off-chip memory may store instructions (e.g., object code) of the software received and executed by the video decoder 300.

[0211] The entropy decoding unit 302 can receive encoded video data from the CPB and perform entropy decoding on the video data to reproduce 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 can generate decoded video data based on the syntax elements extracted from the bitstream.

[0212] Typically, the video decoder 300 reconstructs the image block by block. The video decoder 300 can perform the reconstruction operation on each block individually (where the block currently being reconstructed (i.e., decoded) can be referred to as the "current block").

[0213] Entropy decoding unit 302 can entropy decode the syntax elements of the quantized transform coefficients defining the quantized transform coefficient block, as well as transform information (such as quantization parameters (QP) and / or transform mode indications). Inverse quantization unit 306 can use the QP associated with the quantized transform coefficient block to determine the degree of quantization, and similarly, determine the degree of inverse quantization to be applied by inverse quantization unit 306. Inverse quantization unit 306 can, for example, perform a bit-by-bit left shift operation to inverse quantize the quantized transform coefficients. Inverse quantization unit 306 can thereby form a transform coefficient block including the transform coefficients.

[0214] 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 rotation transform, an inverse direction transform, or another inverse transform to the transform coefficient block.

[0215] Furthermore, the prediction processing unit 304 generates a prediction block based on the prediction information syntax elements entropy-decoded by the entropy decoding unit 302. For example, if the prediction information syntax elements indicate that the current block is an inter-frame prediction, the motion compensation unit 316 can generate the prediction block. In this case, the prediction information syntax elements may indicate the reference picture from which the reference block is to be retrieved in the DPB 314, and a motion vector identifying the position of the reference block in the reference picture relative to the position of the current block in the current picture. The motion compensation unit 316 can generally be configured according to the parameters relative to the motion compensation unit 224 ( Figure 2 The method described is essentially the same as the method used to perform the inter-frame prediction process.

[0216] As another example, when the prediction information syntax element indicates that the current block is intra-predictive, the intra-predictive unit 318 can generate a prediction block according to the intra-predictive mode indicated by the prediction information syntax element. Similarly, the intra-predictive unit 318 can generally be configured according to the intra-predictive unit 226 ( Figure 2 The intra-prediction process is performed in a manner substantially similar to that described above. The intra-prediction unit 318 can retrieve data of neighboring samples of the current block from the DPB 314.

[0217] Reconstruction unit 310 can use the prediction block and the residual block to reconstruct the current block. For example, reconstruction unit 310 can add samples from the residual block to the corresponding samples from the prediction block to reconstruct the current block.

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

[0219] The video decoder 300 can store reconstructed blocks in the DPB 314. For example, in an example where the operation of the filter unit 312 is not performed, the reconstruction unit 310 can store the reconstructed blocks in the DPB 314. In an example where the operation of the filter unit 312 is performed, the filter unit 312 can store the filtered reconstructed blocks in the DPB 314. As discussed above, the DPB 314 can provide reference information (such as samples of the current image for intra-frame prediction and samples of previously decoded images for subsequent motion compensation) to the prediction processing unit 304. Furthermore, the video decoder 300 can output decoded images (e.g., decoded video) from the DPB 314 for use in applications such as... Figure 1 The subsequent presentation on display devices such as display device 118.

[0220] In this manner, video decoder 300 represents an example of a video decoding device, which includes: a memory configured to store video data; and one or more processing units implemented in a circuit and configured to perform the example techniques described in this disclosure. For example, video decoder 300 may be configured to determine a search region for template matching based on at least one of the width or height of a current block, to determine a search region for template matching that extends at least vertically or horizontally from the current block to a corresponding search axis, or to determine one or more block vectors of one or more blocks adjacent to the current block, and to determine a search region for template matching based on the determined one or more block vectors, or a combination thereof.

[0221] As another example, the video decoder 300 may be configured to determine the cost of a template based on a portion of the template smaller than the whole template, filter at least one of a reference template and a current template to perform template matching for decoding the current block to generate at least one of a filtered reference template or a filtered current template, and determine the cost based on at least one of the filtered reference template and the filtered current template, or divide the first reference template and the current template into multiple parts, including a first part of the reference template smaller than the whole of the reference template and a first part of the current template smaller than the whole of the current template, and determine the cost based on the first part of the reference template and the first part of the current template, or a combination thereof.

[0222] As another example, the video decoder 300 can determine a predefined search region based on the size of the current block within the current image, determine one or more block vectors, determine one or more additional search regions based on the one or more block vectors, determine a predicted block of the current block based on the predefined search region and one or more additional search regions, and reconstruct the current block based on the predicted block.

[0223] Figure 4 This is a flowchart illustrating an example method for encoding the current block according to the technology of this disclosure. The current block may be or may include the current CU. Although it is relative to video encoder 200 ( Figure 1 and Figure 2 This is a description, but it should be understood that other devices can be configured to perform similar actions. Figure 4 Similar to the method.

[0224] In this example, the video encoder 200 initially predicts the current block (400). For example, the video encoder 200 may form a prediction block for the current block. The video encoder 200 may utilize the example techniques described in this disclosure to form the prediction block (e.g., a prediction signal). The video encoder 200 then computes a residual block for the current block (402). To compute the residual block, the video encoder 200 computes the difference between the unencoded original block of the current block and the prediction block. The video encoder 200 then transforms the residual block and quantizes the transform coefficients of the residual block (404). Next, the video encoder 200 scans the quantized transform coefficients of the residual block (406). During or after the scan, the video encoder 200 entropy-encodes the transform coefficients (408). For example, the video encoder 200 may use CAVLC or CABAC to encode the transform coefficients. The video encoder 200 then outputs the entropy-encoded data of the block (410).

[0225] Figure 5 This is a flowchart illustrating an example method for decoding a current block of video data according to the technology of this disclosure. The current block may be or may include the current CU. Although it is relative to video decoder 300 ( Figure 1 and Figure 3 This is a description, but it should be understood that other devices can be configured to perform similar actions. Figure 5 Similar to the method.

[0226] The video decoder 300 may receive entropy-coded data for the current block, such as entropy-coded prediction information and entropy-coded data for the transform coefficients of the residual block corresponding to the current block (500). The video decoder 300 may entropy decode the entropy-coded data to determine prediction information for the current block and reproduce the transform coefficients of the residual block (502). The video decoder 300 may, for example, use an intra-frame prediction mode or an inter-frame prediction mode indicated by the prediction information of the current block to predict the current block (504) to compute a prediction block for the current block. The video decoder 300 may utilize the example techniques described in this disclosure to compute the prediction block (e.g., a prediction signal). The video decoder 300 may then perform an inverse scan on the reproduced transform coefficients (506) to create a block of quantized transform coefficients. The video decoder 300 may then inverse quantize the transform coefficients and apply the inverse transform to the transform coefficients to produce a residual block (508). The video decoder 300 may perform final decoding of the current block by combining the prediction block and the residual block (510).

[0227] Figure 15 This is a flowchart illustrating an example operation method. For simplicity, the example techniques are described relative to processing circuitry, examples of which include processing circuitry of video encoder 200 or video decoder 300. For example, one or more memories may be configured to store video data. Examples of one or more memories for the processing circuitry of video encoder 200 include memory 106, video data memory 230, decoded image buffer 218, or some memories of video encoder 200. Examples of one or more memories for the processing circuitry of video decoder 300 include memory 120, CPB memory 320, decoded image buffer 314, or some memories of video decoder 300.

[0228] The processing circuitry can be configured to determine a predefined search region (1500) based on the size of the current block within the current image. Figure 6 The example shown above illustrates a predefined search region, where regions R1 to R6 are examples of predefined search regions. As mentioned above, relative to... Figure 6 The description states that the dimensions (SearchRange_w, SearchRange_h) of all regions within a predefined search region are set to be proportional to the block size (BlkW, BlkH) to have a fixed number of SAD comparisons per pixel. Another example of a predefined search region predefined based on the current block size is... Figure 11A and Figure 11B Example illustrated in .

[0229] The processing circuitry can be configured to determine one or more block vectors (1502). Examples of one or more block vectors include block vector predictors for the current block, where the one or more block vector predictors are based on block vectors of neighboring blocks. As an example, the one or more block vectors could be block vectors from the IBC merge list of the current block.

[0230] The processing circuitry can determine one or more additional search regions (1504) based on one or more block vectors. As an example, the processing circuitry can determine a corresponding center sample identified by each of the one or more block vectors, and determine a corresponding predefined shape region surrounding each center sample. The predefined shape region includes either a rectangular shape or a cross shape.

[0231] As an example, the processing circuitry can determine a first center sample pointed to by a first block vector among one or more block vectors. The processing circuitry can determine a predefined shape (e.g., a rectangle or a cross) surrounding the first center sample. This predefined shape around the first center sample can be a first additional search region. The processing circuitry can determine a second center sample pointed to by a second block vector among one or more block vectors. The processing circuitry can determine a predefined shape (e.g., a rectangle or a cross) surrounding the second center sample. This predefined shape around the second center sample can be a second additional search region, and so on.

[0232] The processing circuitry can determine the predicted block (1506) of the current block based on a predefined search region and one or more additional search regions. As an example, the processing circuitry can determine the template matching cost value between the current template of the current block and the corresponding template of the predicted block in the predefined search region and one or more additional search regions.

[0233] For example, the processing circuitry can predefine the start of a search region and identify prediction blocks (e.g., candidate prediction blocks) within the predefined search region. The processing circuitry can compare the template of each prediction block in the predefined search region with the current template of the current block to determine the template matching cost value (e.g., the SAD value or using methods such as...). Figure 14 (The techniques used in those areas). The template for the prediction block can be L-shaped, with the samples surrounding the prediction block forming the template within the L-shape. The current template can be similar, but around the current block.

[0234] The processing circuitry can also identify prediction blocks (e.g., candidate prediction blocks) within one or more additional search regions. The processing circuitry can compare the template of each prediction block in the predefined search regions with the current template of the current block to determine the template matching cost value (e.g., the SAD value or using methods such as...). Figure 14 (Those technologies).

[0235] In some examples, the processing circuitry may perform further refinement as part of a multi-stage process for determining prediction blocks. For example, the template matching cost value of prediction blocks in a predefined search region and one or more additional search regions may be considered as a first template matching cost value. The processing circuitry may determine additional prediction blocks based on prediction blocks in the predefined search region and one or more additional search regions. For example, the processing circuitry may determine additional prediction blocks offset within an example rectangular region. As an example, the rectangular region has prediction blocks at its center. In some examples, the processing circuitry may determine additional prediction blocks offset by one sample relative to prediction blocks having a template matching cost value that is lowest or below a threshold, but the offset may be more than one sample and may be in a larger region. The processing circuitry may determine a second template matching cost value between the current template and the corresponding template of the additional prediction block.

[0236] To determine the predicted block, the processing circuitry can base it on template matching cost values. As an example, the processing circuitry can determine the predicted block for the current block based on a first template matching cost value and a second template matching cost value.

[0237] In some examples, the processing circuitry may determine the prediction block associated with the lowest template matching cost value. In some examples, the processing circuitry of the video decoder 300 may construct a candidate list of prediction blocks arranged based on corresponding template matching cost values ​​(e.g., minimum to maximum), and receive an index identifying the prediction block in the candidate list.

[0238] In some examples, the processing circuitry may be configured to determine template matching cost values ​​for only a portion of one or more additional search regions. For example, one of the additional search regions may include a principal sub-region and other sub-regions. To determine the template matching cost values, the processing circuitry may determine the template matching cost values ​​between the current template and the corresponding templates of the prediction blocks in the principal sub-region, and, based on the fact that no template matching cost value among the template matching cost values ​​between the current template and the corresponding templates of the prediction blocks in the principal sub-region satisfies a threshold, determine the template matching cost values ​​between the current template and the corresponding templates of the prediction blocks in other sub-regions.

[0239] The processing circuitry can encode or decode the current block based on the prediction block (1508). For example, to decode the current block, the processing circuitry of the video decoder 300 can reconstruct the current block based on the prediction block. For example, the processing circuitry of the video decoder 300 can receive residual information indicating the difference between the current block and the prediction block, and add the residual information to the prediction block to reconstruct the current block. To encode the current block, the processing circuitry of the video encoder 200 can determine the residual information indicating the difference between the current block and the prediction block, and signal the residual information.

[0240] The following numbered clauses illustrate one or more aspects of the devices and technologies described in this disclosure.

[0241] Clause 1A. A method for decoding video data, the method comprising: determining a search region for template matching based on at least one of the width or height of a current block; determining a prediction block based on the search region; and decoding the current block based on the prediction block.

[0242] Clause 2A. A method for decoding video data, the method comprising: determining a search region for template matching, the search region extending at least vertically or horizontally from a current block to a corresponding search axis; determining a prediction block based on the search region; and decoding the current block based on the prediction block.

[0243] Clause 3A. A method for decoding video data, the method comprising: determining one or more block vectors of one or more blocks adjacent to a current block; determining a search region for template matching based on the determined one or more block vectors; determining a prediction block based on the search region; and decoding the current block based on the prediction block.

[0244] Clause 4A. A method for decoding video data, the method comprising: determining a template for template matching for decoding a current block; determining a cost of the template based on a portion of the template less than the whole template; determining a predicted block of the current block based on the cost of the template; and decoding the current block based on the predicted block.

[0245] Clause 5A. A method for decoding video data, the method comprising: filtering at least one of a reference template and a current template to perform template matching for decoding a current block to generate at least one of a filtered reference template or a filtered current template; determining a cost based on at least one of the filtered reference template and the filtered current template; determining a predicted block of the current block based on the cost; and decoding the current block based on the predicted block.

[0246] Clause 6A. A method for decoding video data, the method comprising: dividing a first reference template and a current template into a plurality of parts, the plurality of parts including a first part of the reference template smaller than the whole of the reference template and a first part of the current template smaller than the whole of the current template; determining a cost based on the first part of the reference template and the first part of the current template; discarding the first reference template for determining a predicted block of the current block based on the cost being greater than a threshold; determining the predicted block of the current block based on a second reference template; and decoding the current block based on the predicted block.

[0247] Clause 7A. The method according to any one of Clauses 1A to 6A, wherein decoding the current block includes decoding the current block, and wherein decoding the current block includes: receiving residual information indicating the difference between the current block and the prediction block; and adding the residual information to the prediction block to generate the current block.

[0248] Clause 8A. The method according to any one of Clauses 1A to 7A, wherein decoding the current block comprises decoding the current block as part of a reconstruction loop in the video encoding process.

[0249] Clause 9A. The method according to any one of Clauses 1A to 6A, wherein decoding the current block includes encoding the current block.

[0250] Clause 10A. A method comprising a combination of features according to any one of claims 1A to 9A.

[0251] Clause 11A. An apparatus for decoding video data, the apparatus comprising: one or more memories configured to store the video data; and processing circuitry configured to perform a method according to any one of Clauses 1A to 10A.

[0252] Clause 12A. The device as described in Clause 11A further includes a display configured to display decoded video data.

[0253] Clause 13A. The device pursuant to any one of Clauses 11A and 12A, wherein the device comprises one or more of a camera, computer, mobile device, broadcast receiver device or set-top box.

[0254] Clause 14A. The device pursuant to any one of Clauses 11A to 13A, wherein the device includes a video decoder.

[0255] Clause 15A. The device pursuant to any one of Clauses 11A to 14, wherein the device includes a video encoder.

[0256] Clause 16A. A computer-readable storage medium having instructions stored thereon, which, when executed, cause one or more processors to perform the method according to any one of Clauses 1A to 10A.

[0257] Clause 17A. An apparatus for decoding video data, the apparatus comprising components for performing the method according to any one of Clauses 1A to 10A.

[0258] Clause 1. A method for decoding video data, the method comprising: determining a predefined search region based on the size of a current block within a current image; determining one or more block vectors; determining one or more additional search regions based on the one or more block vectors; determining a predicted block of the current block based on the predefined search region and the one or more additional search regions; and reconstructing the current block based on the predicted block.

[0259] Clause 2. The method according to Clause 1, the method further comprising: determining a template matching cost value between the current template of the current block and the corresponding templates of the predicted blocks in the predefined search region and the one or more additional search regions, wherein determining the predicted block includes determining the predicted block based on the template matching cost value.

[0260] Clause 3. The method according to Clause 2, wherein the template matching cost value is a first template matching cost value, the method further comprising: determining additional prediction blocks based on the prediction blocks in the predefined search region and the one or more additional search regions; and determining a second template matching cost value between the current template and the corresponding template of the additional prediction block, wherein determining the prediction block includes determining the prediction block of the current block based on the first template matching cost value and the second template matching cost value.

[0261] Clause 4. The method according to any one of Clauses 2 and 3, wherein one of the one or more additional search regions comprises a main sub-region and other sub-regions, and

[0262] The determination of the template matching cost value includes: determining the template matching cost value between the current template and the corresponding template of the prediction block in the main sub-region; and determining the template matching cost value between the current template and the corresponding template of the prediction block in other sub-regions based on the fact that none of the template matching cost values ​​between the current template and the corresponding template of the prediction block in the main sub-region satisfy a threshold.

[0263] Clause 5. The method according to any one of Clauses 2 to 4, wherein determining the prediction block includes determining the prediction block associated with the lowest template matching cost value.

[0264] Clause 6. The method according to any one of Clauses 2 to 4, wherein determining the prediction block comprises: constructing a candidate list of prediction blocks arranged based on corresponding template matching cost values; and receiving an index identifying the prediction block in the candidate list.

[0265] Clause 7. The method according to any one of Clauses 1 to 6, wherein the one or more block vectors include one or more block vector predictors of the current block, and wherein the one or more block vector predictors are based on the block vectors of neighboring blocks.

[0266] Clause 8. The method according to any one of Clauses 1 to 7, wherein determining the one or more additional search regions comprises: determining a corresponding center sample identified by each of the one or more block vectors; and determining a corresponding predefined shape region surrounding each of the corresponding center samples.

[0267] Clause 9. The method described in Clause 8, wherein the predefined shape region includes either a rectangular shape or a cross shape.

[0268] Clause 10. The method according to any one of Clauses 1 to 9, wherein reconstructing the current block comprises: receiving residual information indicating the difference between the current block and the prediction block; and adding the residual information to the prediction block to reconstruct the current block.

[0269] Clause 11. An apparatus for decoding video data, the apparatus comprising: one or more memories configured to store the video data; and processing circuitry coupled to the one or more memories, wherein the processing circuitry is configured to: determine a predefined search region based on the size of a current block within a current image; determine one or more block vectors; determine one or more additional search regions based on the one or more block vectors; determine a predicted block of the current block based on the predefined search region and the one or more additional search regions; and reconstruct the current block based on the predicted block.

[0270] Clause 12. The apparatus of Clause 11, wherein the processing circuitry is configured to: determine a template matching cost value between the current template of the current block and the corresponding templates of the predicted blocks in the predefined search region and the one or more additional search regions, wherein, in order to determine the predicted block, the processing circuitry is configured to determine the predicted block based on the template matching cost value.

[0271] Clause 13. The apparatus of Clause 12, wherein the template matching cost value is a first template matching cost value, and wherein the processing circuitry is configured to: determine an additional prediction block based on the prediction block in the predefined search region and the one or more additional search regions; and determine a second template matching cost value between the current template and the corresponding template of the additional prediction block, wherein, in order to determine the prediction block, the processing circuitry is configured to determine the prediction block of the current block based on the first template matching cost value and the second template matching cost value.

[0272] Clause 14. The device according to any one of Clauses 12 and 13, wherein one of the one or more additional search regions comprises a main sub-region and other sub-regions, and wherein, in order to determine the template matching cost value, the processing circuitry is configured to: determine a template matching cost value between the current template and a corresponding template of a predicted block in the main sub-region; and determine a template matching cost value between the current template and a corresponding template of a predicted block in the other sub-regions based on the fact that none of the template matching cost values ​​between the current template and the corresponding template of the predicted block in the main sub-region satisfies a threshold.

[0273] Clause 15. The apparatus according to any one of Clauses 12 to 14, wherein, in order to determine the prediction block, the processing circuitry is configured to perform one of the following: determining the prediction block associated with the lowest template matching cost value; or constructing a candidate list of prediction blocks arranged based on the corresponding template matching cost values, and receiving an index identifying the prediction block in the candidate list.

[0274] Clause 16. The device according to any one of Clauses 11 to 15, wherein the one or more block vectors include one or more block vector predictors of the current block, and wherein the one or more block vector predictors are based on the block vectors of neighboring blocks.

[0275] Clause 17. The device according to any one of Clauses 11 to 16, wherein, in order to determine the one or more additional search regions, the processing circuitry is configured to: determine a corresponding center sample identified by each of the one or more block vectors; and determine a corresponding predefined shape region surrounding each of the corresponding center samples.

[0276] Clause 18. The device according to Clause 17, wherein the predefined shape region includes either a rectangular shape or a cross shape.

[0277] Clause 19. The apparatus according to any one of Clauses 11 to 18, wherein, in order to reconstruct the current block, the processing circuitry is configured to: receive residual information indicating the difference between the current block and the predicted block; and add the residual information to the predicted block to reconstruct the current block.

[0278] Clause 20. An apparatus for encoding video data, the apparatus comprising: one or more memories configured to store the video data; and processing circuitry coupled to the one or more memories, wherein the processing circuitry is configured to: determine a predefined search region based on the size of a current block within a current image; determine one or more block vectors; determine one or more additional search regions based on the one or more block vectors; determine a predicted block of the current block based on the predefined search region and the one or more additional search regions; and encode the current block based on the predicted block.

[0279] It should be recognized that, based on the examples, certain actions or events of any technique described herein may be performed in a different sequence, and may be added, combined, or omitted entirely (e.g., not all actions or events described are necessary for implementing the technique). Furthermore, in some examples, actions or events may be performed concurrently (e.g., through multithreading, interrupt handling, or multiple processors) rather than sequentially.

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

[0281] By way of example, and not limitation, such computer-readable storage media may include one or more of RAM, ROM, EEPROM, CD-ROM or other optical disc storage devices, magnetic disk storage devices or other magnetic storage devices, flash memory, or any other medium capable of storing desired program code in the form of instructions or data structures and accessible by a computer. Furthermore, any connection is appropriately 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 technology (such as infrared, radio, and microwave), then coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technology (such as infrared, radio, and microwave) is included in the definition of medium. However, it should be understood that computer-readable storage media and data storage media do not include connections, carrier waves, signals, or other transient media, but instead refer to non-transient tangible storage media. As used herein, disks and optical discs include compact optical discs (CDs), laser optical discs, optical discs, digital versatile optical discs (DVDs), floppy disks, and Blu-ray discs, where disks typically reproduce data magnetically, while optical discs use lasers to reproduce data optically. Combinations of these should also be included within the scope of computer-readable media.

[0282] Instructions can be executed by one or more processors, such as one or more DSPs, general-purpose microprocessors, ASICs, FPGAs, or other equivalent integrated or discrete logic circuits. Therefore, the terms "processor" and "processing circuit" as used herein can refer to any of the foregoing structures or any other structure suitable for implementing the techniques described herein. Furthermore, in some aspects, the functionality described herein can be provided within dedicated hardware and / or software modules configured for encoding and decoding, or incorporated into combined codecs. Moreover, these techniques can be fully implemented in one or more circuit or logic elements.

[0283] The techniques disclosed herein can be implemented in a wide variety of devices or apparatuses, including wireless mobile phones, integrated circuits (ICs), or a set of ICs (e.g., chipsets). Various components, modules, or units are described in this disclosure to emphasize functional aspects of a device configured to perform the disclosed techniques, but implementation by different hardware units is not necessarily required. Specifically, as described above, various units may be combined in a codec hardware unit, or various units may be provided by a collection of interoperable hardware units (including one or more processors as described above) combined with appropriate software and / or firmware.

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

Claims

1. A method for decoding video data, the method comprising: Determine a predefined search region based on the size of the current block within the current image; Determine one or more block vectors; One or more additional search regions are determined based on the one or more block vectors; The predicted block for the current block is determined based on the predefined search region and the one or more additional search regions; as well as The current block is reconstructed based on the predicted block.

2. The method according to claim 1, further comprising: Determine the template matching cost value between the current template of the current block and the corresponding templates of the predicted blocks in the predefined search region and one or more additional search regions. Determining the prediction block includes determining the prediction block based on the template matching cost value.

3. The method according to claim 2, wherein the template matching cost value is a first template matching cost value, and the method further includes: Additional prediction blocks are determined based on the predefined search region and the prediction blocks in the one or more additional search regions; as well as Determine the second template matching cost value between the current template and the corresponding template of the additional prediction block. Determining the prediction block includes determining the prediction block of the current block based on the first template matching cost value and the second template matching cost value.

4. The method according to claim 2, One of the one or more additional search regions includes a main sub-region and other sub-regions, and Determining the template matching cost includes: Determine the template matching cost value between the current template and the corresponding template of the prediction block in the main sub-region; as well as Based on the fact that no template matching cost value among the template matching cost values ​​between the current template and the corresponding template of the prediction block in the main sub-region satisfies the threshold, the template matching cost value between the current template and the corresponding template of the prediction block in the other sub-region is determined.

5. The method of claim 2, wherein determining the prediction block includes determining the prediction block associated with the lowest template matching cost value.

6. The method of claim 2, wherein determining the prediction block comprises: Construct a candidate list of prediction blocks arranged based on the corresponding template matching cost values; as well as Receive the index of the predicted block in the candidate list.

7. The method of claim 1, wherein the one or more block vectors include one or more block vector predictors of the current block, and wherein the one or more block vector predictors are based on block vectors of neighboring blocks.

8. The method of claim 1, wherein determining the one or more additional search regions comprises: Determine the corresponding center sample identified by each of the one or more block vectors; as well as Determine the corresponding predefined shape region around each center sample in the corresponding center sample.

9. The method of claim 8, wherein the predefined shape region comprises either a rectangular shape or a cross shape.

10. The method of claim 1, wherein reconstructing the current block comprises: Receive residual information indicating the difference between the current block and the predicted block; as well as The residual information is added to the prediction block to reconstruct the current block.

11. An apparatus for decoding video data, the apparatus comprising: One or more memories, the one or more memories being configured to store the video data; and Processing circuitry, coupled to the one or more memories, wherein the processing circuitry is configured to: Determine a predefined search region based on the size of the current block within the current image; Determine one or more block vectors; One or more additional search regions are determined based on the one or more block vectors; The predicted block for the current block is determined based on the predefined search region and the one or more additional search regions; as well as The current block is reconstructed based on the predicted block.

12. The device of claim 11, wherein the processing circuit is configured to: Determine the template matching cost value between the current template of the current block and the corresponding templates of the predicted blocks in the predefined search region and one or more additional search regions. In order to determine the prediction block, the processing circuit is configured to determine the prediction block based on the template matching cost value.

13. The apparatus of claim 12, wherein the template matching cost value is a first template matching cost value, and wherein the processing circuit is configured to: Additional prediction blocks are determined based on the prediction blocks in the predefined search region and the one or more additional search regions; and Determine the second template matching cost value between the current template and the corresponding template of the additional prediction block. In order to determine the predicted block, the processing circuit is configured to determine the predicted block of the current block based on the first template matching cost value and the second template matching cost value.

14. The device according to claim 12, One of the one or more additional search regions includes a main sub-region and other sub-regions, and In order to determine the template matching cost value, the processing circuit is configured as follows: Determine the template matching cost value between the current template and the corresponding template of the prediction block in the master-sub region; and Based on the fact that no template matching cost value among the template matching cost values ​​between the current template and the corresponding template of the prediction block in the main sub-region satisfies the threshold, the template matching cost value between the current template and the corresponding template of the prediction block in the other sub-region is determined.

15. The apparatus of claim 12, wherein, in order to determine the prediction block, the processing circuitry is configured to perform one of the following: Determine the prediction block associated with the lowest template matching cost value; or Construct a candidate list of prediction blocks arranged based on the corresponding template matching cost value, and receive an index identifying the prediction block in the candidate list.

16. The device of claim 11, wherein the one or more block vectors include one or more block vector predictors of the current block, and wherein the one or more block vector predictors are based on block vectors of neighboring blocks.

17. The device of claim 11, wherein, in order to determine the one or more additional search regions, the processing circuitry is configured to: Determine the corresponding center sample identified by each of the one or more block vectors; and Determine the corresponding predefined shape region around each center sample in the corresponding center sample.

18. The device of claim 17, wherein the predefined shape region comprises either a rectangular shape or a cross shape.

19. The device of claim 11, wherein, in order to reconstruct the current block, the processing circuitry is configured to: Receive residual information indicating the difference between the current block and the predicted block; and The residual information is added to the prediction block to reconstruct the current block.

20. An apparatus for encoding video data, the apparatus comprising: One or more memories, the one or more memories being configured to store the video data; and Processing circuitry, coupled to the one or more memories, wherein the processing circuitry is configured to: Determine a predefined search region based on the size of the current block within the current image; Determine one or more block vectors; One or more additional search regions are determined based on the one or more block vectors; The predicted block for the current block is determined based on the predefined search region and the one or more additional search regions; as well as The current block is encoded based on the predicted block.