Method and apparatus for intra block copy

By constructing a candidate list of block vectors for intra-frame template matching prediction patterns, the problem of insufficient sub-pixel accuracy in intra-frame block copying is solved, thereby improving the efficiency and accuracy of video encoding and decoding.

CN121970345APending Publication Date: 2026-05-01BEIJING DAJIA INTERNET INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
BEIJING DAJIA INTERNET INFORMATION TECH CO LTD
Filing Date
2024-10-04
Publication Date
2026-05-01

AI Technical Summary

Technical Problem

Existing video encoding and decoding technologies suffer from inefficiency and high redundancy in intra-frame block copying, especially when dealing with sub-pixel precision, making it difficult to effectively utilize redundant information in video data.

Method used

By constructing a candidate list of block vectors (BVs) for intra-frame template matching prediction (intra-frame TMP) mode, including at least one sub-pixel BV, the accuracy and efficiency of intra-frame prediction are improved.

Benefits of technology

It improves the accuracy and efficiency of intra-frame prediction, reduces redundancy in video data, and enhances the performance of the encoding and decoding processes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121970345A_ABST
    Figure CN121970345A_ABST
Patent Text Reader

Abstract

Methods, apparatus, and non-transitory computer-readable storage media for video decoding and encoding are provided. In one method, a decoder may construct a block vector (BV) candidate list for an intra template matching prediction (intra TMP) mode, where the BV candidate list includes at least one sub-pixel BV. In addition, the decoder may obtain the BV from the BV candidate list. In addition, the decoder may obtain a prediction block of the current block based on the BV.
Need to check novelty before this filing date? Find Prior Art

Description

Cross-references to applications related to methods and devices for intra-frame block copying

[0001] This application is based on and claims priority to U.S. Provisional Application No. 63 / 542,756, filed October 5, 2023, entitled “Methods and Devices for Intra Block Copy,” and U.S. Provisional Application No. 63 / 614,829, filed December 26, 2023, entitled “Methods and Devices for Intra Block Copy,” the entire disclosure of which is incorporated herein by reference for all purposes. Technical Field

[0002] This disclosure relates to video encoding, decoding, and compression, and specifically, but not limited to, methods and apparatus for improving intra-block copying (IBC) methods in the video encoding or decoding process. Background Technology

[0003] Various electronic devices (such as digital televisions, laptops or desktop computers, tablets, digital cameras, digital recording devices, digital media players, video game consoles, smartphones, video conferencing equipment, video streaming devices, etc.) support digital video. Electronic devices send and receive, or otherwise transmit, digital video data via communication networks, and / or store digital video data on storage devices. Due to the limited bandwidth capacity of communication networks and the limited storage resources of storage devices, video data can be compressed using one or more video codec standards before it is transmitted or stored. For example, video codec standards include Universal Video Codec (VVC), Joint Explore Test Model (JEM), High Efficiency Video Codec (HEVC / H.265), Advanced Video Codec (AVC / H.264), Moving Picture Experts Group (MPEG) codec, etc. Video codecs typically employ prediction methods that utilize the inherent redundancy in video data (e.g., inter-frame prediction, intra-frame prediction, etc.). Video codecs aim to compress video data to a form using a lower bitrate while avoiding or minimizing degradation in video quality. Summary of the Invention

[0004] This disclosure provides examples of techniques related to improving intra-frame block copying methods in video encoding or decoding processes.

[0005] According to a first aspect of this disclosure, a video decoding method is provided. In this method, the decoder can construct a candidate list of block vectors (BVs) for intra-frame template matching prediction (intra-frame TMP) mode, wherein the candidate list of BVs may include at least one sub-pixel BV. Furthermore, the decoder can obtain BVs from the candidate list of BVs. The decoder can obtain a predicted block for the current block based on the BVs.

[0006] According to a second aspect of this disclosure, a video coding method is provided. In this method, an encoder can construct a candidate list of bounding v (BV) for intra-frame template matching prediction (intra-frame TMP) mode, wherein the candidate list of BVs may include at least one sub-pixel BV. Furthermore, the encoder can obtain BVs from the candidate list of BVs. The encoder can obtain a predicted block for the current block based on the BVs.

[0007] According to a third aspect of this disclosure, an apparatus for video decoding is provided. The apparatus includes one or more processors; and a memory coupled to the one or more processors and configured to store instructions executable by the one or more processors, wherein the one or more processors, when executing the instructions, are configured to perform the method according to the first aspect.

[0008] According to a fourth aspect of this disclosure, an apparatus for video encoding is provided. The apparatus includes one or more processors; and a memory coupled to the one or more processors and configured to store instructions executable by the one or more processors, wherein the one or more processors, when executing the instructions, are configured to perform the method according to the second aspect.

[0009] According to a fifth aspect of this disclosure, a non-transitory computer-readable storage medium is provided for storing computer-executable instructions that, when executed by one or more computer processors, cause the one or more computer processors to perform the method according to the first aspect.

[0010] According to a sixth aspect of this disclosure, a non-transitory computer-readable storage medium is provided for storing computer-executable instructions that, when executed by one or more computer processors, cause the one or more computer processors to perform the method according to the second aspect.

[0011] According to a seventh aspect of this disclosure, a non-transitory computer-readable storage medium is provided for storing a bit stream to be decoded by the method according to the first aspect.

[0012] According to the eighth aspect of this disclosure, a non-transitory computer-readable storage medium is provided for storing a bit stream to be decoded by the method according to the second aspect.

[0013] According to a ninth aspect of this disclosure, a method for receiving a bitstream is provided, wherein the bitstream includes encoded video information to be decoded by the method according to the first aspect.

[0014] According to a tenth aspect of this disclosure, a method for transmitting a bit stream is provided, wherein the bit stream includes encoded video information to be decoded by the method according to a second aspect.

[0015] It should be understood that the foregoing general description and the following detailed description are merely examples and not limitations of this disclosure. Attached Figure Description

[0016] Examples consistent with this disclosure are illustrated in conjunction with the accompanying drawings, which are included in and form part of this specification, and together with the description, serve to explain the principles of this disclosure.

[0017] Figure 1 is a block diagram illustrating an exemplary system for encoding and decoding video blocks according to some embodiments of the present disclosure.

[0018] Figure 2 is a block diagram illustrating an exemplary video encoder according to some embodiments of the present disclosure.

[0019] Figure 3 is a block diagram illustrating an exemplary video decoder according to some embodiments of the present disclosure.

[0020] Figures 4A to 4E are block diagrams illustrating how a frame is recursively divided into multiple video blocks of different sizes and shapes according to some embodiments of the present disclosure.

[0021] Figures 5A and 5B show examples of 4-parameter affine models according to some examples of this disclosure.

[0022] Figure 5C shows an example of a 6-parameter affine model according to some examples of this disclosure.

[0023] Figure 6 shows an example of adjacent neighbor blocks for affine merging candidates for inheritance, according to some examples of this disclosure.

[0024] Figure 7 shows an example of adjacent neighbor blocks for constructing affine merge candidates according to some examples of this disclosure.

[0025] Figure 8 illustrates the current CTU processing order according to some examples of this disclosure and its available reference samples in the current CTU and the left CTU.

[0026] Figure 9 illustrates, according to some examples of this disclosure, filling candidates for replacing zero vectors in the IBC list.

[0027] Figure 10 shows the reference area of ​​IBC when encoding CTU(m,n) according to some examples of this disclosure.

[0028] Figure 11 shows the IBC reference area of ​​camera-captured content according to some examples of this disclosure.

[0029] Figures 12A and 12B illustrate some examples of methods for dividing angle patterns according to this disclosure.

[0030] Figure 13A shows some examples of spatial neighbor blocks used by ATVMP according to this disclosure.

[0031] Figure 13B illustrates an example of obtaining a sub-CU motion field by applying motion shifts from spatial neighbors and scaling motion information from corresponding co-located sub-CUs, according to some examples of this disclosure.

[0032] Figure 14 is a flowchart of decoding binary bits according to some examples of this disclosure.

[0033] Figure 15 shows the intra-frame template matching search region used in some examples of this disclosure.

[0034] Figure 16A shows an example of BV adjustment for horizontal flipping according to some examples of this disclosure.

[0035] Figure 16B shows an example of BV adjustment for vertical flipping according to some examples of this disclosure.

[0036] Figure 17 shows an example of five locations in a reconstructed brightness sample according to some examples of this disclosure.

[0037] Figure 18 illustrates an example of the prediction process of the DBV method according to some examples of this disclosure.

[0038] Figure 19 illustrates examples of AMVP IBC candidate clustering based on L2 distance and TM cost according to some examples of this disclosure.

[0039] Figure 20 shows an updated intra-frame TMP search region according to some examples of this disclosure.

[0040] Figure 21 illustrates an example of using intra-frame TMP block vectors for IBC blocks according to some examples of this disclosure.

[0041] Figures 22A to 22D illustrate subpixel precision supported in intra-frame TMP mode according to some examples of this disclosure.

[0042] Figure 23 illustrates subpixel positions with 1 / 2 pixel precision supported in intra-frame TMP mode according to some examples of this disclosure.

[0043] Figure 24 illustrates an example of subpixel precision and orientation supported in intra-frame TMP mode according to some examples of this disclosure.

[0044] Figure 25 is a diagram illustrating a computing environment coupled to a user interface according to some embodiments of the present disclosure.

[0045] Figure 26 is a flowchart illustrating a method for video decoding according to some examples of this disclosure.

[0046] Figure 27 is a flowchart illustrating a method for video encoding corresponding to the method for video decoding shown in Figure 26, according to some examples of the present disclosure. Detailed Implementation

[0047] Referring now to the detailed description, examples of which are illustrated in the accompanying drawings. Numerous non-limiting details are set forth in the following detailed description to aid in understanding the subject matter presented herein. However, various alternatives may be used without departing from the scope of the claims, and the subject matter may be practiced without these specific details. For example, the subject matter presented herein can be implemented on many types of electronic devices with digital video capabilities.

[0048] It should be noted that the terms "first," "second," etc., in the specification, claims, and drawings of this disclosure are used to distinguish objects and are not used to describe any specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this disclosure described herein can be implemented in sequences other than those shown in the drawings or described in this disclosure.

[0049] Figure 1 is a block diagram illustrating an exemplary system 10 for encoding and decoding video blocks in parallel according to some embodiments of the present disclosure. As shown in Figure 1, system 10 includes a source device 12 that generates and encodes video data that will later be decoded by a target device 14. The source device 12 and the target device 14 can include any electronic device from a wide variety of electronic devices, including cloud servers, server computers, desktop or laptop computers, tablet computers, smartphones, set-top boxes, digital televisions, cameras, display devices, digital media players, video game consoles, video streaming devices, etc. In some embodiments, the source device 12 and the target device 14 are equipped with wireless communication capabilities.

[0050] In some implementations, target device 14 may receive encoded video data to be decoded via link 16. Link 16 may include any type of communication medium or device capable of moving encoded video data from source device 12 to target device 14. In one example, link 16 may include a communication medium enabling source device 12 to transmit encoded video data directly to target device 14 in real time. The encoded video data may be modulated according to a communication standard (e.g., a wireless communication protocol) and transmitted to target device 14. 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 (e.g., 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 means that may facilitate communication from source device 12 to target device 14.

[0051] In some other implementations, encoded video data can be sent from output interface 22 to storage device 32. The target device 14 can then access the encoded video data in storage device 32 via input interface 28. Storage device 32 can include any data storage medium of various distributed or locally accessed data storage media, such as hard disk drives, Blu-ray discs, digital universal discs (DVDs), compact disc read-only memory (CD-ROMs), flash memory, volatile or non-volatile memory, or any other suitable digital storage medium for storing encoded video data. In another example, storage device 32 can correspond to a file server or another intermediate storage device that can hold the encoded video data generated by source device 12. Target device 14 can access the stored video data from storage device 32 via streaming or downloading. The file server can be any type of computer capable of storing and sending encoded video data to target device 14. Exemplary file servers include web servers (e.g., for websites), file transfer protocol (FTP) servers, network attached storage (NAS) devices, or local disk drives. Target device 14 can access the encoded video data via any standard data connection suitable for accessing encoded video data stored on the file server. Standard data connections include wireless channels (e.g., Wi-Fi connections), wired connections (e.g., digital subscriber line (DSL), cable modems, etc.), or a combination of both. Transfer of encoded video data from storage device 32 can be streaming, downloading, or a combination of both.

[0052] As shown in Figure 1, source device 12 includes a video source 18, a video encoder 20, and an output interface 22. Video source 18 may include sources or combinations of such sources, such as: a video capture device (e.g., a camera), a video archive containing previously captured video, a video feed interface for receiving video from a video content provider, and / or a computer graphics system for generating computer graphics data as source video. As an example, if video source 18 is a camera in a security monitoring system, source device 12 and target device 14 may form a camera phone or video phone. However, the embodiments described in this application are generally applicable to video encoding and decoding and can be applied to wireless and / or wired applications.

[0053] Video captured, pre-captured, or computer-generated video can be encoded by video encoder 20. The encoded video data can be sent directly to target device 14 via output interface 22 of source device 12. Alternatively, the encoded video data can be stored on storage device 32 for later access by target device 14 or other devices for decoding and / or playback. Output interface 22 may further include a modem and / or transmitter. The encoded video data may include a series of images, each image comprising one or more sample arrays, for example, for monochrome, only luminance (Y); luminance and two chrominances in the YCbCr or YCgCo domain; or green, blue, and red in the GBR (also known as RGB) domain. For ease of reference and terminology in this application, in some embodiments, the variables and terms associated with each set having three sample arrays may be referred to as luminance and chrominance, where the two chrominance arrays may be referred to as Cb and Cr, regardless of the actual color representation used. Video data can be in chroma format 4:0:0, chroma format 4:2:0, chroma format 4:2:2 or chroma format 4:4:4, but this application is not limited to these.

[0054] Target device 14 includes an input interface 28, a video decoder 30, and a display device 34. Input interface 28 may include a receiver and / or a modem, and receives encoded video data via link 16. The encoded video data transmitted via link 16 or provided on storage device 32 may include various syntax elements generated by video encoder 20 for use by video decoder 30 when decoding the video data. Such syntax elements may be included within encoded video data transmitted on a communication medium, stored on a storage medium, or stored on a file server.

[0055] In some embodiments, the target device 14 may include a display device 34, which may be an integrated display device or an external display device configured to communicate with the target device 14. The display device 34 displays decoded video data to a user and may include 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.

[0056] Video encoder 20 and video decoder 30 can operate according to proprietary or industry standards (e.g., VVC, HEVC, MPEG-4 Part 10, AVC) or extensions of such standards. It should be understood that this application is not limited to any particular video encoding / decoding standard and can be applied to other video encoding / decoding standards. It is generally understood that the video encoder 20 of source device 12 can be configured to encode video data according to any of these current or future standards. Similarly, it is also generally understood that the video decoder 30 of target device 14 can be configured to decode video data according to any of these current or future standards.

[0057] The video encoder 20 and video decoder 30 can be implemented as any circuit of a variety of suitable encoder and / or decoder circuits, such as one or more microprocessors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), discrete logic devices, software, hardware, firmware, or any combination thereof. When partially implemented in software, the electronic device may store instructions for software in a suitable non-transitory computer-readable medium and use one or more processors to execute the instructions in hardware to perform the video encoding / decoding operations disclosed in this disclosure. Each of the video encoder 20 and video decoder 30 may be included in one or more encoders or decoders, and either encoder or decoder may be integrated as part of a combined encoder / decoder (CODEC) in the respective device.

[0058] In some embodiments, at least a portion of the components of source device 12 (e.g., video source 18, video encoder 20 or hereinafter, components included in video encoder 20 with reference to FIG. 2, and output interface 22) and / or at least a portion of the components of target device 14 (e.g., input interface 28, video decoder 30 or hereinafter, components included in video decoder 30 with reference to FIG. 3, and display device 34) may operate in a cloud computing service network such as Software as a Service (SaaS), Platform as a Service (PaaS), or Infrastructure as a Service (IaaS), where the cloud computing service network can provide software, platform, and / or infrastructure. In some embodiments, one or more components of source device 12 and / or target device 14 not included in the cloud computing service network may be located in one or more client devices, and these client devices may communicate with a server computer in the cloud computing service network via a wireless communication network (e.g., a cellular communication network, a short-range wireless communication network, or a Global Navigation Satellite System (GNSS) communication network) or a wired communication network (e.g., a local area network (LAN) communication network or a power line communication (PLC) network). In one embodiment, at least a portion of the operations described herein can be implemented as a cloud-based service provided by one or more server computers, wherein the one or more server computers are implemented by at least a portion of the components of the source device 12 and / or at least a portion of the components of the target device 14 in the cloud computing service network; and one or more other operations described herein can be implemented by one or more client devices. In some embodiments, the cloud computing service network can be a private cloud, a public cloud, or a hybrid cloud. Terms such as “cloud,” “cloud computing,” and “cloud-based” used herein are used interchangeably without departing from the scope of this disclosure. It should be understood that this disclosure is not limited to implementation in the aforementioned cloud computing service network. Instead, this disclosure can also be implemented in any other type of computing environment currently known or developed in the future.

[0059] Figure 2 is a block diagram illustrating an exemplary video encoder 20 according to some embodiments described in this application. The video encoder 20 can perform intra-frame predictive coding and inter-frame predictive coding on video blocks within a video frame. Intra-frame predictive coding relies on spatial prediction to reduce or remove spatial redundancy in the video data within a given video frame or picture. Inter-frame predictive coding relies on temporal prediction to reduce or remove temporal redundancy in the video data within neighboring video frames or pictures of a video sequence. It should be noted that in the field of video encoding and decoding, the term "frame" can be used as a synonym for the terms "image" or "picture".

[0060] As shown in Figure 2, the video encoder 20 includes a video data memory 40, a prediction processing unit 41, a decoded picture buffer (DPB) 64, an adder 50, a transform processing unit 52, a quantization unit 54, and an entropy coding unit 56. The prediction processing unit 41 further includes a motion estimation unit 42, a motion compensation unit 44, a segmentation unit 45, an intra-frame prediction processing unit 46, and an intra-frame block copying (BC) unit 48. In some embodiments, the video encoder 20 also includes an inverse quantization unit 58, an inverse transform processing unit 60, and an adder 62 for video block reconstruction. A loop filter 63, such as a deblocking filter, can be located between the adder 62 and the DPB 64 to filter block boundaries to remove block artifacts from the reconstructed video. In addition to the deblocking filter, another loop filter (e.g., a sample adaptive offset (SAO) filter, a cross-component sample adaptive offset (CCSAO) filter, and / or an adaptive loop filter (ALF)) can be used to filter the output of the adder 62. It should be noted that, regarding the CCSAO technique, this application is not limited to the embodiments described herein, but can also be applied to situations where an offset is selected for any other component of the luminance component and the two chrominance components based on any one of the luminance component and the two chrominance components (as mentioned above, for ease of notation and terminology in this application, in the YCbCr domain, the luminance component and the two chrominance components can represent Y, Cb, and Cr; in the YCgCo domain, the luminance component and the two chrominance components can represent Y, Cg, and Co; or in the RGB domain, the luminance component and the two chrominance components can represent G, B, and R) to modify that other component based on the selected offset. Furthermore, it should be noted that the first component mentioned herein can be any one of the luminance component and the two chrominance components, the second component mentioned herein can be any one of the luminance component and the two chrominance components, and the third component mentioned herein can be the remaining component of the luminance component and the two chrominance components. In some examples, the loop filter can be omitted, and the decoded video block can be directly provided to the DPB 64 by the adder 62. The video encoder 20 may take the form of a fixed or programmable hardware unit, or may be distributed among one or more of the fixed or programmable hardware units described.

[0061] Video data memory 40 can store video data to be encoded by components of video encoder 20. The video data in video data memory 40 can be obtained, for example, from video source 18 as shown in FIG. 1. DPB 64 is a buffer that stores reference video data (e.g., reference frames or pictures) for use by video encoder 20 (e.g., in intra-frame or inter-frame predictive coding modes) when encoding video data. Video data memory 40 and DPB 64 can be formed from any of a variety of memory devices. In various examples, video data memory 40 can be on-chip along with other components of video encoder 20, or off-chip relative to those components.

[0062] As shown in Figure 2, after receiving video data, the segmentation unit 45 within the prediction processing unit 41 segments the video data into video blocks. This segmentation may also include segmenting the video frame into strips, tiles (e.g., a collection of video blocks) or other larger coding units (CUs) according to a predefined splitting structure associated with the video data (e.g., a quadtree (QT) structure). A video frame is, or can be considered, a two-dimensional array or matrix of samples with sample values. Samples in the array may also be referred to as pixels or image elements (pel). The number of samples in the horizontal and vertical directions (or axes) of the array or image defines the size and / or resolution of the video frame. For example, a video frame can be divided into multiple video blocks using QT segmentation. A video block is again, or can be considered, a two-dimensional array or matrix of samples with sample values, but its dimension is smaller than that of the video frame. The number of samples in the horizontal and vertical directions (or axes) of the video block defines the size of the video block. By iteratively using, for example, QT segmentation, binary tree (BT) segmentation, or ternary tree (TT) segmentation, or any combination thereof, a video block can be further segmented into one or more block partitions or sub-blocks (which can again form blocks). It should be noted that the term "block" or "video block" as used herein can refer to a portion of a frame or image, particularly a rectangular (square or non-square) portion. Referring to, for example, HEVC and VVC, a block or video block can be or corresponds to a coding tree unit (CTU), CU, prediction unit (PU), or transform unit (TU) and / or can be or corresponds to a corresponding block (e.g., coding tree block (CTB), coding block (CB), prediction block (PB), or transform block (TB)) and / or sub-block.

[0063] The prediction processing unit 41 can select one of several feasible predictive coding modes for the current video block based on error results (e.g., coding rate and distortion level), such as one or more inter-frame predictive coding modes among multiple intra-frame predictive coding modes. The prediction processing unit 41 can provide the resulting intra-frame or inter-frame predictive coding block to adder 50 to generate a residual block, and to adder 62 to reconstruct the coding block for subsequent use as part of a reference frame. The prediction processing unit 41 also provides syntax elements (e.g., motion vectors, intra-frame mode indicators, segmentation information, and other such syntax information) to entropy coding unit 56.

[0064] To select a suitable intra-predictive coding mode for the current video block, the intra-predictive processing unit 46 within the prediction processing unit 41 can perform intra-predictive coding of the current video block in relation to one or more neighboring blocks in the same frame as the current block to be encoded to provide spatial prediction. The motion estimation unit 42 and motion compensation unit 44 within the prediction processing unit 41 perform inter-predictive coding of the current video block in relation to one or more prediction blocks in one or more reference frames to provide temporal prediction. The video encoder 20 can perform multiple coding passes, for example, to select a suitable coding mode for each block of video data.

[0065] In some implementations, motion estimation unit 42 determines an inter-frame prediction mode for the current video frame by generating motion vectors based on a predetermined pattern within the video frame sequence. The motion vectors indicate the displacement of a video block within the current video frame relative to a prediction block within a reference video frame. Motion estimation performed by motion estimation unit 42 is the process of generating motion vectors that estimate the motion of video blocks. For example, the motion vectors may indicate the displacement of a video block within the current video frame or picture relative to a prediction block within a reference frame associated with the current block being encoded in the current frame. The predetermined pattern may designate video frames in the sequence as P-frames or B-frames. Intra-frame BC unit 48 may determine vectors (e.g., block vectors) for intra-frame BC coding in a similar manner to how motion estimation unit 42 determines motion vectors for inter-frame prediction, or the block vectors may be determined using motion estimation unit 42.

[0066] Regarding pixel differences, the predicted block for a video block can be, or can correspond to, a block or reference block of a reference frame considered to closely match the video block to be encoded. Pixel differences can be determined by sum of absolute differences (SAD), sum of squared differences (SSD), or other difference metrics. In some implementations, the video encoder 20 can compute values ​​for sub-integer pixel positions of the reference frame stored in the DPB 64. For example, the video encoder 20 can interpolate values ​​for quarter-pixel positions, eighth-pixel positions, or other fractional pixel positions of the reference frame. Therefore, the motion estimation unit 42 can perform motion search relative to full-pixel positions and fractional pixel positions and output a motion vector with fractional pixel accuracy.

[0067] The motion estimation unit 42 calculates the motion vector for a video block in an inter-frame predictive coding frame by comparing the position of the video block with the position of the predicted block in a reference frame selected from either a first reference frame list (list 0) or a second reference frame list (list 1), each of the first and second reference frame lists identifying one or more reference frames stored in the DPB 64. The motion estimation unit 42 sends the calculated motion vector to the motion compensation unit 44, and then to the entropy coding unit 56.

[0068] Motion compensation performed by motion compensation unit 44 may involve acquiring or generating prediction blocks based on motion vectors determined by motion estimation unit 42. Upon receiving motion vectors for the current video block, motion compensation unit 44 may locate the prediction block pointed to by the motion vector in a reference frame list within a reference frame list, retrieve the prediction block from DPB 64, and forward the prediction block to adder 50. Adder 50 then forms a residual video block of pixel differences by subtracting the pixel values ​​of the prediction block provided by motion compensation unit 44 from the pixel values ​​of the currently encoded video block. The pixel differences forming the residual video block may include a luminance component difference or a chrominance component difference, or both. Motion compensation unit 44 may also generate syntax elements associated with video blocks of a video frame for use by video decoder 30 when decoding video blocks of a video frame. Syntax elements may include, for example, syntax elements defining motion vectors for identifying prediction blocks, any flags indicating prediction modes, or any other syntax information described herein. It should be noted that motion estimation unit 42 and motion compensation unit 44 may be highly integrated, but are described separately for conceptual purposes.

[0069] In some implementations, the intra-BC unit 48 can generate vectors and acquire prediction blocks in a manner similar to that described above in conjunction with the motion estimation unit 42 and the motion compensation unit 44; however, these prediction blocks are in the same frame as the current block being encoded, and these vectors are referred to as block vectors rather than motion vectors. Specifically, the intra-BC unit 48 can determine the intra-prediction mode to be used for encoding the current block. In some examples, the intra-BC unit 48 can, for example, use various intra-prediction modes to encode the current block during individual encoding passes and test their performance through rate-distortion analysis. Next, the intra-BC unit 48 can select a suitable intra-prediction mode from the various tested intra-prediction modes to use and generate an intra-mode indicator accordingly. For example, the intra-BC unit 48 can use rate-distortion analysis to calculate rate-distortion values ​​for the various tested intra-prediction modes and select the intra-prediction mode with the best rate-distortion characteristics from the tested modes as the suitable intra-prediction mode to use. Rate-distortion analysis generally determines the amount of distortion (or error) between the coded block and the original uncoded block that was encoded to produce the coded block, as well as the bit rate (i.e., the number of bits) used to produce the coded block. Intra-frame BC unit 48 can calculate the ratio based on the distortion and rate for various coded blocks to determine which intra-frame prediction mode exhibits the optimal rate-distortion value for the block.

[0070] In other examples, the intra-frame BC unit 48 may use, in whole or in part, the motion estimation unit 42 and the motion compensation unit 44 to perform such functions for intra-frame BC prediction according to the embodiments described herein. In any case, for intra-frame block copying, in terms of pixel differences, the predicted block may be a block considered to closely match the block to be encoded, the pixel differences may be determined by SAD, SSD, or other difference metrics, and identifying the predicted block may include calculating values ​​for sub-integer pixel positions.

[0071] Regardless of whether the predicted block comes from the same frame predicted intra-frame or from different frames predicted inter-frame, the video encoder 20 can form a residual video block by subtracting the pixel values ​​of the predicted block from the pixel values ​​of the current video block being encoded. The pixel difference forming the residual video block can include both luma component difference and chroma component difference.

[0072] As an alternative to the inter-frame prediction performed by the motion estimation unit 42 and the motion compensation unit 44 as described above, or the intra-block copy prediction performed by the intra-BC unit 48, the intra-prediction processing unit 46 can perform intra-frame prediction on the current video block. Specifically, the intra-prediction processing unit 46 can determine an intra-prediction mode for encoding the current block. To this end, the intra-prediction processing unit 46 can use various intra-prediction modes to encode the current block, for example, during individual encoding passes, and the intra-prediction processing unit 46 (or, in some examples, the mode selection unit) can select a suitable intra-prediction mode from the tested intra-prediction modes for use. The intra-prediction processing unit 46 can provide information indicating the intra-prediction mode selected for the block to the entropy coding unit 56. The entropy coding unit 56 can encode the information indicating the selected intra-prediction mode into the bitstream.

[0073] After prediction processing unit 41 determines the prediction block for the current video block via inter-frame prediction or intra-frame prediction, adder 50 forms a residual video block by subtracting the prediction block from the current video block. The residual video data in the residual block may be included in one or more TUs and provided to transform processing unit 52. Transform processing unit 52 uses a transform (e.g., discrete cosine transform (DCT) or a conceptually similar transform) to transform the residual video data into residual transform coefficients.

[0074] The transform processing unit 52 can send the resulting transform coefficients to the quantization unit 54. The quantization unit 54 quantizes the transform coefficients to further reduce the bit rate. The quantization process can also reduce the bit depth associated with some or all of the coefficients. The degree of quantization can be modified by adjusting the quantization parameters. In some examples, the quantization unit 54 can subsequently perform a scan on the matrix including the quantized transform coefficients. Alternatively, the entropy coding unit 56 can perform the scan.

[0075] After quantization, entropy coding unit 56 entropy-encodes the quantized transform coefficients into a video bitstream using, for example, context-adaptive variable-length coding (CAVLC), context-adaptive binary arithmetic coding (CABAC), syntax-based context-adaptive binary arithmetic coding (SBAC), probabilistic interval segmented entropy (PIPE) coding, or another entropy coding method or technique. The encoded bitstream can then be sent to video decoder 30 as shown in FIG. 1, or archived in storage device 32 as shown in FIG. 1 for later transmission to or retrieval by video decoder 30. Entropy coding unit 56 can also entropy-encode motion vectors and other syntax elements used for the current video frame being encoded.

[0076] The inverse quantization unit 58 and the inverse transform processing unit 60 apply inverse quantization and inverse transform, respectively, to reconstruct residual video blocks in the pixel domain for generating reference blocks to predict other video blocks. As noted above, the motion compensation unit 44 can generate motion-compensated prediction blocks from one or more reference blocks of frames stored in the DPB 64. The motion compensation unit 44 can also apply one or more interpolation filters to the prediction blocks to compute sub-integer pixel values ​​for use in motion estimation.

[0077] Adder 62 adds the reconstructed residual block to the motion-compensated prediction block generated by motion compensation unit 44 to generate a reference block for storage in DPB 64. The reference block can then be used as a prediction block by intra-frame BC unit 48, motion estimation unit 42, and motion compensation unit 44 for inter-frame prediction of another video block in subsequent video frames.

[0078] Figure 3 is a block diagram illustrating an exemplary video decoder 30 according to some embodiments of this application. The video decoder 30 includes a video data memory 79, an entropy decoding unit 80, a prediction processing unit 81, an inverse quantization unit 86, an inverse transform processing unit 88, an adder 90, and a DPB 92. The prediction processing unit 81 further includes a motion compensation unit 82, an intra-frame prediction unit 84, and an intra-frame BC unit 85. The video decoder 30 can perform a decoding process that is substantially the inverse of the encoding process described above in conjunction with Figure 2 regarding the video encoder 20. For example, the motion compensation unit 82 can generate prediction data based on motion vectors received from the entropy decoding unit 80, while the intra-frame prediction unit 84 can generate prediction data based on intra-frame prediction mode indicators received from the entropy decoding unit 80.

[0079] In some examples, units of the video decoder 30 may be assigned tasks to perform embodiments of this application. Furthermore, in some examples, embodiments of this disclosure may be distributed across one or more units of the video decoder 30. For example, the intra-frame BC unit 85 may perform embodiments of this application individually or in combination with other units of the video decoder 30 (e.g., motion compensation unit 82, intra-frame prediction unit 84, and entropy decoding unit 80). In some examples, the video decoder 30 may not include the intra-frame BC unit 85, and the functionality of the intra-frame BC unit 85 may be performed by other components of the prediction processing unit 81 (e.g., motion compensation unit 82).

[0080] Video data memory 79 can store video data, such as encoded video bitstreams, that will be decoded by other components of video decoder 30. The video data stored in video data memory 79 can be obtained, for example, from storage device 32, from a local video source (e.g., a camera), via wired or wireless network communication of video data, or by accessing a physical data storage medium (e.g., a flash drive or hard disk). Video data memory 79 may include an encoded picture buffer (CPB) that stores encoded video data from the encoded video bitstream. The DPB 92 of video decoder 30 stores reference video data for use by video decoder 30 (e.g., in intra-frame or inter-frame predictive coding modes) when decoding video data. Video data memory 79 and DPB 92 can be formed from any of a variety of memory devices, such as dynamic random access memory (DRAM) (including synchronous DRAM (SDRAM)), magnetoresistive RAM (MRAM), resistive RAM (RRAM), or other types of memory devices. For illustrative purposes, video data memory 79 and DPB 92 are depicted as two distinct components of video decoder 30 in FIG. 3. However, it will be apparent to those skilled in the art that the video data memory 79 and DPB92 can be provided by the same memory device or separate memory devices. In some examples, the video data memory 79 may be on-chip along with other components of the video decoder 30, or off-chip relative to those components.

[0081] During the decoding process, the video decoder 30 receives an encoded video bitstream representing video blocks of encoded video frames and associated syntax elements. The video decoder 30 may receive syntax elements at the video frame level and / or the video block level. The entropy decoding unit 80 of the video decoder 30 performs entropy decoding on the bitstream to generate quantization coefficients, motion vectors or intra-prediction mode indicators, and other syntax elements. The entropy decoding unit 80 then forwards the motion vectors or intra-prediction mode indicators, and other syntax elements to the prediction processing unit 81.

[0082] When a video frame is encoded as an intra-predictive coded (I) frame or used as an intra-coded prediction block in other types of frames, the intra-predictive unit 84 of the prediction processing unit 81 can generate prediction data for the video block of the current video frame based on the intra-predictive mode transmitted by the signal and reference data from the previous decoded block of the current frame.

[0083] When a video frame is encoded as an inter-frame predictive coded (i.e., B or P) frame, the motion compensation unit 82 of the prediction processing unit 81 generates one or more prediction blocks for the current video frame based on motion vectors and other syntax elements received from the entropy decoding unit 80. Each of the prediction blocks can be generated from a reference frame within a reference frame list. The video decoder 30 can construct the reference frame list, i.e., list 0 and list 1, based on the reference frames stored in the DPB 92 using a default construction technique.

[0084] In some examples, when a video block is encoded according to the intra-frame BC mode described herein, the intra-frame BC unit 85 of the prediction processing unit 81 generates a prediction block for the current video block based on the block vector and other syntax elements received from the entropy decoding unit 80. The prediction block can be located within a reconstructed region of the same image as the current video block, as defined by the video encoder 20.

[0085] Motion compensation unit 82 and / or intra-frame prediction (BC) unit 85 determine prediction information for video blocks in the current video frame by parsing motion vectors and other syntax elements, and then use this prediction information to generate prediction blocks for the current video block being decoded. For example, motion compensation unit 82 uses some of the received syntax elements to determine the prediction mode (e.g., intra-frame prediction or inter-frame prediction) used to encode video blocks in the video frame, the inter-frame prediction frame type (e.g., B or P), construction information for one or more reference frames in the reference frame list for the frame, motion vectors for each inter-frame prediction encoded video block in the frame, the inter-frame prediction state for each inter-frame prediction encoded video block in the frame, and other information for decoding video blocks in the current video frame.

[0086] Similarly, the intra-BC unit 85 can use some of the received syntax elements, such as flags, to determine which video blocks in the frame are predicted using the intra-BC mode, which video blocks in the frame are in the reconstruction region and should be stored in the DPB 92, the block vector for each intra-BC predicted video block in the frame, the intra-BC prediction state for each intra-BC predicted video block in the frame, and other information for decoding video blocks in the current video frame.

[0087] The motion compensation unit 82 can also perform interpolation using interpolation filters, such as those used by the video encoder 20 during encoding of video blocks, to calculate interpolated values ​​for sub-integer pixels of the reference block. In this case, the motion compensation unit 82 can determine the interpolation filters used by the video encoder 20 based on the received syntax elements and use these interpolation filters to generate the prediction block.

[0088] The dequantization unit 86 dequantizes the quantized transform coefficients provided in the bitstream and entropy-decoded by the entropy decoding unit 80 using the same quantization parameters calculated by the video encoder 20 for each video block in the video frame to determine the degree of quantization. The inverse transform processing unit 88 applies an inverse transform (e.g., inverse DCT, inverse integer transform, or a conceptually similar inverse transform process) to the transform coefficients in order to reconstruct the residual block in the pixel domain.

[0089] After the motion compensation unit 82 or the intra-frame BC unit 85 generates a prediction block for the current video block based on vectors and other syntax elements, the adder 90 reconstructs the decoded video block for the current video block by adding the residual block from the inverse transform processing unit 88 to the corresponding prediction block generated by the motion compensation unit 82 and the intra-frame BC unit 85. A loop filter 91 (e.g., a deblocking filter, SAO filter, CCSAO filter, and / or ALF) may be located between the adder 90 and the DPB 92 for further processing of the decoded video block. In some examples, the loop filter 91 may be omitted, and the decoded video block may be directly provided to the DPB 92 by the adder 90. The decoded video block in a given frame is then stored in the DPB 92, which stores reference frames for subsequent motion compensation of the next video block. The DPB 92 or a separate memory device may also store the decoded video for later presentation on a display device (e.g., display device 34 of FIG. 1).

[0090] In a typical video coding process, a video sequence usually consists of an ordered set of frames or images. Each frame may include three sample arrays, denoted as SL, SCb, and SCr. SL is a two-dimensional array of luminance samples. SCb is a two-dimensional array of Cb chrominance samples. SCr is a two-dimensional array of Cr chrominance samples. In other instances, a frame may be monochrome and therefore consist of only a two-dimensional array of luminance samples.

[0091] As shown in Figure 4A, the video encoder 20 (or more specifically, the segmentation unit 45) generates a coded representation of a frame by first segmenting the frame into a set of CTUs. A video frame may include an integer number of CTUs ordered sequentially from left to right and top to bottom in raster scan order. Each CTU is the largest logical coding unit, and the width and height of the CTU are signaled by the video encoder 20 in a sequence parameter set such that all CTUs in the video sequence have the same size, such as 128×128, 64×64, 32×32, and 16×16. However, it should be noted that this application is not limited to a specific size. As shown in Figure 4B, each CTU may include a CTB for a luminance sample, two corresponding coding tree blocks for a chrominance sample, and syntax elements for encoding the samples of the coding tree blocks. The syntax elements describe the nature of different types of units of the coded pixel blocks and how the video sequence can be reconstructed at the video decoder 30, including inter-frame prediction or intra-frame prediction, intra-frame prediction mode, motion vectors, and other parameters. In a monochrome image or an image with three separate color planes, a CTU can include a single coding tree block and syntax elements for encoding samples of that coding tree block. The coding tree block can be an N×N sample block.

[0092] To achieve better performance, the video encoder 20 can recursively perform tree partitioning on the coding tree blocks of the CTU, such as binary tree partitioning, ternary tree partitioning, quadtree partitioning, or a combination thereof, and divide the CTU into smaller CUs. As depicted in Figure 4C, the 64×64 CTU 400 is first partitioned into four smaller CUs, each with a block size of 32×32. Among the four smaller CUs, CU 410 and CU 420 are each partitioned into four CUs with a block size of 16×16. The two 16×16 CUs, 430 and 440, are further partitioned into four CUs with a block size of 8×8. Figure 4D depicts a quadtree data structure showing the final result of the partitioning process of the CTU 400 as depicted in Figure 4C, where each leaf node of the quadtree corresponds to a CU of a corresponding size ranging from 32×32 to 8×8. Similar to the CTU depicted in Figure 4B, each CU can include two corresponding coded blocks of luminance and chrominance samples of the same size frame, as well as syntax elements for encoding the samples of the coded blocks. In monochrome images or images with three separate color planes, a CU can include a single coded block and a syntax structure for encoding the samples of the coded block. It should be noted that the quadtree segmentation depicted in Figures 4C and 4D is for illustrative purposes only, and a CTU can be split into multiple CUs based on quadtree segmentation / tritree segmentation / binary tree segmentation to adapt to varying local characteristics. In multi-type tree structures, a CTU is segmented according to a quadtree structure, and each quadtree leaf CU can be further segmented according to binary and ternary tree structures. As shown in Figure 4E, a coded block with width W and height H has five possible segmentation types: quadtree segmentation, horizontal binary segmentation, vertical binary segmentation, horizontal triplet segmentation, and vertical triplet segmentation.

[0093] In some implementations, the video encoder 20 may further segment the coded blocks of the CU into one or more (M×N) PBs. A PB is a rectangular (square or non-square) sample block to which the same prediction (inter-frame or intra-frame) is applied. The PU of the CU may include a PB for luma samples, two corresponding PBs for chroma samples, and syntax elements for predicting the PBs. In a monochrome image or an image with three separate color planes, a PU may include a single PB and a syntax structure for predicting the PBs. The video encoder 20 may generate predicted luma blocks, predicted Cb blocks, and predicted Cr blocks for each PU of the CU, representing the luma PB, Cb PB, and Cr PB.

[0094] Video encoder 20 can generate prediction blocks for a PU using intra-frame prediction or inter-frame prediction. If video encoder 20 uses intra-frame prediction to generate prediction blocks for a PU, then video encoder 20 can generate prediction blocks for a PU based on decoded samples of the frame associated with the PU. If video encoder 20 uses inter-frame prediction to generate prediction blocks for a PU, then video encoder 20 can generate prediction blocks for a PU based on decoded samples of one or more frames other than the frame associated with the PU.

[0095] After the video encoder 20 generates predicted luminance blocks, predicted Cb blocks, and predicted Cr blocks for one or more PUs of the CU, the video encoder 20 can generate luminance residual blocks for the CU by subtracting the predicted luminance blocks of the CU from the original luminance coding blocks of the CU, such that each sample in the luminance residual block of the CU indicates the difference between a luminance sample in one of the predicted luminance blocks of the CU and a corresponding sample in the original luminance coding block of the CU. Similarly, the video encoder 20 can generate Cb residual blocks and Cr residual blocks for the CU, respectively, such that each sample in the Cb residual block of the CU indicates the difference between a Cb sample in one of the predicted Cb blocks of the CU and a corresponding sample in the original Cb coding block of the CU, and each sample in the Cr residual block of the CU indicates the difference between a Cr sample in one of the predicted Cr blocks of the CU and a corresponding sample in the original Cr coding block of the CU.

[0096] Furthermore, as shown in Figure 4C, the video encoder 20 can use quadtree partitioning to decompose the luminance residual block, Cb residual block, and Cr residual block of the CU into one or more luminance transform blocks, Cb transform blocks, and Cr transform blocks, respectively. A transform block is a rectangular (square or non-square) sample block to which the same transform is applied. A TU of the CU can include a transform block of the luminance sample, two corresponding transform blocks of the chrominance sample, and syntax elements for transforming the transform block samples. Therefore, each TU of the CU can be associated with a luminance transform block, a Cb transform block, and a Cr transform block. In some examples, the luminance transform block associated with a TU can be a sub-block of the CU's luminance residual block. A Cb transform block can be a sub-block of the CU's Cb residual block. A Cr transform block can be a sub-block of the CU's Cr residual block. In a monochrome image or an image with three separate color planes, a TU can include a single transform block and syntax structures for transforming the samples of that transform block.

[0097] The video encoder 20 can apply one or more transforms to the luminance transform block of the TU to generate a luminance coefficient block for the TU. The coefficient block can be a two-dimensional array of transform coefficients. The transform coefficients can be scalars. The video encoder 20 can apply one or more transforms to the Cb transform block of the TU to generate a Cb coefficient block for the TU. The video encoder 20 can apply one or more transforms to the Cr transform block of the TU to generate a Cr coefficient block for the TU.

[0098] After generating coefficient blocks (e.g., luminance coefficient blocks, Cb coefficient blocks, or Cr coefficient blocks), video encoder 20 can quantize the coefficient blocks. Quantization typically refers to the process of quantizing transform coefficients to potentially reduce the amount of data used to represent the transform coefficients, thereby providing further compression. After quantizing the coefficient blocks, video encoder 20 can entropy encode the syntax elements indicating the quantized transform coefficients. For example, video encoder 20 can perform CABAC on the syntax elements indicating the quantized transform coefficients. Finally, video encoder 20 can output a bitstream comprising a bit sequence that forms a representation of coded frames and associated data; the bitstream is stored in storage device 32 or transmitted to target device 14.

[0099] After receiving the bitstream generated by the video encoder 20, the video decoder 30 can parse the bitstream to obtain syntax elements. The video decoder 30 can reconstruct frames of video data, at least in part, based on the syntax elements obtained from the bitstream. The process of reconstructing the video data is generally the inverse of the encoding process performed by the video encoder 20. For example, the video decoder 30 can perform an inverse transform on the coefficient block associated with the TU of the current CU to reconstruct the residual block associated with the TU of the current CU. The video decoder 30 also reconstructs the coded blocks of the current CU by adding samples of the predicted blocks of the PU for the current CU to corresponding samples of the transformed blocks of the TU of the current CU. After reconstructing the coded blocks for each CU of the frame, the video decoder 30 can reconstruct the frame.

[0100] As mentioned above, video coding primarily uses two modes (i.e., intra-frame prediction and inter-frame prediction) to achieve video compression. It should be noted that IBC can be considered either intra-frame prediction or a third mode. Between the two modes, inter-frame prediction contributes more to coding efficiency than intra-frame prediction because it uses motion vectors to predict the current video block based on a reference video block.

[0101] However, with continuously improving video data capture technologies and finer video tile sizes used to preserve details in video data, the amount of data required to represent the motion vectors for the current frame has also increased significantly. One way to overcome this challenge benefits from the fact that not only do a set of neighboring CUs in both the spatial and temporal domains have similar video data for prediction purposes, but the motion vectors between these neighboring CUs are also similar. Therefore, the motion information of spatially neighboring CUs and / or temporally co-located CUs can be used as an approximation of the motion information (e.g., motion vectors) of the current CU (also known as the "Motion Vector Prediction" (MVP) of the current CU) by exploring their spatial and temporal correlations.

[0102] Instead of encoding the actual motion vector of the current CU determined by the motion estimation unit 42 into the video bitstream as described above in conjunction with Figure 2, the motion vector prediction value of the current CU is subtracted from the actual motion vector of the current CU to generate the motion vector difference (MVD) for the current CU. By doing so, it is not necessary to encode the motion vector determined by the motion estimation unit 42 for each CU of the frame into the video bitstream, and the amount of data used to represent motion information in the video bitstream can be significantly reduced.

[0103] Similar to the process of selecting a prediction block in a reference frame during inter-frame prediction of a coded block, both the video encoder 20 and the video decoder 30 need to employ a set of rules to construct a motion vector candidate list (also known as a "merging list") for the current CU using those potential candidate motion vectors associated with spatially neighboring CUs and / or temporally co-located CUs. Then, a member is selected from the motion vector candidate list as the motion vector prediction value for the current CU. By doing so, it is not necessary to send the motion vector candidate list itself from the video encoder 20 to the video decoder 30, and the index of the selected motion vector prediction value within the motion vector candidate list is sufficient for both the video encoder 20 and the video decoder 30 to encode and decode the current CU using the same motion vector prediction value from the motion vector candidate list.

[0104] The main focus of this disclosure is to further enhance intra-block copying methods by improving encoding / decoding efficiency and / or reducing their encoding / decoding complexity.

[0105] Intra-Block Copying (IBC) in Universal Video Coding (VVC) is a tool used in HEVC extensions on SCC. It is well known to significantly improve the encoding and decoding efficiency of screen content material. Since IBC mode is implemented as a block-level coding mode, block matching (BM) is performed at the encoder to find the optimal block vector (or motion vector) for each CU. Here, the block vector is used to indicate the displacement from the current block to a reference block that has already been reconstructed within the current frame. The luma block vector of the IBC-coded CU has integer precision. The chroma block vector is also rounded to integer precision. When combined with AMVR, IBC mode can switch between 1-pixel motion vector precision and 4-pixel motion vector precision. IBC-coded CUs are considered a third prediction mode, distinct from intra-prediction or inter-prediction modes. IBC mode is suitable for CUs with a width and height of 64 luma samples or less.

[0106] On the encoder side, hash-based motion estimation is performed on the IBC. The encoder performs RD checks on blocks with a width or height no greater than 16 luminance samples. For non-merging modes, a block vector search is first performed using a hash-based search. If the hash search does not return any valid candidates, a local search based on block matching is performed.

[0107] In hash-based search, hash key matching (32-bit CRC) between the current block and reference blocks is extended to all allowed block sizes. Hash key calculation for each location in the current image is based on 4 × 4 sub-blocks. For larger current blocks, a hash key is determined to match the hash key of a reference block when all hash keys of all 4 × 4 sub-blocks match the hash key at the corresponding reference location. If multiple reference blocks are found to match the hash key of the current block, the block vector cost of each matching reference is calculated, and the reference with the minimum cost is selected.

[0108] In block matching search, the search scope is set to cover both the previous CTU and the current CTU.

[0109] At the CU level, IBC modes are transmitted using flags, and can be transmitted as either IBC AMVP mode or IBC skip / merge mode: - IBC Skip / Merge Mode: The merge candidate index is used to indicate which block vectors from the list of neighboring candidate IBC coding blocks are used to predict the current block. The merge list consists of spatial candidates, HMVP candidates, and paired candidates.

[0110] - IBC AMVP mode: Encodes block vector differences in the same way as motion vector differences. The block vector prediction method uses two candidates as prediction values, one from the left neighbor and one from the top neighbor (if IBC encoding is used). When neither neighbor is available, the default block vector is used as the prediction value. A flag indicating the index of the block vector prediction value is transmitted via signaling.

[0111] To reduce memory consumption and decoder complexity, the IBC reference area in VVC only allows the reconstruction of a predefined area including the current CTU region and a certain area of ​​the left CTU. Figure 8 illustrates the reference area of ​​the IBC mode, where each block represents a 64 × 64 lumen sample unit.

[0112] Intra-block copying in Enhanced Compression Model (ECM) is improved in several ways by IBC.

[0113] The IBC merge / AMVP list construction has been modified as follows: • IBC merge / AMVP candidates can only be inserted into the IBC merge / AMVP candidate list if they are valid.

[0114] • Candidates in the top right, bottom left, and top left spaces, as well as a pairwise average candidate, can be added to the IBC merge / AMVP candidate list.

[0115] • Apply template-based adaptive reordering (ARMC-TM) to the IBC merge list.

[0116] Three candidates are located at the nearest corner of the reference region, and another three candidates are determined to be in the middle of the three sub-regions (A, B, and C), with their coordinates determined by the width, height, and ΔX and ΔY parameters of the current block, as depicted in Figure 9.

[0117] IBC template matching is used in both IBC merge mode and IBC AMVP mode.

[0118] Compared to the list used in the regular IBC merge mode, the IBC-TM merge list has been modified to select candidates based on a pruning method, with the same motion distance between candidates as in the regular TM merge mode. The zero motion supplement at the end is replaced with motion vectors for the left (-W, 0), top (0, -H), and top-left (-W, -H), where W is the width of the current CU and H is the height of the current CU.

[0119] In IBC-TM merging mode, the selected candidates are refined using a template matching method before the RDO or decoding process. IBC-TM merging mode competes with the regular IBC merging mode and uses a signal transmission TM-merging flag.

[0120] In IBC-TM AMVP mode, a maximum of three candidates are selected from the IBC-TM merge list. Each of these three selected candidates is refined using a template matching method and ranked according to its resulting template matching cost. Then, during motion estimation, only the first two are considered as usual.

[0121] Template matching refinement in IBC-TM merge mode and AMVP mode is very straightforward because the IBC motion vector is constrained (i) to integers and (ii) to the reference region, as shown in Figure 8. Therefore, in IBC-TM merge mode, all refinements are performed with integer precision, while in IBC-TM AMVP mode, they are performed with integer or 4-pixel precision depending on the AMVR value. This refinement only accesses samples that are not interpolated. In both cases, the refinement motion vector and the template used in each refinement step must adhere to the constraints of the reference region.

[0122] The IBC reference area extends to the two CTU rows above. Figure 10 illustrates the reference area used to encode CTU (m,n).

[0123] IBC adaptation for camera-captured content: When adapting IBC for camera-captured content, the IBC reference range is reduced from 2 CTU rows to 2 × 128 rows, as shown in Figure 11. On the encoder side, to reduce complexity, the local search range is set to a horizontal [-8,8] and vertical [-8,8] range centered on the first block vector prediction value of the current CU. This encoder modification is not applicable to SCC sequences.

[0124] Sub-block-based Temporal Motion Vector Prediction (SbTMVP) Figures 13A and 13B illustrate the SbTMVP process. SbTMVP predicts the motion vectors of sub-CUs within the current CU in two steps. In the first step, spatial neighbor A1 in Figure 13A is examined. In the second step, as shown in Figure 13B, the motion shift identified in the first step (i.e., added to the coordinates of the current block) is applied to obtain sub-CU-level motion information (motion vectors and reference indices) from the co-location image.

[0125] Intra-template matching (TMP) prediction is a special intra-prediction mode that copies the best prediction block from the reconstructed portion of the current frame that best matches the current template (L-shaped template). For a predefined search range, the encoder searches for the template most similar to the current template in the reconstructed portion of the current frame and uses the corresponding block as the prediction block. The encoder then signals the use of this mode and performs the same prediction operation on the decoder side.

[0126] A prediction signal is generated by matching the L-shaped causal neighbors of the current block with another block in a predefined search region in Figure 15, which consists of the following: R1: current CTUR2: top left CTUR3: top CTUR4: left CTU. The absolute difference (SAD) is used as the cost function.

[0127] Within each region, the decoder searches for the template with the minimum SAD relative to the current template and uses its corresponding block as the prediction block.

[0128] Within each region, the decoder constructs a candidate list of up to 19 template-matched block vectors, ranked in ascending order according to template cost (SAD). The following modes are supported: First, a single predicted value: a single predicted value is selected from the candidate list.

[0129] The second aspect involves the fusion of multiple predictions: multiple predictions are mixed multiple times to derive the final prediction block. The mixing weights are calculated either based on the template matching cost of each prediction or using a weight derivation method based on Wiener filters.

[0130] Third is subpixel precision: When using a single prediction value, subpixel precision can be used at 1 / 2 pixel precision, 1 / 4 pixel precision, or 3 / 4 pixel precision, with 8 possible directions for each precision.

[0131] Fourth is the linear filter model: a linear filter can be learned between the reference template and the current template, and the linear model is applied to the reference block. This mode can be used for a single prediction when sub-pixel precision is not used.

[0132] The dimensions of all regions (SearchRange_w, SearchRange_h) are set proportionally to the block dimensions (BlkW, BlkH) to ensure a fixed number of SAD comparisons per pixel. That is: SearchRange_w = a × BlkW; SearchRange_h = a × BlkH, where ' ' is a constant that controls the tradeoff between gain and complexity. In fact, ' 'Equals 5.'

[0133] To accelerate the template matching process, the search range of all search regions is subsampled by a factor of 3. After finding the best match, a refinement process is performed. Refinement is achieved by performing a second template matching search around the best match to narrow down the search area.

[0134] For CUs with width and height dimensions less than or equal to 64, enable the intra-frame template matching tool. This maximum CU size used for intra-frame template matching is configurable.

[0135] When DIMD is not used for the current CU, the intra-frame template matching prediction mode is transmitted at the CU level using a dedicated flag.

[0136] In this method, block vectors (BVs) derived from intra-template matching prediction (intra-TMP) are used for intra-block copying (IBC). The stored intra-TMP BVs of neighboring blocks, together with the IBC BVs, are used as spatial BV candidates in the construction of the IBC candidate list.

[0137] The intra-frame TMP block vector is stored in the IBC block vector buffer, and the current IBC block can use both the IBC BV of neighboring blocks and the intra-frame TMP BV as BV candidates in the IBC BV candidate list, as shown in Figure 21. The intra-frame TMP block vector is added as a spatial candidate to the IBC block vector candidate list.

[0138] In video codecs, intra-block copying is well-known for accurately predicting both screen content and artificially generated content, where patterns and edges can repeat within a frame. Intra-block copying can also be beneficial for predicting natural content with repeating textures in the current frame. For codec scenarios with limited repeating content, intra-block copying can be omitted while still transmitting its minimum signaling bits. In such cases, to further improve the codec efficiency of intra-block copying, a more flexible on / off control mechanism with varying granularity is desired.

[0139] In inter-frame prediction encoding / decoding modes, fractional motion vectors are used to improve prediction accuracy. However, in the current intra-block copy mode, only integer motion vectors are used. This study aims to explore the encoding / decoding benefits of using fractional motion vectors for intra-block copy. When using fractional motion in intra-block copy, several follow-up issues need to be addressed: fractional motion derivation, signal transmission, interpolation padding, interpolation filter selection, and interaction with other encoding / decoding tools.

[0140] In this disclosure, the encoding / decoding tools for intra-block copying are improved in the following aspects: • Interpolation-based fractional intra-block copying • Fractional motion search • Fractional motion refinement • Conditional sample / pixel padding for fractional interpolation • Interpolation filter switching • Multi-hypothesis fractional intra-block copying • Signal transmission of motion information • IBC merging / AMVP motion candidate list construction • Combination with intra-template matching • Improved intra-TMP mode Interpolation-based fractional intra-block copying Fractional motion search In one embodiment, fractional motion search can be performed on the encoder side, and the final motion signal can be transmitted to the decoder side. After subtracting the motion prediction values ​​known to both the encoder and decoder, the motion transmitted as a signal can be in the format of motion difference. The motion search can be performed in three steps: • In step 1, the best N integer motion vectors with the minimum distortion cost (e.g., sum of absolute differences (SAD)) can be searched first.

[0141] • In step 2, half-pixel thinning is applied around each of the N integer motion vectors. In this step 2, M optimal half-pixel positions can be obtained (the optimal M positions indicate the M half-pixel motion differences with the lowest rate distortion cost). For example, an encoder or decoder can obtain the M optimal half-pixel positions with the lowest rate distortion cost. If K of the N integer motion vectors are selected, the output can be a total of K × M half-pixel positions.

[0142] • In step 3, quarter-pixel thinning is applied around the optimal half-pixel position for each of the N integer motion vectors. In this step 3, a set of Q quarter-pixel positions can be obtained for each of the K × M half-pixel positions obtained in step 2. The optimal R quarter-pixel positions from all K × M × Q candidate positions can then be generated. The optimal position among the R positions (e.g., the position with the minimum rate distortion) can be determined by full rate distortion calculation and transmitted to the decoder. For example, the encoder can generate the optimal R quarter-pixel positions, then select the best position with the minimum rate distortion among the R positions, and transmit the best position among the R positions to the decoder. The values ​​of N, M, K, Q, and R are position integers.

[0143] Following these three steps, (e.g., in the format of motion vector difference) the optimally thinned motion vector is transmitted via signal transmission (after half-pixel and / or quarter-pixel thinning). In this disclosure, and in this and the following sections, the motion vector can be used interchangeably with a block vector that identifies a reference / predicted block in the same picture / frame.

[0144] In some examples, if the actual highest precision after quarter-pixel thinning is only half a pixel (e.g., the highest precision bit or the last bit of the quarter-pixel motion vector is zero), the signal transmission of these thinned motion vectors can be performed in two different ways.

[0145] In one approach, the motion vector is still thinned by signal transmission in quarter-pixel or 1 / 4-pixel increments. In this case, half-pixel or 1 / 2-pixel precision is never used for signal transmission.

[0146] In another approach, the motion vector is refined using signal transmission with a practical precision of only half a pixel or half a pixel. In this case, signal transmission with half a pixel or half a pixel precision is supported.

[0147] In another embodiment, fractional motion search can be performed at both the encoder and decoder sides, eliminating the need to transmit the final fractional motion via signaling. In this approach, a template-matching-based method can be used to find the optimal fractional motion.

[0148] In one or more embodiments, an inverse L-shaped sample / pixel region adjacent to a coding block may be used as a matching template, and the sample / pixel width may be prefix, configurable, or signaled at the sequence or / and picture, or / and slice, or / and CTU level.

[0149] Within a constrained search region (which is defined by a prefix, configurable, or signaled number of CTUs, or CTU lines, or samples from the upper, left, or / and upper-left spatial regions), the template similarity between any adjacent / non-adjacent reference block and the current coding block is calculated, and the best N reference blocks with the closest similarity are selected as candidates in the template list.

[0150] An additional flag is signaled to indicate whether to use the template matching method. If the flag is true, another index value indicating which candidate in the template list to use should be further signaled.

[0151] In another embodiment, both the encoder search method and the template matching method are used jointly. For example, first, integer motion and fractional refinement methods are employed at the encoder, and then another template refinement is further applied at both the encoder side and the decoder side. Since the encoder search method is already accurate enough, the template refinement can be performed with higher precision and in a smaller region. For example, the motion refinement at the coding side is performed with a precision of up to half-pixel or quarter-pixel, while the template refinement can be further performed with a precision of quarter-pixel or one-eighth pixel or one-sixteenth pixel.

[0152] To constrain the complexity during fractional motion search, several methods can be provided as follows.

[0153] When the current coding block uses other coding modes (e.g., other intra-coding modes such as angular mode, planar mode, etc.), the best SAD (Sum of Absolute Differences) or SATD (Sum of Absolute Transformed Differences) cost is used as a threshold to prematurely terminate the current fractional motion search. In one example, given that the current best SAD or SATD cost from other coding modes is X, the predefined threshold factor is f (e.g., example values can be 1.1, 1.2, 1.21, etc.), and the best SAD or SATD cost of the current integer motion search from the IBC mode is Y. If Y >= f × X, the subsequent fractional motion search can be simplified (e.g., the N best integer motion vectors for further fractional refinement can be reduced to N', and N' < N) or skipped (e.g., the N best integer motion vectors for further fractional refinement can be reduced to 0). Note that the values of N, N', and f can be predefined, signaled, or adaptively determined (e.g., based on the texture richness of the current coding block).

[0154] The fractional search can be simplified or skipped based on combinations of other coding modes. For example, if the current coding block is enabled for IBC-CIIP or / and IBC-LIC, the fractional search for IBC can be simplified (e.g., the N best integer motion vectors for further fractional refinement can be reduced to N', and N' < N) or skipped (e.g., the N best integer motion vectors for further fractional refinement can be reduced to 0). Note that the values of N, N', and f can be predefined or signaled or determined adaptively (e.g., based on the texture richness of the current coding block).

[0155] When the fractional search is simplified, several different simplification methods can be provided as follows.

[0156] In one example, the N best integer motion vectors selected for further fractional refinement can be reduced to N', where N' < N.

[0157] The N best integer motion vectors selected for further fractional refinement can come not only from the current integer search process but also from previous integer or / and fractional search processes (historical search processes) of the same current coding block or different coding blocks. For example, for the current block, the encoder side can perform several rounds of motion search processes, where different modes (e.g., IBC-CIIP, IBC-LIC) can be enabled or disabled for the current block in each round. The motion search process of a later round can be based on the best output of the previously executed / earlier round of the motion search process. For example, when IBC-CIIP or / and IBC-LIC is enabled for the current motion search process, the best output (e.g., the best M integer / fractional motion vectors, M >= 1) of the previous round of the motion search process (where IBC-CIIP or / and IBC-LIC is disabled) can be put into the candidate list and further refined by the current integer / fractional search process.

[0158] Fractional motion refinement can identify the starting motion vector (MV) with or without a fractional motion search process. The starting Mv can be adjusted for two reasons: • For less signaling overhead, the starting Mv can be rounded to a specific precision or value such that the mv difference between the starting Mv and the selected mv prediction value is minimized.

[0159] The starting Mv can be adjusted for two reasons: • For less signaling overhead, the starting Mv can be rounded to a specific precision or value such that the mv difference between the starting Mv and the selected mv prediction value is minimized. • For less signaling overhead, several least significant bits of the starting MV can be discarded.

[0160] With or without the above adjustments, it may be necessary to refine the starting Mv on the decoder side.

[0161] In one or more embodiments, method-based template matching can be used. In one example, an inverse L-shaped sample / pixel region adjacent to the coded block can be used as a matching template. The initial Mv can be refined at the integer pixel and / or fractional pixel level. The potential refinement set can be {1 / 4 pixel, 2 / 4 pixel, 3 / 4 pixel} or / and {1 / 8 pixel, 3 / 8 pixel, 5 / 8 pixel, 7 / 8 pixel}, and the refinement directions are two horizontal directions and two vertical directions (positive and negative values). The refined Mv that generates the prediction block with the most similar template is selected as the final Mv. Note that if the most similar template is selected, the selected refinement can be implicitly obtained by the decoder, or if multiple refined Mvs with N most similar templates are obtained, the selected refinement can be explicitly obtained by the encoder.

[0162] In one or more embodiments, additional flags can be transmitted via signaling to indicate whether this fractional motion refinement is applied. These additional flags can be transmitted as sequences, images, strips, or CTU levels.

[0163] Conditional sample / pixel padding for fractional interpolation: When using fractional Mv, the interpolation operation may require a number of pixels / samples more than the current block. The actual difference depends on the interpolation filter tap length. A pixel / sample padding process may be necessary if some pixels / samples are unavailable. Different padding schemes can be used.

[0164] In one or more embodiments, a repeating fill type can be used. Unavailable pixel / sample locations can be filled with the same value of the nearest available pixel / sample in the same row or column. This repeating fill can be performed first in the horizontal direction (left and right border fills), and then in the vertical direction (top and bottom border fills). Alternatively, this repeating fill can be performed first in the vertical direction (top and bottom border fills), and then in the horizontal direction (left and right border fills).

[0165] In one or more embodiments, a symmetrical fill type can be used. Unavailable pixel / sample locations can be filled with pixels at positions symmetrical to the fill boundary. This fill can be performed first in the horizontal direction (left or right boundary fill) and then in the vertical direction (top or bottom boundary fill). Alternatively, this repeating fill can be performed first in the vertical direction (top or bottom boundary fill) and then in the horizontal direction (left or right boundary fill).

[0166] In one or more embodiments, the filling process may be conditionally skipped or simplified.

[0167] In one embodiment, the filling process may be partially or completely skipped depending on the value of the fractional portion of the motion vector. In one example, if the horizontal or vertical portion of the motion vector is equal to zero, the corresponding vertical or horizontal filling may be skipped or not. If both directions of the motion vector are equal to zero, the filling process may be completely skipped or the entire filling process may still be performed.

[0168] In another embodiment, the corresponding padding process in the horizontal and / or vertical directions can be skipped even if the horizontal and / or vertical portions of the motion vector are not zero, in order to reduce computational and / or bandwidth access costs. An example of this is when the number of unavailable samples required for the interpolation process is less than a threshold N, where N can be a predefined value such as 1 or transmitted via signaling. For example, given a 12-tap interpolation filter, the number of top and left samples required for interpolation is 5, while the number of bottom and right samples required is 6. If the number of unavailable samples required for the interpolation process in the horizontal direction (left and right) or the vertical direction (top and bottom) is less than 2, the padding process in one direction can be skipped.

[0169] In another embodiment, if all the required samples involved in the interpolation process related to a particular motion vector are checked to be valid (e.g., all the samples involved in the interpolation process are located inside the valid reference region, as shown in Figures 8, 10, and 11), the process can be skipped entirely or the entire filling process can still be performed.

[0170] In another embodiment, regarding the interpolation process, the number of desired left or top samples located outside the reference block pointed to by the integer MV or the integer part of MV is one less than the number of desired right or bottom samples, and the padding size of the left and top samples can be reduced by one. For example, if a 12-tap interpolation filter is used for an IBC coded block with non-zero fractional parts in the horizontal and vertical directions of the motion vector, the padding size of the top and left samples is 5, while the padding size of the bottom and right samples is 6.

[0171] In another embodiment, in some cases, the interpolation process is used only for motion search (e.g., encoder fractional motion estimation) or motion reordering (e.g., ARMC), motion refinement (e.g., IBC-DBV, IBC template matching), and parameter generation for prediction refinement (e.g., template prediction generation for IBC-LIC parameter derivation), but not for the final prediction generation of the current coding block, and the padding process can be skipped (e.g., by forcing the fractional part to zero).

[0172] Interpolation filter switching may be necessary for various reasons. For example, if the image / video content is noisy and a smooth filter effect is desired, a longer filter tap length may be preferred. Conversely, if reduced padding complexity is required or the image / video content has rich textured edges, a shorter filter tap length may be preferred.

[0173] In one or more embodiments, filter switching can be determined on the decoder side by analyzing image / video content (such as gradient histograms), which does not require signaling bits.

[0174] In one or more other embodiments, filter switching can be evaluated on the encoder side and transmitted as a signal at different granularities (based on sequence, image, strip, CTU level, or region).

[0175] In one or more other embodiments, filter switching can be evaluated on the encoder side and transmitted as a signal for different frame / strip types (e.g., I-strip, B-strip, and P-strip).

[0176] In one or more other embodiments, filter switching can be evaluated on the encoder side and transmitted as a signal for different video components (e.g., luminance and chrominance components, or Y, Cb and Cr components).

[0177] In one or more other embodiments, filter switching can be evaluated on the encoder side and transmitted as a signal for motion accuracy (e.g., 1 pixel, 4 pixels, or fractional pixels, such as 1 / 2, or / and 1 / 4, or / and 1 / 8 pixels, or / and 1 / 16 pixels).

[0178] In one or more other embodiments, filter switching can be evaluated on the encoder side and transmitted by signal for different interpolation scenarios (e.g., regular compensation prediction for the current block, or compensation prediction for templates such as the top template or / and left template of the current block).

[0179] In another embodiment, the filter switching provided in any combination of the scenarios specified above can be predefined and does not require signal transmission. For example, a 2-tap interpolation filter can always be used if the following three conditions are met: chroma component, template prediction generation, and natural content.

[0180] Another example of predefined filter switching that does not require signal transmission depends on the block size.

[0181] In one embodiment, for smaller blocks, a shorter interpolation filter length is applied, or even no interpolation is applied. When the luma and chroma components have different ratios (e.g., in YUV420 video format), the size of the smaller blocks can be defined differently for each component. For example, for chroma blocks of size 2 × 2 or / and 2 × 4 or / and 4 × 2, a shorter interpolation filter (e.g., 2-tap) is performed, or even no interpolation is performed. If no interpolation is performed, the non-zero fractional portion of the chroma motion vector can be truncated or rounded to an integer value. For luma blocks of size 4 × 4 or / and 4 × 8 or / and 8 × 4, a shorter interpolation filter (e.g., 4-tap or 2-tap) is performed, or even no interpolation is performed. If no interpolation is performed, the non-zero fractional portion of the luma motion vector can be truncated or rounded to an integer value.

[0182] In another embodiment, the filter switching described above may depend on other flags and may not require signal transmission. For example, if a video block is marked as encoded in a specific mode (intra-frame TMP mode) or with a specific motion precision, the filter switching may be determined accordingly.

[0183] In one embodiment, filter switching is predefined according to a specific mode. For example, when using ARMC, IBC template matching mode, IBC-BVDP, and IBC-BVPC modes, the reference template generation for template matching cost calculation can use interpolation filters with shorter lengths (e.g., 2-tap, 4-tap, 6-tap) compared to default filters (e.g., default 12-tap or 8-tap filters for luma and default 6-tap filters for chroma). For IBC-LIC and processing IBC chroma samples, the default luma interpolation filter (e.g., 12-tap filter) and / or chroma interpolation filter (e.g., 6-tap filter) can be used respectively. In another example, for template matching-related tools such as ARMC, IBC template matching mode, IBC-BVDP, and IBC-BVPC modes, the reference template can be generated by ignoring fractional parts (e.g., truncating or rounding to integer values), and the interpolation and padding processes can be skipped entirely.

[0184] The filter switching methods provided above can be applied in any combination.

[0185] Multi-hypothesis fractional intra-block copying can generate multiple predicted blocks when multiple motion vectors (from motion search and / or motion refinement) are available. Multi-hypothesis intra-block copying can be used when averaging multiple similar blocks can produce better block predictions.

[0186] In one or more embodiments, the number of hypotheses may be predefined, configured, or signaled. Additionally, the weights used to average the multiple prediction hypotheses may also be predefined, configured, or signaled.

[0187] In one example, the number of hypotheses can be equal to 2. In this case, the current one-way prediction IBC mode can be extended to a two-way prediction IBC mode. The weights used to combine the two predictions can be inherited from spatial neighbors, transmitted via signaling, obtained on the encoder and decoder sides without signaling, reused from the same weights used for inter-frame prediction blocks, or adaptively selected from predefined weights set on the encoder side and transmitted via signaling to the decoder side.

[0188] In one or more other embodiments, the number of multiple hypotheses can be implicitly determined on the decoder side. For example, if N prediction blocks can be generated, and the value transmitted by signal is N, which is outside the range (0 to N-1) of a valid single prediction block, then multiple hypotheses are enabled, and the average of all N prediction blocks can be used.

[0189] Multiple hypotheses can be generated from N motion / block vectors, where each motion / block vector can generate a specific motion-compensated prediction block, and N is a positive integer. The N motion / block vectors can be obtained from the same candidate list or different candidate lists. In one example, the N motion / block vectors can be obtained from the same IBC merge candidate list or AMVP list, or partially from both the IBC merge candidate list and the IBC AMVP candidate list. In another example, the N motion / block vectors can be obtained entirely or partially based on an intra-template matching method.

[0190] In the case of bidirectional prediction IBC mode (e.g., in the special case of multiple hypotheses where the number of multiple hypotheses is reduced to 2), several sub-modes may exist.

[0191] A sub-pattern can be an AMVP-AMVP pattern. In this sub-pattern, motion from both directions can be obtained on the encoder side and then explicitly signaled to the decoder. For MV predictions, two indices (for both directions) or one index (for one of the directions) can be signaled. In the case of signaling only one index, the other index can be obtained on the decoder side (e.g., bilateral matching or template matching methods (using the signaled index as the matching target) can be used to find the closest candidate by minimizing the prediction difference between the two directions). For MV differences, two MV differences (for both directions) or one MV difference (for one of the directions) can be signaled.

[0192] Another sub-mode can be the merge-merge mode. In this sub-mode, the encoder can select motion from two directions from one or more constructed merge lists, and then transmit the selected index to the decoder as a signal. Because the index is transmitted as a signal instead of the actual motion in this sub-mode, it can be called implicit signal transmission.

[0193] Another sub-mode could be the AMVP-merge mode. In this sub-mode, motion from one direction can be obtained and explicitly transmitted to the decoder as a signal, while motion from the other direction can be implicitly transmitted as a signal and then obtained on the decoder side.

[0194] In the case of bidirectional predictive IBC mode, if more than two sub-modes are supported, the switching between different sub-modes can be signaled to the decoder (e.g., a flag for selecting a specific sub-mode), or determined dynamically by the decoder (e.g., based on sub-mode selection from the top or left neighboring block, or based on the size or shape of the current coding block, or texture analysis of the current coding block, or other mode statistics (such as gradient histograms), etc.), without using signal transmission.

[0195] The application of the bidirectional prediction IBC model can be further combined with a multi-hypothesis model. In this case, the prediction generated from the bidirectional prediction IBC model is used as the base prediction, and then weighted averaged using additional multi-hypothesis predictions (e.g., one or more additional multi-hypothesis predictions). If multiple additional multi-hypothesis predictions are supported, the numbers can be predefined (e.g., fixed at 3) or further transmitted using signals (e.g., flags indicating the numerical values).

[0196] The interpolation process for template matching may require adaptive use of fractional motion / block vectors when applying template-based adaptive reordering (ARMC-TM) to IBC merging and / or AMVP mode, or / and when applying template-based motion refinement to IBC merging and / or AMVP mode.

[0197] For Template-Based Adaptive Reordering (ARMC-TM), it may be necessary to compute a template-based distortion cost for each motion / block vector candidate. Since this template-based distortion cost is only used for candidate reordering and not for the final compensation prediction, the fractional part of each motion / block vector candidate (if a non-zero fractional part exists) may or may not be considered for template-based distortion computation. Specifically, in one or more examples, fractional motion-based interpolation may or may not be performed on each motion / block vector candidate without a non-zero fractional part.

[0198] Similarly, when calculating the template distortion cost for each motion refinement location, it may or may not be necessary to consider the fractional part for each location.

[0199] When motion vectors in intra-frame block copying support multiple levels of precision, permissible signal transmission methods can be defined accordingly.

[0200] In one or more embodiments, only one level of precision with zero motion vector difference is allowed. This precision may be predefined, configurable, or transmitted via signaling. For example, this precision may be predefined as the highest precision supported by the motion vector, such as 1 / 4 pixel or 1 / 8 pixel.

[0201] In one or more embodiments, multiple precisions with zero motion vector difference are allowed. These multiple precisions can be predefined, configurable, or transmitted via signals. For example, such precision can be predefined as the highest or second highest precision supported by the motion vector, such as 1 / 4 pixel and 1 pixel. When multiple precisions with zero motion vector difference are allowed, after the zero motion vector difference indication transmitted via signals (1 flag or 1 binary bit), one or more additional flags are transmitted to indicate which precision is used.

[0202] When multiple precisions are supported, the current precision flag can be signed in different ways. In one example, a flag indicating whether the current precision is greater than 0 is first signaled. If so, another flag indicating whether the current precision is greater than 1 is further signaled. Alternatively, a second flag indicating whether the current precision is greater than 1 can be implicitly obtained at the decoder without explicit signaling. In one example, the value of the motion / block vector difference can be used to achieve this (e.g., even or odd motion / block vector differences can indicate a specific motion precision value). In this document, values ​​of 0, 1, or other values ​​greater than 1 can be predefined or configured to represent different motion vector (or motion vector difference) precisions (e.g., 0 for 1 pixel precision, 1 for 1 / 2 pixel precision, 2 for 1 / 4 pixel precision, and 3 for 1 / 8 pixel precision).

[0203] In one or more embodiments, multiple MV candidates in the IBC merge / AMVP motion candidate list are divided into different groups. In one example, the grouping criterion could be MV precision, where MV candidates in the same group have the same actual MV precision. Actual MV precision is defined as the MV precision after right-shifting all the least significant zeros of MV.

[0204] In one or more embodiments, the IBC merge / AMVP motion candidate list is constructed by grouping multiple MV candidates into different groups. In one example, the grouping criterion may be MV precision, where MV candidates in the same group have the same actual MV precision. Actual MV precision is defined as the MV precision after right-shifting all the least significant zeros of the MV.

[0205] In one or more other embodiments, multiple lists of IBC merge / AMVP motion candidates are created, in addition to the exit list. For each list, only Mv candidates with the same actual Mv precision are added. Similarly, the actual Mv precision is defined as the Mv precision after right-shifting all the least significant zeros of Mv.

[0206] In cases where multiple candidate list groups and / or multiple candidate lists are generated, the group index and / or candidate list index need to be determined before the actual Mv candidate index can be decided. In one or more other examples, the group index and / or candidate list index can be evaluated on the encoder side and then signaled to the decoder. In one or more other still examples, the group index and / or candidate list index can be inherited from a specific neighboring block without explicit signaling.

[0207] When combined with intra-template matching, the predicted blocks generated through intra-block copying can be generated based on the motion vector used for intra-block copying. When combined with intra-template matching, the predicted blocks generated through intra-block copying are further refined. Specifically, for a predefined search range around the predicted block generated through intra-block copying, the encoder searches for the template most similar to the current template in the reconstructed portion of the current frame and uses the corresponding block as the predicted block. In this method, the predicted block generated through intra-block copying is considered the starting block position, which is used to guide the subsequent block search process in the intra-template matching method.

[0208] The combination of intra-block copying and intra-template matching prediction modes can be signaled at the CU level using a dedicated flag. Alternatively, the original intra-block copying flag above the original intra-template matching mode flag can be used to indicate the combination of intra-block copying and intra-template matching prediction modes.

[0209] In one or more other examples, the combination of intra-block copying and intra-template matching prediction can generate improved motion vectors.

[0210] In one example, the Intra-Block Copy (IBC) mode provides an initial motion vector, which can be further refined using an intra-template matching method. In this case, the IBC mode is used as a starting point with a coarse motion vector transmitted via signal transmission, which can then be used to guide subsequent intra-TMP processes.

[0211] In one embodiment, the initial / coarse motion vector can be signaled in IBC AMVP mode, which is achieved by signaling the MV prediction value and MV difference. In another embodiment, the initial / coarse motion vector can be signaled in IBC merging mode, which is achieved by signaling the index in the constructed merge list. Note that in this IBC-guided intra-TMP mode, for MVs signaled in IBC AMVP or merging mode, the corresponding AMVP or merge list can be constructed using the same or different procedures as in the default IBC AMVP or merging mode.

[0212] Once the initial MV is transmitted via signaling, the normal intra-frame TMP process can be performed to further refine the initial MV. In one embodiment, the intra-frame TMP process can be performed similarly to the default intra-frame TMP process. In another embodiment, the intra-frame TMP process can be performed in a modified version. In one example, the search region in the default intra-frame TMP process can be reduced to a smaller region. Additionally, the search granularity in the default intra-frame TMP process can be changed (e.g., the sampling grid is changed from 3 × 3 to 1 × 1).

[0213] In another example, motion / block vectors obtained from the intra-template matching method can be reused to generate an IBC merge candidate list or an IBC AMVP candidate list. In this case, motion / block vectors generated for spatially adjacent or non-adjacent neighboring blocks can be cached or saved. In one example, the motion / block vectors of neighboring blocks encoded in the intra-template matching method can be saved in a history motion vector table. Alternatively or additionally, the motion / block vectors of neighboring blocks encoded in the intra-template matching method can be saved in the encoder's local cache and then reused by the encoder during the motion search process.

[0214] In other examples, combining intra-block duplication and intra-template matching prediction can generate improved prediction blocks. In one example, two prediction blocks can be generated separately using intra-block duplication and intra-template matching prediction methods, and a weighted average of these two prediction blocks can be generated to represent the final prediction block of the current coded block. In another example, multiple prediction blocks (e.g., N>1) can be generated separately, where M out of the N prediction blocks (e.g., M<=N) can be generated by intra-block duplication, and S out of the N prediction blocks (e.g., S<=N) can be generated by intra-template matching prediction. When combining N prediction blocks (e.g., N>1), the weight values ​​can be obtained using matching cost (e.g., an example of matching cost calculation can be based on an L-shaped template, where a higher matching cost indicates a lower weight value, and a lower matching cost indicates a higher weight value) or a least-squares flavor method.

[0215] In another example, more than two prediction blocks can be generated independently using the intra-block copying method and the intra-template matching prediction method. In this case, a prediction mode based on multiple hypotheses can be defined. Note that multiple hypotheses (e.g., multiple prediction blocks) can come from only the IBC mode or only from the intra-TMP mode, or they can come from both the IBC mode and the intra-TMP mode.

[0216] In the multi-hypothesis mode, the IBC encoder can generate multiple prediction blocks based on searching multiple block vectors. For the IBC-AMVP mode, the corresponding multiple block vectors can be transmitted to the decoder as signals using a combination of block vector prediction indexes and block vector differences. For the IBC merging mode, the corresponding multiple block vectors can be transmitted to the decoder as signals using a set of candidate indices from the constructed merging candidate list.

[0217] In another example, the intra-frame TMP mode can be combined with or replaced by the IBC mode.

[0218] In one embodiment, the existing IBC-TM mode can be extended by reusing a similar search pattern and search region in the intra-frame TMP mode (as shown in Figure 16).

[0219] In another embodiment, a zero-block vector having both zero horizontal and zero vertical components can be added to the IBC-AMVP and IBC-Merge lists. In this case, when a zero-block vector is selected from the IBC-AMVP and IBC-Merge lists, it indicates that the same or similar search pattern and search region can be used in the IBC mode utilizing template matching as the search pattern and search region used in the intra-frame TMP mode.

[0220] Improvements to the intra-frame TMP mode: Under the current intra-frame TMP mode (intra-frame template matching prediction mode), sub-pixel accuracy is supported. Several methods are proposed to further improve the intra-frame TMP mode.

[0221] In some examples, a new candidate list can be constructed for intra-frame TMP block vector derivation. The new candidate list may consist only of subpixel block vectors, or it may include both integer block vectors and subpixel block vectors. Alternatively, an existing candidate list of integer pixel block vectors can be updated by adding subpixel block vectors. A template-matching-based reordering process can be applied to either the new candidate list or the updated existing candidate list.

[0222] In one or more examples, one or more block vectors from the candidate list, either integer precision or subpixel precision, or both integer and subpixel precision, can be selected by the encoder and signaled to the decoder side. When signaling selected candidate indices, integer precision and subpixel precision can be signaled jointly or separately. For joint signaling, integer precision and subpixel precision can be included in the same candidate list, which may or may not utilize template-based reordering. For separate signaling, integer precision and subpixel precision can be included in different candidate lists, and the integer precision and subpixel precision signaled can be determined separately on the encoder side.

[0223] In one example, both the encoder and decoder can select a predefined constant index (e.g., index value 0) from the candidate list.

[0224] In some examples, currently supported subpixel precision includes 1 / 2 pixel precision, 1 / 4 pixel precision, and 3 / 4 pixel precision, as shown in Figure 22A. To minimize system complexity and / or overhead, a subset of subpixel precision can be supported. In one embodiment, only 1 / 4 pixel precision may be supported, as shown in Figure 22B. In another embodiment, only 1 / 4 pixel and 1 / 2 pixel precision may be supported.

[0225] In some examples, for each supported subpixel precision, eight possible directions are further supported, as shown in Figure 22A. To minimize system complexity and / or overhead, a subset of directions may be supported. In one embodiment, only the top, top right, and right directions are supported. Figure 22C shows an example of each of the three supported precisions supporting three directions. Figure 22D shows an example of each of the two supported precisions supporting three directions. In alternative examples, only 1 / 2 pixel and 1 / 4 pixel precisions may be supported, and each of these precisions supports eight directions, as shown in Figure 24. Figure 24 shows pixels at supported 1 / 4 pixel positions and pixels at supported 1 / 2 pixel positions in different shapes (i.e., circles and triangles) to distinguish these pixels being at different fractional positions. The supported 1 / 2 pixel positions in Figure 24 include eight 1 / 2 pixel positions in specific directions (i.e., top, top right, right, bottom right, bottom, bottom, bottom left, left, and top left directions, as indicated in Figure 24).

[0226] In some examples, more sub-pixel locations with a certain precision can be supported. As shown in Figure 23, more sub-pixel locations with 1 / 2 pixel precision are supported than in Figure 22A.

[0227] In one or more examples, two distinct candidate lists can be constructed for block vector derivation of the intra-frame TMP. One candidate list can be identical to an existing candidate list that includes candidate block vectors with integer precision. The other candidate list can include sub-pixel precision and orientation around selected block vectors with integer precision, and the included sub-pixel precision and orientation can be defined as in the example shown in Figure 24. A template-matching-based reordering process can be applied to the second list. Different signal transmission methods can be provided as follows.

[0228] In one approach, selected candidate indices from a first candidate list, comprising block vectors with integer precision, can first be signaled. An on / off flag is then signaled to indicate whether subpixel precision / orientation is applied. If the flag is false, subpixel precision / orientation is not supported. If the flag is true, a second candidate list is constructed, comprising subpixel precision / orientation around the selected integer block vector and signaled. Selected candidate indices can then be signaled for the second candidate list. Alternatively, predefined candidate indices, such as index 0, can be selected and signaling is not required.

[0229] If candidate indices are signaled against a second candidate list, then candidate indices to be signaled can be selected from a subset of the second candidate list. For example, only one index value from 0 to N can be signaled, where the value N is less than or equal to the size of the second candidate list, and the value of N can be predefined, configured, or signaled at different granularities (e.g., sequence, image, or stripe level). In one example, the value of N is predefined as 1.

[0230] In another approach, selected candidate indices from a first candidate list including block vectors with integer precision can be signaled first. Candidate indices from a second candidate list may or may not be signaled immediately, and no on / off flags are signaled. In this approach, a specific combination of values ​​for subpixel precision and orientation (e.g., both the subpixel precision value and orientation value are equal to 0) can be used to indicate that the integer block vectors signaled do not support subpixel precision. This specific combination of values ​​can also be included in the second candidate list. Whether or not a template-matching-based reordering process is applied to the second candidate list, candidate indices representing selected combinations of supported subpixel precision and orientation may or may not be further signaled, depending on whether predefined candidate indices are selected on the decoder side.

[0231] If candidate indices are signaled against a second candidate list, then candidate indices to be signaled can be selected from a subset of the second candidate list. For example, only one index value from 0 to N can be signaled, where the value N is less than or equal to the size of the second candidate list, and the value of N can be predefined, configured, or signaled at different granularities (e.g., sequence, image, or stripe level). In one example, the value of N is predefined as 1.

[0232] With or without further signal transmission to select a candidate from the second candidate list, the selected candidate may indicate support for only integer precision, or support for a specific combination of subpixel precision and orientation.

[0233] If the candidate list includes combinations of values ​​representing integer precision (e.g., subpixel precision is not supported), the associated template matching cost can be scaled when a template matching-based reordering process is applied. The scaling factor (e.g., 0.85 or 0.9) can be predefined, configured, or signaled at different granularities (e.g., sequence, image, or strip level).

[0234] In some examples, multi-model template selection for subpixel precision can be supported. In the current intra-frame TMP mode, a candidate list of integer-pixel block vectors can be constructed by summing block vectors from three different templates: top template only, left template only, or L-shaped template (including both left and top templates if both are available). For subpixel precision block vectors, candidate derivation can also be performed by considering multiple templates.

[0235] In one embodiment, multi-template-based selection for sub-pixel precision can be performed separately from selection for integer pixel precision. A similar process can also be applied.

[0236] In another embodiment, multi-template-based selection for integer pixel precision can be inherited or reused for subpixel precision. For example, if candidate derivation for integer pixel precision can be constructed using a template of one type (e.g., top-only template), then candidate derivation for subpixel precision can use the same type of template. If template-based reordering is applied to candidates for subpixel precision, the template cost can be reused / inherited from the template type used for the corresponding integer pixel candidates.

[0237] In another embodiment, the multi-template-based selection for integer block vector derivation can serve as an early termination of sub-pixel block vector derivation. If the integer block vector is derived / selected / signaled using a specific template type (e.g., a top template, a left template, or an L-shaped template including both the top and left directions), this indicates that the integer block vector does not support sub-pixel precision, and no further signaling is applied for selecting sub-pixel precision / direction. In one example, if the integer block vector is derived / selected / signaled using only the top or left template, this indicates that sub-pixel precision is not supported, and no further template-matching-based reordering process or / and signaling is applied, even if required in other cases.

[0238] Note that the reason why integer block vectors are derived only from a specific template type (e.g., only top template or left template) is that other templates are not available (e.g., the current block is located on the picture boundary or CTU boundary) or a specific template type is intentionally used (even if the L-shaped template is available).

[0239] For subpixel-precision block vectors, an interpolation process is applied to generate prediction blocks. The applied interpolation filter can be predefined or dynamically switched. In one embodiment, a fixed 8-tap or 12-tap interpolation filter can be applied to the prediction block generation and / or template-based reordering process. In another embodiment, the interpolation filter can be dynamically switched. In one example, the interpolation filter can be determined based on subpixel precision; for example, a 4-tap interpolation filter is applied for 1 / 2 pixel precision, while an 8-tap interpolation filter is applied for 1 / 4 pixel precision or 3 / 4 pixel precision. In another example, the interpolation filter can be determined based on the size of the current block. For small blocks, such as blocks with fewer than 8 × 8 pixels, a shorter tap interpolation filter (e.g., a 4-tap filter) is used, while for other large blocks, a longer tap interpolation filter (e.g., a 12-tap filter) is used. In another example, if a template-based reordering process is applied to a candidate list that includes subpixel precision and orientation, the interpolation filter can be applied differently to the prediction block generation and template generation processes. For example, an 8-tap or 12-tap interpolation filter can be applied to generate prediction blocks, while shorter-tap interpolation filters, such as 2-tap, 4-tap, or 6-tap filters, can be applied to generate template samples for the template-based reordering process. In another example, if the intra-frame TMP mode is also applied to chroma block prediction, the interpolation filter can be applied differently to generate both the luma and chroma prediction blocks.

[0240] Intra-frame TMP can support different template sizes. In the current intra-frame TMP mode, a fixed template size is used (e.g., 4 rows or 4 columns of template pixels for the top and left templates). For small blocks, smaller template sizes can be supported in intra-frame TMP. For example, for blocks with fewer than 8 × 8 pixels, a fixed template size of 2 × width or 2 × height can be used. This different template size can be applied to sub-pixel precision reordering processes and / or integer pixel block vector candidate derivation.

[0241] Figure 25 illustrates a computing environment 2510 coupled to a user interface 2550. The computing environment 2510 may be part of a data processing server. The computing environment 2510 includes a processor 2520, a memory 2530, and an input / output (I / O) interface 2540.

[0242] Processor 2520 typically controls the overall operation of computing environment 2510, such as operations associated with display, data acquisition, data communication, and image processing. Processor 2520 may include one or more processors for executing instructions to perform all or some of the steps in the methods described above. Furthermore, processor 2520 may include one or more modules that facilitate interaction between processor 2520 and other components. The processor may be a central processing unit (CPU), microprocessor, microcontroller, graphics processing unit (GPU), etc.

[0243] Memory 2530 is configured to store various types of data to support the operation of computing environment 2510. Memory 2530 may include predefined software 2532. Examples of such data include instructions for any application or method operating on computing environment 2510, video datasets, image data, etc. Memory 2530 can be implemented using any type of volatile or non-volatile memory device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.

[0244] I / O interface 2540 provides an interface between processor 2520 and peripheral interface modules (such as keyboard, click wheel, buttons, etc.). Buttons may include, but are not limited to, a home button, a start scan button, and a stop scan button. I / O interface 2540 can be coupled to encoders and decoders.

[0245] Figure 26 is a flowchart illustrating a method for video decoding according to an example of this disclosure.

[0246] In step 2601, the processor 2520 may construct a block vector (BV) candidate list for intra template matching prediction (intra-TMP) mode on the decoder side, wherein the BV candidate list may include at least one sub-pixel BV. In some examples, the sub-pixel BV may be a block vector derived with sub-pixel precision. Sub-pixel precision can represent precision at the sub-pixel (fractional pixel) level.

[0247] In some examples, a BV candidate list can be constructed by adding at least one sub-pixel BV to a new candidate list different from the existing candidate list used for intra-frame TMP mode, where the existing candidate list may include one or more integer pixel BVs. In one or more examples, in addition to at least one sub-pixel BV, the BV candidate list may further include at least one integer pixel BV. The existing candidate list may be a candidate list that includes block vector candidates derived from intra-frame TMP for IBC. Integer pixel BVs may be block vectors derived with integer pixel precision. Integer pixel precision can represent precision at the integer pixel level.

[0248] In some examples, an existing candidate list for intra-frame TMP mode can be updated to construct a BV candidate list by adding at least one sub-pixel BV to the existing candidate list, wherein the existing candidate list may include one or more integer pixel BVs.

[0249] In step 2602, the processor 2520 can obtain the BV from the BV candidate list on the decoder side. In some examples, the BV can be obtained from the BV candidate list by receiving a candidate index indicating the BV in the BV candidate list and obtaining the BV based on the candidate index.

[0250] In some examples, processor 2520 can further obtain a reordered BV candidate list by reordering all BVs in the BV candidate list based on template matching. Additionally, BVs can be obtained from the BV candidate list by obtaining candidate indices indicating the BVs in the reordered BV candidate list and obtaining the BVs from the reordered BV candidate list based on these candidate indices. In one or more examples, the candidate indices are predefined constant indices. For example, the index value can be predefined as 0 in the candidate list and can be selected by both the encoder and decoder.

[0251] In some examples, at least one subpixel BV may include at least one of the following: a subset of subpixel precision or a subset of orientation. Figures 22A to 22D illustrate examples of different subsets of subpixel precision or different subsets of orientation, respectively. In one or more examples, the subset of subpixel precision may include 1 / 4 pixel precision and 1 / 2 pixel precision, and the subset of orientation may include top, top right, right, bottom right, bottom, bottom left, left, and top left, as shown in Figure 24.

[0252] In step 2603, the processor 2520 can obtain the predicted block of the current block based on the BV on the decoder side. In some examples, two different candidate lists can be constructed for block vector derivation of the intra-frame TMP. In one or more examples, obtaining the BV from the BV candidate list can include obtaining a first BV from an existing candidate list and obtaining a second BV from the BV candidate list, wherein the existing candidate list includes one or more integer pixel BVs, and the first BV is at integer precision. Furthermore, the predicted block of the current block can be obtained based on at least one of the first BV or the second BV.

[0253] In some examples, processor 2520 may further receive a first candidate index indicating a first BV in an existing candidate list, receive an on / off flag indicating whether subpixel BVs are supported; in response to determining that the on / off flag indicates that subpixel BVs are not supported, obtain a predicted block for the current block based on the first BV; and in response to determining that the on / off flag indicates that subpixel BVs are supported, obtain a second candidate index indicating a second BV, and obtain a predicted block for the current block based on the first and second BVs. This method can be applied, but is not limited to, cases where the BV candidate list does not include integer pixel BVs.

[0254] In some examples, the step of obtaining a second candidate index indicating a second BV includes one of the following steps: receiving the second candidate index indicating a second BV, wherein the second candidate index is selected from a subset of the BV candidate list; or obtaining a predefined candidate index indicating a second BV.

[0255] In some examples, the BV candidate list is reordered based on template matching, and a subset of the BV candidate list includes the top N BV candidates from the reordered BV candidate list, where N is greater than 1 and not greater than the size of the BV candidate list, and N is predefined, configured, or received at different granularities.

[0256] In some examples, processor 2520 may further receive a first candidate index indicating a first BV in an existing candidate list, obtain a value combination indicating whether a subpixel BV is supported, wherein the value combination includes a subpixel precision value and an orientation value; in response to determining that the value combination indicates that a subpixel BV is not supported, obtain a predicted block for the current block based on the first BV; and in response to determining that the value combination indicates that a subpixel BV is supported, obtain a second BV based on the value combination, and obtain a predicted block for the current block based on the first BV and the second BV. This method can be applied, but is not limited to, cases where the BV candidate list includes integer pixel BVs. In these examples, a specific value combination for subpixel precision and orientation (e.g., both the subpixel precision value and the orientation value are equal to 0) can be used to indicate that an integer BV transmitted by signaling does not support subpixel precision.

[0257] In some examples, the step of obtaining a second BV based on a combination of values ​​may include receiving a second candidate index representing the combination of values ​​and obtaining the second BV based on the second candidate index. In some examples, the second candidate index is selected from a subset of a second BV candidate list, which is reordered based on template matching, and the subset of the second BV candidate list includes the top N BV candidates from the reordered second BV candidate list, where N is not greater than the size of the second BV candidate list, and where N is predefined, configured, or received at different granularities.

[0258] In some examples, in response to a combination of determined values ​​indicating integer precision in the BV candidate list, the processor 2520 can reorder the BV candidate list based on scaling template matching using predefined, configured, or scaling factors received at different granularities.

[0259] In some examples, at least one sub-pixel BV is obtained based on a multi-template selection, and the multi-template selection of the at least one sub-pixel BV is performed in one of the following ways: the multi-template selection of the at least one sub-pixel BV is performed separately from the integer pixel BV; the multi-template selection of the at least one sub-pixel BV inherits from or reuses the template type used to derive the integer pixel BV; or the multi-template selection of the at least one sub-pixel BV terminates at a predefined template type used when deriving the integer pixel BV.

[0260] In some examples, the template cost used in template matching reuses or inherits the template type used for integer pixel candidates. For instance, if candidate derivation for integer pixel precision is constructed using a template of one type (e.g., top-only template), candidate derivation for subpixel precision can use the same type of template. If template-based reordering is applied to candidates for subpixel precision, the template cost can reuse / inherit the template type used for the corresponding integer pixel candidates.

[0261] In some examples, the predicted block of the current block can be obtained based on the BV by applying a predefined interpolation filter or dynamically switching an interpolation filter. In some examples, the step of obtaining the predicted block of the current block based on the BV further includes: determining a dynamically switching interpolation filter based on the sub-pixel accuracy of the BV or the size of the current block; and obtaining the predicted block of the current block based on the BV by applying the dynamically switching interpolation filter.

[0262] In some examples, reordering all BVs in the BV candidate list based on template matching includes: reordering all BVs in the BV candidate list based on template matching using a template interpolation filter; the step of obtaining the prediction block of the current block based on BV includes: obtaining the prediction block of the current block based on BV by applying a predefined interpolation filter or dynamically switching interpolation filters. The template interpolation filter may have shorter taps than the predefined interpolation filter or the dynamically switched interpolation filter.

[0263] In some examples, the prediction block of the current block can be obtained based on BV by applying different interpolation filters to the chroma prediction block and the luminance prediction block of the current block.

[0264] In some examples, intra-frame TMP mode applies different template sizes to blocks with different sizes. In some examples, template matching during reordering applies different template sizes to blocks with different sizes. For example, intra-frame TMP can support different template sizes. For small blocks, smaller template sizes can be supported in intra-frame TMP. For example, for blocks with fewer than 8 × 8 pixels, a fixed template size of 2 × width or 2 × height can be used. This different template size can be applied to sub-pixel precision reordering processes and / or integer pixel block vector candidate derivation.

[0265] Figure 27 is a flowchart illustrating a method for video encoding corresponding to the method for video decoding shown in Figure 26, according to some examples of the present disclosure.

[0266] In step 2701, the processor 2520 may construct a block vector (BV) candidate list for intra template matching prediction (intra-TMP) mode on the encoder side, wherein the BV candidate list may include at least one sub-pixel BV. In some examples, the sub-pixel BV may be a block vector derived with sub-pixel precision. Sub-pixel precision can represent precision at the sub-pixel (fractional pixel) level.

[0267] In some examples, a BV candidate list can be constructed by adding at least one sub-pixel BV to a new candidate list different from the existing candidate list used for intra-frame TMP mode, where the existing candidate list may include one or more integer pixel BVs. In one or more examples, in addition to at least one sub-pixel BV, the BV candidate list may further include at least one integer pixel BV. The existing candidate list may be a candidate list that includes block vector candidates derived from intra-frame TMP for IBC. Integer pixel BVs may be block vectors derived with integer pixel precision. Integer pixel precision can represent precision at the integer pixel level.

[0268] In some examples, an existing candidate list for intra-frame TMP mode can be updated to construct a BV candidate list by adding at least one sub-pixel BV to the existing candidate list, wherein the existing candidate list may include one or more integer pixel BVs.

[0269] In step 2702, the processor 2520 can obtain a BV from the BV candidate list on the encoder side. In some examples, a BV can be obtained from the BV candidate list by signaling the candidate index of a BV in the BV candidate list and obtaining the BV based on the candidate index.

[0270] In some examples, processor 2520 can further obtain a reordered BV candidate list by reordering all BVs in the BV candidate list based on template matching. Additionally, BVs can be obtained from the BV candidate list by obtaining candidate indices indicating the BVs in the reordered BV candidate list and obtaining the BVs from the reordered BV candidate list based on these candidate indices. In one or more examples, the candidate indices are predefined constant indices. For example, the index value can be predefined as 0 in the candidate list and can be selected by both the encoder and decoder.

[0271] In some examples, at least one subpixel BV may include at least one of the following: a subset of subpixel precision or a subset of orientation. Figures 22A to 22D illustrate examples of different subsets of subpixel precision or different subsets of orientation, respectively. In one or more examples, the subset of subpixel precision may include 1 / 4 pixel precision and 1 / 2 pixel precision, and the subset of orientation may include top, top right, right, bottom right, bottom, bottom left, left, and top left, as shown in Figure 24.

[0272] In step 2703, the processor 2520 can obtain the predicted block of the current block based on the BV on the encoder side. In some examples, two different candidate lists can be constructed for block vector derivation of the intra-frame TMP. In one or more examples, obtaining the BV from the BV candidate list can include obtaining a first BV from an existing candidate list and obtaining a second BV from the BV candidate list, wherein the existing candidate list includes one or more integer pixel BVs, and the first BV is at integer precision. Furthermore, the predicted block of the current block can be obtained based on at least one of the first BV or the second BV.

[0273] In some examples, processor 2520 may further transmit a first candidate index indicating a first BV in an existing candidate list, and a signal indicating an on / off flag indicating whether subpixel BVs are supported; in response to determining that the on / off flag indicates that subpixel BVs are not supported, a predicted block for the current block is obtained based on the first BV; and in response to determining that the on / off flag indicates that subpixel BVs are supported, a second candidate index indicating a second BV is obtained, and a predicted block for the current block is obtained based on the first and second BVs. This method can be applied, but is not limited to, cases where the BV candidate list does not include integer pixel BVs.

[0274] In some examples, the step of obtaining a second candidate index indicating a second BV includes one of the following steps: signaling the second candidate index indicating the second BV, wherein the second candidate index is selected from a subset of the BV candidate list; or obtaining a predefined candidate index indicating the second BV.

[0275] In some examples, the BV candidate list is reordered based on template matching, and a subset of the BV candidate list includes the top N BV candidates from the reordered BV candidate list, where N is greater than 1 and not greater than the size of the BV candidate list, and N is predefined, configured, or signaled at different granularities.

[0276] In some examples, processor 2520 may further signal a first candidate index of a first BV in an existing candidate list to obtain a combination of values ​​indicating whether a subpixel BV is supported, wherein the combination of values ​​includes a subpixel precision value and an orientation value; in response to determining that the combination of values ​​indicates that a subpixel BV is not supported, a predicted block for the current block is obtained based on the first BV; and in response to determining that the combination of values ​​indicates that a subpixel BV is supported, a second BV is obtained based on the combination of values, and a predicted block for the current block is obtained based on the first BV and the second BV. This method can be applied, but is not limited to, cases where the BV candidate list includes integer pixel BVs. In these examples, a specific combination of values ​​for subpixel precision and orientation (e.g., both the subpixel precision value and the orientation value are equal to 0) can be used to indicate that the integer BV signaled does not support subpixel precision.

[0277] In some examples, the step of obtaining a second BV based on a combination of values ​​may include signaling a second candidate index representing the combination of values ​​and obtaining the second BV based on the second candidate index. In some examples, the second candidate index is selected from a subset of a second BV candidate list, which is reordered based on template matching, and the subset of the second BV candidate list includes the top N BV candidates from the reordered second BV candidate list, where N is not greater than the size of the second BV candidate list, and where N is predefined, configured, or signaled at different granularities.

[0278] In some examples, in response to a combination of determined values ​​indicating integer precision in the BV candidate list, the processor 2520 can reorder the BV candidate list based on scaling template matching using predefined, configured, or signaled scaling factors at different granularities.

[0279] In some examples, at least one sub-pixel BV is obtained based on a multi-template selection, and the multi-template selection of the at least one sub-pixel BV is performed in one of the following ways: the multi-template selection of the at least one sub-pixel BV is performed separately from the integer pixel BV; the multi-template selection of the at least one sub-pixel BV inherits from or reuses the template type used to derive the integer pixel BV; or the multi-template selection of the at least one sub-pixel BV terminates at a predefined template type used when deriving the integer pixel BV.

[0280] In some examples, the template cost used in template matching reuses or inherits the template type used for integer pixel candidates. For instance, if candidate derivation for integer pixel precision is constructed using a template of one type (e.g., top-only template), candidate derivation for subpixel precision can use the same type of template. If template-based reordering is applied to candidates for subpixel precision, the template cost can reuse / inherit the template type used for the corresponding integer pixel candidates.

[0281] In some examples, the predicted block of the current block can be obtained based on the BV by applying a predefined interpolation filter or dynamically switching an interpolation filter. In some examples, the step of obtaining the predicted block of the current block based on the BV further includes: determining a dynamically switching interpolation filter based on the sub-pixel accuracy of the BV or the size of the current block; and obtaining the predicted block of the current block based on the BV by applying the dynamically switching interpolation filter.

[0282] In some examples, reordering all BVs in the BV candidate list based on template matching includes: reordering all BVs in the BV candidate list based on template matching using a template interpolation filter; the step of obtaining the prediction block of the current block based on BV includes: obtaining the prediction block of the current block based on BV by applying a predefined interpolation filter or dynamically switching interpolation filters. The template interpolation filter may have shorter taps than the predefined interpolation filter or the dynamically switched interpolation filter.

[0283] In some examples, the prediction block of the current block can be obtained based on BV by applying different interpolation filters to the chroma prediction block and the luminance prediction block of the current block.

[0284] In some examples, intra-frame TMP mode applies different template sizes to blocks with different sizes. In some examples, template matching during reordering applies different template sizes to blocks with different sizes. For example, intra-frame TMP can support different template sizes. For small blocks, smaller template sizes can be supported in intra-frame TMP. For example, for blocks with fewer than 8 × 8 pixels, a fixed template size of 2 × width or 2 × height can be used. This different template size can be applied to sub-pixel precision reordering processes and / or integer pixel block vector candidate derivation.

[0285] In one embodiment, a method for storing a bitstream is also provided, comprising: storing the bitstream on a digital storage medium, wherein the bitstream includes encoded video information generated by the above-described encoding method or encoded video information to be decoded by the above-described decoding method.

[0286] In one embodiment, a method for transmitting a bitstream generated by the encoder described above is also provided. In another embodiment, a method for receiving a bitstream to be decoded by the decoder described above is also provided.

[0287] In an embodiment, a non-transitory computer-readable storage medium is also provided, including, for example, a plurality of programs in memory 2530 and / or a bitstream generated by the above-described encoding method or a bitstream to be decoded by the above-described decoding method. The plurality of programs can be executed by processor 2520 in computing environment 2510 to perform the above-described methods. In one example, the plurality of programs can be executed by processor 2520 in computing environment 2510 to receive (e.g., from video encoder 20 in FIG. 2) a bitstream or data stream including encoded video information (e.g., video blocks representing encoded video frames, and / or one or more associated syntax elements, etc.), and can also be executed by processor 2520 in computing environment 2510 to perform the above-described decoding method based on the received bitstream or data stream. In another example, the plurality of programs can be executed by processor 2520 in computing environment 2510 to perform the above-described encoding method to encode video information (e.g., video blocks representing video frames, and / or one or more associated syntax elements, etc.) into a bitstream or data stream, and can also be executed by processor 2520 in computing environment 2510 to send the bitstream or data stream (e.g., to video decoder 30 in FIG. 3). Alternatively, a non-transitory computer-readable storage medium may store a bitstream or data stream comprising encoded video information (e.g., video blocks representing encoded video frames, and / or one or more associated syntax elements, etc.) generated by an encoder (e.g., video encoder 20 in FIG. 2) using, for example, the above-described encoding method, for use by a decoder (e.g., video decoder 30 in FIG. 3) when decoding video data. The non-transitory computer-readable storage medium may be, for example, ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, etc.

[0288] In one embodiment, a bitstream generated by the above-described encoding method or a bitstream to be decoded by the above-described decoding method is provided. In another embodiment, a bitstream comprising encoded video information generated by the above-described encoding method or encoded video information to be decoded by the above-described decoding method is provided.

[0289] In one embodiment, a computing device is also provided, comprising: one or more processors (e.g., processor 2520); and a non-transitory computer-readable storage medium or memory 2530 therein storing a plurality of programs executable by the one or more processors, wherein the one or more processors are configured to perform the methods described above when executing the plurality of programs.

[0290] In one embodiment, a computer program product having instructions for storing or transmitting a bitstream is also provided, the bitstream including encoded video information generated by the encoding method described above or encoded video information to be decoded by the decoding method described above. In another embodiment, a computer program product including, for example, a plurality of programs in a memory 2530, the plurality of programs being executable by a processor 2520 in a computing environment 2510 to perform the methods described above. For example, the computer program product may include a non-transitory computer-readable storage medium.

[0291] In an embodiment, the computing environment 2510 may be implemented by one or more ASICs, DSPs, digital signal processing devices (DSPDs), programmable logic devices (PLDs), FPGAs, GPUs, controllers, microcontrollers, microprocessors, or other electronic components for performing the methods described above.

[0292] The description in this disclosure has been presented for illustrative purposes and is not intended to be exhaustive or limited to this disclosure. Many modifications, variations, and alternative embodiments will be apparent to those skilled in the art from the teachings presented in the foregoing description and the associated drawings.

[0293] Unless otherwise specifically stated, the order of steps in the method according to this disclosure is intended to be illustrative only, and the steps of the method according to this disclosure are not limited to the specific order described above, but may be changed according to actual circumstances. Furthermore, at least one step in the method according to this disclosure may be adjusted, combined, or omitted as needed.

[0294] The examples chosen and described are intended to explain the principles of this disclosure and to enable others skilled in the art to understand the various embodiments of this disclosure, and preferably to utilize the basic principles and various embodiments with various modifications suitable for the intended particular purpose. Therefore, it will be understood that the scope of this disclosure is not limited to the specific examples of the disclosed embodiments, and that modifications and other embodiments are intended to be included within the scope of this disclosure.

Claims

1. A method for video decoding, the method comprising: A block vector (BV) candidate list is constructed by the decoder for intra template matching prediction (intra-TMP) mode, wherein the BV candidate list includes at least one sub-pixel BV; the BV is obtained by the decoder from the BV candidate list; and the predicted block of the current block is obtained by the decoder based on the BV.

2. The method as described in claim 1, wherein, Constructing a BV candidate list for intra-frame TMP mode includes one of the following operations: obtaining the BV candidate list by adding the at least one sub-pixel BV to a new candidate list different from an existing candidate list for the intra-frame TMP mode, wherein the existing candidate list includes one or more integer pixel BVs; or updating the existing candidate list for the intra-frame TMP mode by adding the at least one sub-pixel BV to the existing candidate list, wherein the at least one sub-pixel BV includes at least one of the following: a subset of sub-pixel precision or a subset of orientation.

3. The method of claim 1, further comprising: The decoder obtains a reordered BV candidate list by reordering all BVs in the BV candidate list based on template matching, wherein the template cost used in the template matching reuses or inherits the template type used for integer pixel candidates, wherein obtaining the BV from the BV candidate list includes: obtaining a candidate index indicating the BV in the reordered BV candidate list; and obtaining the BV from the reordered BV candidate list based on the candidate index.

4. The method of claim 2, wherein, The subset of subpixel precision includes 1 / 4 pixel precision and 1 / 2 pixel precision, and the subset of directions includes top, top right, right, bottom right, bottom, bottom left, left, and top left.

5. The method of claim 4, wherein, Obtaining the BV from the BV candidate list includes: obtaining a first BV from an existing candidate list, wherein the existing candidate list includes one or more integer pixel BVs, and wherein the first BV is of integer precision; and obtaining a second BV from the BV candidate list, wherein obtaining a predicted block of the current block based on the BV includes: obtaining a predicted block of the current block based on at least one of the first BV or the second BV.

6. The method of claim 5, further comprising: The decoder receives a first candidate index indicating the first BV in the existing candidate list; The decoder receives an on / off flag indicating whether subpixel BV is supported; in response to determining that the on / off flag indicates that subpixel BV is not supported, a prediction block for the current block is obtained based on the first BV; In response to determining that the on / off flag indicates support for a subpixel BV, the decoder obtains a second candidate index indicating the second BV, and the decoder obtains a predicted block for the current block based on the first BV and the second BV.

7. The method of claim 6, wherein, Obtaining the second candidate index indicating the second BV includes one of the following steps: receiving the second candidate index indicating the second BV, wherein the second candidate index is selected from a subset of the BV candidate list; or obtaining a predefined candidate index indicating the second BV, wherein the BV candidate list is reordered based on template matching, and the subset of the BV candidate list includes the first N BV candidates in the reordered BV candidate list, wherein N is greater than 1 and not greater than the size of the BV candidate list, and wherein N is predefined, configured, or received at different granularities.

8. The method of claim 5, further comprising: The decoder receives a first candidate index indicating the first BV in the existing candidate list; The decoder obtains a combination of values ​​indicating whether subpixel block values ​​(BVs) are supported, wherein the combination of values ​​includes a subpixel precision value and a direction value; in response to determining that the combination of values ​​indicates that subpixel BVs are not supported, a prediction block for the current block is obtained based on the first BV; in response to determining that the combination of values ​​indicates that subpixel BVs are supported, the decoder obtains a second BV based on the combination of values, and the decoder obtains a prediction block for the current block based on the first BV and the second BV; In response to determining that the combination of values ​​indicates integer precision in the BV candidate list, the decoder reorders the BV candidate list based on scaling template matching using predefined, configured, or received scaling factors at different granularities.

9. The method of claim 8, wherein, Obtaining the second BV based on the value combination includes: receiving a second candidate index representing the value combination; and obtaining the second BV based on the second candidate index, wherein the second candidate index is selected from a subset of a second BV candidate list, the second BV candidate list being reordered based on template matching, and the subset of the second BV candidate list includes the first N BV candidates from the reordered second BV candidate list, wherein N is not greater than the size of the second BV candidate list, and wherein N is predefined, configured, or received at different granularities.

10. The method of claim 1, wherein, The at least one sub-pixel BV is obtained based on a multi-template selection, wherein the multi-template selection of the at least one sub-pixel BV is performed in one of the following ways: the multi-template selection of the at least one sub-pixel BV is performed separately from the integer pixel BV; the multi-template selection of the at least one sub-pixel BV inherits or reuses the template type used to derive the integer pixel BV; or the multi-template selection of the at least one sub-pixel BV terminates at a predefined template type used when deriving the integer pixel BV.

11. The method of claim 1, wherein, Obtaining a prediction block for the current block based on the BV includes: obtaining a prediction block for the current block based on the BV by applying a predefined interpolation filter or a dynamically switched interpolation filter, wherein obtaining a prediction block for the current block based on the BV by applying the dynamically switched interpolation filter includes: determining the dynamically switched interpolation filter based on the sub-pixel accuracy of the BV or the size of the current block; and obtaining a prediction block for the current block based on the BV by applying the dynamically switched interpolation filter.

12. The method of claim 3, wherein, Reordering all BVs in the BV candidate list based on the template matching includes: reordering all BVs in the BV candidate list using a template interpolation filter based on the template matching, wherein obtaining a prediction block for the current block based on the BV includes at least one of the following operations: obtaining a prediction block for the current block based on the BV by applying a predefined interpolation filter or a dynamically switched interpolation filter, wherein the template interpolation filter has a shorter tap than the predefined interpolation filter or the dynamically switched interpolation filter; or obtaining a prediction block for the current block based on the BV by applying different interpolation filters to the chroma prediction block and the luma prediction block of the current block based on the BV, wherein the intra-frame TMP mode applies different template sizes to blocks of different sizes, and wherein the template matching in the reordering applies different template sizes to blocks of different sizes.

13. A method for video encoding, the method comprising: The encoder constructs a block vector (BV) candidate list for intra template matching prediction (intra-TMP) mode, wherein the BV candidate list includes at least one sub-pixel BV; the encoder obtains a BV from the BV candidate list; and the encoder obtains a predicted block for the current block based on the BV.

14. The method of claim 13, wherein, Constructing a BV candidate list for intra-frame TMP mode includes one of the following operations: obtaining the BV candidate list by adding the at least one sub-pixel BV to a new candidate list different from an existing candidate list for the intra-frame TMP mode, wherein the existing candidate list includes one or more integer pixel BVs; or updating the existing candidate list for the intra-frame TMP mode by adding the at least one sub-pixel BV to the existing candidate list, wherein the at least one sub-pixel BV includes at least one of the following: a subset of sub-pixel precision or a subset of orientation.

15. The method of claim 13, further comprising: The encoder obtains a reordered BV candidate list by reordering all BVs in the BV candidate list based on template matching, wherein the template cost used in the template matching reuses or inherits the template type used for integer pixel candidates, wherein obtaining the BV from the BV candidate list includes: obtaining a candidate index indicating the BV in the reordered BV candidate list; and obtaining the BV from the reordered BV candidate list based on the candidate index.

16. The method of claim 14, wherein, The subset of subpixel precision includes 1 / 4 pixel precision and 1 / 2 pixel precision, and the subset of directions includes top, top right, right, bottom right, bottom, bottom left, left, and top left.

17. The method of claim 16, wherein, Obtaining the BV from the BV candidate list includes: obtaining a first BV from an existing candidate list, wherein the existing candidate list includes one or more integer pixel BVs, and wherein the first BV is of integer precision; and obtaining a second BV from the BV candidate list, wherein obtaining a predicted block of the current block based on the BV includes: obtaining a predicted block of the current block based on at least one of the first BV or the second BV.

18. The method of claim 17, further comprising: The encoder transmits a signal indicating a first candidate index of the first BV in the existing candidate list; the encoder transmits a signal indicating whether subpixel BV is supported; in response to determining that the on / off flag indicates that subpixel BV is not supported, a prediction block of the current block is obtained based on the first BV; In response to determining that the on / off flag indicates support for a subpixel BV, the encoder transmits a second candidate index indicating the second BV, and the encoder obtains a predicted block for the current block based on the first BV and the second BV.

19. The method of claim 18, wherein, Indicating the second candidate index of the second BV by signal transmission includes one of the following steps: indicating the second candidate index of the second BV by signal transmission, wherein the second candidate index is selected from a subset of the BV candidate list; or indicating a predefined candidate index of the second BV by signal transmission, wherein the BV candidate list is reordered based on template matching, and the subset of the BV candidate list includes the first N BV candidates in the reordered BV candidate list, wherein N is greater than 1 and not greater than the size of the BV candidate list, and wherein N is predefined, configured, or received at different granularities.

20. The method of claim 17, further comprising: The encoder transmits a signal indicating the first candidate index of the first BV in the existing candidate list; The encoder obtains a combination of values ​​indicating whether subpixel block value (BV) is supported, wherein the combination of values ​​includes a subpixel precision value and an orientation value; in response to determining that the combination of values ​​indicates that subpixel BV is not supported, a prediction block of the current block is obtained based on the first BV; in response to determining that the combination of values ​​indicates that subpixel BV is supported, the encoder obtains a second BV based on the combination of values, and the encoder obtains a prediction block of the current block based on the first BV and the second BV; In response to determining that the combination of values ​​indicates integer precision in the BV candidate list, the encoder reorders the BV candidate list based on scaling template matching using a predefined, configured, or signaled scaling factor at different granularities.

21. The method of claim 20, wherein, Obtaining the second BV based on the value combination includes: signaling a second candidate index representing the value combination; and obtaining the second BV based on the second candidate index, wherein the second candidate index is selected from a subset of the second BV candidate list, the second BV candidate list is reordered based on template matching, and the subset of the second BV candidate list includes the first N BV candidates in the reordered second BV candidate list, wherein N is not greater than the size of the second BV candidate list, and wherein N is predefined, configured, or signaled at different granularities.

22. The method of claim 13, wherein, The at least one sub-pixel BV is obtained based on a multi-template selection, wherein the multi-template selection of the at least one sub-pixel BV is performed in one of the following ways: the multi-template selection of the at least one sub-pixel BV is performed separately from the integer pixel BV; the multi-template selection of the at least one sub-pixel BV inherits or reuses the template type used to derive the integer pixel BV; or the multi-template selection of the at least one sub-pixel BV terminates at a predefined template type used when deriving the integer pixel BV.

23. The method of claim 13, wherein, Obtaining a prediction block for the current block based on the BV includes: obtaining a prediction block for the current block based on the BV by applying a predefined interpolation filter or a dynamically switched interpolation filter, wherein obtaining a prediction block for the current block based on the BV by applying the dynamically switched interpolation filter includes: determining the dynamically switched interpolation filter based on the sub-pixel accuracy of the BV or the size of the current block, and obtaining a prediction block for the current block based on the BV by applying the dynamically switched interpolation filter.

24. The method of claim 15, wherein, Reordering all BVs in the BV candidate list based on the template matching includes: reordering all BVs in the BV candidate list using a template interpolation filter based on the template matching, wherein obtaining a prediction block for the current block based on the BV includes at least one of the following operations: obtaining a prediction block for the current block based on the BV by applying a predefined interpolation filter or a dynamically switched interpolation filter, wherein the template interpolation filter has a shorter tap than the predefined interpolation filter or the dynamically switched interpolation filter; or obtaining a prediction block for the current block based on the BV by applying different interpolation filters to the chroma prediction block and the luma prediction block of the current block based on the BV, wherein the intra-frame TMP mode applies different template sizes to blocks of different sizes, and wherein the template matching in the reordering applies different template sizes to blocks of different sizes.

25. An apparatus for video encoding and decoding, the apparatus comprising: One or more processors; as well as A memory coupled to the one or more processors and configured to store instructions executable by the one or more processors, wherein the one or more processors are configured to perform the method as described in any one of claims 1 to 24 when executing the instructions.

26. A non-transitory computer-readable storage medium for storing computer-executable instructions, which, when executed by one or more computer processors, cause the one or more computer processors to perform the method as described in any one of claims 1 to 24.

27. A non-transitory computer-readable storage medium for storing a bit stream to be decoded by the method of any one of claims 1 to 12.

28. A non-transitory computer-readable storage medium for storing a bit stream generated by the method of any one of claims 13 to 24.

29. A method for receiving a bit stream, wherein, The bitstream includes encoded video information to be decoded by the method described in any one of claims 1 to 12.

30. A method for transmitting a bit stream, wherein, The bitstream includes encoded video information generated by any one of claims 13 to 24.