Video decoding and encoding methods

By constructing and adjusting candidate lists using machine learning and template regions, the method addresses inefficiencies in traditional video encoding, improving decoding efficiency and adaptability, and optimizing bit consumption.

WO2026026361A1PCT designated stage Publication Date: 2026-02-05ZHEJIANG DAHUA TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2025/104304
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-11-15
Filing Date
2025-06-27
Publication Date
2026-02-05

AI Technical Summary

Technical Problem

Traditional video encoding methods face limitations in efficiency due to the inefficiencies in constructing and utilizing candidate lists for block vector prediction, leading to increased bit consumption and reduced adaptability to different image contents.

Method used

A method involving constructing and adjusting candidate lists using machine learning models and template regions to enhance the accuracy and efficiency of video encoding and decoding processes, particularly through the use of block vector predictors and affine motion information candidates.

Benefits of technology

Improves decoding efficiency, enhances video quality, and increases adaptability by reducing bit consumption and optimizing the use of candidate lists, thereby enhancing compression efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025104304_05022026_PF_FP_ABST
    Figure CN2025104304_05022026_PF_FP_ABST
Patent Text Reader

Abstract

Disclosed herein are a video decoding method and a video encoding method. The decoding method may include: constructing a candidate list of a current block; adjusting the candidate list to obtain an adjusted candidate list; decoding the current block based on the adjusted candidate list. The encoding method may include: constructing the candidate list of the current block; adjusting the candidate list to obtain the adjusted candidate list; and encoding the current block based on the adjusted candidate list.
Need to check novelty before this filing date? Find Prior Art

Description

VIDEO DECODING AND ENCODING METHODSCROSS-REFERENCE TO RELATED APPLICATIONS

[0001] This application claims priority to Chinese Patent Application No. 202411063146.0 filed on August 2, 2024, Chinese Patent Application No. 202411060594.5 filed on August 2, 2024, Chinese Patent Application No. 202411070314.9 filed on August 5, 2024, and Chinese Patent Application No. 202411646390. X filed on November 15, 2024, the entire contents of which are incorporated herein by reference.TECHNICAL FIELD

[0002] The present disclosure relates to the field of video processing technology, and in particular relates to video decoding and encoding methods.BACKGROUND

[0003] Due to the substantial volume of video image data, encoding and compression are typically required for the video image data. The compressed data, referred to as video bitstream, which is transmitted to the user through a wired or wireless network, and then decoded for viewing. The entire video encoding process includes prediction, transformation, quantization, entropy coding, and other processes. The prediction is divided into two parts: intra-frame prediction and inter-frame prediction. The traditional encoding method may have certain limitations, which affects the efficiency of encoding and decoding to a certain extent.

[0004] There is therefore a need to provide video decoding and encoding methods that may enhance the efficiency of processing video images.SUMMARY

[0005] One or more embodiments of the present disclosure provide a video decoding method. The method includes: constructing a candidate list of a current block; adjusting the candidate list to obtain an adjusted candidate list; and decoding the current block based on the adjusted candidate list.

[0006] One or more embodiments of the present disclosure provide a video encoding method. The method includes: constructing a candidate list for a current block; adjusting the candidate list to obtain an adjusted candidate list; encoding the current block based on the adjusted candidate list.

[0007] One or more embodiments of the present disclosure provide an electronic device including a processor. The processor is configured to execute instructions to perform a video decoding method or a video encoding method.

[0008] One or more embodiments of the present disclosure provide a non-transitory computer readable storage medium including at least one set of instructions. When the at least one set of instructions executed by at least one processor of a computer device, the at least one set of instructions directs the at least one processor to perform a video decoding method or a video encoding method.BRIEF DESCRIPTION OF THE DRAWINGS

[0009] The present disclosure will be further illustrated by way of exemplary embodiments, which will be described in detail by the accompanying drawings. These embodiments are not limiting, and in these embodiments, the same numbering denotes the same structure, wherein:

[0010] FIG. 1 is an exemplary schematic diagram illustrating a template region according to some embodiments of the present disclosure;

[0011] FIG. 2 is an exemplary schematic diagram illustrating a position of a searching result based on corrected motion information of a template region according to some embodiments of the present disclosure;

[0012] FIG. 3 is an exemplary flowchart illustrating a video decoding process according to some embodiments of the present disclosure;

[0013] FIG. 4 is an exemplary flowchart illustrating a video decoding process according to other embodiments of the present disclosure;

[0014] FIG. 5 is a schematic diagram illustrating a position of a control point of a current block according to some embodiments of the present disclosure;

[0015] FIG. 6 is an exemplary schematic diagram illustrating a template region according to other embodiments of the present disclosure;

[0016] FIG. 7 is an exemplary schematic diagram illustrating an affine template region according to some embodiments of the present disclosure;

[0017] FIG. 8 is a schematic diagram illustrating an exemplary process for deriving motion vectors of sub-blocks of an affine template region according to some embodiments of the present disclosure;

[0018] FIG. 9 is a schematic diagram illustrating an exemplary process for dividing a template region according to some embodiments of the present disclosure;

[0019] FIG. 10 is a schematic diagram illustrating an exemplary process for deriving motion information of sub-blocks of a template region according to some embodiments of the present disclosure;

[0020] FIG. 11 is an exemplary flowchart illustrating a video decoding process according to other embodiments of the present disclosure;

[0021] FIG. 12 is an exemplary schematic diagram illustrating a prediction angle according to some embodiments of the present disclosure;

[0022] FIG. 13 is an exemplary schematic diagram illustrating reference weights according to some embodiments of the present disclosure;

[0023] FIG. 14 is an exemplary schematic diagram illustrating a weight matrix according to some embodiments of the present disclosure;

[0024] FIG. 15 is an exemplary schematic diagram illustrating a temporal homogeneous predefined position according to some embodiments of the present disclosure;

[0025] FIG. 16 is an exemplary schematic diagram illustrating a spatial adjacent candidate according to some embodiments of the present disclosure;

[0026] FIG. 17 is an exemplary schematic diagram illustrating a CTU boundary candidate according to some embodiments of the present disclosure;

[0027] FIG. 18 is an exemplary schematic diagram illustrating a spatial candidate position according to some embodiments of the present disclosure;

[0028] FIG. 19 is an exemplary schematic diagram illustrating a position of a searching result of a motion information candidate according to some embodiments of the present disclosure;

[0029] FIG. 20 is an exemplary flowchart illustrating a video decoding process according to other embodiments of the present disclosure;

[0030] FIG. 21 is an exemplary flowchart illustrating a video decoding process according to some other embodiments of the present disclosure;

[0031] FIG. 22 is a schematic diagram illustrating an exemplary manner for determining motion information of sub-blocks according to some embodiments of the present disclosure;

[0032] FIG. 23 is a schematic diagram illustrating another exemplary manner for determining motion information of sub-blocks according to some embodiments of the present disclosure;

[0033] FIG. 24 is a schematic diagram illustrating yet another exemplary manner for determining motion information of sub-blocks according to some embodiments of the present disclosure;

[0034] FIG. 25 is an exemplary flowchart illustrating a video decoding process according to other embodiments of the present disclosure;

[0035] FIG. 26 is an exemplary flowchart illustrating a video decoding process according to other embodiments of the present disclosure;

[0036] FIG. 27 is an exemplary flowchart illustrating a process for encoding and decoding based on intra-block copy according to some embodiments of the present disclosure;

[0037] FIG. 28 is an exemplary schematic diagram illustrating a process for filling spatial candidates in encoding and decoding based on intra-block copy according to some embodiments of the present disclosure;

[0038] FIG. 29 is an exemplary schematic diagram illustrating a chaining process for decoding and encoding based on intra-block copy according to some embodiments of the present disclosure;

[0039] FIG. 30 is an exemplary schematic diagram illustrating a pixel template in a process for encoding and decoding based on intra-block copy according to some embodiments of the present disclosure;

[0040] FIG. 31 is an exemplary schematic diagram illustrating a BVP candidate based on block adaptive predefined positions in a process for encoding and decoding based on intra-block copy according to some embodiments of the present disclosure;

[0041] FIG. 32 is an exemplary schematic diagram illustrating a position based on a spatial BVP candidate in a process for encoding and decoding based on intra-block copy according to some embodiments of the present disclosure;

[0042] FIG. 33 is an exemplary schematic diagram illustrating offset processing for encoding and decoding based on intra-block copy according to some embodiments of the present disclosure;

[0043] FIG. 34 is an exemplary modular diagram illustrating a device for decoding and encoding based on intra-block copy according to some embodiments of the present disclosure;

[0044] FIG. 35 is an exemplary flowchart illustrating a video encoding process according to some embodiments of the present disclosure;

[0045] FIG. 36 is a schematic diagram illustrating overall encoding and decoding process for decoding and encoding based on intra-block copy according to some embodiments of the present disclosure;

[0046] FIG. 37 is another exemplary modular diagram illustrating a device for decoding and encoding based on intra-block copy according to some embodiments of the present disclosure;

[0047] FIG. 38 is an exemplary flowchart illustrating a video encoding process according to some other embodiments of the present disclosure;

[0048] FIG. 39 is an exemplary flowchart illustrating a video encoding process according to some other embodiments of the present disclosure;

[0049] FIG. 40 is an exemplary flowchart illustrating a video encoding process according to some other embodiment of the present disclosure;

[0050] FIG. 41 is an exemplary flowchart illustrating a video encoding process according to some other embodiment of the present disclosure;

[0051] FIG. 42 is an exemplary flowchart illustrating a video encoding process according to some other embodiments of the present disclosure;

[0052] FIG. 43 is an exemplary flowchart illustrating a process of video encoding and decoding according to some embodiments of the present disclosure;

[0053] FIG. 44 is a schematic diagram illustrating a structure of an electronic device according to some embodiments of the present disclosure; and

[0054] FIG. 45 is a schematic diagram illustrating a structure of a non-transitory computer readable storage medium according to some embodiments of the present disclosure.DETAILED DESCRIPTION

[0055] In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the following will briefly introduce the accompanying drawings that need to be used in the description of the embodiments. Obviously, the accompanying drawings in the following description are only some examples or embodiments of the present disclosure, and it is possible for a person of ordinary skill in the art to apply the present disclosure to other similar scenarios according to these drawings without creative labor. Unless obviously obtained from the context or the context illustrates otherwise, the same numeral in the drawings refers to the same structure or operation.

[0056] It should be understood that the terms "system" , "device" , "unit" and / or "module" as used herein is a way to distinguish between different components, elements, parts, sections or assemblies at different levels. However, the words may be replaced by other expressions if other words accomplish the same purpose.

[0057] Flowcharts are used in the present disclosure to illustrate operations performed by a system according to embodiments of the present disclosure. It should be appreciated that the preceding or following operations are not necessarily performed in an exact sequence. Instead, steps may be processed in reverse order or simultaneously. Also, it is possible to add other operations to these processes, or to remove a step or steps from these processes.

[0058] Since the amount of video image data is usually large, it is necessary to compress video pixel data (e.g., RGB, YUV, etc. ) at an encoding end, and the compressed data is called a video bitstream. The video bitstream is transmitted over a wired or wireless network to a user end (adecoding end) and then decoded for viewing. The overall video encoding process includes common processes such as block division, prediction, transformation, quantization, and encoding. And the overall process of encoding and decoding is usually that the encoding process starts from inputting a video frame to encoding it into a bitstream and ends, and the decoding process starts from receiving the bitstream to reconstructing the video frame.

[0059] The block division refers to a process in video encoding where the input includes individual image frames to be encoded. However, when encoding each frame, the frame needs to be divided into several largest coding units (LCUs) . Then, each LCU undergoes recursive partitioning into coding units (CUs) of different sizes, resulting in a plurality of CUs. The video encoding is performed on a CU-by-CU basis. The smallest coding unit is called the SCU.

[0060] In intra / inter-frame prediction, it is generally observed that luminance and chrominance signal values of adjacent pixels are relatively close, exhibiting strong correlation. If the luminance and chrominance information is directly represented by sampled data, significant spatial redundancy exists in the data. If redundant data is removed first and then encoded, the average count of bits per pixel point is indicated to decrease, thus realizing the reduction of spatial redundancy for data compression. The process of transformation usually includes subtracting a real value of a current block from a predicted value after the prediction of the current block is completed, resulting in a residual block. This residual block is then subjected to transformations, such as discrete cosine transform (DCT) , discrete sine transform (DST) , or other transformation manners. Most images have a lot of flat regions and regions where the content transforms slowly, and the correlation of adjacent pixel points is strong. Through transformation, these correlations may be reduced, while a dispersed distribution of image energy in the spatial is converted into a relatively concentrated distribution in the transform domain. This process effectively removes spatial redundancy. The residual block refers to data that represents difference between a true image and a predicted image at a position of the current block.

[0061] The quantization refers to a process of mapping a continuous value of a signal into a plurality of discrete magnitudes, which achieves a many-to-one mapping of the signal values. After the residual data is transformed, transform coefficients have a large range of values, and the quantization may effectively reduce the range of values of the signal, and thus obtain better compression. Because the quantization discretizes continuous values into various quantization intervals, the quantization is the root cause of image distortion.

[0062] An intra block copy (IBC) prediction mode may be used in the prediction process of the present disclosure. The IBC prediction mode mainly predicts based on motion compensation, and may usually be used to copy a block of pixels from one region to another within a single frame. The intra block copy, also known as intra block duplication, is a prediction mode in video image codec technology. The IBC prediction mode is specifically based on a block vector (BV) for motion compensation to obtain the predicted value of a current image block. The IBC prediction mode differs from an inter-frame prediction mode in that a reference region pointed to by BV is a reconstructed region in the current image frame, whereas a reference region pointed to by a motion vector (MV) in the inter-frame prediction mode is the other reconstructed reference image.

[0063] In the IBC prediction mode, in order to save the bit consumption of the BV, the IBC prediction mode supports a block vector predictor (BVP) technique, and a predicted block vector is hereinafter referred to as BVP in the present disclosure. The BVP technique is mainly used to improve encoding and decoding efficiency and involves determining a predicted displacement vector for the current image block from a set of candidate displacement vectors, and then encoding or decoding the current image block based on the predicted displacement vector. The resulting use of the BVP technique reduces the need for actual data transfers, thereby saving bandwidth and storage space.

[0064] It should be noted that the application condition of the BVP technique requires that a count of history based block vector prediction (HBVP) candidates in the current image frame is greater than or equal to 2 for the BVP technique to be effective. Therefore, when the count of HBVP candidates is less than 2, it is a direct transmission of the BV from the encoding end to the decoding end; when the count of HBVP candidates is greater than or equal to 2, it is a transmission of block vector index (bvpIndex, bvpIdx) and block vector difference (BVD) . The block vector difference characterizes a difference between the block vector and a predicted value of the current image block.

[0065] Currently, it is generally necessary to express the BV based on the BVP and the BVD. However, the transmission of BVD consumes a significant amount of bits. Moreover, when the BVP prediction is inaccurate, the BVP cannot be adjusted, which makes the IBC prediction mode less adaptable to different image contents and hinders the improvement of compression efficiency.

[0066] Currently, predictions are typically made for the current block based on templates. For example, a candidate list is first constructed, and then processes such as sorting and searching are performed using a template region cost of the candidate list.

[0067] The specific process of sorting and searching using the template region cost of the current block is shown below: using a motion vector prediction (MVP) list generation manner, the top four candidates are selected as candidate MVPs for temporal motion (TM) prediction. These MVPs are then deduplicated, and an MVP list is sorted using a template (the smaller the template cost, the shorter the codeword assigned) . Additionally, the MVPs are adjusted to integer-pixel positions by rounding down.

[0068] FIG. 1 is an exemplary schematic illustrating a template region according to some embodiments of the present disclosure. FIG. 2 is an exemplary schematic diagram illustrating a position of a searching result based on corrected motion information of a template region according to some embodiments of the present disclosure.

[0069] As shown in FIG. 1, the following template (with a width of 4 pixels) is constructed based on the reconstructed pixels surrounding the current block (unfilled region in FIG. 1) , and a template matching search is performed for each available direction of the MVP. The template region of the current block is the gray filled region in FIG. 1.

[0070] In some embodiments, in the process of template matching, an optimal MV is finally obtained by searching 30 times with hexagons in FIG. 2, and then searching 1 time with squares in FIG. 2. The MV optimized by template matching is used as a final MV of the current block, and a predicted block of the current block is generated. The hexagonal search includes determining a template cost using a Sum of Absolute Differences (SAD) manner; searching for a point with the smallest template cost each time as a centroid for the next search; and aborting the current hexagonal search if the centroid is optimal.

[0071] An index of the optimal MVP after utilizing the template sorting is encoded in a bitstream using variable length codes.

[0072] In some embodiments, the inter-frame prediction manner based on a template does not fully exploit the potential gains. The template may be further utilized to enhance performance to improve compression performance.

[0073] FIG. 3 is an exemplary flowchart illustrating a video decoding process according to some embodiments of the present disclosure. As shown in FIG. 3, process 300 includes the following operations. In some embodiments, the process 300 may be executed by a processor.

[0074] In 310, a candidate list for a current block may be constructed.

[0075] The current block refers to an image block in an image frame that is currently being decoded or currently pending decoding.

[0076] The candidate list refers to a list of a plurality of candidates. Each candidate corresponds to a predicted value for the current block. More details regarding the predicted value may be found in the related description above.

[0077] In some embodiments, the candidate list for the current block includes motion information candidates (also known as candidate motion information) .

[0078] The motion information candidates refer to the predicted values for the current block determined based on motion information ofpixel blocks in the neighborhood of the current block.

[0079] In some embodiments, the motion information candidates include at least one of a history-based candidate, an ultra motion vector expression candidate, an extended temporal motion vector prediction (ETMVP) candidate, a spatial motion information candidate, a temporal motion information candidate, a spatial derivation candidate, a temporal derivation candidate, a coded tree unit (CTU) boundary candidate, an affine motion information candidate, or a motion vector adaptive prediction (MVAP) candidate. The ultra motion vector expression candidate refers to motion information obtained after offset compensation of a motion vector. The spatial candidate refers to motion information of a reconstructed image unit in a current image. The temporal candidates refer to motion information of image units in other decoded images. The spatial derivation candidate refers to motion information obtained by processing the motion information of the reconstructed image units in the current image by at least one of scaling, offsetting, or weighted averaging. The temporal derivation candidate refers to motion information obtained by processing the motion information of the image units in the other decoded images by scaling, offsetting, weighted averaging, or the like. The CTU boundary candidate refers to motion information of the reconstructed image units around the CTU to which the current block belongs. The spatial candidates may include adjacent spatial candidates and non-adjacent spatial candidates, and the non-adjacent spatial candidates may include candidates obtained based on positions, etc. Additionally, the spatial derivation candidate may include a candidate based on the spatial candidate after offsetting. The temporal candidate may include at least one of motion information of at least one coded unit in a temporal co-located block of the current block or motion information of a peripheral coded unit of the temporal co-located block. The at least one coded unit in the temporal co-located block may include at least one of a coded unit at a center position or a coded unit at a corner position of the temporal co-located block, etc. The foregoing motion information candidates may provide richer candidates for a weighted prediction technique, thereby improving compression efficiency.

[0080] The processor may construct the candidate list in a plurality of ways. For example, the processor may generate the candidate list for the current block by iterating through different kinds of candidates. More details may be found in other contents of the present disclosure (e.g., description in connection with FIG. 11) .

[0081] In some embodiments, the processor may use a candidate list constructed based on conventional prediction techniques as the candidate list. More details may be found in other contents of the present disclosure (e.g., description in connection with FIG. 4) .

[0082] In 320, the candidate list may be adjusted to obtain an adjusted candidate list.

[0083] In some embodiments, the processor may adjust the candidate list in a plurality of ways. For example, the processor may sort and / or correct candidates in the candidate list, etc.

[0084] In some embodiments, the processor may sort and / or correct the candidate list based on a template region of the current block to obtain the adjusted candidate list.

[0085] In some embodiments, the processor may determine the adjusted candidate list based on the candidate list using a first model.

[0086] The first model refers to a model for adjusting the candidate list. In some embodiments, the first model is a machine learning model. For example, the first model may be at least one of a recurrent neural network (RNN) model or a user-defined model.

[0087] An input of the first model includes the candidate list, and an output of the first model includes the adjusted candidate list.

[0088] In some embodiments, the processor may obtain the first model by training based on a plurality of first training samples with first labels. The processor may input the plurality of first training samples into an initial first model, construct a loss function based on the outputs of the initial first model and the first labels, and iteratively update parameters of the initial first model based on the loss function. When an iteration termination condition is satisfied, the iteration is ended and a trained first model is obtained. The manners of iterative updating include, but are not limited to, a gradient descent manner, etc., and the iteration termination condition may be that the loss function converges, or a count of iterations reaches a threshold.

[0089] The processor may identify a historical candidate list in the historical data as the first training sample, and a staff member manually adjusts the historical candidate list to obtain an adjusted candidate list, and identify the adjusted candidate list as the first label corresponding to the first training sample.

[0090] Some embodiments of the present disclosure, adjusting the candidate list by the first model, can effectively improve the accuracy and efficiency of the adjustment.

[0091] In some embodiments, the processor may also adjust the candidate list based on importance of the candidates in the candidate list, a template cost of the candidates, a predefined offset adjustment strategy, or the like. The adjustments include a plurality of ways such as merely sorting, merely correcting, sorting then correcting, correcting then sorting, or the like. More details regarding how to adjust the candidate list may be found in other contents of the present disclosure (e.g., descriptions in connection with FIGs. 4-34) .

[0092] In 330, the current block may be decoded based on the adjusted candidate list.

[0093] In some embodiments, the processor may decode the current block in a plurality of ways. For example, the processor may decode the current block utilizing various types of decoders.

[0094] In some embodiments, the processor may also decode the current block based on an index value of the current block, a block vector of a reference block of the current block, or the like. More details regarding how to decode may be found in other contents of the present disclosure (e.g., descriptions in connection with FIGs. 4-34) .

[0095] Some embodiments of the present disclosure, adjusting the candidate list prior to decoding, can improve the decoding efficiency, enhance the video quality, and enhance the flexibility and adaptability of decoding.

[0096] FIG. 4 is an exemplary flowchart illustrating a video decoding process according to some other embodiments of the present disclosure. As shown in FIG. 4, process 400 includes the following operations. In some embodiments, process 400 may be executed by a processor.

[0097] In some embodiments, the processor may perform video decoding through the process 400 when motion information candidates in a candidate list includes affine motion information candidates.

[0098] In 410, the candidate list for a current block may be constructed.

[0099] In some embodiments, the processor may construct the candidate list for the current block, and subsequently adjust the candidate list based on a template region of the current block, so as to apply a template-based motion information adjustment manner under affine prediction. This enables the template-based inter-prediction manner to achieve significant gains.

[0100] The affine motion information candidates refer to motion information of a plurality of control points of the current block.

[0101] FIG. 5 is a schematic diagram illustrating a position of a control point of a current block according to some embodiments of the present disclosure.

[0102] For example, as shown in FIG. 5, in a four-parameter affine prediction mode, the affine motion information candidates include motion information of two control points at top-left and top-right of the current block. For example, as shown in FIG. 5, in a six-parameter affine prediction mode, the affine motion information candidates include motion information of three control points at upper left, upper right, and lower left of the current block.

[0103] In some embodiments, the processor may use a candidate list constructed based on conventional prediction techniques (e.g., affine merge prediction techniques, affine motion vector prediction (AMVP) techniques, etc. ) as the candidate list. For example, the processor may directly use a candidate list in an affine merge mode as the candidate list.

[0104] In 420, the candidate list may be adjusted to obtain an adjusted candidate list based on the template region of the current block.

[0105] In some embodiments, the processor may adjust the candidate list constructed based on the conventional prediction techniques based on the template region. For example, the processor may use the candidate list in the affine merge mode as the candidate list. An encoding end and a decoding end may adjust (e.g., sort and / or correct) the candidate list using the template region by default, i.e., the affine merge prediction technique may use the template region to adjust the candidate list by default.

[0106] As another example, the processor may use an MVP list of affine AMVP as the candidate list. The encoding end and the decoding end may adjust (e.g., sort and / or correct) the MVP candidate list in the MVP list of the affine AMVP using the template region by default, i.e., the affine AMVP prediction technique may use the template region to adjust the candidate list by default.

[0107] As a further example, the processor may select any of two modes of adjusting or not adjusting the candidate list based on the template region. At the encoding end, one of the modes is selected through competition. At the decoding end, based on a syntax, ifthe mode of adjusting is selected, the same manner as the encoding end is used to perform adjustments based on the template region. Finally, the corresponding mode is selected according to the transmitted index of the chosen mode.

[0108] In other embodiments, the processor may reconstruct a candidate list. The processor may adjust a reconstructed candidate list based on a template cost. For example, the processor may reconstruct an affine MVP / MV list, sort the affine motion information candidates in the list, and / or perform MVP refinement.

[0109] In some embodiments, when a scheme of adjusting the candidate list constructed based on the affine prediction technique according to template cost is adopted as a mode of the affine prediction technique, and a scheme of adjustment based on the template cost is treated as an optional mode, a first syntax may be set in a bitstream of the current block. That is, the encoding end may write the first syntax into the bitstream of the current block.

[0110] In some embodiments, the decoding end may determine, based on the first syntax of the current block in the bitstream, whether to perform sorting and / or correcting on the candidate list based on the template region of the current block. For example, the decoding end may decode the first syntax in the bitstream of the current block to determine whether to perform an adjustment on the candidate list based on the template region, i.e., to determine whether to perform operation 420 after executing operation 410. For example, sorting and / or MV correcting MV candidates in the affine merge (skip / direct) mode, the scheme may be used as a sub-mode under the affine merge (skip / direct) . As another example, sorting and / or MVP correcting MVP candidates in the MVP list of the affine AMVP, the scheme may be used as a sub-mode under the affine AMVP.

[0111] In some embodiments, the processor may perform processing such as de-duplication and / or rounding on the candidate list. For example, the processor may determine an MVP / MV list to be reordered. As another example, the processor may selectively perform a candidate de-duplication operation on the reconstructed candidate list. As a further example, the processor may selectively perform a rounding operation on the motion information candidates in the MVP / MV list. The de-duplication refers to a process for retaining only one of the duplicate plurality of affine motion information candidates in the candidate list.

[0112] In 430, the current block may be decoded based on the adjusted candidate list.

[0113] In some embodiments, the processor may adjust the candidate list based on the template region of the current block to apply a template-based motion information adjustment manner under affine prediction, thereby enabling the template-based inter-prediction manner to achieve significant gains.

[0114] The template region of the current block may be a reconstructed region around the current block, which may be either a reconstructed region adjacent to the current block or a reconstructed region that is not closely adjacent to the current block. More preferably, the template region of the current block is the reconstructed region adjacent to the current block.

[0115] FIG. 6 is an exemplary schematic diagram illustrating a template region according to other embodiments of the present disclosure.

[0116] As shown in FIG. 6, in the case where a video decoding order is from top to bottom and left to right, the template region of the current block may include at least one of a reconstructed region above the current block (also referred to as a top template) , a reconstructed region at the top-left corner of the current block (also referred to as a top-left corner) , or a reconstructed region to the left of the current block (also referred to as a left template) . In some embodiments, only template pixels obtained from the region above the current block may be used as the template region of the current block, meaning that only a certain count ofpixel rows above the current block may be selected as the template region of the current block. In other embodiments, only template pixels obtained from the region to the left of the current block may be used as the template region of the current block, meaning that only a certain count ofpixel columns to the left of the current block may be selected as the template region of the current block. In yet other embodiments, the template pixels obtained from both the region above and the region to the left of the current block may be used as the template region of the current block, meaning that a certain count ofpixel rows above and a certain count of pixel columns to the left of the current block may be selected as the template region of the current block. In some embodiments, template pixels obtained from the region above, the region to the left, and a top-left corner region of the current block may be used as the template region of the current block, meaning that a certain count ofpixel rows above, a certain count of pixel columns to the left, and the pixels from the top-left corner region of the current block may be selected as the template region of the current block. The size of the template region is not limited. For example, a height of the template region in a first direction of the current block may be two, four, six, or nine, where the first direction may be above and / or below, and a width of the template region in a second direction of the current block may be two, four, six, or nine, where the second direction may be left and / or right.

[0117] In some embodiments, the processor may set a region selection syntax in the bitstream, i.e., the encoding end may configure the region selection syntax in the bitstream of an image block to indicate a selected template region of the image block through the value of the region selection syntax.

[0118] In some embodiments, the decoding end may decipher the region selection syntax of the current block, and select the template region from the reconstructed pixel regions in the first direction and / or the second direction of the current block based on the value of the region selection syntax.

[0119] In other embodiments, the encoding end and the decoding end agree on a template region selection scheme allowing the reconstructed pixel region at a predefined position around the current block to be used as the template region. In such cases, the encoding end may not transmit the region selection syntax.

[0120] In some embodiments, the processor may sort and / or correct the candidate list to obtain the adjusted candidate list based on the template region of the current block.

[0121] In some embodiments, the processor may sort the candidate list for the current block based on the template region of the current block.

[0122] In some embodiments, the processor may determine fifth template costs for at least some of candidates in the candidate list. The fifth template costs of the candidates are determined based on a predicted value of the template region, and the predicted value of the template region is obtained by applying the candidates to predict the template region. The processor may reorder at least some of the candidates based on the fifth template costs of the at least some of the candidates. It will be appreciated that the candidates herein are affine motion information candidates.

[0123] In some embodiments, the processor may sort at least some of the candidates in ascending order of the fifth template costs, i.e., candidates with small fifth template costs are ranked first. Placing candidates that are more likely to be selected earlier in the list by the fifth template costs further reduces a count of bits in the bitstream for the selected candidates to improve encoding performance. In other embodiments, the processor may also sort the at least some of the candidates in descending order of first template costs.

[0124] In some embodiments, the processor may sort the at least some of the candidates based on the fifth template costs of the at least some of the candidates in the candidate list to re-index the at least some of the candidates.

[0125] In some embodiments, the decoding end may identify, from the at least some of the candidates, a candidate that has a same index value with a candidate of the current block; and decode the current block based on the candidate with the same index value. Corresponding to the operations performed by the decoding end, the encoding end may encode an index of a best candidate of the current block based on the index re-determined by the at least some of the candidates.

[0126] In some embodiments of the present disclosure, the candidate with small fifth template costs correspond to relatively small prediction costs of the current block. Thus, by reordering at least some of the candidates based on the fifth template costs, the candidates with smaller prediction costs for the current block can be ranked higher. In cases where the optimal affine motion information for the current block is derived from at least some of the candidates, encoding bits required for the index of the optimal affine motion information of the current block can be reduced.

[0127] In some embodiments, the decoding end may directly select a candidate of a predefined bit in a reordered order to decode the current block. For example, a candidate for a first bit in the reordered order may be selected to decode the current block. As another example, a candidate for a second position in the reordered order may be selected to decode the current block.

[0128] In other embodiments, the decoding end may directly select the candidate with the smallest fifth template cost among the at least some of the candidates to decode the current block. For example, if at least some of the candidates are sorted in ascending order based on the fifth template costs, the decoding end may select a first candidate from a reordered candidate list to decode the current block. As another example, if at least some of the candidates are sorted in descending order based on the fifth template costs, the decoding end may select a last candidate from the reordered candidates to decode the current block.

[0129] In the above embodiment, the fifth template costs of the candidates need to be determined in order to sort the candidate list based on the fifth template costs of the candidates.

[0130] In some embodiments, the processor may derive affine motion information for the template region using the affine motion information candidates; predict the template region using the affine motion information to obtain a predicted value of the template region; and determine a fifth template cost of each of the at least some of the affine motion information candidates based on the predicted value and a reconstructed value of the template region.

[0131] In some embodiments, the processor may determine motion information of a template sub-block in the template region using the affine motion information candidate; then may perform a prediction of the template sub-block based on the motion information of the template sub-block to obtain a predicted value of the template sub-block, thereby obtaining the predicted value of the template region under the affine motion information candidate; and then determine a cost value of the template region under the affine motion information candidate based on the predicted value of the template region under the affine motion information candidate, i.e., a first template cost of the affine motion information candidate is obtained. The predicted value of the template region under the affine motion information candidate may be determined from a combination of at least one predicted value of at least one template sub-block of the template region under the affine motion information candidate.

[0132] In some embodiments, each affine motion information candidate includes motion information of a plurality of control points of the current block, and the processor may estimate affine motion information of each template sub-block in the template region based on the motion information of the plurality of control points and coordinates of the each template sub-block in the template region.

[0133] FIG. 7 is an exemplary schematic diagram illustrating an affine template region according to some embodiments of the present disclosure. FIG. 8 is a schematic diagram illustrating an exemplary process for deriving motion vectors of sub-blocks of an affine template region according to some embodiments of the present disclosure.

[0134] In some embodiments, as shown in FIGs. 7 and 8, the processor may derive motion information for each template sub-block (filled block in FIGs. 7 and 8) in the template region using the affine motion information candidate. The unfilled blocks in FIGs. 7 and 8 are sub-blocks of the current block. The manner for deriving the motion information of the template sub-blocks using the affine motion information candidate is the same as the manner for deriving the motion information of the sub-blocks in the current block using the affine motion information candidate. For example, the processor may substitute the affine motion information candidate and position information of the sub-blocks in the current block into a four-parameter affine formula to determine the motion information of the sub-blocks in the current block, and the processor may similarly substitute the affine motion information candidate and position information of the template sub-block into the four-parameter affine formula to determine the motion information of the template sub-block. As another example, the processor may substitute the affine motion information candidate and the position information of the sub-blocks in the current block into a six-parameter affine formula to determine the motion information of the sub-blocks in the current block, and the processor may similarly substitute the affine motion information candidate and the position information of the template sub-blocks into the six-parameter affine formula to determine the motion information of the template sub-blocks. In the aforementioned manner, the processor may derive the affine motion information for the each template sub-block in the template region based on the motion information of the plurality of control points in the affine motion information candidate and the coordinates of the each template sub-block. The four-parameter and the six-parameter affine formulas are represented by the following formulas (1) and (2) , respectively.

[0135] In other embodiments, the processor may derive a control point motion vector (CPMV) corresponding to the template region using the affine motion information candidate (i.e., a candidate CPMV) , and use the CPMV of the template region to derive the MVs for the each template sub-block in the template region.

[0136] Alternatively, if the motion information of the sub-blocks in the current block is processed before prediction, after determining the motion information of the each template sub-block, the processor may also process the motion information of the template sub-block by the same processing operations and then predict the template sub-block using the motion information of the template sub-block after processed. For example, if the current block undergoes secondary compensation, the template region undergoes secondary compensation using a same manner.

[0137] After determining the motion information of the template sub-block in the template region, the processor may predict the template sub-block using the motion information of the template sub-block to obtain the predicted value of the template sub-block, thereby obtaining the predicted value of the template region; and then based on the predicted value of the template region, determine the fifth template costs.

[0138] In some embodiments, the processor may determine the fifth template cost of the affine motion information candidates based on the reconstructed value of the template region and the predicted value of the template region under the affine motion information candidate. The formula for determining the template cost is not limited, for example, a sum of absolute differences (SAD) formula, a sum of absolute transformed differences (SATD) formula, etc. In some embodiments, the processor may obtain the fifth template costs for the affine motion information candidates by determining a SAD of the reconstructed value of the template region under the affine motion information candidates and the predicted value of the template region. In other embodiments, the processor may obtain the fifth template costs for the affine motion information candidates by determining a SATD of the reconstructed value of the template region under the affine motion information candidates and the predicted value of the template region.

[0139] As mentioned above, the template region is used to determine the motion information in terms of the template sub-blocks and to make predictions. In this case, the processor may first determine the template sub-blocks in the template region.

[0140] In some embodiments, the template region includes at least one of a first template region disposed in a first direction of the current block or a second template region disposed in a second direction of the current block.

[0141] In some embodiments, the processor may divide the first template region into sub-blocks according to a width of the first template region to obtain the at least one template sub-block, divide the second template region into sub-blocks according to a height of the second template region to obtain the at least one template sub-block; or divide the template region into sub-blocks according to an extension line of a division line of current sub-block to obtain the at least one template sub-block. The template region disposed between adjacent first direction and second direction may not be subdivided into sub-blocks. The first direction includes above the current block and / or below the current block, and the second direction includes on a left side of the current block and / or on a right side of the current block. In some embodiments, if the first direction is above the current block and the second direction is on the left side of the current block, the template region located between the adjacent first direction and second direction refers to a template region located between above and on the left side of the current block, i.e., it refers to an upper left corner of the template region.

[0142] As shown above, in some embodiments, the processor may divide pixel regions in the template region of the current block located in the first direction of the current block into sub-blocks according to a width, and / or may divide pixel regions in the template region of the current block located in the second direction of the current block into sub-blocks according to a height. In some embodiments, the processor may divide pixel regions in the template region of the current block located in the first direction of the current block into sub-blocks according to the width of the template region, and / or may divide pixel regions in the template region of the current block located in the second direction of the current block into sub-blocks according to the height of the template region. In other embodiments, the processor may divide the pixel regions in the template region of the current block located in the first direction of the current block into sub-blocks equidistant from each other according to a width direction of the current block, and / or the processor may divide the pixel regions in the template region of the current block into sub-blocks located in the second direction of the current block equidistant from each other along a height direction of the current block.

[0143] FIG. 9 is a schematic diagram illustrating an exemplary process for dividing a template region according to some embodiments of the present disclosure.

[0144] In other embodiments, the processor may divide the template region of the current block based on a division manner of the current block. As shown in FIGs. 8 and 9, the processor may extend a sub-block division line in the current block into the template region, thereby dividing the template region into the sub-blocks using the extension line of the division line of the current block.

[0145] After dividing the template region of the current block by the manner of dividing the template region into the sub-blocks described above, the at least one template sub-block may be obtained by dividing the template region of the current block.

[0146] When a scheme of sorting the candidate list constructed by the affine prediction technology based on template cost is adopted as a sub-scheme of the affine prediction technology, and when sorting is performed based on the template cost, a second syntax may be set in the bitstream of the current block. That is, the encoding end may write the second syntax into the bitstream of the current block to indicate whether the candidate list is sorted based on the template cost.

[0147] In some embodiments, the decoding end may determine whether to sort the candidate list based on the second syntax of the current block in the bitstream. For example, the decoding end may decode the second syntax in the bitstream of the current block to determine whether to sort the candidate list based on the template cost, i.e., to determine whether to perform the sorting in operation 420 after performing a sorting program in operation 410.

[0148] In some embodiments, sorting the candidates in affine merge mode using a template includes: constructing the template region (template width of 4) based on the reconstructed pixels around the current block, more details regarding how to construct the template region may be found in other contents of the present disclosure (e.g., description in connection with FIG. 1) .

[0149] FIG. 10 is a schematic diagram illustrating an exemplary process for deriving motion information of sub-blocks of a template region according to some embodiments of the present disclosure.

[0150] In some embodiments, for each candidate in the candidate list, the MVs of all sub-blocks of the template region are derived using the CPMV, as shown in FIG. 10. The processor obtains the predicted value for the template region based on the template region, determines a SAD cost with the reconstructed value for the template region, and ranks the candidates based on the SAD cost. Subsequently, the encoding end transmits serial numbers of selected candidates in the new order, and the decoding end uses a same approach to sort all the candidates and indexes the best candidate in the new order based on decoded serial numbers.

[0151] In some embodiments, the processor may adjust the candidates in the candidate list for the current block based on the template region of the current block.

[0152] For example, the processor may correct the motion information candidates in the candidate list based on the template region.

[0153] In some embodiments, the processor may correct the motion information candidate using a searching process, and determine corrected motion information candidates based on a sixth template cost of the searching process, the sixth template cost of the searching process being determined based on the predicted value of the template region determined in the searching process. By utilizing the template region for the search of motion vectors, a count of bits used for syntactic expression of a motion vector difference (MVD) is reduced, or the accuracy of the candidates used under the affine merge is improved, making the prediction results more accurate. The motion vectors in the list serve as a searching start point for the template-based search, and further corrections may be made to the candidate motion vectors using the searching process based on the searching start point. The sixth template cost may include a seventh template cost, an eighth template cost, or a ninth template cost as described below.

[0154] In some embodiments, the processor may derive the affine motion information for the template region using the affine motion information candidates; perform a plurality of adjustments on the affine motion information; obtain the predicted value of the template region by predicting the template region using the affine motion information after each adjustment; determine the seventh template cost based on the predicted value of the template region; and determine the corrected affine motion information candidates based on the seventh template cost of the affine motion information obtained after the plurality of adjustments.

[0155] In the embodiment, the affine motion information for the template region may include the motion information for the plurality of control points of the template region. Or the affine motion information for the template region may include the motion information for all sub-blocks in the template region.

[0156] In some embodiments, obtaining the predicted value of the template region by predicting the template region using the affine motion information after each adjustment includes that: if the affine motion information includes the motion information of the plurality of control points of the template region, the processor determines the motion information of each template sub-block in the template region based on the affine motion information after each adjustment and an affine formula; and predicts each template sub-block based on the motion information of the each template sub-block to obtain the predicted value of the each template sub-block, thereby obtaining the predicted value of the template region under the adjusted affine motion information each time. The process of determining the seventh template cost based on the predicted value of the template region is similar to the process of determining the fifth template cost in the sorting process. For example, the processor may determine a seventh template cost for the affine motion information after each adjustment based on the reconstructed value of the template region and the predicted value of the template region under the affine motion information after each adjustment. To achieve a better correction effect, the processor may determine an affine motion information candidate after correction based on the affine motion information with the smallest seventh template cost among the affine motion information after the plurality of adjustments. The processor may derive the affine motion information candidate after correction for the current block based on the affine motion information with the smallest seventh template cost among the affine motion information after the plurality of adjustments, e.g., the processor may derive the affine motion information candidate after correction for the current block based on the affine formula and the affine motion information with the smallest seventh template cost.

[0157] In some embodiments, performing the plurality of adjustments on the affine motion information includes: adjusting the affine motion information by performing a plurality of offsetting on the affine motion information based on one or more offset vectors. Performing the plurality of offsetting on the affine motion information based on the one or more offset vectors may include: performing offsetting on current affine motion information based on the one or more offset vectors to obtain adjusted affine motion information; if a searching termination condition is not satisfied, using the adjusted affine motion information as the current affine motion information, and returning to perform the offsetting on the current affine motion information based on the one or more offset vectors. Exemplarily, the affine motion information is the motion information of the plurality of control points of the template region, and during each adjustment, the processor may perform computational processing such as addition or subtraction between the offset vector and the motion information of at least one control point in the template region to derive the affine motion information after each adjustment. The offset vectors may be set according to the actual situation, and are not limited herein. For example, the offset vectors may be (1, 0) , (0, 1) , etc.

[0158] In other embodiments, performing the plurality of adjustments on the affine motion information further includes: adjusting the affine motion information iteratively based on one or more correction vectors that are determined based on an optical flow formula.

[0159] In some embodiments, the adjusting the affine motion information iteratively based on one or more correction vectors that are determined based on an optical flow formula may include: deriving the one or more correction vectors for the affine motion information based on the optical flow formula; obtaining the adjusted affine motion information based on the affine motion information and the one or more correction vectors of the affine motion information; if the searching termination condition is not satisfied, using the adjusted affine motion information as the current affine motion information, and returning to perform the process for deriving the one or more correction vectors for the affine motion information based on the optical flow formula.

[0160] In some embodiments, deriving the one or more correction vectors for the current affine motion information based on the optical flow formula includes: determining gradients of a plurality of points in the template region based on the current affine motion information; obtaining a set of coefficient solution equations by bringing the gradients, the predicted value, a reconstructed value, and coordinate information of the plurality of points in the template region into a coefficient solution equation; solving the set of coefficient solution equations to obtain coefficients of a correction vector determination formula; determining one or more correction vectors for control points in the template region using the coefficients of the correction vector determination formula and coordinates of the control points in the template region. The obtaining adjusted affine motion information based on the affine motion information and the one or more correction vectors of the affine motion information includes: adjusting motion information of the control points in the affine motion information by performing offsetting on the motion information based on the one or more correction vectors of the control points to obtain the adjusted affine motion information, for example, adding the correction vector of the control point and the motion information of the control point in the current affine motion information to obtain the adjusted affine motion information. In some embodiments, the set of coefficient solution equations is obtained by bringing the correction vector determination formula into the optical flow formula, and the correction vector determination formula is determined based on the affine formula. It will be appreciated that a current predicted value of the point in the template region described above refers to a predicted value of a corresponding point in the template region predicted using the current affine motion information.

[0161] In some embodiments, the processor may utilize the optical flow formula and gradient information to continually and iteratively update the affine motion information for the template region. Specifically, the processor may update parameters of an affine model and determine a correction vector delta MV based on the optical flow formula and the gradient information, with each iteration of the affine motion information CPMV being equal to a previous iteration of the affine motion information CPMV plus the correction vector delta MV of a current iteration. The following is an example of the six-parameter affine model.

[0162] According to the affine formula, the determination formula for the kth iteration of   (i.e., the correction vector determination formula) is:

[0163] The point (x, y) at each position within the current template conforms to formula (3) above.

[0164] Meanwhile, according to the optical flow formula, there is: wherein, I'k (x, y) denotes a predicted pixel before the kth iteration and I (x, y) denotes a reconstruction pixel  of the template region. The spatial gradients and are derived by applying horizontal and vertical Sobel filters to I'k (x, y) .

[0165] Byusingformula (3) andformula (4) above, aformulaforparameters (a, b, c, d, e, f) maybe obtained by: wherein, I (x, y) -I'k (x, y) denotes a residual difference between the predicted pixel before the kth iteration  and the reconstructed pixel,  and have also been determined. The above process is equivalent to solving a six-variable equation to obtain the computational parameters (a, b, c, d, e, f) of the delta MV.

[0166] After obtaining the parameters (a, b, c, d, e, f) , the delta MV for that iteration is obtained. The processor updates CPMV to CPMVk=delta MVk+CPMVk-1.

[0167] The processor uses an updated CPMV for motion compensation of the template region and determines the SAD cost. The processor control the performance of a plurality of iterations, compares the SAD cost in each iteration with the cost of an initial set of CPMVs for the template region, and selects the CPMV with the smallest cost as the best result from the searching process. The searching process ends when the delta MVs in a particular iteration are all zero or the cost of a particular iteration is less than a set threshold or a maximum count of searches is reached.

[0168] Finally, the processor derives the CPMV of the current block based on a set of CPMVs of the template region to obtain the candidate results after the searching process.

[0169] As mentioned above, when performing the plurality of adjustments on the affine motion information, the adjustments continue if the searching termination condition is not currently satisfied; furthermore, the adjustments end if a searching termination condition is currently satisfied.

[0170] In some embodiments, the searching termination condition may be a cost condition. Exemplarily, when the seventh template cost of the adjusted affine motion information is less than a first threshold, the searching termination condition is satisfied and the adjustment is ended, i.e., the operations of performing the plurality of adjustments on the affine motion information is no longer executed. In other embodiments, when a difference between the seventh template cost of the affine motion information after this adjustment and the seventh template cost of the affine motion information after the previous adjustment is less than a second threshold, the searching termination condition is satisfied and the adjustment is ended, i.e., the operations of performing the plurality of adjustments on the affine motion information is no longer executed.

[0171] In other embodiments, the searching termination condition may also be an adjustment count condition. Exemplarily, when a count of adjustments of the affine motion information of a current affine motion information candidate to be corrected is greater than a third threshold, the searching termination condition is satisfied, and the adjustment is ended, i.e., the operations of performing the plurality of adjustments on the affine motion information is no longer executed.

[0172] In other embodiments, the searching termination condition may also be a pixel adjustment range condition. Exemplarily, when the adjustment of the affine motion information of the current affine motion information candidate to be corrected exceeds a maximum search range, the searching termination condition is satisfied and the adjustment is ended, i.e., the operations of performing the plurality of adjustments on the affine motion information is no longer executed.

[0173] In other embodiments, the processor may perform a plurality of adjustments on the affine motion information candidates; obtain the predicted value of the template region by predicting the template region using the affine motion information candidates after each adjustment; determine the eighth template cost based on the predicted value of the template region; and determine the corrected affine motion information candidates based on the eighth template costs of the affine motion information candidates obtained after the plurality of adjustments.

[0174] In some embodiments, performing the plurality of adjustments on the affine motion information candidates includes: adjusting the affine motion information candidates by performing a plurality of offsetting on the affine motion information candidates based on one or more offset vectors. Performing the plurality of offsetting on the affine motion information candidates based on the one or more offset vectors may include: performing offsetting on a current affine motion information candidate based on the one or more offset vectors to obtain an adjusted affine motion information candidate; if a searching termination condition is not satisfied, using the adjusted affine motion information candidate as the current affine motion information candidate, and returning to perform the offsetting on the current affine motion information candidate based on the one or more offset vectors. Exemplarily, the affine motion information candidate is the motion information of the plurality of control points in the current block, and during each adjustment, the processor may perform computational processing such as addition or subtraction between the offset vector and the motion information of the at least one control point in the current block to derive the affine motion information candidate after each adjustment. The offset vectors may be set according to the actual situation and is not limited here, for example, the offset vector may be (1, 0) , (0, 1) , etc.

[0175] The specific process of obtaining the predicted value of the template region by predicting the template region using the affine motion information candidate after each adjustment may be referred to the relevant descriptions in the sorting realization, and will not be repeated here. The process of determining the eighth template cost based on the predicted value of the template region is similar to the process of determining the fifth template cost in the sorting process. For example, the processor may determine the eighth template cost for the affine motion information candidate after each adjustment based on the reconstructed value of the template region and the predicted value of the template region under the affine motion information candidate after each adjustment. To achieve a better correction effect, the processor may determine an affine motion information candidate with the smallest eighth template cost among the affine motion information candidates after the plurality of adjustments as the corrected affine motion information candidate.

[0176] As shown above, when performing the plurality of adjustments on the affine motion information candidates, if the searching termination condition is not currently satisfied, the adjustments continue; furthermore, if the searching termination condition is currently satisfied, the adjustments end.

[0177] In some embodiments, the searching termination condition may be a cost condition. Exemplarily, when the eighth template cost of the affine motion information candidate after this adjustment is less than a fourth threshold, the searching termination condition is satisfied and the adjustment is ended, i.e., the operations of performing the plurality of adjustments on the affine motion information candidate is no longer executed. In other embodiments, when a difference between the eighth template cost of the affine motion information candidate after this adjustment and the eighth template cost of the affine motion information candidate after the previous adjustment is less than a fifth threshold, the searching termination condition is satisfied and the adjustment is ended, i.e., the operations of performing the plurality of adjustments on the affine motion information candidate is no longer executed.

[0178] In other embodiments, the searching termination condition may also be an adjustment count condition. Exemplarily, when a count number of adjustments of a current affine motion information candidate to be corrected is greater than a sixth threshold, the searching termination condition is satisfied and the adjustment is ended, i.e., the operations of performing the plurality of adjustments on the affine motion information candidate is no longer executed.

[0179] In other embodiments, the searching termination condition may also be a pixel adjustment range condition. Exemplarily, when the adjustment of the current affine motion information candidate to be corrected (i.e., the current affine motion information candidate) exceeds a maximum search range, the searching termination condition is satisfied and the adjustment is ended, i.e., the operations of performing the plurality of adjustments on the affine motion information candidate is no longer executed.

[0180] In other embodiments, the processor may derive the motion information of the template sub-blocks in the template region using the affine motion information candidates; search for optimal offsets for the template sub-blocks based on the motion information of the template sub-blocks; fit the affine motion information of the template region based on the optimal offsets of a plurality of searched template sub-blocks; and determine the corrected affine motion information candidates based on the affine motion information of the template region. In some embodiments, the aforementioned operations may be executed once or may be repeated sequentially until a final searching termination condition is met.

[0181] In some embodiments, the processor may perform a plurality of adjustments on the motion information of the template sub-blocks; obtain the predicted value of each of the template sub-blocks by predicting each of the template sub-blocks using the motion information after each adjustment; determine the ninth template cost of the motion information after each adjustment based on the predicted value of each of the template sub-blocks; and determine the optimal offset of each of the template sub-blocks based on the ninth template cost of the motion information after the plurality of adjustments.

[0182] Similar to the adjustments of the affine motion information or the affine motion information candidate, the processor may also adjust the motion information of each of the template sub-blocks by one or more offset vectors; or the processor may derive a correction vector for the motion vectors based on the optical flow formula, determine the motion vectors after each adjustment based on the correction vector for the motion vectors.

[0183] And, similar to the adjustments of the affine motion information or the affine motion information candidate, when the searching termination condition is currently satisfied, the adjustment is ended, i.e., the operations of performing the plurality of adjustments on the motion information of each of the template sub-blocks is no longer executed. The searching termination condition for the adjustment of the motion information is similar to the searching termination condition for the affine motion information or the affine motion information candidate. For example, the searching termination condition includes: terminating the adjustment when a difference in the cost of two adjacent searching results is less than a correspondingly set threshold; or terminating the adjustment when the cost of a certain searching result is less than a correspondingly set threshold; or setting a maximum search count and terminating the adjustment when the maximum search count is reached; or setting a maximum search range and terminating the adjustment when the maximum search range is exceeded.

[0184] The optimal offset for the template sub-block refers to motion information with the smallest ninth template cost among the motion information after the plurality of adjustments.

[0185] When a scheme of correcting the candidate list constructed by the affine prediction technology based on template cost is adopted as a sub-scheme of the affine prediction technology, and when correcting is performed based on the template cost, a third syntax may be set in the bitstream of the current block. That is, the encoding end may write the third syntax into the bitstream of the current block to indicate whether the candidate list is corrected based on the template cost.

[0186] In some embodiments, the decoding end may decode the third syntax in the bitstream of the current block to confirm whether to correct the candidate list based on the template cost, i.e., to confirm whether to execute a correction scheme in operation 420 after performing operation 410.

[0187] In some embodiments, different correction schemes (i.e., different searching schemes) may be used as different sub-schemes, so that a correction scheme syntax may be set in the bitstream, i.e., the encoding side may set the correction scheme syntax in the bitstream of the image block to indicate a selected correction scheme for the image block by the value of the correction scheme syntax.

[0188] In some embodiments, the decoding end may decode the value of the correction scheme syntax of the current block in the bitstream to determine the selected motion information correction scheme for the current block based on the value of the correction scheme syntax. Alternatively, the encoding end and the decoding end agree on a motion information correction scheme, for example, agreeing to fix the use of one of the plurality of motion information correction schemes described above, in which case the encoding end may not transmit the correction scheme syntax.

[0189] The above implementations of sorting and correcting may be used alone or in combination.

[0190] In some embodiments, the processor may merely sort the candidate list, or merely correct the candidate list. For example, the processor may sort the candidates in the affine merge mode using templates, and may sort the candidates in the affine merge mode using only the template costs. In some embodiments, both the encoding end and the decoding end default to sorting all candidates in the affine merge mode using the template costs.

[0191] When used in combination, there is no restriction on the order in which the sorting and correcting are done before or after. For example, the processor may first sort the candidate list based on the template region, and then correct at least one affine motion information candidate in a reordered candidate list based on the template region. As another example, the processor may first correct the at least one affine motion information candidate in the candidate list based on the template region, and then sort a corrected candidate list based on the template region.

[0192] In some embodiments, the processor may sort the candidate list to obtain a sorted candidate list; correct the sorted candidate list to obtain an adjusted candidate list.

[0193] In some embodiments, the processor may sort the candidate list of the current block based on the template region of the current block to obtain the reordered candidate list; correct the at least one of the affine motion information candidate in the reordered candidate list based on the template region.

[0194] In some embodiments, after obtaining the reordered candidate list, the decoding end may determine the affine motion information candidate from the sorted candidate list that has the same index value with the motion information of the current block; correct, based on the template region, the affine motion information candidate that has the same index value to obtain corrected motion information; and decode the current block based on the corrected motion information. After obtaining the reordered candidate list, the encoding end may correct the at least one of the affine motion information candidate in the reordered candidate list based on the template region to obtain the corrected candidate list; determine optimal motion information for the current block based on the corrected candidate list.

[0195] In some embodiments, the encoding end may determine the optimal motion information for the current block based on the adjusted candidate list; if the optimal motion information for the current block is derived from the adjusted candidate list, encode one or more indexes of the optimal motion information that are redetermined by sorting the optimal motion information. For example, the encoding end may determine the optimal motion information for the current block based on a predicted cost of the corrected affine motion information candidate in the corrected candidate list; if the optimal motion information for the current block is derived from the corrected candidate list, encode the one or more indexes of the optimal motion information that are redetermined by sorting the optimal motion information, thereby informing the decoding end of the optimal motion information for the current block.

[0196] In a specific embodiment, for example, a candidate list is constructed using the same candidate construction manner as in the affine AMVP mode, using two adjustment manners, using the template costs of the candidates before the searching process for sorting, the processor first determines a template cost for each candidate and after sorting the candidates according to the template cost, determine the sorted candidates as the starting points of the searching process for the motion vectors. This scheme may be used as a sub-mode under the affine AMVP mode.

[0197] In a specific embodiment, for example, a candidate list is constructed using the same manner as the MV candidate construction for the affine merge, the processor may perform a correction process for the affine motion information candidate based on the template region, and before the correction is performed, the processor may sort the candidate list using the template cost.

[0198] The manner, as a new inter-frame affine prediction mode, is compared and selected against other affine prediction modes at the encoding end, and selection of the mode is indicated through syntax. However, there is no need for syntax to express the MVD corresponding to a selected candidate. If the mode is selected on the decoding end, the same way of constructing candidates, sorting, and searching is used to obtain the affine CPMV group used in the final prediction.

[0199] In some embodiments, the processor may correct the candidate list to obtain the corrected candidate list; sort the corrected candidate list to obtain the adjusted candidate list.

[0200] In some embodiments, the processor may correct at least one of the affine motion information candidates in the candidate list based on the template region to obtain the corrected candidate list; sort the corrected candidate list for the current block based on the template region of the current block to obtain the reordered candidate list. After obtaining the reordered candidate list, the decoding end may determine the affine motion information candidate from the reordered candidate list that has the same index value with the motion information; decode the current block using the affine motion information candidate that has the same index value. After obtaining the reordered candidate list, the encoding end may determine the optimal motion information for the current block based on the reordered candidate list.

[0201] In some embodiments, the encoding end may determine the optimal motion information for the current block based on the adjusted candidate list; if the optimal motion information for the current block is derived from the adjusted candidate list, encode the one or more indexes of the optimal motion information that are redetermined by sorting the optimal motion information. For example, the encoding end may determine the optimal motion information for the current block based on the predicted cost of the affine motion information candidate in the reordered candidate list; if the optimal motion information for the current block is from the reordered candidate list, encode the one or more indexes of the optimal motion information that are re-determined by the template region, thereby informing the decoding end of the optimal motion information for the current block.

[0202] In a specific embodiment, for example, when constructing a new list, the candidates in the list are sequentially constructed using the same manners and quantities as in the existing technology. These include the history-based affine model derivation and the control point motion vector construction manners in affine skip / direct modes, and the control point motion vector construction manner in affine AMVP. Two adjustment manners are employed, and the template costs of the candidates after searching are used for sorting. The processor first uses each candidate as the searching start point to perform the searching process for the motion vectors, and use the template cost under the best motion vector after searching to sort the order of the candidates. The scheme serves as a sub-mode under the affine merge mode.

[0203] In another specific embodiment, after constructing a candidate list using the same manner as the MVP candidate construction for the affine AMVP, the processor may perform a correction process for the affine motion information candidate based on the template region, and before the correction, sort the candidate list using the template cost.

[0204] The manner, as a new inter-frame affine prediction mode, is compared and selected against other affine prediction modes at the encoding end, and selection of the mode is indicated through syntax. However, there is no need for syntax to express the MVD corresponding to a selected candidate. If the mode is selected on the decoding end, the same way of constructing candidates, sorting, and searching is used to obtain the affine CPMV group used in the final prediction.

[0205] In some embodiments, the decoding end may obtain the predicted value for the current block by predicting the current block based on the candidate; decode to obtain a residual value for the current block. In some embodiments, the decoding end may perform processing, such as entropy decoding, inverse quantization, inverse transform, or the like, on the bitstream to obtain the residual value of the current block; based on the residual value and the predicted value of the current block, obtain the decoding result of the current block.

[0206] FIG. 11 is an exemplary flowchart illustrating a video decoding process according to other embodiments of the present disclosure. As shown in FIG. 11, process 1100 includes the following operations. In some embodiments, the process 1100 may be executed by a processor.

[0207] In 1110, a weight matrix of a current block may be generated.

[0208] In some embodiments, a plurality of prediction modes may be provided in the video codec method. Some of the prediction modes use a prediction manner that utilizes the weight matrix to weight two initial predicted blocks of the current block to obtain a predicted block of the current block, and the weight matrices corresponding to these prediction modes are different. So in the case where an optimal prediction mode of the current block indicates that weighted prediction of the current block is performed using the weight matrix, the weight matrix of the current block may be determined based on the optimal prediction mode of the current block.

[0209] In some embodiments, a decoder may decode a bitstream to obtain a predicted pattern index of the current block, which in turn generates a weight matrix corresponding to the predicted pattern index of the current block.

[0210] FIG. 12 is an exemplary schematic diagram illustrating a prediction angle according to some embodiments of the present disclosure. FIG. 13 is an exemplary schematic diagram illustrating reference weights according to some embodiments of the present disclosure. FIG. 14 is an exemplary schematic diagram illustrating a weight matrix according to some embodiments of the present disclosure.

[0211] In some embodiments, the prediction modes that use the weight matrix for weighted prediction of the current block may include fifty-six prediction modes. The fifty-six prediction modes may include eight angles as shown in FIG. 12 and seven reference weight configurations as shown in FIG. 13. The weight matrix of the fifty-six prediction modes is as shown in FIG. 14, black color in FIG. 14 indicates that a weight value is zero, and white color indicates that a weight value is a predefined value. The reference weight configurations may include seven reference weight configurations as shown in FIG. 13. The reference weight configurations may be a distribution function of reference weight values obtained based on reference weight index values. As shown in FIG. 13, the function is assigned as a non-strictly monotonically increasing function, with eight equally divided points of a reference weight effective length (indicated by black arrows in FIG. 13) as the reference points. The reference weight effective length is determined based on the prediction angles and size of the current block. In another realization, a prediction model that uses the weight matrix for weighted prediction of the current block may similarly include angles and reference weight configurations. However, a count of angles may be seven or less (e.g., by removing some of the angles in FIG. 12) , and / or, the reference weight configurations may also not be seven.

[0212] In the case of a plurality of prediction modes that use the weight matrix including at least one angle and at least one reference weight configuration for weighted prediction of the current block, the processor may determine the angle and the reference weight configuration selected for the optimal prediction mode of the current block based on the prediction mode index or the optimal prediction mode of the current block. Subsequently, the processor may first set the reference weight values (i.e., setting the reference weight configuration) at the surrounding positions of the current block (including both integer and sub-pixel positions) , and then use the angle to obtain the reference weight value corresponding to each pixel position, thereby deriving the weight matrix for the current block.

[0213] In some embodiments, the weight matrix may be generated using an intra-prediction manner, inputs are reference weights and angle modes. The reference weights include seven templates, as shown in FIG. 13, a center weight (a point with a weight of 4) varies in position across different reference weight templates. Additionally, the angle modes of associated technique include eight predicted angles, as shown in FIG. 12.

[0214] In 1120, a candidate list for the current block may be constructed.

[0215] In some embodiments, the processor may first construct the candidate list for the current block, to subsequently determine two pieces of motion information of the current block based on the candidate list of the current block for weighted prediction.

[0216] In operation 1120, the processor may sequentially traverse motion information candidates of each category according to an order in which the motion information candidates of the each category are added to the candidate list, so as to generate the candidate list for the current block.

[0217] For example, the candidate list includes a history-based motion vector prediction (HMVP) , a spatial candidate, and a temporal candidate, with an order of addition being spatial candidate > HMVP > temporal candidate. This allows for first traversing and adding the spatial candidate of the current block, then traversing and adding the HMVP of the current block, and finally traversing and adding the temporal candidate of the current block, thereby obtaining the candidate list for the current block.

[0218] For example, the candidate list may include a HMVP, a spatial candidate, a temporal candidate, and a CTU boundary candidate, with an order of addition being spatial candidate > CTU boundary candidate >temporal candidate > HMVP. This allows for first traversing and adding the spatial candidate of the current block, then traversing and adding the CTU boundary candidate of the current block, followed by traversing and adding the temporal candidate of the current block, and finally traversing and adding the HMVP of the current block, thereby obtaining the candidate list for the current block.

[0219] In some embodiments, the candidate list may be provided with a length limitation, such as a length of the candidate list being less than or equal to a first value. In this case, the processor may not traverse the other motion information candidates if the candidate list has been added to fullness by traversing a plurality of motion information candidates for the current block. The first value may be set according to the actual situation and is not limited herein.

[0220] In other embodiments, a count of additions of the each category of the motion information candidates may also be subject to a quantity limit. If, during traversal of a certain category of the motion information candidates, the count of such candidates in the candidate list has already reached the quantity limit, the processor may cease traversing the certain category of the motion information candidates and proceed to traverse a next category of the motion information candidates.

[0221] In some embodiments, during the process of constructing the candidate list for the current block, the processor may perform a redundancy check on a currently traversed motion information candidate. If the redundancy check is passed, the currently traversed motion information candidate is added to the candidate list; otherwise, the motion information candidate is not added.

[0222] For example, the processor may determine whether the currently traversed motion information candidate points to a same position in a same reference image as any motion information candidate in the candidate list. Ifit points to the same position in the same reference image, the redundancy check for the currently traversed motion information candidate fails, and the candidate may not be added; otherwise, the redundancy check passes, and the processor may add the currently traversed motion information candidate to the candidate list.

[0223] As another example, if the current motion information candidate points to a same reference frame as a motion information candidate in the candidate list and a difference between respective reference positions exceeds a predefined threshold, the processor adds the current motion information candidate to the candidate list; if the current motion information candidate points to the same reference frame as the motion information candidate in the candidate list and the difference between the respective reference positions is less than or equal to the predefined threshold, the processor does not add the current motion information candidate to the candidate list. In some embodiments, the motion information candidate added to the candidate list as described above includes unidirectional motion information.

[0224] In other embodiments, the motion information candidate includes bidirectional motion information. If the current motion information candidate includes the bidirectional motion information, the processor detaches at least one of forward motion information and backward motion information from the current motion information candidate to be added to the candidate list, or, not adding the current motion information candidate to the candidate list. For example, in the case where the traversed motion information candidate includes the bidirectional motion information, the processor may choose not to add the motion information candidate, or detach the motion information candidate into a forward motion information candidate and add the forward motion information candidate to the candidate list, or detach the motion information candidate into a backward motion information candidate and add the backward motion information candidate to the candidate list, or detach the motion information candidate into both a forward motion information candidate and a backward motion information candidate and add together to the candidate list.

[0225] In some embodiments, the processor may determine whether to detach the traversed motion information candidate into the forward motion information or the backward motion information based on the position in the candidate list. For example, the processor may choose a direction of prediction for idx%2 (idx refers to a candidate added by a first idx, and takes values starting from zero; a value of zero for idx%2 means that a forward direction is chosen, and a value of one for idx%2 means that a backward direction is chosen) .

[0226] In some embodiments, candidate checking is performed using enhanced checking. That is, if a candidate added later points to the same reference image as a candidate added earlier and the difference between the reference positions pointed to is less than or equal to four, the candidate is not added.

[0227] In some embodiments, an initial candidate list has a length of sixteen, and a derivation manner adds one, eight, eight, and eight candidates in an order of the temporal candidate, the spatial candidate, the history-based candidate, and the CTU boundary candidate, respectively. When each derivation manner adds the candidates, if a total count of additions reaches a predefined length of the candidate list, no more candidates are added.

[0228] FIG. 15 is an exemplary schematic diagram illustrating a temporal homogeneous predefined position according to some embodiments of the present disclosure.

[0229] Temporal candidate: assuming that the five temporal homogeneous predefined positions are as shown in FIG. 15, the processor adds one candidate to the candidate list in an order ofT0, T1, T2, T3, and T4, i.e., a count of additions in the derivation manner reaches a predefined count of additions, then subsequent candidates in the derivation manner are not added.

[0230] FIG. 16 is an exemplary schematic diagram illustrating a spatial adjacent candidate according to some embodiments of the present disclosure.

[0231] Spatial candidate: assuming that several spatial adjacent candidates are as shown in FIG. 16, with dark shaded region denoting SCUs, the processor adds up to eight candidates to the candidate list in an order of clockwise from the bottom-left to the top-right of the current block, and if a number of additions in the derivation manner reaches eight, subsequent candidates in the derivation manner are not added.

[0232] History-based candidate: the processor traverses an HMVP candidate list in inverse order and adds up to eight candidates to the candidate list, if a count of additions in the derivation manner reaches eight, then subsequent candidates in the derivation manner are not added.

[0233] FIG. 17 is an exemplary schematic diagram illustrating a CTU boundary candidate according to some embodiments of the present disclosure.

[0234] CTU boundary candidate: the processor adds up to eight candidates to the candidate list in clockwise order from the left side to the top side of a CTU boundary where the current block is located, and if a count of additions in the derivation manner reaches eight, subsequent candidates in the derivation manner are no longer added. In some embodiments, each position to add a candidate may be spaced apart by a certain length, e.g., each candidate is spaced apart by one SCU, as shown in FIG. 17.

[0235] FIG. 18 is an exemplary schematic diagram illustrating a spatial candidate position according to some embodiments of the present disclosure.

[0236] In other embodiments, a length of the candidate list is five, and the processor adds valid motion information candidates (for which a coding block of a corresponding position has been decoded and the prediction mode is inter-frame prediction) to the candidate list in an order of T→F→G→C→A→B→D. T denotes the temporal candidate, and F, G, C, A, B, and D denote the spatial candidates, as shown in FIG. 18.

[0237] During the addition process, a duplication check is performed. If a candidate to be added points to the same position in the same reference image as a previously added candidate, it is not added. When adding the candidates, if a count of added candidates has reached five, the process of constructing the candidate list is terminated; if a count of the last added candidates does not exceed five, a scaling process is performed on the first added candidate until the candidate list has reached five.

[0238] In some embodiments, during the addition process of the candidates, if the prediction mode of the candidates is bidirectional, a prediction direction is selected based on idx%2 (idx refers to an idx-th added candidate, starting from 0; idx%2 being zero selects a forward direction, and idx%2 being one selects a backward direction) . Otherwise, if the candidate is unidirectional, the corresponding prediction direction is selected.

[0239] In some embodiments, the processor may replace a construction manner of associated technology with a construction manner of the candidate list in operation 1120. In other embodiments, the processor may add the construction manner of the candidate list in operation 1120 to related weighted prediction technique.

[0240] In 1130, based on the template region of the current block, the candidate list may be adjusted to determine first motion information and second motion information of the current block.

[0241] The first motion information and the second motion information correspond to motion information of different positions in an adjusted candidate list.

[0242] In some embodiments, after constructing the candidate list for the current block, the processor may adjust the candidate list based on the template region of the current block, applying a manner for adjusting the motion information based on the template under a weighted prediction scheme. This allows the inter-frame prediction template-based manner to achieve significant gains.

[0243] In some embodiments, the processor may also determine the template region for the current block based on a region selection syntax. More details regarding the template region and the region selection syntax may be found in other contents of the present disclosure (e.g., description in connection with FIG. 4) .

[0244] In some embodiments, the processor may sort the candidate list for the current block based on the template region of the current block.

[0245] In some embodiments, the processor may determine a third template cost for at least some of the motion information candidates in the candidate list. The third template cost of at least some of the motion information candidates is determined based on a predicted value of the template region, and the predicted value of the template region is determined by predicting the template region based on the motion information candidate. The processor may reorder at least some of the motion information candidates based on the third template cost of the at least some of the motion information candidates.

[0246] In some embodiments, the processor may sort the motion information candidates based on the third template cost in a plurality of ways. For example, the processor may retain a predefined count of the motion information candidates with low third template costs to generate the adjusted candidate list.

[0247] Reordering the motion information candidates based on the third template cost is similar to ordering affine motion information candidates based on a fifth template cost, more details may be found in operation 420 and related descriptions.

[0248] In some embodiments, the processor may sort the motion information candidates in the candidate list based on importance of at least some of the motion information candidates in the candidate list to obtain the adjusted candidate list. For example, the processor may sort all of the motion information candidates based on the third template costs of at least some of the motion information candidates; retain a predefined count of motion information candidates with high importance to constitute a reordered candidate list. The predefined count is less than or equal to a count of the motion information candidates in the candidate list.

[0249] In the above embodiment, the third template costs of the candidates need to be determined in order to sort the candidate list based on the third template costs of the candidates.

[0250] In some embodiments, the processor may predict the template region using the motion information candidates to obtain the predicted value for the template region; determine costs for the motion information candidates, i.e., determine the third template costs for the motion information candidates, based on the predicted value the template region under the motion information candidates.

[0251] In some embodiments, the processor may compute the third template costs for the motion information candidates based on the predicted value and a reconstructed value of the template region.

[0252] The manner for determining the third template costs is similar to the manner for determining the fifth template cost, more details may be found in operation 420 and related descriptions.

[0253] Different template cost computation schemes may be used as different sub-schemes so that a cost determination syntax may be set up in the bitstream, i.e., the encoding end may set up the cost determination syntax in the bitstream of image blocks to indicate the template cost computation scheme selected for the image blocks by the values of the cost determination syntax. Correspondingly, the decoding end may decode the value of the cost determination syntax of the current block in the bitstream to determine the template cost computation scheme selected for the current block based on the value of the cost determination syntax. Alternatively, the encoding end and the decoding end agree on a template cost computation scheme, enabling the cost value of the template region to be determined using a predefined cost determination formula. In this case, the encoding end does not need to transmit the cost determination syntax.

[0254] In some embodiments, corresponding to the sorting process of the candidate list, a first cost determination syntax may be provided, and the processor may decipher the first cost determination syntax of the current block, determine a determination formula for the third template costs based on a value of the first cost determination syntax; and substitute the predicted value of the template region predicted using the motion information candidate and the reconstructed value of the template region into the determination formula of the third template cost to obtain the third template cost of the motion information candidate. That is, the cost determination syntax may include the first cost determination syntax.

[0255] When a scheme of sorting the candidate list constructed by the weighted prediction technology based on the template cost is adopted as a sub-scheme of the weighted prediction technology, and when sorting is performed based on the template cost, a first scheme syntax may be set in the bitstream of the current block. That is, the encoding end may write the first scheme syntax into the bitstream of the current block to indicate whether to apply a sorting manner based on the template to the candidate list. And the decoding end may decode the first scheme syntax in the bitstream of the current block to confirm whether to apply the sorting manner based on the template to the candidate list of the weighted prediction technology, i.e., to confirm, after constructing the candidate list for the weighted prediction technology, whether to perform the sorting scheme in operation 1230. In some embodiments, the processor may adopt the scheme of sorting the candidate list constructed using the weighted prediction technique based on the template cost as the default execution scheme. This allows the default execution of sorting the candidate list constructed using the weighted prediction technique based on the template cost, meaning that the first scheme syntax does not need to be transmitted. It is possible to add a designed candidate list reordering manner to the related techniques, and the manner may be executed by default or based on a syntactic expression that determines whether to execute it.

[0256] In a specific embodiment, it is assumed that the length of the initial candidate list is N=8 and the length of the reordered candidate list is M=4.

[0257] The template region is an L-shaped template region, and a variance determination manner is SAD.

[0258] Assuming that the initial candidate list has candidates numbered in order as {0, 1, 2, 3, 4, 5, 6, 7} , and corresponding SAD costs determined are {100, 80, 75, 150, 200, 180, 90, 120} , then after sorting the template costs from low to high, four candidates in the reordered candidate list correspond to the original candidate list numbers {2, 1, 6, 0} . Therefore, the four candidates in the reordered candidate list are the {2nd, 1st, 6th, 0th} candidates from the initial list.

[0259] In other embodiments, the processor may adjust the candidates in the candidate list for the current block based on the template region of the current block.

[0260] For example, the processor may correct the motion information candidates in the candidate list based on the template region, which may provide a more flexible refinement scheme and greatly improve the accuracy of a prediction vector.

[0261] In some embodiments, the processor may correct a motion information candidate to be corrected using a searching process. A corrected motion information candidate is determined based on a second template cost during the searching process, the second template cost during the searching process being determined based on a predicted value of the template region determined during the searching process. By utilizing the template region for the searching process of the motion information, a count of bits used for the syntactic expression of MVD is reduced, or the accuracy of the candidates used in weighted prediction techniques is improved, thereby making the prediction results more accurate. The motion information in the list serves as a searching start point for the template-based search, and the processor may make further corrections to the motion information candidates using the searching process based on the searching start point.

[0262] In some embodiments, when in the searching process, the processor may perform template cost determination for a predefined count of positions around the searching start point and determine the results of a current round of search based on the second template cost for the predefined count of positions to determine correction results of the motion information candidate.

[0263] In some embodiments, during the process of performing the template cost determination for the predefined count of positions around the searching start point, the processor may use a position of a current template cost determination as a reference position pointed to by the motion information to predict the current block, thereby obtaining a current predicted block of the current block. Based on the current predicted block of the current block, the second template cost of the position of the current template cost determination is determined. Subsequently, the second template costs of the predefined count of positions are compared to determine the search result, thereby obtaining the correction result of the motion information candidate (i.e., the corrected motion information candidate) .

[0264] The process of determining the second template cost based on the predicted value of the template region is similar to the process of determining the first template cost in the sorting process. For example, the processor may determine the second template cost for each position based on the reconstructed value of the template region and the predicted value of the template region under each position. To achieve a better correction, a position with the smallest second template cost among the predefined count of positions may be used as the result of the current round of search.

[0265] In some embodiments, corresponding to the correction process of the motion information candidates in the candidate list, a second cost determination syntax may be established to characterize a determination formula for the second template cost during the correction process of the motion information candidates. That is, the cost determination syntax may include the second cost determination syntax. The first cost determination syntax and the second cost determination syntax may be the same, i.e., the first cost determination syntax and the second cost determination syntax may be represented by a same syntax, i.e., the first cost determination syntax and the second cost determination syntax are a same syntax in the bitstream. Of course, in other embodiments, the first cost determination syntax and the second cost determination syntax may be represented by different syntaxes in the bitstream.

[0266] In some embodiments, the processor may decode the second cost determination syntax of the current block, determine the determination formula for the second template cost based on the values of the second cost determination syntax; and substitute the reconstructed value of the template region and the predicted value of the template region at each searching position into the determination formula for the second template cost to obtain the second template cost of the motion information candidate.

[0267] In some embodiments, the processor may perform one or more rounds of search for the motion information candidate to be corrected based on the template region to obtain the corrected motion information candidate; if a round count of the motion information candidate for the current round of search is equal to 1, determine the searching start point for the current round of search based on the motion information candidate to be corrected; if the round count of the current round of search is greater than 1, determining a searching result of a previous round of search as the searching start point in the current round of search; and in each round of search of the motion information candidate, one or more second template costs of one or more predefined positions around the searching start point are determined, and a searching result of the current round of search is determined based on the one or more second template costs of the one or more predefined positions.

[0268] In some embodiments, when the round count of the motion information candidate for the current round of search is equal to 1, the processor may directly use the position pointed to by the current motion information to be corrected as the searching start point for the current round. In other embodiments, when the round count of the motion information candidate for the current round of search is equal to 1, the processor may preprocess the current motion information to be corrected, and then use a position pointed to by the preprocessed motion information as the searching start point for the current round. The preprocessing may be integer pixelization, i.e., when the round count of the motion information candidate for the current round of search is equal to 1, the processor may integer-pixelize the current motion information to be corrected, and then use a position pointed to by the integer-pixelized motion information as the searching start point of the current round.

[0269] In some embodiments, if a position of the searching result of the current round of search is the same as a position of the searching start point of the current round of search, the processor terminates the searching process and designates the motion information candidate corresponding to the searching start point of the current round of search as the corrected motion information candidate; if the round count of the current round of search is equal to a first threshold, the processor designates the motion information candidate corresponding to the position of the searching result of the current round of search as the corrected motion information candidate.

[0270] FIG. 19 is an exemplary schematic diagram illustrating a position of a searching result of a motion information candidate according to some embodiments of the present disclosure.

[0271] In some embodiments, the predefined count of positions around the searching start point may be set according to the actual situation, and is not limited herein. For example, the predefined count of positions include, but are not limited to, the following shapes as shown in FIG. 19, where a five-pointed star denotes a searching start point and a diamond-shaped dot denotes a searching position. The point searching positions in FIG. 19 are merely schematic and do not imply that the search shape is limited to these specific points. Additionally, the distance between the positions in FIG. 19 is not restricted, and may be any distance. For example, each grid may be 1 / 4, 1 / 2, 1, 2, etc. pixel distance.

[0272] (1) Hexagonal search: a number of positions that form a hexagon around the searching start point as the center;

[0273] (2) Rectangular search: a number of positions that form a square around the searching start point as the center;

[0274] (3) Rhombus search: a number of positions that form a rhombus around the searching start point as the center.

[0275] When performing a plurality of rounds of search, the searching position of the searching start point for different rounds may be the same or different, and there is no restriction here. For example, two rounds of search are performed for the motion information candidate, and both rounds perform the hexagonal search. As another example, three rounds of search are performed on the motion information candidate, with the hexagonal search performed in a first round, the rectangular search performed in a second round, and the rhombus search performed in a third round. As a further example, the correction process is performed using an L-shaped template, and the difference determination manner is using SAD. The correction process uses R=31 rounds of search, with the first thirty rounds using the hexagonal search (in a same position as in the aforementioned hexagonal search schematic FIG. 19, and where each grid represents 1 / 4 pixel) , and the last one round using the rectangular search (in a same position as in the aforementioned square search schematic FIG. 11, and where each grid represents 1 / 4 pixel) .

[0276] In some embodiments, during the correction process, the processor may also perform range clipping on a correction vector, i.e., limiting the position searched for to a certain range between the position searched for and an initial searching start point. If the range is exceeded, the position is set to be invalid or a position that is the closest distance away from the position within an allowable range is substituted for the position. If the searching position exceeds a predefined range around the position indicated by the motion information to be corrected, the searching position is set as invalid, or the second template cost of the nearest position within the predefined range is used as the second template cost of the searching position.

[0277] In some embodiments, the motion information correction of operation 1130 may be corrected and adjusted to at least one of the original motion information or vectors corrected based on a predefined manner. For example, the processor may first correct and adjust the motion information candidates in the candidate list by a correction manner in the related art.

[0278] In some embodiments, the processor corrects and adjusts the motion information candidates using the corresponding correction distance and correction direction to obtain preliminary corrected motion information; and then corrects and adjusts the preliminary corrected motion information based on the template region to obtain the corrected motion information candidate.

[0279] Supported correction distances and correction directions may be respectively shown in Table 1 and Table 2. Two adaptive weighted prediction (AWP) candidates may independently determine the correction distance and the correction direction. The specific correction distance and correction direction may be decoded from a correction distance index and a correction direction index corresponding to each candidate in the bitstream. Table 1 Correction distances of AWP candidates Table 2 Correction directions of AWP candidates

[0280] In some embodiments, the processor first reorders the candidate list based on the template region to obtain the reordered candidate list; corrects at least some of the motion information candidates in the reordered candidate list based on the template region to obtain the corrected motion information candidates, thereby obtaining the corrected candidate list.

[0281] When a scheme of correcting the candidate list constructed by the weighted prediction technique based on the template cost is considered as a sub-scheme of the weighted prediction technique, and a scheme of correcting based on the template cost is treated as an optional scheme, a second scheme syntax may be set in the bitstream of the current block. That is, the encoding end may write the second scheme syntax in the bitstream of the current block to indicate whether to apply a template-based correction manner to the candidate list of the weighted prediction technique. And the decoding end may decode the second scheme syntax in the bitstream of the current block to confirm whether to apply the template-based correction manner to the candidate list of the weighted prediction technique, i.e., to confirm, after constructing the candidate list for the weighted prediction technique, whether to perform the correction scheme in operation 430. When the second scheme syntax indicates that the template-based correction manner is not applied to the candidate list of the weighted prediction technique, the processor may choose not to correct the first motion information and the second motion information of the current block, or may correct at least one of the first motion information or the second motion information of the current block based on the correction distance and the correction direction. Whether to correct at least one of the first motion information or the second motion information of the current block based on the correction distance and the correction direction may be determined by the relevant syntax obtained by decoding from the bitstream.

[0282] In some embodiment, the processor may adopt the scheme of correcting the candidate list constructed by the weighted prediction technique based on the template cost as the default execution scheme. In this way, the scheme of correcting the candidate list constructed by the weighted prediction technique based on the template cost may be executed by default, meaning that the second scheme syntax may not need to be transmitted. That is, the designed candidate vector correction manner may be added to the related technology, and the manner may be executed by default or based on a syntactic expression to determine whether to execute.

[0283] In some embodiments, the processor may, after adjusting the candidate list based on the template region, determine the first motion information and the second motion information for the current block based on the adjusted candidate list.

[0284] After determining the adjusted candidate list using operation 1130, the processor may determine the first motion information and the second motion information for the current block from the adjusted candidate list.

[0285] In some embodiments, the processor may use the motion information candidate at a first predefined position in the adjusted candidate list as the first motion information and the motion information candidate at a second predefined position in the adjusted candidate list as the second motion information.

[0286] In some embodiments, the processor may sort the candidate list based on the template region to obtain the reordered candidate list; based on the reordered candidate list, determine the first motion information and the second motion information. For example, the processor may use the motion information candidate at a first predefined position in the reordered candidate list as the first motion information, and use the motion information candidate at a second predefined position in the reordered candidate list as the second motion information.

[0287] In some embodiments, the processor may correct at least one motion information candidate in the adjusted candidate list based on the template region to confirm at least one of corrected first motion information or corrected second motion information. For example, the processor may use the motion information candidate at the first predefined position in the corrected candidate list as the first motion information, and use the motion information candidate at the second predefined position in the corrected candidate list as the second motion information.

[0288] In some embodiments, the processor may sort the candidate list based on the template region to obtain the reordered candidate list; correct the at least some of the motion information candidates in the reordered candidate list based on the template region to obtain the corrected candidate list; use the motion information candidate at the first predefined position in the corrected candidate list as the first motion information; and use the motion information candidates at the second predefined position in the corrected candidate list as the second motion information.

[0289] In some embodiments, the processor may decode the bitstream to determine indexes of the first motion information and the second motion information of the current block, and find out the first motion information and the second motion information of the current block from the adjusted candidate list based on the indexes. For example, the processor may sort the candidate list based on the template region to obtain the reordered candidate list; and find out the first motion information and the second motion information from the reordered candidate list based on the indexes of the first motion information and the second motion information. As another example, the processor may correct at least some of the motion information candidates in the candidate list based on the template region to obtain the corrected candidate list; find out the first motion information and the second motion information from the corrected candidate list based on the indexes of the first motion information and the second motion information. As a further example, the processor may sort the candidate list based on the template region to obtain the reordered candidate list; correct the at least some of the motion information candidates in the reordered candidate list based on the template region to obtain the corrected candidate list; and find out the first motion information and the second motion information from the corrected candidate list based on the indexes of the first motion information and the second motion information.

[0290] In some embodiments, if the process of adjusting the candidate list based on the template region involves correcting the candidate list based on the template region, the processor may first determine, based on the indexes of the first motion information and the second motion information, at least one of first motion information to be corrected or second motion information to be corrected from the candidate list, and correct at least one of the first motion information to be corrected or the second motion information to be corrected based on the template region to obtain at least one of the corrected first motion information or the corrected second motion information. For example, the processor may determine, based on the indexes of the first motion information and the second motion information, the first motion information to be corrected and the second motion information to be corrected from the candidate list; correct the first motion information to be corrected and the second motion information to be corrected based on the template region, to obtain the corrected first motion information and the corrected second motion information.

[0291] As another example, the processor may reorder the candidate list based on the template region to obtain the reordered candidate list; determine, based on the indexes of the first motion information and the second motion information, at least one of the first motion information to be corrected or the second motion information to be corrected from the reordered candidate list; and correct at least one of the first motion information to be corrected or the second motion information to be corrected based on the template region to obtain the corrected first motion information and the corrected second motion information.

[0292] As a further example, the processor may determine at least one of the first motion information to be corrected or the second motion information to be corrected from the candidate list based on the indexes of at least one of the first motion information or the second motion information; correct at least one of the first motion information to be corrected or the second motion information to be corrected based on correction angles and the correction direction to obtain at least one of preliminary corrected first motion information or preliminary corrected second motion information; and correct at least one of the preliminary corrected first motion information or the preliminary corrected second motion information based on the template region to obtain at least one of the corrected first motion information or the corrected second motion information. As yet another example, the processor may sort the candidate list based on the template region to obtain the reordered candidate list; determine, based on the indexes of the first motion information and the second motion information, at least one of the first motion information to be corrected or the second motion information to be corrected from the reordered candidate list; correct at least one of the first motion information to be corrected or the second motion information to be corrected based on the correction angles and the correction direction to obtain at least one of the preliminarily corrected first motion information or the preliminarily corrected second motion information; and correct at least one of the preliminarily corrected first motion information or the preliminarily corrected second motion information based on the template region to obtain at least one of the corrected first motion information or the corrected second motion information.

[0293] In 1140, a weighted prediction of the current block may be performed using the weight matrix, the first motion information, and the second motion information to obtain a predicted value of the current block.

[0294] In some embodiments, after determining the weight matrix, the first motion information, and the second motion information for the current block, the processor may perform the weighted prediction on the current block to obtain the predicted value of the current block.

[0295] A size of the weight matrix is positively correlated with a size of the current block.

[0296] In some embodiments, the size of the weight matrix is the same as the size of the current block. This allows two initial predicted blocks of the current block to be obtained by predicting from two pieces of motion information, and the sizes of the two initial predicted blocks are the same as the size of the current block. Subsequently, the predicted block of the current block may be obtained by weighing the two initial predicted blocks using the weight matrix. In this case, the weighing formula of the two initial predicted blocks may be expressed by the following formula (6) : predMatrixAwp (x, y) = predMatrixAwp0 (x, y) *AwpWeightMatrix (x, y) + predMatrixAwp1 (x, y) *  (maxWeight-AwpWeightMatrix (x, y) ) (6) wherein, predMatrixAwp (x, y) , predMatrixAwp0 (x, y) , predMatrixAwp1 (x, y) , and  AwpWeightMatrix (x, y) denote a final predicted value, a first initial predicted value, a second initial predicted value, and a weighted weight in the weight matrix in the current block located at the (x, y) position, respectively, and maxWeight denotes a predefined value. In other words, the process of obtaining the predicted blocks of the current block by weighting the two initial predicted blocks using the weight matrix may be understood as follows: for each pixel, an element value in the weight matrix corresponding to the pixel serves as the weighting weight for the pixel value in one initial predicted block, while a weight difference for the pixel serves as the weighting weight for the pixel value in the other initial predicted block. The pixel values from the two initial predicted blocks are then weighted to obtain the predicted value for the pixel, thereby obtaining the predicted blocks of the current block. The weight difference of the pixel is equal to a difference between the predefined value and the element value of the pixel in the weight matrix.

[0297] The predefined value may be set according to the actual situation, and is no limitation here, for example, the predefined value may be 8, 4, etc.

[0298] In some embodiments, the size of the weight matrix is 1 / n of the size of the current block, so that the processor may obtain the initial predicted blocks of the current block by predicting each of the two motion information, and may perform the weight prediction on the initial predicted blocks using the weight matrix after down-sampling the initial predicted blocks to obtain intermediate predicted blocks of the current block, and then up-sample the intermediate predicted blocks to obtain the final predicted blocks of the current block. The size of the intermediate predicted block is 1 / n of the size of the current block.

[0299] In some embodiments, the processor may determine the predicted block for the current block based on the adjusted candidate list and the current block via a second model.

[0300] The second model refers to a model for decoding the current block based on the adjusted candidate list. In some embodiments, the second model is a machine learning model. For example, the second model may be at least one of a convolutional neural networks (CNN) model or a user-defined model.

[0301] Inputs to the second model include the adjusted candidate list and the current block, and outputs to the second model include the predicted block for the current block.

[0302] In some embodiments, the processor may be trained to obtain the second model based on a plurality of second training samples with second labels. The training process of the second model is the same as the training process of the first model, more details may be found in FIG. 3 above.

[0303] The second training samples include a sample candidate list and a sample current block, and the second labels include actual pixel values corresponding to the sample current block. The second training samples and the second labels may be obtained based on historical data.

[0304] Some embodiments of the present disclosure, decoding the current block by the second model can effectively improve the accuracy and efficiency of decoding.

[0305] In 1150, a decoding result of the current block may be obtained based on the predicted value of the current block.

[0306] In some embodiments, the decoding end may decode to obtain a residual value for the current block. In some embodiments, the decoding end may perform entropy decoding, inverse quantization, and inverse transform on the bitstream to obtain the residual value of the current block; based on the residual value and the predicted value of the current block, obtain the decoding result of the current block.

[0307] FIG. 20 is an exemplary flowchart illustrating a video decoding process according to other embodiments of the present disclosure. As shown in FIG. 20, process 2000 includes the following operations. In some embodiments, the process 2000 may be executed by a processor.

[0308] In 2010, a weight matrix for a current block may be generated.

[0309] Specific operations may be found in operation 1110, which will not be repeated here.

[0310] In 2020, a candidate list for the current block may be constructed.

[0311] Specific operations may be found in operation 1120, which will not be repeated here.

[0312] In 2030, motion information candidates in the candidate list may be reordered based on importance of each of the motion information candidates in the candidate list to obtain a reordered candidate list.

[0313] In some embodiments, the processor may reorder the motion information candidates in the candidate list based on a template region, more details may be found in operation 1130, and will not be repeated herein. A first template cost is negatively correlated with the importance, i.e., the motion information candidates with relatively low first template costs are more important.

[0314] In other embodiments, the processor may determine the importance of each of the motion information candidates based on a proximity of the motion information candidates in the candidate list, thereby reordering the motion information candidates in the candidate list. The closer motion information candidates (e.g., motion information candidates with smaller picture order count (POC) differences) are more important, so that the closer motion information candidates may be ranked ahead of the more distant motion information candidates.

[0315] In 2040, based on the reordered candidate list, first motion information and second motion information for the current block may be determined.

[0316] Specific operations may be found in operation 1130, and will not be repeated here.

[0317] In 2050, a weighted prediction of the current block may be performed using a weight matrix, the first motion information, and the second motion information to obtain a predicted value of the current block.

[0318] Specific operations may be found in operation 1140, and will not be repeated here.

[0319] In 2060, a decoding result of the current block may be obtained based on the predicted value of the current block.

[0320] Specific operations may be found in operation 1150, and will not be repeated here.

[0321] FIG. 21 is an exemplary flowchart illustrating a video decoding process according to some other embodiments of the present disclosure. As shown in FIG. 21, process 2100 includes the following operations. In some embodiments, the process 2100 may be executed by a processor.

[0322] In 2110, in response to a prediction mode of a current block being a sub-block prediction mode, a template region of the current block may be divided to obtain at least one template sub-block.

[0323] When the prediction mode of the current block is the sub-block prediction mode, the processor may divide the template region of the current block to obtain the at least one template sub-block. This facilitates the subsequent determination of first template costs for at least some of sub-mode candidates in the sub-block prediction mode based on the at least one template sub-block. Consequently, it enables the subsequent sorting of at least some of the sub-mode candidates using the first template costs of at least some of the sub-mode candidates. This approach allows the application of a template-based candidate sorting manner within the sub-block prediction mode.

[0324] More details regarding the current block may be found in other contents of the present disclosure (e.g., description in connection with FIG. 3) , and more details regarding the template region, the template sub-blocks, and the first template costs may be found in other contents of the present disclosure (e.g., description in connection with FIG. 4) .

[0325] The sub-block prediction mode is a technique used in video coding to improve compression efficiency. The sub-block prediction mode allows for the dividing of larger coding and decoding blocks, enabling more precise control over the prediction manner for each sub-block. The sub-block prediction mode may include an extended temporal motion vector prediction (ETMVP) mode, a motion vector adaptive prediction (MVAP) mode, or the like.

[0326] In some embodiments, although the prediction mode of the current block is the sub-block prediction mode, under certain conditions, such as where the cost of dividing is higher than the cost of not dividing, the current block may be predicted without dividing, i.e., the current block may be predicted as a whole block. The template region of the current block may also not be subdivided when the current block is not subdivided. When the current block is subdivided, the template region of the current block may be or may not be subdivided, as appropriate.

[0327] In some embodiments, different sub-block acquisition schemes may serve as different sub-schemes so that a sub-block acquisition syntax may be set up in a bitstream, i.e., an encoding end may set up the sub-block acquisition syntax in the bitstream of an image block. The value of the sub-block acquisition syntax may then indicate a sub-block division manner for the template region of the image block.

[0328] In some embodiments, a decoding end may interpret the value of the sub-block acquisition syntax in the bitstream for the current block, and based on the value of the sub-block acquisition syntax, determine the sub-block division manner for the template region of the current block. Alternatively, the encoding end and the decoding end agree on a sub-block division scheme, in which case the encoding end may not transmit the sub-block acquisition syntax.

[0329] In 2120, a first template cost may be determined for at least some sub-modes in the sub-block prediction mode.

[0330] In some embodiments, after dividing the template region of the current block to obtain the at least one template sub-block, the processor may determine the first template costs of at least some of the sub-mode candidates in the sub-block prediction mode based on the at least one template sub-block. This facilitates the subsequent sorting of at least some of the sub-mode candidates using the first template costs, thereby enabling the application of a template-based candidate sorting manner in the sub-block prediction mode.

[0331] In some embodiments, the first template cost of the sub-mode candidates may be determined based on a predicted value of the template region of the current block. The predicted value of the template region under the sub-mode candidates includes the predicted values of the at least one template sub-block under the sub-mode candidates, and the predicted values of the at least one template sub-block under the sub-mode candidates are derived based on the motion information of the at least one template sub-block under the sub-mode candidates.

[0332] As described above, the processor may first determine the motion information for the at least one template sub-block under the sub-mode candidates. In some embodiments, the processor may determine the motion information of the template sub-block based on the motion information of a sub-block of the current block closest to the template sub-block, the manner of obtaining the motion information of the sub-block of the current block closest to the template sub-block, or the motion information at the corresponding position of the template sub-block in a reference block template of the current block. The position relationship between the reference block template and a reference block of the current block is equivalent to the position relationship between the template region and the current block.

[0333] FIG. 22 is a schematic diagram illustrating an exemplary manner for determining motion information of sub-blocks according to some embodiments of the present disclosure. FIG. 23 is a schematic diagram illustrating another exemplary manner for determining motion information of sub-blocks according to some embodiments of the present disclosure. FIG. 24 is a schematic diagram illustrating yet another exemplary manner for determining motion information of sub-blocks according to some embodiments of the present disclosure.

[0334] In some embodiments, the processor may use the motion information of the current sub-block that is closest to the template sub-block as the motion information of the template sub-block. For example, as shown in FIG. 22, if the sub-block prediction mode is MVAP and the current block includes current sub-blocks ①, ②, ③, and ④, assuming that the sub-mode candidate for the current block is specifically a horizontal mode of MVAP, i.e., the sub-blocks ① and ② use the motion information at position A1, and the sub-blocks ③ and ④ use the motion information at position A3. The template region of the current block includes template sub-block D1 +D2, template sub-block E1 +E2, template sub-block A1 +A2 and template sub-block A3+A4. The processor may use the motion information of the current sub-block ① as the motion information of the template sub-block A1+A2 and the template sub-block D1+D2, i.e., the motion information of the template sub-block A1 +A2 and the template sub-block D1 +D2 uses the motion information of the position A1. The processor may use the motion information of the current sub-block ② as the motion information of the template sub-block E1+E2, i.e., the template sub-block E1+E2 uses the motion information of the A1 position. The processor may use the motion information of the current sub-block ③ as the motion information of the template sub-block A3+A4, i.e., the template sub-block A3+A4 uses the motion information of the position A3.

[0335] In other embodiments, the processor may obtain the motion information of the template sub-block using a motion information acquisition manner for acquiring the motion information of the current sub-block closest to the template sub-block. For example, as shown in FIG. 22, if the sub-block prediction mode is MVAP and the current block includes current sub-blocks ①, ②, ③, and ④, assuming that the sub-mode candidate for the current block is specifically a horizontal mode of MVAP, i.e., sub-blocks ① and ② use the motion information at the position A1, and sub-blocks ③ and ④ use the motion information at the position A3. The template region of the current block includes template sub-block D1+D2, template sub-block E1 +E2, template sub-block A1 +A2, and template sub-block A3+A4, and the template sub-block may also obtain the motion information by the horizontal mode of the MVAP.

[0336] In a specific embodiment, the reference region of the motion information is not additionally extended, i.e., a reference list of the motion information still includes the motion information of sub-blocks A1, A2, A3, A4, B1, B2, C, D1, D2, E1, E2, E3, and E4. If the motion information acquisition manner for acquiring the motion information of the current sub-block closest to the template sub-block is used, the motion information may be obtained from the motion information of the sub-blocks A1, A2, A3, A4, B1, B2, C, D1, D2, E1, E2, E3, and E4, then the obtained motion information is used as the motion information of the template sub-block. For example, the template sub-block D1+D2 and the template sub-block E1+E2 may obtain motion information of a position C from the motion information of the sub-blocks A1, A2, A3, A4, B1, B2, C, D1, D2, E1, E2, E3, and E4 by the horizontal mode of MVAP, so that the processor may use the motion information of the position C as the motion information of the template sub-block D1 +D2 and the template sub-block E1+E2. If using the motion information acquisition manner for acquiring the motion information of the current sub-block closest to the template sub-block may not obtain motion information from the motion information of the sub-blocks A1, A2, A3, A4, B1, B2, C, D1, D2, E1, E2, E3, and E4, then the processor may designate the motion information of the current sub-block closest to the template sub-block or predefined motion information as the motion information of the template sub-block. For example, if the template sub-block A1 +A2 and the template sub-block A3+A4 do not obtain the motion information through the horizontal mode of MVAP, the processor may designate the motion information of the current sub-block ① closest to the template sub-block A1 +A2 as the motion information of the template sub-block A1+A2, i.e., the template sub-block A1 +A2 uses the motion information of the position A1, and the processor may designate the motion information of the current sub-block ③ closest to the template sub-block A3+A4 as the motion information of the template sub-block A3+A4, i.e., the template sub-block A3+A4 uses the motion information of the position A3.

[0337] In another specific embodiment, as shown in FIG. 23, the processor may additionally extend the reference region of the motion information, i.e., the reference list of the motion information except the motion information of the sub-blocks A1, A2, A3, A4, B1, B2, C, D1, D2, E1, E2, E3, and E4, but may also include the motion information of additionally extended sub-blocks F, G1, G2, G3, G4, G5, and G6. When using the motion information acquisition manner for acquiring the motion information of the current sub-block closest to the template sub-block may obtain the motion information from the motion information of the sub-blocks A1, A2, A3, A4, B1, B2, C, D1, D2, E1, E2, E3, E4, F, G1, G2, G3, G4, G5, and G6, then the processor uses the obtained motion information as the motion information of the template sub-block. For example, the template sub-block D1+D2 and the template sub-block E1+E2 may obtain the motion information of the position C by the horizontal mode of MVAP from the motion information of the sub-blocks A1, A2, A3, A4, B1, B2, C, D1, D2, E1, E2, E3, E4, F, G1, G2, G3, G4, G5, and G6, then the processor may designate the motion information of the position C as the motion information of the template sub-block D1+D2 and the template sub-block E1+E2. As another example, the template sub-block A1+A2 may obtain motion information ora position G1 by the horizontal mode of MVAP from the motion information of the sub-blocks A1, A2, A3, A4, B1, B2, C, D1, D2, E1, E2, E3, E4, F, G1, G2, G3, G4, G5, and G6, so that the processor may designate the motion information of the position G1 as the motion information of the template sub-block A1 +A2. If using the motion information acquisition manner for acquiring the motion information of the current sub-block closest to the template sub-block may not obtain the motion information from the motion information of the sub-blocks A1, A2, A3, A4, B1, B2, C, D1, D2, E1, E2, E3, E4, F, G1, G2, G3, G4, G5, and G6, the processor may designate the motion information of the current sub-block closest to the template sub-block or the predefined motion information as the motion information of the template sub-block. For example, assuming that the motion information of G3 is not available, and the template sub-block A3+A4 may not obtain the motion information through the horizontal mode of MVAP, the processor may designate the motion information of the current sub-block ③ closest to the template sub-block A3+A4 as the motion information of the template sub-block A3+A4, i.e., the template sub-block A3+A4 uses the motion information of the position A3. In summary, in the embodiment, the processor may obtain the motion information of the template sub-block by using a motion information acquisition manner for acquiring the motion information of the current sub-block closest to the template sub-block; if the motion information of the template sub-block is not obtained, the processor may designate the motion information of the current sub-block closest to the template sub-block or the predefined motion information as the motion information of the template sub-block.

[0338] In yet further embodiments, the processor may determine the motion information of the template sub-block based on motion information of a corresponding position of the template sub-block in the reference block template. For example, as shown in FIG. 24, a left image shows an ETMVP reference block (unfilled region in the figure) and a corresponding template (hatched region) , while a right image in FIG. 24 shows an ETMVP current block (unfilled region in the figure) and a corresponding template (hatched region) . In the embodiment, the reference block is located at a position offset downward from a co-located block, and the motion information of the current sub-block is derived from the corresponding sub-block in the reference block. The template region is defined as template pixels that may be obtained from the regions above, to the left, and at the top-left comer of the current block. An upper template region is divided into sub-blocks according to a width of the current sub-block, and a left template region is divided into sub-blocks according to a height of the current sub-block, i.e., the template region is divided into a total of none sub-blocks as shown in FIG. 24. Similar to the motion information acquisition manner for acquiring the motion information of the current sub-block, each template sub-block uses the motion information of the sub-block in the corresponding position of the reference block template. Additionally, if the motion information of the corresponding template sub-block in the reference block template may not be obtained due to reasons such as the template sub-block in the corresponding position of the reference block template exceeding an image boundary or a maximum coding unit boundary, or the motion information of the template sub-block in the corresponding position of the reference block template being unavailable, the processor may use the motion information of the current sub-block closest to the template sub-block or the predefined motion information as the motion information of the template sub-block.

[0339] In some embodiments, the processor may determine the motion information for each template sub-block in the template region under each of the at least some of the sub-mode candidates based on the above.

[0340] In some embodiments, different sub-block motion information acquisition schemes may serve as distinct sub-schemes. As such, a sub-block motion information acquisition syntax may be established in the bitstream. Specifically, the encoding end may set the sub-block motion information acquisition syntax in the bitstream of the image block, and the value of the sub-block motion information acquisition syntax indicates the sub-block motion information acquisition scheme selected for the image block.

[0341] In some embodiments, the decoding end may decipher the value of the sub-block motion information acquisition syntax in the bitstream for the current block, and based on the value of the sub-block motion information acquisition syntax, determine the sub-block motion information acquisition scheme selected for the current block. Alternatively, the encoding end and the decoding end may agree on a sub-block motion information acquisition scheme in advance, and this agreed-upon scheme may be used as the sub-block motion information acquisition scheme for the current block. In such case, the encoding end may omit transmitting the sub-block motion information acquisition syntax.

[0342] At least some of the sub-mode candidates may be different sub-modes under one sub-block prediction technique. For example, at least some of the sub-modes may be a horizontal mode, a vertical mode, etc., in an MVAP prediction technique. As another example, at least some of the sub-modes may be a vertical upward offset mode, a horizontal rightward offset mode, a vertical downward offset mode, a horizontal leftward offset mode, etc., in an ETMVP prediction technique.

[0343] In other implementations, at least some of the sub-modes may be different sub-modes in at least two sub-block prediction techniques. For example, at least some of the sub-modes may be a horizontal mode and / or a vertical mode in the MVAP prediction technique, a vertical upward offset mode, a horizontal rightward offset mode, a vertical downward offset mode and / or a horizontal leftward offset mode, etc., in the ETMVP prediction technique.

[0344] In some embodiments, after determining the motion information of the template sub-block in the template region under the sub-mode candidates as described above, the processor may perform a prediction of the template sub-block based on the motion information of the template sub-block to obtain the predicted value of the template sub-block, to obtain the predicted value of the template region under the sub-mode candidates; and then determine a cost value of the template region under the sub-mode candidates based on the predicted value of the template region under the sub-mode candidates, i.e., the first template costs of the sub-mode candidates are obtained.

[0345] In some embodiments, the processor may determine the first template costs for the sub-modes based on a reconstructed value of the template region and the predicted value of the template region under the sub-mode candidates. A determination formula for determining the template cost is not limited, for example, a SAD determination formula, a SATD determination formula, etc., may be selected. In some embodiments, the processor may determine a SAD of the reconstructed value of the template region under the sub-mode candidates and the predicted value of the template region to obtain the first template costs of the sub-mode candidates. In other embodiments, the processor may determine a SATD of the reconstructed value of the template region under the sub-mode candidates and the predicted value of the template region to obtain the first template costs for the sub-mode candidates.

[0346] In 2130, the least some of the sub-mode candidates may be sorted based on the first template costs of the at least some of the sub-mode candidates.

[0347] In some embodiments, after determining the first template costs for the at least some of the sub-mode candidates, the processor may sort the at least some of the sub-mode candidates.

[0348] In some embodiments, the processor may sort at least some of the sub-mode candidates in ascending order of the first template costs. By sorting the sub-mode candidates with small first template costs, the bitstream transmission bits may be reduced. In other embodiments, the processor may also sort at least some of the sub-mode candidates in descending order of the first template costs.

[0349] In cases where the at least some of the sub-mode candidates include different sub-mode candidates under at least two sub-block prediction techniques, the processor may sort the sub-mode candidates under the different sub-block prediction techniques separately, i.e., sort the sub-mode candidates under each sub-block prediction technique separately. For example, if the at least some of the sub-mode candidates include two sub-mode candidates under MVAP and four sub-mode candidates under ETMVP, the processor may separately sort the two sub-mode candidates under MVAP based on the first template costs of the two sub-mode candidates under MVAP, and may also separately sort the four sub-mode candidates under ETMVP based on the first template costs of the four sub-mode candidates under ETMVP.

[0350] In other embodiments, the processor may also sort the sub-mode candidates under at least two sub-block prediction techniques, when at least some of the sub-mode candidates include different sub-mode candidates under at least two sub-block prediction techniques. For example, if at least some of the sub-mode candidates include two sub-mode candidates under MVAP and four sub-mode candidates under ETMVP, the processor may sort the two sub-mode candidates under MVAP and the four sub-mode candidates under ETMVP based on the first template costs of the two sub-mode candidates under MVAP and the first template costs of the four sub-mode candidates under ETMVP.

[0351] In some embodiments, the processor may construct a candidate list for the current block, the candidate list including the sub-mode candidates for the sub-block prediction technique. The processor may also group the candidate list to obtain at least two candidate groups; sort, in an intra-group sort, all candidates in the candidate groups to obtain a sorted candidate list based on the first template costs of the at least some of the sub-mode candidates. The foregoing operation facilitates subsequent decoding of the current block based on the sorted candidate list. The processor may sort, in an intra-group sort, the candidates in the candidate groups including the sub-mode candidates based on the first template costs of at least some of the sub-mode candidates. For the candidates that are not the sub-mode candidates but are subject to sorting, the processor may determine fourth template costs for the candidates, and use the fourth template costs, and the first template costs for the sub-modes to sort, in an intra-group sort, the candidates in each group of at least one of the at least two candidate groups.

[0352] In 2140, the current block may be decoded based on at least some of the sub-mode candidates after sorting.

[0353] In some embodiments, the processor may decode the current block based on the at least some of the sub-mode candidates after reordering.

[0354] In some embodiments, in operation 2130, the decoding end may sort the at least some of the sub-mode candidates based on the first template costs of the at least some of the sub-mode candidates to re-index the at least some of the sub-mode candidates. In operation 2140, the decoding end may determine, from the at least some of the sub-mode candidates, a candidate having a same index value with a candidate of the current block; and decode the current block based on the candidate having the same index value.

[0355] More details regarding how to decode may be found in operation 430 and related descriptions.

[0356] FIG. 25 is an exemplary flowchart illustrating a video decoding process according to some other embodiments of the present disclosure. As shown in FIG. 25, process flow 2500 includes the following operations. In some embodiments, the process 2500 may be executed by a processor.

[0357] In 2510, a candidate list for a current block may be constructed.

[0358] During decoding of the current block, the processor may construct the candidate list for the current block for subsequent decoding of the current block based on the candidate list for the current block.

[0359] In some embodiments, the candidate list for the current block may include at least one of a first candidate list or a second candidate list.

[0360] The first candidate list refers to a candidate list for the current block constructed based on a conventional prediction technique. For example, the first candidate list includes at least one of MVAP sub-mode candidates or ETMVP sub-mode candidates for the current block.

[0361] More details regarding how to construct the candidate list may be found in operation 410 and related descriptions.

[0362] In some embodiments, the encoding end may write a first syntax to a bitstream to determine, via the first syntax, whether to perform adjusting on the first candidate list based on a template region of the current block, i.e., whether to perform operation 2520 after operation 2510. More details regarding the first syntax may be found in operation 410 and related descriptions.

[0363] The second candidate list refers to a candidate list for the current block constructed based on a non-conventional prediction technique. The second candidate list for the current block is independent of the first candidate list for the current block under the conventional prediction technique. For example, the processor may rebuild a new candidate list as the second candidate list using a skip / direct mode, UMVE, and ETMVP construction of a candidate; this scenario serves as a new scheme. At an encoding end, the mode competes with other skip / direct modes for selection. At a decoding end, based on syntax, if the mode is selected, the candidate list is constructed in a same manner as at the encoding end and adjusted according to a template cost. Finally, the corresponding mode is chosen based on an index of the selected mode transmitted.

[0364] In some embodiments, a fourth syntax may be set in the bitstream of the current block, i.e., the encoding end may write the fourth syntax in the bitstream of the current block to indicate whether to adopt new prediction modes by the fourth syntax, which is required to construct the second candidate list and adjust at least some of candidates in the list.

[0365] In some embodiments, the decoding end may determine, based on the fourth syntax, whether to reconstruct the second candidate list for the current block and adjust the at least some of the candidates in the list. For example, the decoding end may decode the fourth syntax in the bitstream of the current block to determine whether to reconstruct the second candidate list of the current block and adjust the at least some of the candidates in the list, i.e., to determine whether to perform operations 2510 and 2520. The acquisition manner for acquiring the candidates of the second candidate list may be performed according to the agreement between the encoding end and the decoding end, or may also be transmitted based on a syntax.

[0366] In some embodiments, the processor may integrate a plurality of existing candidate construction manners to adjust a more comprehensive list, thereby further leveraging the performance of the template-based manner.

[0367] In 2520, the candidate list may be adjusted based on the template region of the current block.

[0368] After constructing the candidate list for the current block, the processor may adjust the candidate list for the current block based on the template region of the current block for subsequent decoding of the current block based on an adjusted candidate list.

[0369] In some embodiments, when the candidate list of the current block includes an MVAP candidate, a UMVE candidate, an ETMVP candidate, or a HMVP candidate, the processor may adjust the candidate list based on the template region of the current block to fully exploit the performance of template-based mining.

[0370] In some embodiments, the processor may sort the candidate list for the current block based on the template region of the current block.

[0371] In some embodiments, the processor may determine a fourth template cost for at least some of the candidates in the candidate list; and reorder the at least some of the candidates based on the fourth template cost of the at least some of the candidates. It will be appreciated that the candidates herein may include at least one of sub-mode candidates or motion information candidates.

[0372] Reordering the candidates based on the fourth template cost is similar to sorting the candidates based on a fifth template cost, more details may be found in operation 420 and related descriptions.

[0373] In the above embodiment, the fourth template costs of the candidates need to be determined in order to sort the candidate list based on the fourth template costs of the candidates.

[0374] In the case where the candidate is a sub-mode candidate, the fourth template cost of the candidate may be determined based on a predicted value of the template region, and the predicted value of the template region under the candidate is obtained by predicting based on motion information of the template region under the candidate.

[0375] In some embodiments, the candidate may be a sub-mode candidate of a sub-block prediction technique. In such cases, the processor may determine the motion information of the template sub-block based on the motion information of a current sub-block closest to the template sub-block, a motion information acquisition manner for acquiring the motion information of the current sub-block closest to the template sub-block, or the motion information of the template sub-block at a corresponding position in a reference block template of the current block. Specific operations may be found in operation 2120, which will not be elaborated here.

[0376] In the case where the candidate is a motion information candidate, the fourth template cost of the candidate may be determined based on the predicted value of the template region, and the predicted value of the template region under the candidate is predicted based on the motion information candidate.

[0377] The fourth template cost is determined in a similar manner to the fifth template cost, more details may be found in operation 420 and related descriptions.

[0378] In some embodiments, the processor may sort all candidates in the candidate list based on the fourth template cost.

[0379] In other embodiments, the processor may sort a first predefined count of candidates in the candidate list based on the fourth template cost.

[0380] In some embodiments, the processor may group the candidate list to obtain at least two candidate groups; sort, in an intra-group sort, candidates in each group of at least one of the at least two candidate groups based on the fourth template costs of the candidates in the candidate list, and / or, sort, in an inter-group sort, the at least two candidate groups to obtain a sorted candidate list. That is, after the grouping, the processor may perform the intra-group sort and / or the inter-group sort on the candidate groups.

[0381] In some embodiments, the processor may perform the inter-group sort on all candidates within each candidate group across all candidate groups based on the fourth template cost, or may perform the intra-group sort on all candidates within each candidate group for some of the candidate groups based on the fourth template cost.

[0382] In some embodiments, the processor may group the candidate list according to the order of the candidates in the candidate list. Iftwo candidates are located in the same candidate group, all candidates between the two candidates are located in the same candidate group. The processor may select a predefined count of candidates as the candidate group in order of the order of the candidates in the candidate list. Or the processor may group the candidate list based on how the candidates in the candidate list are acquired. Generally, a number of candidates acquired by the same acquisition manner are adjacent to each other, which is also equivalent to grouping the candidates in the candidate list according to the sequential order.

[0383] In some embodiments, the order of the different groups may remain unchanged when sorting, i.e., only the intra-group sort is performed. In other embodiments, the order of the different groups may also be reordered based on the template cost, i.e., both the intra-group sort and the inter-group sort are performed. Alternatively, the inter-group sort may be performed, and the intra-group may not be performed.

[0384] In some embodiments, the processor may sort, in the intra-group sort, the at least two candidate groups based on a statistical value of the fourth template cost for each group to obtain the sorted candidate list. For example, the processor may sort a plurality of groups in ascending order based on a sum of the fourth template costs. As another example, the processor may sort the plurality of groups in ascending order based on an average of the fourth template costs.

[0385] In a specific example, for example, sorting spatial candidates, temporal candidates, and MVAP candidates in skip / direct mode using a template may include: dividing the entire list into four groups including the temporal candidates, the spatial candidates, the MVAP candidates, and HMVP candidates, and the spatial candidates and the MVAP candidates are sorted using the templates. The spatial candidates are obtained by predicting the template region based on a MV to obtain a predicted value of a template, while the MVAP candidate may obtain the predicted value of the template region based on the content of operation 2110. The cost determination manner based on SAD is employed to determine a cost between the predicted value of the template region and a reconstructed value, thereby enabling the grouping and sorting of the candidate list.

[0386] In another specific example, for example, sorting UMVE candidates in skip / direct mode using a template may include: setting UMVE to have sixty-four candidates, which includes thirty-two candidates for each of two base MVs, with four directions and eight distances, respectively; grouping the UMVE candidates by different base MVs and different directions, resulting in a total of eight groups, where each group contains candidates with the same base MV and the same offset direction; and sorting the candidates within each group based on the template cost to obtain a sorted UMVE candidate list.

[0387] In other embodiments, the processor may adjust the candidates in the candidate list for the current block based on the template region of the current block.

[0388] For example, the processor may correct the motion information candidates in the candidate list based on the template region when the candidates are the motion information candidates.

[0389] In some embodiments, the processor may sort at least some of the motion information candidates based on a third template cost of at least some of the motion information candidates. More details may be found in operation 1130 and related descriptions.

[0390] In 2530, the current block may be decoded based on the adjusted candidate list.

[0391] In some embodiments, the decoding end may select the candidates from the adjusted candidate list to decode the current block. For example, the processor may determine a candidate from the sorted candidate list that has a same index value as a best candidate of the current block; decode the current block based on the candidate that has the same index value. In the case of sorting the candidate list based on the template region at operation 2520, the descriptions of the candidate selection may be found in the description of operation 2520, which will not be repeated here.

[0392] In other embodiments, in the case where the candidate list is adjusted and corrected based on the template region in operation 2520, the decoding end may determine the candidate from the candidate list that has the same candidate index value as the current block; and decode the current block based on the candidates that has the same index value.

[0393] FIG. 26 is an exemplary flowchart illustrating a video encoding process according to some other embodiments of the present disclosure. As shown in FIG. 26, process 2600 includes the following operations. In some embodiments, the process 2600 may be executed by a processor.

[0394] In 2610, a candidate list for a current block may be constructed.

[0395] More details may be found in operation 2510, and will not be repeated here.

[0396] In addition, if it is confirmed that an adjustment scheme of the candidate list based on a template region is performed for a candidate list under a conventional prediction technique, an encoding end and a decoding end may also confirm whether to perform a group sorting scheme, i.e., the decoding end confirms whether to perform operations 2620, 2630 and 2640, and the encoding end confirms whether to perform operations 4020, 4030, and 4040. For the decoding end, in the case of confirming that the adjustment scheme of the candidate list based on the template region is performed for the candidate list under the conventional prediction technique based on a value of a fifth syntax, the decoding end may decode the fifth syntax of the current block; and based on the value of the fifth syntax, confirm whether to perform subsequent operations for the first candidate list. The subsequent operations may include: an operation of grouping the candidate list to obtain at least two candidate groups, an operation of sorting, in an intra-group sort, all candidates in each candidate group of at least one candidate group to obtain a sorted candidate list based on a second template cost, and an operation of decoding the current block based on the sorted candidate list. And for the encoding end, in the case of confirming that the adjustment scheme of the candidate list based on the template region is performed for the candidate list under the conventional prediction technique, the encoding end may compare grouped scheme with ungrouped scheme to determine whether the current block needs to be grouped for sorting. For example, the coding end may compare the grouped scheme with the ungrouped scheme using the best candidates for the current block. Exemplarily, the encoding end may select the scheme with the smallest, best candidate index of the current block as the final scheme for the current block; based on a confirmation result of whether the current block requires grouping and sorting, encode the fifth syntax. The fifth syntax is used to indicate whether to perform the group sorting scheme.

[0397] In 2620, the candidate list may be grouped to obtain the at least two candidate groups.

[0398] After constructing the candidate list for the current block, the processor may group the candidate list to obtain the at least two candidate groups, enabling subsequent sorting of at least one candidate group, in an intra-group sort. This approach fully leverages the performance of template mining while further balancing complexity and performance.

[0399] More details regarding how to group the candidate list may be found in operation 2520 and related descriptions.

[0400] In some embodiments, different grouping schemes may serve as distinct sub-schemes, allowing the inclusion of a grouping syntax in a bitstream. Specifically, the encoding end may set up the grouping syntax in the bitstream of an image block, where the value of a grouping syntax indicates the grouping scheme selected for the image block. Correspondingly, the decoding end may decipher the grouping syntax of the current block; determine a grouping scheme of the candidate list based on the value of the grouping syntax; and utilize the grouping scheme to group the candidate list to obtain the at least two candidate groups.

[0401] For the current block, the processor may determine the grouping scheme of the candidate list for the current block based on a plurality of grouping schemes. In some embodiments, the processor may select a predefined grouping scheme from the plurality of grouping schemes as the grouping scheme of the candidate list for the current block. In other embodiments, the processor may determine the grouping scheme of the candidate list for the current block based on how the candidate list is constructed. For example, the candidate list includes candidates obtained using a plurality of acquisition manners, and the processor may group the candidate list based on the acquisition manners of the candidates in the candidate list. As another example, the candidate list includes candidates obtained using only one acquisition manner, and the processor may group the candidate list based on the order of the candidates in the candidate list.

[0402] In 2630, candidates in each group of at least one of the at least two candidate groups may be sorted, in the intra-group sort, based on fourth template costs of the candidates in the candidate list, and / or, the at least two candidate groups may be sorted, in an inter-group sort, to obtain the sorted candidate list.

[0403] More details regarding sorting the candidate group may be found in operation 2520 and related descriptions.

[0404] In 2640, the current block may be decoded based on the sorted candidate list.

[0405] Specific details may be found in operation 2530, and will not be repeated here.

[0406] FIG. 27 is an exemplary flowchart illustrating a process for encoding and decoding based on intra-block copy according to some embodiments of the present disclosure. The method of the present embodiment is applied to a decoding end.

[0407] In some embodiments, process 2700 is executed by a processor. As shown in FIG. 27, the process 2700 includes the following operations.

[0408] In 2710, in response to receiving a bitstream from an encoding end, block vector index information corresponding to a current block of an image to be decoded in the bitstream may be obtained, the image to be decoded including a current block to be decoded and one or more decoded image blocks.

[0409] A specific process of decoding processing at the decoding end may include decoding relevant syntax representing a BV from the bitstream to obtain the block vector index information.

[0410] The block vector indexing information refers to index information used to locate a block vector, and a specific type of the index information may include one or more types, which will not be discussed herein. It should be noted that syntax decoding may yield data such as macroblock type and quantization parameters. In the present disclosure, additional types of data may also be transmitted by designing syntax, meaning that more information may be obtained from the bitstream, which will not be discussed here. The decoding end performs operations in response to various syntactic information decoded from the bitstream (aresult of decoding syntax in the bitstream) .

[0411] The image to be decoded refers to an image that is currently to be decoded at the decoding end. In some embodiments, the image to be decoded may include the current block to be decoded and the one or more decoded image blocks.

[0412] In 2720, a block vector candidate list may be constructed based on block vectors of reference blocks in the image to be decoded, the block vector candidate list including candidate block vectors, the reference blocks being determined in the one or more decoded image blocks based on the current block.

[0413] In a prediction process of image decoding, the processor may use image information of a decoded block in an image (e.g., a luminance value, a chrominance value, etc., in a YUV color mode) as a predicted value of a block to be decoded in the image. This is equivalent to using the decoded block as a reference block for the block to be decoded within the same image. Typically, a plurality of adjacent decoded blocks surrounding the current block may be selected as the reference blocks. The selection of the reference blocks may be implemented in any feasible manner, which will not be described further here.

[0414] In some embodiments, during the encoding and decoding process, since the current block may have a plurality of reference blocks, meaning that a single current block may correspond to a plurality of candidate block vectors (BVP candidates) , these BVP candidates are stored in an established BVP candidate list. Therefore, a syntax needs to include a bvpIdx syntax to indicate which specific BVP in the list is selected as a final BVP to be used for reconstructing the current block.

[0415] In the present disclosure, the processor may construct a list based on the block vector (BV) of the reference block. The reference block may be a decoded block in the image to be decoded that is adjacent or similar to the current block, etc., and is not limited here. That is, the block vector candidate list (or a block prediction vector candidate list, a BVP candidate list) for the current block is constructed based on the BVs of previously decoded blocks (the reference blocks) that have been predicted using an intra block copy (IBC) mode. The list is commonly referred to as a history block prediction vector (HBVP) list. So, the BVP stored in the BVP candidate list of the present disclosure may be from the HBVP list. During a list construction process described in the present disclosure, the HBVP list may be traversed, and the block vectors of each reference block in the HBVP list may be populated into a newly created block vector candidate list (aBVP candidate list) for the current block.

[0416] In some embodiments, the current block may be efficiently encoded or decoded during the coding and decoding process by selecting a predicted value from the BVP candidate list that best fits the current block in combination with some additional information, such as residual data. Exemplarily, for a complete video decoding and decoding process, the encoding end generates the BVP candidate list and selects an optimal BVP as the predicted value of the block vector for the current block. The encoding end then encodes a difference between the block vector and the predicted value of the current block (i.e., a residual value) and a BVP index (indicating which BVP predicted value in the list has been selected) , into a bitstream, which is sent as the bitstream to the decoding end. During the decoding process, the decoding end receives the information and recovers the block vector of the current block from the BVP candidate list constructed by the decoding end, thereby reconstructing the current block.

[0417] In some embodiments, a list construction process of the present disclosure may use common list construction manners and / or use customized list construction manners of the present disclosure. The decoding end may determine the specific manner selected by the encoding end in the encoding process by using relevant syntactic information decoded in the bitstream. The common list construction manners may be as follows: constructing a BVP candidate list with a length of seven, where each position in the BVP candidate list represents a BVP category; first, populating the newly created BVP candidate list categorized by type based on the HBVP list; then, for any unfilled categories in the BVP candidate list, populating based on spatial candidates of the current block; if the corresponding spatial candidates do not exist, continuing to populate the list based on the HBVP.

[0418] The specific process of constructing the BVP candidate list is as follows.

[0419] S1: category filling based on HBVP: by traversing the HBVP list in reverse order, filling the newly created BVP candidate list with candidates of each category in the following sequence. If the BVP candidate list already contains BVs of the same type, the subsequently encountered BV will replace the earlier one of the same type and be stored in the BVP candidate list.

[0420] The BVP candidate list may be represented by an array BVP_cands, with zero to six being the indexes bvpIdx of the BVP in the corresponding position.

[0421] (1) BVP_cands [0] holds the BVs of the reference blocks with W*H (width*height) >32 in the HBVP list.

[0422] (2) BVP_cands [1] holds the BVs that have more than two occurrences of the same BV in the HBVP list.

[0423] (3) BVP_cands [2] holds the BVs of blocks located to the left of the current block in the HBVP list.

[0424] (4) BVP_cands [3] holds the BVs of blocks in the HBVP list that are on the upper side of the current block.

[0425] (5) BVP_cands [4] holds the BVs of blocks in the HBVP list that are located to the upper left of the current block.

[0426] (6) BVP_cands [5] holds the BVs of blocks in the HBVP list that are located to the upper right of the current block.

[0427] (7) BVP_cands [6] holds the BVs of blocks in the HBVP list that are located to the lower left of the current block.

[0428] The BVs that meet the aforementioned conditions may or may not exist, so a count of BVs filled into the BVP candidate list may vary. In practice, a flag cnt_hbvp_cands may be used to represent a count of valid BVs filled into the BVP candidate list, which also indicates the count of valid BVPs populated into the BVP candidate list. The valid BVP refers to a BVP where at least one of an x-component and a y-component is not equal to zero.

[0429] S2: spatial candidate filling: for categories in the BVP candidate list that are not filled by the HBVP, filling based on the spatial candidates in the current block.

[0430] The positions of the spatial candidate may be referenced as shown in FIG. 28. FIG. 28 is an exemplary schematic diagram illustrating a process for filling spatial candidates in encoding and decoding based on intra-block copy according to some embodiments of the present disclosure.

[0431] If a current frame to be decoded is an I-frame, the spatial non-adjacent block is used, and if it is not an I-frame, the spatial adjacent block is used, as follows:

[0432] (1) if the index bvpIdx is even, using a left-side spatial candidate A (when not in the I-frame) or A′ (when in the I-frame) ;

[0433] (2) if the index bvpIdx is odd, using an upper-side spatial candidate B (when not in the I-frame) or B′ (when in the I-frame) .

[0434] The spatial candidates are restricted to be in a same coding tree unit (CTU) as the current block, the adjacent block candidates (when not in the I-frame) are restricted to be in a skip prediction (SP) mode, and the non-adjacent block candidates (when in the I-frame) are restricted to be in an IBC mode or a SP mode.

[0435] The I-frame refers to a type of frame in video coding, also known as a keyframe. The I-frame is independently encoded frame that does not depend on other frames (e.g., forward or backward reference frames) for decoding. The spatial non-adjacent block refers to a decoded block that is not directly adjacent to the current block in the current frame; the spatial adjacent block refers to a decoded block that is directly adjacent to the current block in the current frame. The left-side spatial candidate refers to a decoded block to the left of the current block; the upper-side spatial candidate refers to a decoded block above the current block.

[0436] The specific positions of the spatial candidates may be found in Table 3 below. Table 3 Specific positions of spatial candidates

[0437] S3: ordinary filling based on HBVP: if the corresponding spatial candidate does not exist, then continuing to fill based on HBVP, a filling process is as follows:

[0438] (1) if bvpIdx is less than the count of HBVPs, the candidate at that position is the hbvpNum% (bvpIdx+1) th HBVP candidate; hbvpNum is the count of HBVPs.

[0439] (2) otherwise, ifbvpIdx is greater than or equal to the count of HBVPs, the candidate at that position is a first HBVP candidate.

[0440] Additionally, an IBC prediction mode supports an adaptive block vector resolution (ABVR) technique. When a current IBC is the IBC prediction mode under screen content, it may support two pixel precisions for the BV: 4-pel and 1-pel. The BV precision may be indicated by a syntax element abvr_idx. However, an ABVR technique is not supported for the IBC prediction mode in natural video sequences.

[0441] The ABVR technique is a technique used in video encoding to optimize the representation and transmission of motion vectors by dynamically adjusting the precision (i.e., resolution) of the motion vectors to reduce a count of coded bits while ensuring the video quality, thus improving the compression efficiency.

[0442] The above descriptions primarily illustrate an implementable process for constructing a BVP candidate list using common list construction manners. However, by employing the customized list construction manner described in the present disclosure, it is possible to construct a BVP candidate list with a length that differs from the BVP candidate lists constructed using common manners. Additionally, the strategy for adding BVP candidates (candidate block vectors) to the BVP candidate lists may also be optimized and adjusted. Further details and examples of these manners will be provided in the subsequent sections of this document.

[0443] In 2730, one or more target candidate block vectors may be determined from the candidate block vectors of the block vector candidate list based on the block vector index information of the candidate block vectors.

[0444] The target candidate block vectors are used to characterize a motion relationship between the current block and a corresponding block in the reference frame, which is determined during the encoding process and transmitted to the decoding end via the bitstream.

[0445] At the decoding end, based on the block vector index information bvpIdx decoded and obtained from the bitstream, a corresponding target BVP candidate, i.e., the target candidate block vector, may be located from the constructed BVP candidate list using indexing techniques. This target BVP candidate is already determined during the encoding process at the encoding end. Subsequently, an index position of the target BVP candidate in the BVP candidate list constructed at the encoding end is encoded into the bitstream for transmission.

[0446] Thus, accordingly, the decoding end, after decoding the block vector index information obtained, is able to perform a corresponding index lookup from the BVP candidate list created by the decoding end to obtain the target BVP candidate.

[0447] In 2740, one or more offsets of the one or more target candidate block vectors may be adjusted using a predefined offset adjustment strategy to obtain one or more adjusted candidate block vectors.

[0448] The offset adjustment strategy is a technique used in video encoding to optimize residual block transformation and quantization. The offset adjustment strategy may reduce the error in the transformation and quantization process by adjusting an offset value of the residual block, thus improving the encoding efficiency and video quality. The predefined offset adjustment strategy may be predefined by staffbased on experience.

[0449] The purpose of using the offset adjustment strategy is to determine a BVP offset to offset adjust the BVP so that a more accurate BVP may be determined.

[0450] In some embodiments, the processor′s adjustment of candidate block vectors may involve applying the predefined offset adjustment strategy to each BVP candidate (the candidate block vector) in the BVP candidate list, including at least one of directional offsets or distance offsets. This process may generate additional BVP candidates (adjusted candidate block vectors) , thereby enabling the determination of a more accurate BVP in subsequent operations. This approach goes beyond merely filtering BVPs within the BVP candidate list and takes into account other referenceable regions that might otherwise be overlooked.

[0451] Exemplarily, a mathematical expression of the BVP offset adjustment may be expressed by the following formula (7) : BVPf = BVPs + Offset (7) wherein, BVPs denotes an unoffset adjusted BVP, BVPf denotes an offset adjusted BVP, and Offset  denotes an offset of the BVP. It should also be noted that the process of determining the Offset may be divided into two parts, an offset mode and offset determination. The offset mode refers to data that indicates the manner in which the BVP candidate is allowed to perform the offset, e.g., retaining the offset in direction and / or distance, etc.; the offset determination refers to a process of determining a final offset position from several offset positions of the process.

[0452] More details regarding the offset adjustment strategy and how to adjust the one or more offsets of the one or more target candidate block vectors may be found in other contents of the present disclosure (e.g., description in connection with FIG. 33) .

[0453] In 2750, a target block vector may be determined among the one or more target candidate block vectors and / or the one or more adjusted candidate block vectors; and a predicted block corresponding to the current block may be determined based on the target block vector.

[0454] Explained in conjunction with the foregoing operations, there exists an image block that is most similar to the current block in the reference block corresponding to the target candidate block vector and / or in the reference block corresponding to the adjusted candidate block vector, and a block vector between the image block and the current block may be referred to as the target block vector. The processor therefore needs to determine the target block vector among the target candidate block vectors and / or the adjusted candidate block vectors.

[0455] The reference block pointed to by the target block vector is also the decoded image block most similar to the current block. The current block is used as the base, and the reference block pointed to by the target block vector is used as the predicted block of the current block, then the current block may be reconstructed based on the image information of the predicted block, and then a decoded current block is obtained.

[0456] As illustrated in conjunction with the preceding operations, after determining the target BVP candidate, the processor is further capable of determining corresponding one or more offset-adjusted BVPs (the adjusted candidate block vectors) based on the target BVP candidate by an offset adjustment manner. That is, the processor may determine a first reference block corresponding to the current block based on the BVP candidate, and determine a second reference block corresponding to the current block based on the offset-adjusted BVP. The second reference block is essentially obtained by applying an offset adjustment to the first reference block. Therefore, by analyzing differences between the reference blocks and the current block, for example, comparing adjacent pixels of the reference blocks with adjacent pixels of the current block, the target reference block most similar to the current block may be determined from the reference blocks. This also means that the BVP corresponding to the target reference block may be determined, thereby obtaining the target block vector.

[0457] In a specific implementation process, the processor may perform matching merely between the first reference block and the current block, or merely between the second reference block and the current block, or may perform matching between both the first reference block and the second reference block and the current block, which is not limited here.

[0458] On the basis of the above embodiments, embodiments of the present disclosure illustrate the operation of determining a target block vector by performing a lookup process among the one or more target candidate block vectors and / or the one or more adjusted candidate block vectors corresponding to the one or more target candidate block vectors. Specifically, the manner of the embodiment includes the following operations.

[0459] In response to a syntactic interpretation result of a bitstream, if the syntactic interpretation result indicates a block vector difference is received from the encoding end, the processor designates a sum of a looked-up candidate block vector and the block vector difference as the target block vector; if the syntactic interpretation result indicates no block vector difference is received from the encoding end, designates the looked-up candidate block vector as the target block vector.

[0460] The syntactic interpretation result refers to information obtained after syntactic parsing of the bitstream. The block vector difference refers to a difference used to represent the motion vectors in video encoding.

[0461] In the embodiment, it is primarily explained whether the process of determining the target block vector BV at the decoding end needs to be executed in a conventional manner (i.e., BV = BVP + BVD) . Specific related explanations may be found in aforementioned embodiments, which will not be reiterated here.

[0462] The execution manner at the decoding end depends on the syntactic interpretation result of the decoding end of the bitstream. In the encoding and decoding process described in the present disclosure, syntax related to the determination of BVD may be designed to selectively enable or disable the BVD. Specifically, it is necessary to refer to whether the encoding end encodes the BVD in the bitstream during the encoding process and transmits the BVD to the decoding end via the bitstream.

[0463] Specifically, in response to the syntactic interpretation result of the bitstream, if the syntactic interpretation result indicates the block vector difference is received from the encoding end, the sum of the looked-up candidate block vector (the target BVP candidate) and the block vector difference is designated as the target block vector; if the syntactic interpretation result indicates no block vector difference is received from the encoding end, the looked-up candidate block vector (the target BVP candidate) is designated as the target block vector. The looked-up candidate block vector refers to a BVP candidate (BVPs) that may be found correspondingly in the BVP candidate list using the block vector index information, and / or the candidate block vector (BVPf) determined after offset adjustment based on the BVP candidate (BVPs) found in the BVP candidate list.

[0464] It should be noted that, as previously explained in the examples, there may be a certain difference (BVD) between the predicted BVP and the actual BV. The encoding end may determine the BVD difference and transmit the BVD difference to the decoding end through the bitstream. Therefore, when determining the target block vector BV, the decoding end needs to combine the finally determined BVP candidate with the decoded BVD for analysis in order to obtain the target block vector BV of the current block. Therefore, in fact a mathematical expression of the process of determining the target block vector BV may be expressed by the following formula (8) : BV = BVP + BVD (8) wherein, the BVP may be the BV determined at the decoding end from the BVP candidate list and may be  the BV determined from the offset-adjusted BVP, and the BVD denotes the difference between the BVP and the BV. The BVP candidate list construction technique and the BVP offset adjustment technique may be understood in conjunction with the contextualized example descriptions of the present disclosure, and will not be repeated here.

[0465] For the determination of the BV, the encoding end may first identify the reference block that matches (is similar or identical to) the current block by performing block matching manners such as motion search or hash search in the image to be encoded. The block vector between the current block and the reference block is then determined as the target block vector BV (which is equivalent to the BV that yields the best image reconstruction effect, or a true BV) . Additionally, a block prediction vector BVP between the current block and the reference block needs to be obtained. The difference between the BV and the BVP is then determined, thereby determining the BVD, which is transmitted in the bitstream. Consequently, the decoding end may directly retrieve the BVD from the bitstream.

[0466] The above are common BVD determination techniques, which may or may not be used in the present disclosure, and are not limited here.

[0467] Furthermore, as explained in the previous embodiments, the BVP candidate list construction technique and the BVP offset adjustment technique designed in the present disclosure may make BVP prediction more accurate, thereby achieving BV=BVP. Therefore, in the present disclosure, there is no need to transmit the BVD by the encoding end, and the BV may be determined directly through the finally selected BVP.

[0468] In summary, by combining the BVP-related techniques provided in the present disclosure with common manners, the encoding end may choose to transmit the BVD or not in practical application scenarios, and notify the decoding end of the specific manner through syntax design. Therefore, in the present disclosure, the process for determining the BVD may include the following three schemes.

[0469] (1) BVD is present by default: BV is determined by BVP and BVD, i.e. BV=BVP+BVD.

[0470] (2) No BVD by default: BV is directly determined by BVP, i.e., BV=BVP.

[0471] (3) Adaptive BVD: When encoding and decoding different image blocks, the BVs of the different image blocks may be determined by BVP and BVD or BVs may be determined directly by BVP.

[0472] In the scheme of adaptive BVD, the exact manner to be used may be determined at the encoding end through rate-distortion optimization techniques, and the chosen manner is transmitted in the bitstream. At the decoding end, the manner of determining the BV may be directly decoded from the bitstream.

[0473] In some embodiments, the decoding end, upon receiving the bitstream sent by the encoding end, may obtain the block vector index information corresponding to the current block of the image to be decoded in the bitstream by a syntactic decoding processing technique; perform a list construction process based on the block vectors of each reference blocks in the image to be decoded to obtain the block vector candidate list; then adjust the one or more offsets of the one or more target candidate block vectors using the predefined offset adjustment strategy to obtain the one or more adjusted candidate block vectors; use the block vector index information transmitted from the encoding end to search among the candidate block vectors and the adjusted candidate block vectors to obtain the target block vector; and determine, based on the target block vector, the predicted block corresponding to the current block among the decoded image blocks of the image to be decoded. Therefore, the image information of the predicted block may be used as predicted image information of the current block, and image reconstruction of the current block based on the predicted block is realized.

[0474] In some embodiments of the present disclosure, the list construction manner is more flexible, and it also allows for offset adjustments to the candidate block vectors in the list. This ensures that the reference data for determining the predicted block of the current block is more comprehensive, thereby improving the accuracy of image reconstruction.

[0475] FIG. 29 is an exemplary schematic diagram illustrating a chaining process for decoding and encoding based on intra-block copy according to some embodiments of the present disclosure.

[0476] On the basis of the above embodiments, embodiments of the present disclosure illustrate the operation of constructing a block vector candidate list based on block vectors of reference blocks in the image to be decoded. Specifically, the manner of the present embodiment includes the following operations: constructing a to-be-filled list; obtaining a block vector candidate list by selecting candidate block vectors from block vectors of reference blocks and filling the candidate block vectors into the to-be-filled list based on a predefined list filling strategy.

[0477] As illustrated in connection with the foregoing embodiments, the manner of list construction processing in the present disclosure may be a manner that refers to an existing BVP candidate list construction manner, a manner for constructing a BVP candidate list provided in the present disclosure, or a manner that combines the existing manner with the method provided in the present disclosure (e.g., part of a encoding and decoding process adopts the existing manner, and part of the encoding and decoding process adopts the manner provided in the present application) . With respect to the existing BVP candidate list construction manners, which have been described in the foregoing embodiments, the present embodiments mainly illustrate the BVP candidate list construction manners provided herein by way of example.

[0478] The predefined list filling strategy refers to a strategy for selecting BVPs to be filled into a BVP candidate list, as described below. The predefined list filling strategy may be set by a staff member based on experience.

[0479] Exemplarily, the processor may construct a BVP candidate list of length N (N>=1) , add BVP candidates to the list in a predefined order from M (M>=1) types of BVP candidates, where each type may add Im (Im>=1, m= {1, 2, ..., M} ) BVP candidates. The types of the BVP candidates may include, but are not limited to the following four types.

[0480] (1) BVP candidates based on constant predefined position: a predefined reference position is used as a BVP candidate, and the predefined reference position is a constant. For example, for a current block, the processor directly sets predefined constant vectors (-1, -1) , (-2, -2) , etc., as the BVP candidates. The constant predefined position and the predefined reference position may be set by staff based on experience.

[0481] (2) BVP candidates based on block adaptive predefined position: the predefined reference position is used as the BVP candidate, the predefined reference position is a value related to size information such as a width and a height of the current block. For example, the width*height of the current block is w*h, the BVP candidate based on the block adaptive predefined position may be set as (-w, -h) , (-2w, -2h) , etc., which will not be discussed here.

[0482] (3) Candidates based on HBVP categories: HBVP candidates are obtained in a predefined order, and BVs in the HBVP candidates are classified to derive BVP candidates. The category rules include, but are not limited to, reference block size (w*h) , BV frequency (a count of times a same BV appears in the HBVP list) , positions relative to the reference block (bottom-left, left, top-left, top, top-right) , etc. For specific details, refer to the examples provided in the preceding embodiments.

[0483] (4) Spatial BVP candidates: BV information of adjacent or non-adjacent coded and decoded blocks in the spatial is used as a BVP candidate, which may be described in the same way with reference to the example description of the preceding embodiments. Among them, since some of the technical solutions in the present disclosure may be similarly applied to both the encoding end and the decoding end, for ease of explanation, the term 'encoded / decoded block' (encoding / decoding block) mentioned in the present disclosure refers to either an 'encoded block' (encoding block) or a 'decoded block' (decoding block) , depending on the context of the encoding end or the decoding end. Similarly, the term 'current block' is used as a general term to refer to either the current block to be encoded in the encoding end or the current block to be decoded in the decoding end.

[0484] Exemplarily, the above content provides four list filling strategies. In practical application scenarios, the order in which the list filling strategies are applied in the BVP candidate list is not restricted. For example, the BVP candidate list may be filled according to (3) first; if the BVP candidate list is not filled after the execution of the policy corresponding to (3) is completed, it may be filled according to (4) ; similarly, if the BVP candidate list is not filled after the execution of the policy corresponding to (4) is completed, the BVP candidate may be selected to be filled according to (1) or (2) . Alternatively, it may be in the predefined order of (1) , (2) , (3) , (4) or some other order, without qualification here.

[0485] Based on the above embodiments, embodiments of the present disclosure further illustrate the list filling process. Specifically, the present disclosure also provides ways to optimize the BVP candidate list.

[0486] Exemplarily, the processor may selectively decide whether to perform chaining process on the BVP candidates to be filled into the list during the list filling process. The chaining process may newly generate more BVPs to increase the likelihood of more predictions, allowing for increased accuracy of subsequent predictions. If the already encoded / decoded block at the reference position pointed to by the BVP candidate is in IBC mode, the reference position pointed to by the already encoded / decoded block at the reference position of the BVP candidate may be used as a new BVP candidate. The mathematical expression of the chaining process may be represented by the following formula (9) : BVPfinal = BVPstart + BVPref  (9) wherein, BVPfinal denotes a BVP after the chaining process, BVPstart denotes a BVP candidate that has not  undergone BVP chaining process, and BVPref denotes a BV of the coded reference block pointed to by BVPstart. More details may be found in FIG. 7.

[0487] Additionally, since the already encoded / decoded block at the reference position after the chaining process may still be in the IBC mode, a maximum count of chaining iterations may be limited by setting a predefined maximum chaining count. For example, the processor may set the maximum chaining count to 1, meaning that for each BVP candidate, the chaining process is limited to a maximum of one iteration, or that all BVP candidates collectively are restricted to a total of only one chaining iteration, resulting in the scenario illustrated in FIG. 7.

[0488] On the basis of the above embodiments, embodiments of the present disclosure illustrate the operation of obtaining the block vector candidate list by selecting candidate block vectors from the block vectors of the reference blocks and filling the candidate block vectors into the to-be-filled list based on a predefined list filling strategy. Specifically, the manner of the embodiment includes the following operations: comparing a candidate block vector currently filled into the to-be-filled list with the candidate block vectors that have been filled into the to-be-filled list; in response to the to-be-filled list including a candidate block vector that is the same as the candidate block vector currently filled into the to-be-filled list, performing de-duplication on the to-be-filled list.

[0489] The de-duplication refers to a process of identifying and removing duplicate candidate block vectors during the filling process.

[0490] Described in connection with the foregoing embodiments, the manner of optimizing the BVP candidate list in the present disclosure may also include BVP candidate de-duplication process. Similar to the BVP chaining process, the BVP candidate de-duplication process is optionally performed or not performed.

[0491] In some embodiments, in the process of adding the BVP candidates to the list in a predefined order, the processor may determine whether the BVP candidate already exists in the BVP candidate list at the time of adding a current BVP candidate. If, when adding the current BVP candidate, there already exists the BVP candidate in the BVP candidate list, then it should be compared whether the current BVP candidate to be added is the same as the BVP candidate already present in the list. If the current BVP candidate to be added is the same as the BVP candidate already present in the list are the same, there is no need to add the current BVP candidate. In some embodiments, a comparison criterion for the BVP candidates may involve comparing with all existing BVP candidates or only comparing BVP candidates at specific positions. Additionally, the criteria for determining whether the BVP candidates are the same may include, but are not limited to, assessing whether horizontal components and vertical components of two BVP candidates are identical. For example, only comparing BVP candidates at specific positions includes: when adding a third BVP candidate to the BVP candidate list, one may choose to compare the third BVP candidate with both a first BVP candidate and a second BVP candidate in the list, or alternatively, compare the third BVP candidate only with either the first BVP candidate or the second BVP candidate. If the horizontal component and the vertical component of the two BVP candidates are the same, the two BVP candidates are determined to be the same.

[0492] On the basis of the above embodiment, embodiments of the present disclosure illustrate the operation of obtaining the block vector candidate list by selecting candidate block vectors from the block vectors of the reference blocks and filling the candidate block vectors into the to-be-filled list based on a predefined list filling strategy. Specifically, the manner of the embodiment includes the following operations: classifying the block vectors of the reference blocks to obtain a classification result; selecting, based on the classification result, the candidate block vectors to fill in the to-be-filled list from the block vectors of the reference blocks.

[0493] Explained in connection with the foregoing embodiments, the BVs of the reference block may be classified and processed according to one or more of the four list filling strategies in the foregoing embodiments to obtain the classification result.

[0494] The classification result includes a plurality of types, such as BVP candidates classified based on block adaptive predefined positions, candidates classified based on HBVP categories (size of coding blocks) , candidates classified based on HBVP categories (BV frequency) , candidates classified based on HBVP categories (relative to a left side of the coding block) , candidates classified based on HBVP categories (relative to a top side of the coding block) , candidates classified based on HBVP categories (relative to a top-left side of the coding block) , candidates classified based on HBVP categories (relative to a top-right side of the coding block) , candidates classified based on HBVP categories (relative to a bottom-left side of the coding block) , and BVP candidates classified based on spatial types, or the like, to construct the BVP candidate list. There is no limit to the order in which the plurality of types is in the BVP candidate list.

[0495] On the basis of the above embodiments, embodiments of the present disclosure illustrate the operation of classifying the block vectors of the reference blocks to obtain a classification result. Specifically, the manner of the embodiment includes the following operations: classifying the reference blocks based on block sizes of the reference blocks to obtain a size classification result; classifying the block vectors based on occurrence frequencies of the block vectors of the reference blocks to obtain a frequency classification result; and classifying the reference blocks based on positions of the reference blocks relative to the current block to obtain a position classification result; the selecting, based on the classification result, the candidate block vectors to fill in the to-be-filled list from the block vectors of the reference blocks includes: determining, based on the size classification result, a block vector of a reference block with a block size greater than a predefined size threshold as the candidate block vector; determining, based on the frequency classification result, a block vector with an occurrence frequency greater than a predefined frequency threshold as the candidate block vector; and determining, based on the position classification result, a block vector of a reference block that matches a corresponding position of the current block as the candidate block vector.

[0496] The predefined size threshold and the predefined frequency threshold may be set by the staff member based on experience; and matching means that the position of the reference block with respect to the current block is the same as or close to the corresponding position of the current block.

[0497] Explained in conjunction with the foregoing embodiments, the embodiment focuses on the process of classifying the block vectors (BVP candidates) of each reference block.

[0498] In some embodiments, during the classification process, common manners for constructing the BVP candidate list may be referenced, including at least classification based on the block size of each reference block, classification based on the occurrence frequency of each block vector in the block vectors of the reference blocks, and classification based on the position of the each reference block relative to the current block, or the like. The specific classification process is not described herein.

[0499] In some embodiments, selecting, based on the classification result, the candidate block vectors to fill in the to-be-filled list from the block vectors of the reference blocks may be performed in a plurality of ways. For example, the processor may determine a filling order of each type of BVP in the BVP candidate list according to the order described in the above example, and based on this order, a maximum count of BVP candidates that may be added (filled) for each type may be set. For example, a candidate count of 3, 1, 1, 1, 1, 1, 1, 1, and 3 indicates that in the BVP candidate list, a maximum of three BVP candidates determined based on block adaptive predefined positions may be added first, followed by one BVP candidate determined based on HBVP categories (size of a coding block) , then one BVP candidate determined based on HBVP categories (BV frequency) , or the like, up to three BVP candidates determined based on spatial type.

[0500] It should also be noted that if a list length of a newly constructed BVP candidate list is set to 10, then 10 BVP candidates need to be added to fill the BVP candidate list completely. Taking the above example as an illustration, if each type may determine the corresponding BVP candidates, then when filling the BVP candidate determined based on HBVP categories (relative to the bottom-left side of the coding / decoding block) into the list, the list has already been fully filled, and there is no need to fill in the BVP candidates determined based on the spatial type. On the contrary, if the corresponding BVP candidates may not be determined from certain types, resulting in this BVP candidate list not being filled completely, it is necessary to continue to get the BVP candidates in the predefined order to fill in the BVP candidate list.

[0501] On the basis of the above embodiments, embodiments of the present disclosure illustrate the operation of selecting, based on the classification result, the candidate block vectors to fill in the to-be-filled list from the block vectors of the reference blocks. The to-be-filled list includes a to-be-filled count. Specifically, the manner of the embodiment includes the following operations: in response to a count of candidate block vectors selected from the block vectors of the reference blocks being less than the to-be-filled count, determining one or more spatial reference blocks of the current block based on one or more predefined spatial positions; and sequentially filling, based on a predefined filling order for the one or more predefined spatial positions, block vectors of the one or more spatial reference blocks as candidate block vectors into the to-be-filled list.

[0502] The predefined filling order may be set by the staff based on experience.

[0503] This embodiment primarily illustrates that after filling the BVP candidate list with the candidate block vectors (BVP candidates) selected from the block vectors of each of the reference blocks based on the HBVP classification results, if the BVP candidate list is not fully filled (i.e., the count of BVP candidates used for filling is less than the list length of the to-be-filled list or the to-be-filled count) , it is necessary to continue acquiring additional BVP candidates through other manners to fill the list. For example, the one or more spatial reference block for the current block are determined based on the one or more predefined spatial position, and sequentially filling, based on the predefined filling order for the one or more predefined spatial positions, the block vectors of the one or more spatial reference blocks as the candidate block vectors are sequentially filled into the to-be-filled list until the list is filled or the count of additions of that type of BVP candidate reaches a predefined count threshold (e.g., three in the preceding example) .

[0504] On the basis of the above embodiments, embodiments of the present disclosure illustrate the operations of constructing a block vector candidate list based on block vectors of reference blocks in the image to be decoded. Specifically, the manner of the embodiment includes the following operations: constructing an initial block vector candidate list based on the block vectors of the reference blocks, the initial block vector candidate list including initial candidate block vectors; determining a pixel cost between the current block and each of the reference blocks based on one or more adjacent pixels of the current block and one or more adjacent pixels of a reference block corresponding to each of the initial candidate block vectors; and rearranging the initial candidate block vectors in the initial block vector candidate list based on the pixel costs to obtain the block vector candidate list.

[0505] The cost determination refers to a process of quantifying pixel differences between the current block and the reference block through a certain cost function. The cost function may include sum of absolute differences (SAD) , sum of squared errors (SSE) , etc. The pixel cost refers to a value of the specific difference between the current block and the reference block determined by the cost function.

[0506] Described in connection with the foregoing embodiments, the manner of optimizing the BVP candidate list in the present disclosure may also include BVP candidate rearranging process. Similarly, the BVP candidate rearranging process is optionally performed or not performed.

[0507] The BVP candidate rearranging process refers to a process of rearranging the order of BVP candidates within the BVP candidate list, thereby reducing syntax overhead. A BVP candidate list that is not rearranged may be noted as an initial block vector candidate list, and the BVP candidates included therein may be noted as initial candidate block vectors. After the rearrangement, the BVP candidate list may then be identified as the block vector candidate list, and the BVP candidates included therein are also the candidate block vectors.

[0508] Exemplarily, in the present disclosure, the BVP candidate rearranging process is based on a ninth template cost to sort the BVP candidates in the list, which may be found in FIG. 6.

[0509] The ninth template cost refers to data used to measure similarity between a current CU and the reference block in adjacent pixel regions. The adjacent pixel regions serving as templates may include, but are not limited to, only the left adjacent pixels, only the top adjacent pixels, the left and top adjacent pixels, the left, top, and top-left comer adjacent pixels, and other regions. The process of determining the ninth template cost may be described as follows: using adjacent pixels of the current CU as a reconstruction template, and using adjacent pixels of the reference block pointed to by each BVP candidate as a reference template, determining the ninth template cost by comparing the reconstruction template with each reference template, then, sorting the BVP candidates in the list based on the ninth template cost corresponding to each BVP candidate. Determination manners for the ninth template cost may include, but is not limited to, determining a SAD, a SATD, a mean squared error (MSE) , etc. Specifically, the BVP candidates with smaller ninth template costs may be arranged earlier in the list (similar to a priority sorting approach) . In some embodiments, to simplify the BVP candidate list, a rearranged candidate list may retain only a predefined count of BVP candidates, thereby reducing syntactic overhead. For example, if there are ten BVP candidates in the list prior to the rearrangement, there may be eight BVP candidates in the rearranged candidate list where the ninth template cost is less.

[0510] Based on the above embodiments, embodiments of the present disclosure provide additional optimizations to optimize the list filling process. Specifically, the present disclosure may perform precision processing on the BVPs in the BVP candidate list to achieve precision optimization.

[0511] Similarly, the precision processing of BVP candidates is optional in the present disclosure. Precision processing manners include but are not limited to fixed precision, multi-precision, etc. The precision refers to pixel precision of the BV representation.

[0512] Exemplarily, (1) fixed precision: processing the BVP candidate to a predefined precision. (2) Multi-precision: providing a set of a plurality of precisions (for example, the precisions predefined for the BVP candidates may be {4-pel, 1-pel, 1 / 2-pel} , and selecting an appropriate precision from the plurality of precisions to process the BVP candidates. The 'pel' refers to a pixel unit, meaning a BVP may represent 4 pixels, 1 pixel, or 1 / 2 pixel. The specific precision processing manner may select a target BV precision at the encoding end through rate-distortion optimization techniques (for example, by determining the pixel cost at each pixel precision through rate-distortion and choosing the precision with a minimum pixel cost as the target precision) . At the decoding end, the target BV precision may be determined based on a precision index transmitted from the encoding end.

[0513] On the basis of the above embodiments, the embodiment is illustrated by way of example in conjunction with each of the foregoing embodiments and substituting specific implementable scenarios.

[0514] Example 1:

[0515] (1) BVP candidate list construction: following the existing manner for constructing BVP candidate list, a BVP candidate list with a length of seven is constructed, and BVs from the HBVP list are filled into the BVP candidate list. For example, a constructed BVP candidate list is {bvp1, bvp2, bvp3, bvp4, bvp5, bvp6, bvp7} .

[0516] It should be noted that the optimization manner involving chaining process may not be enabled in this example for the time being.

[0517] (2) BVP candidate de-duplication: during the construction of the BVP candidate list, each time a BVP candidate is added to the candidate list, it is necessary to check all existing BVP candidates in the candidate list for deduplication. That is, when adding bvp2, it is compared with bvp 1; when adding bvp3, it is compared with at least one of bvp1 or bvp2, or the like. For example, after de-duplication, the BVP candidate list becomes {bvp1, bvp2, bvp4, bvp5, bvp6} , and bvp3 and bvp7 are removed due to the presence of duplicate BVP candidates.

[0518] (3) BVP candidate rearrangement: as shown in FIG. 30, FIG. 30 is an exemplary schematic diagram illustrating a pixel template in a process for encoding and decoding based on intra-block copy according to some embodiments of the present disclosure. The shaded region represents the pixel template of the current block or the reference block, while the white region represents the current block or the reference block. Using reconstructed pixels in the four rows and four columns surrounding the current block as a current template, and reconstructed pixels in the four rows and four columns surrounding the reference position pointed to by the BVP candidate as a reference template, the ninth template cost (e.g., the SAD) is determined between the current template and the reference template. Assuming the ninth template costs corresponding to a deduplicated candidate list {bvp1, bvp2, bvp4, bvp5, bvp6} are {40, 30, 50, 70, 10} , a reordered BVP candidate list may arrange the BVP candidates in the following sequence: {bvp6, bvp2, bvp1, bvp4, bvp5} .

[0519] Example 2:

[0520] (1) BVP list construction: According to the list construction manner described earlier in the present disclosure, a new BVP candidate list is constructed with a length of ten. The BVP candidate list is constructed in the following order: BVP candidates based on block-adaptive predefined positions, candidates based on HBVP categories (codec block size) , candidates based on HBVP categories (BV frequency) , candidates based on HBVP categories (relative to the left side of the codec block) , candidates based on HBVP categories (relative to the top side of the codec block) , candidates based on HBVP categories (relative to the top-left of the codec block) , candidates based on HBVP categories (relative to the top-right of the codec block) , candidates based on HBVP categories (relative to the bottom-left of the codec block) , and spatial BVP candidates. A maximum count of BVP candidates added for each type is 3, 1, 1, 1, 1, 1, 1, 1, and 3, respectively.

[0521] The BVP candidates based on the block-adaptive predefined positions may be illustrated in FIG. 31. FIG. 31 is an exemplary schematic diagram illustrating a BVP candidate based on block adaptive predefined positions in a process for encoding and decoding based on intra-block copy according to some embodiments of the present disclosure. In this example, there are a total of eight block-adaptive predefined positions, as shown by shaded regions in FIG. 31 (cux, cuy, cuw, and cuh represent a horizontal coordinate, a vertical coordinate, a width, and a height of a coding unit (current block) in the image, respectively) . The order of addition is indicated by numbered labels in FIG. 31. If a count of BVP candidates of the type in the BVP candidate list reaches three, the processor may no longer add the BVP candidates of the type. It should be understood that the BVP candidates of the type may be block vectors obtained by subtracting the predefined positions from a current CU position.

[0522] The manner for determining BVP candidates based on HBVP categories may include the following: candidates based on HBVP categories (codec block size) : traversing the HBVP candidate list in reverse order, if the condition (cuw*cuh>32) is satisfied, adding the HBVP candidate to the BVP candidate list; candidates based on HBVP categories (BV frequency) : traversing the HBVP candidate list in reverse order, if the HBVP candidate appears more than twice, adding the HBVP candidate to the BVP candidate list; candidates based on HBVP categories (relative to the left side of the codec block) : traversing the HBVP candidate list in reverse order, if the HBVP candidate is located to the left of the current block, add the HBVP candidate to the BVP candidate list; candidates based on HBVP categories (relative to the top side of the codec block) : traversing the HBVP candidate list in reverse order, if the HBVP candidate is located above the current block, add the HBVP candidate to the BVP candidate list; candidates based on HBVP categories (relative to the top-left of the codec block) : traversing the HBVP candidate list in reverse order, if the HBVP candidate is located to the top-left of the current block, add the HBVP candidate to the BVP candidate list; candidates based on HBVP categories (relative to the top-right of the codec block) : traversing the HBVP candidate list in reverse order, if the HBVP candidate is located to the top-right of the current block, add the HBVP candidate to the BVP candidate list; candidates based on HBVP categories (relative to the bottom-left of the codec block) : traversing the HBVP candidate list in reverse order, if the HBVP candidate is located to the bottom-left of the current block, add the HBVP candidate to the BVP candidate list.

[0523] Additionally, the spatial BVP candidates may be illustrated in FIG. 32. FIG. 32 is an exemplary schematic diagram illustrating a position based on a spatial BVP candidate in a process for encoding and decoding based on intra-block copy according to some embodiments of the present disclosure. In the embodiment, there are a total of five positions of the spatial BVP candidate, as shown by shaded region in FIG. 32, and the order of adding each candidate is indicated by numbered labels in FIG. 32. If the CU corresponding to a position of the candidate is in IBC mode, the BV of the CU may be used as the spatial BVP candidate. Similarly, if the count of added BVP candidates of the type reaches three, no more BVP candidates of the type are added.

[0524] In some embodiments, since the length of the BVP candidate list is ten, if the count of BVP candidates added during a BVP candidate addition process has already reached ten, there is no need to perform any other BVP candidate addition operations.

[0525] (2) BVP chaining process: if the reference block pointed to by an added BVP candidate is in IBC mode, the BVP candidate may undergo chaining process as shown in FIG. 31. This embodiment may limit each BVP candidate to perform at most only one chaining process or limit all BVP candidates in total to perform at most only one chaining process.

[0526] (3) BVP candidate de-duplication: during the construction of the BVP list, each subsequently added BVP candidate needs to be checked for duplicates against all existing BVP candidates in the BVP candidate list, if the BVP candidate to be added is found to be identical to any candidate already in the BVP candidate list, the duplicate BVP candidate may not be added.

[0527] (4) BVP candidate rearrangement: the candidates are sorted based on the ninth template costs, following the same candidate reordering process as described in Example 1, which will not be reiterated here.

[0528] (5) BVP precision processing: a set of precision allowed for BVP candidate use is {4-pel, 1-pel, 1 / 2-pel} . At the encoding end, the optimal BV precision may be selected using rate-distortion optimization techniques, and a precision index corresponding to the optimal BV precision within a precision set is encoded into the bitstream and transmitted to the decoding end. At the decoding end, the optimal BV precision may be determined by decoding the precision index from the precision set. The precision index information is also considered block vector index information.

[0529] FIG. 33 is an exemplary schematic diagram illustrating offset processing for encoding and decoding based on intra-block copy according to some embodiments of the present disclosure.

[0530] On the basis of the above embodiments, embodiments of the present disclosure illustrate the operation of adjusting one or more offsets of the one or more target candidate block vectors using a predefined offset adjustment strategy to obtain one or more adjusted candidate block vectors. The predefined offset adjustment strategy includes an offset mode and an offset determination mode, the offset determination mode includes a template determination mode. Specifically, the manner of the embodiment includes the following operations: performing offsetting on each of the one or more target candidate block vectors based on the offset mode to obtain an offset candidate block vector, the offset mode including directional offsetting and / or distance offsetting; determining one or more offset reference blocks corresponding to a current block based on the one or more offset candidate block vectors; determining, based on the template determination mode, an offset cost between the current block and each of the one or more offset reference blocks and / or a candidate reference block corresponding to the each target candidate block vector; determining, based on the one or more offset costs, a target reference block from the one or more offset reference blocks and / or the one or more candidate reference blocks; and designating a candidate block vector corresponding to the target reference block as an adjusted candidate block vector.

[0531] The offset mode includes the direction offsetting and / or the distance offsetting, the direction offsetting refers to a process of performing offsetting on the direction of the BVP candidate, distance offsetting refers to a process of performing offsetting on the distance of the BVP candidate. In a way of direction offsetting: the distance is a fixed offset distance, and the direction includes a plurality of predefined offset directions. In a way of distance offsetting: the direction is a fixed offset direction, the distance includes a plurality of predefined offset distances, and the predefined offset distances include but are not limited to fractional-pixel distances and integer-pixel distances. It is understood that the two ways of direction offsetting and distance offsetting may also be combined, i.e., the direction includes a plurality of predefined offset directions and the distance includes a plurality of predefined offset distances, which is not limited here.

[0532] Exemplarily, as illustrated in FIG. 33, after adjusting the BVP candidates according to the aforementioned implementable offset mode, offset-adjusted BVP candidates may be obtained, and based on these offset-adjusted BVP candidates, the corresponding offset-adjusted reference blocks (offset reference blocks) may be determined.

[0533] Further, after the offset processing by the offset mode, then offset determination mode is required. The offset determination mode may include template-based offset determination and index-based offset determination. In specific implementations, the two modes may be implemented in either one or both coexisting implementations, which are not limited herein.

[0534] In a process of the template-based offset determination, a determination process of the ninth template costs from the BVP candidate rearrangement may be similarly referenced. To differentiate determination operations of the ninth template costs across different scenarios, in the embodiment, the determined ninth template cost is referred to as the offset cost. Under a given offset mode, an offset result is determined based on the offset cost (the ninth template cost) , the offset result is an offset-adjusted BVP candidate with the lowest ninth template cost among several offset-adjusted BVP candidates. The template definition here is similar to that in the BVP candidate rearrangement: a reconstruction template consists of adjacent reconstructed pixels of a current CU; a reference template consists of adjacent reconstructed pixels of a reference block pointed to by the offset-adjusted BVP candidate. The ninth template cost is a cost between the reconstruction template and the reference template, and the manner for determining the cost may include, but are not limited to, SAD, SATD, MSE, etc. Consequently, a processor may determine the target reference block matching the current block (e.g., the reference block most similar to the current block or the reference block identical to the current block) based on the ninth template cost and identify the candidate block vector (BVP candidate) corresponding to the target reference block as the adjusted candidate block vector (adjusted BVP candidate) .

[0535] Taking FIG. 33 as an example for illustrative explanation, the offset mode may involve offsetting in both direction and distance. The darkest block in the center represents a position of the reference block pointed to by the target BVP candidate determined based on the index information, while the lighter block represents a position of the reference block pointed to by the target BVP candidates after offset adjustment. The innermost layer may be set to a 1-pixel distance, and the outermost layer to a 32-pixel distance. The predefined offset directions include {horizontal left, diagonal up, vertical up, anti-diagonal up, horizontal right, diagonal down, vertical down, anti-diagonal down} , totaling eight directions. The predefined offset distances include {1, 2, 4, 8, 16, 32} , totaling six offset distances, with the unit of distance being pixels.

[0536] Therefore, during the template-based offset determination process, the processor may determine eight directions*six distances=48 offset BVP reference blocks (reference blocks corresponding to the adjusted candidate block vectors) and / or unoffset BVP reference blocks (reference blocks corresponding to the target candidate block vectors) relative to the ninth template cost of the current block (for specific details, refer to the aforementioned example explanation, which primarily involves comparing adjacent pixels of each reference block with adjacent pixels of the current block) , from which the BVP candidate with the lowest ninth template cost is selected as the offset result. For example, the unoffset BVP candidate is (-16, -10) . The offset candidate with the lowest ninth template cost is determined to be horizontally offset to the left with an offset distance of eight. Therefore, the offset result (the offset BVP candidate) is (-24, -10) . Here, the vector representation is based on the position of the current block (horizontal position of the current block minus horizontal position of the reference block, vertical position of the current block minus vertical position of the reference block) . Since the template-based offset determination mode may be performed during both encoding and decoding, there is no need to transmit syntax elements. Only the index-based offset determination mode requires that relevant index information be coded into a syntax and transmitted to a decoding end via a bitstream. The lookup is performed at the decoding end after decoding the relevant index information from the bitstream.

[0537] On the basis of the above embodiments, embodiments of the present disclosure illustrate the operations of determining, based on the template determination mode, an offset cost between the current block and each of the one or more offset reference blocks and / or a candidate reference block corresponding to the each target candidate block vector, and the operations of determining, based on the one or more offset costs, a target reference block from the one or more offset reference blocks and / or the one or more candidate reference blocks. Specifically, the manner of the embodiment includes the following operations: determining a first pixel cost between the current block and each of the one or more offset reference blocks based on an adjacent pixel template of the current block and an adjacent pixel template of the each offset reference block; and / or determining a second pixel cost between the current block and the candidate reference block based on one or more adjacent pixels of the current block and one or more adjacent pixels of the candidate reference block; determining the target reference block from the one or more offset reference blocks and / or the one or more candidate reference blocks based on the one or more first pixel costs and / or the one or more second pixel costs.

[0538] Exemplarily, the processor may determine the target reference block from the one or more offset reference blocks based on the first pixel cost; or may determine the one or more candidate reference blocks as the target reference block based on the second pixel cost; alternatively, may determine the target reference block from the one or more offset reference blocks and the one or more candidate reference block based on the first pixel costs of the one or more offset reference blocks and the second pixel costs of the one or more candidate reference blocks. The present disclosure does not impose any limitations in this regard.

[0539] The specific implementation process of the embodiment may be understood in conjunction with the explanations provided for the aforementioned embodiments, and thus may not be repeated herein.

[0540] On the basis of the above embodiments, embodiments of the present disclosure illustrate the operations of adjusting one or more offsets of the one or more target candidate block vectors using a predefined offset adjustment strategy to obtain one or more adjusted candidate block vectors. The offset determination mode includes an index determination mode. Specifically, the manner of the embodiment includes the following operations: determining a corresponding offset distance and a corresponding offset direction based on an offset distance index and an offset direction index in the block vector index information of each of the one or more target candidate block vectors; performing directional offsetting and / or distance offsetting on the target candidate block vector based on the offset distance and / or the offset direction, to obtain the target reference block; and designating the candidate block vector corresponding to the target reference block as the adjusted candidate block vector.

[0541] The offset distance index refers to distance information of the block vector in space, which is usually expressed as an index value; the offset direction index refers to direction information of the block vector in space, which is usually expressed as an index value.

[0542] Since the embodiment determines the block vector based on the index information, it is equivalent to an encoding end already informing the decoding end of the determined block vector used for block prediction through the bitstream. Therefore, after the decoding end determines the adjusted candidate block vector corresponding to the target reference block, the decoding end may directly use the adjusted candidate block vector as the target block vector, or may take a sum of the adjusted candidate block vector and a block vector difference as the target block vector. Alternatively, it may be that the decoding end then selects a vector from the adjusted candidate block vector and the target candidate block vector as the target block vector.

[0543] The preceding embodiments primarily explain the template-based offset determination mode, while the embodiment focuses on illustrating the index-based offset determination mode.

[0544] The index-based offset determination mode primarily involves assigning numbers to a plurality of offset candidates under a predefined offset mode according to the offset mode, and then determining the offset result from the predefined offset mode based on the index information. For example, the numbering of the offset distances may be as shown in Table 4 below. Table 4 Numbering of the offset distances

[0545] The numbering of the offset directions may be shown in Table 5 below. Table 5 Numbering of the offset direction

[0546] Exemplarily, at the encoding end, the optimal predefined offset distance of two is determined based on rate-distortion optimization techniques (specifically by determining a cost corresponding to each offset distance and selecting the one with the smallest cost, which may not be elaborated here) , and the optimal predefined offset direction is vertical upward. If unoffset BVP Candidate= (-10, -8) , then the offset BVP candidate may be (-10, -10) . Therefore, based on a predefined offset mode list, the encoding end determines that an offset distance index of the optimal offset result is two and an offset direction index is two, and writes the information into the bitstream in a syntactic manner for transmission to the decoding end. At the decoding end, the block vector index information, including the offset distance index and the offset direction index, is directly obtained through syntactic decoding. Then, based on the BVP-related syntax, the unoffset BVP candidate is determined from the BVP candidate list constructed at the decoding end. Subsequently, the offset BVP candidate is ultimately determined according to the offset determination mode represented by the offset distance index and the offset direction index, thereby determining the target block vector.

[0547] It is understandable that when there are combinations of offset modes in a specific implementation scenario, the offset determination modes may also be combined. That is, one offset determination mode is determined based on a template approach, while another offset determination mode is determined based on an index approach.

[0548] Exemplarily, the offset mode may involve offsetting in both direction and distance. The offset determination mode may first determine the offset direction based on a template, and then determine the offset distance based on an index (or other feasible combinations, which are not limited here) .

[0549] Determining the offset direction based on the template includes: fixing the predefined distance to one pixel, determining the ninth template cost for eight predefined directions at the one-pixel distance, and selecting the direction with the smallest ninth template cost as the optimal predefined offset direction, for example, the optimal predefined offset being horizontal right. Determining the offset distance based on the index includes: assigning a corresponding number to each offset distance. At the encoding end, the optimal predefined offset distance may be determined using rate-distortion optimization techniques, and the index information of the optimal predefined offset distance is written into the bitstream. At the decoding end, the optimal predefined offset distance is decoded from the bitstream, combined with the optimal predefined offset direction determined based on the template, and the unoffset BVP candidate to ultimately determine the offset BVP.

[0550] FIG. 34 is an exemplary modular diagram illustrating a device for decoding and encoding based on intra-block copy according to some embodiments of the present disclosure. The device is provided in a decoding end. As shown in FIG. 34, the exemplary device 3400 for decoding and encoding based on intra-block copy includes: an obtaining module 3410, a first list construction module 3420, a candidate vector determination module 3430, a first offset adjustment module 3440, and a prediction determination module 3450.

[0551] The obtaining module 3410 may be configured to, in response to receiving a bitstream from an encoding end, obtain block vector index information corresponding to a current block of an image to be decoded in the bitstream, the image to be decoded including a current block to be decoded and one or more decoded image blocks.

[0552] The first list construction module 3420 is configured to construct a block vector candidate list based on block vectors of reference blocks in the image to be decoded, the block vector candidate list including candidate block vectors, the reference blocks being determined in the one or more decoded image blocks based on the current block.

[0553] The candidate vector determination module 3430 is configured to determine one or more target candidate block vectors from the candidate block vectors of the block vector candidate list based on block vector index information of the candidate block vectors.

[0554] The first offset adjustment module 3440 is configured to adjust one or more offsets of the one or more target candidate block vectors using a predefined offset adjustment strategy to obtain one or more adjusted candidate block vectors.

[0555] The prediction determination module 3450 is configured to determine a target block vector among the one or more target candidate block vectors and / or the one or more adjusted candidate block vectors, and determine a predicted block corresponding to the current block based on the target block vector.

[0556] More details regarding the obtaining module 3410, the first list construction module 3420, the candidate vector determination module 3430, the first offset adjustment module 3440, and the prediction determination module 3450 may be found in other contents of the present disclosure (e.g., descriptions in connection with FIGs. 27-33) .

[0557] In the exemplary device for decoding and encoding based on intra-block copy, when the decoding end receives the bitstream sent by the encoding end, it obtains at least the block vector index information corresponding to the current block of the image to be decoded in the bitstream through syntax decoding processing technology. The image to be decoded includes the current block to be decoded and the decoded image blocks. Based on the block vectors of each reference block in the image to be decoded, a list construction process is performed to obtain the block vector candidate list, which includes the candidate block vectors. The reference blocks are determined in the decoded image blocks based on the current block. Then, the target candidate block vector is determined from the candidate block vectors in the block vector candidate list using the block vector index information interpreted from a bitstream syntax. The predefined offset adjustment strategy is selected to perform offset adjustment processing on the target candidate block vector, resulting in the adjusted candidate block vector. The image block corresponding to the target candidate block vector or the adjusted candidate block vector may contain the predicted block that matches the current block. Therefore, the target block vector may be determined from the target candidate block vector and / or the adjusted candidate block vector, and the predicted block corresponding to the current block may be determined based on the target block vector. This allows the image information of the predicted block to be used as the predicted image information of the current block, enabling image reconstruction of the current block based on the predicted block. Compared to constructing the block vector candidate list solely through predefined templates, the list construction manner described in the present disclosure is more flexible. Additionally, it allows for offset adjustment of the candidate block vectors in the list, making reference data more comprehensive when determining the predicted block of the current block, thereby improving the accuracy of image reconstruction.

[0558] It should be noted that the device provided in the above embodiments and the method provided in the above embodiments share a same concept. The specific operations performed by each module and unit have been described in detail in the method embodiments, and thus may not be repeated here. In practical applications, the device provided in the above embodiments may allocate the aforementioned functions to different functional modules as needed, that is, divide the internal structure of the device into different functional modules to accomplish all or part of the functions described above. This document does not impose any restrictions on such arrangements.

[0559] FIG. 35 is an exemplary flowchart illustrating a video decoding process according to some embodiments of the present disclosure. As shown in FIG. 35, process 3500 includes the following operations. In some embodiments, the process 3500 may be executed by a processor.

[0560] In 3510, a candidate list for a current block may be constructed.

[0561] Specific operations may be found in the instructions related to operation 310, and may not be repeated here.

[0562] In 3520, the candidate list may be adjusted to obtain an adjusted candidate list.

[0563] Specific operations may be found in the instructions related to operation 320, and may not be repeated here.

[0564] In 3530, the current block may be encoded based on the adjusted candidate list.

[0565] In some embodiments, the processor may encode the current block in a plurality of ways. For example, the processor may utilize an encoder to encode the current block.

[0566] In some embodiments, the processor may encode the current block based on block vector index information of a reference block corresponding to the current block, a predicted value of the current block, an index value of a candidate in the adjusted candidate list, or the like, more details may be found in FIGs. 36-42 and the related descriptions.

[0567] In some embodiments, the encoding end may determine optimal motion information for the current block based on the adjusted candidate list; in response to the optimal motion information coming from the adjusted candidate list or a candidate list before the adjustment, encode a first syntax for the current block to indicate, via the first syntax, whether to perform an adjustment of the candidate list based on a template region of the current block; encode a second syntax of the current block to indicate, via the second syntax, whether to perform sorting of the adjusted candidate list; and / or encode a third syntax of the current block to indicate, via the third syntax, whether to perform correcting of affine motion information candidate.

[0568] Specific operations may be found in the instructions related to operation 430, and may not be repeated here.

[0569] FIG. 36 is a schematic diagram illustrating overall encoding and decoding process for decoding and encoding based on intra-block copy according to some embodiments of the present disclosure. Therein are shown, respectively, a coding process involved at an encoding end in IBC mode based coding and a decoding process involved at a decoding end in IBC mode based coding.

[0570] The operations that the encoding end needs to perform may at least include: first constructing a BVP candidate list, then performing offsetting on BVP candidates in the list, followed by searching for a reference block corresponding to a current block based on each BVP candidate, and determining optimal BV through the each BVP candidate and the corresponding BV decision between each reference block and the current block. Finally, the relevant syntax used to represent the BV (such as BVP candidate, BVP adjustment manner, BVD determination manner, etc. ) is encoded into a bitstream, which is then transmitted to the decoding end.

[0571] When the method for encoding and decoding based on intra-block copy of the present disclosure is applied to the encoding end, it may include the following operations.

[0572] In S210, a block vector candidate list may be obtained based on block vectors of the reference blocks corresponding to a current block to be encoded in an image to be encoded, the block vector candidate list including candidate block vectors, the reference blocks being determined in one or more encoded image blocks of the image to be encoded based on the current block.

[0573] As illustrated in conjunction with the aforementioned embodiments, on the decoding end, a corresponding BVP candidate list is constructed for the current block to be decoded in the image to be decoded, whereas in operation S210, a corresponding BVP candidate list is constructed for the current block to be encoded in the image to be encoded. In fact, the manner and process of constructing the BVP candidate list may be referred to in the same way as the process of constructing the BVP candidate list in the process of decoding reconstruction in the decoding end in the preceding embodiment, and may not be repeated here. The main difference is that the encoding end is processed based on the image block to be encoded, while the decoding end is processed based on the image block to be decoded.

[0574] It should be noted that, for the encoding end, the specific list construction manner may be used to syntactically encode the corresponding information into the bitstream and send it to the decoding end. The decoding end may then decode, from the bitstream, the list construction manner that is used. For example, if the encoding end constructs the BVP candidate list based on an existing manner, the manner may be written into the syntax. Subsequently, after decoding the bitstream, the decoding end may accordingly construct the BVP candidate list using the same technique as the encoding end.

[0575] In S220, offsets of the candidate block vectors may be adjusted using a predefined offset adjustment strategy to obtain adjusted candidate block vectors.

[0576] Similarly, regarding the offset adjustment strategy for the BVP candidate list created by the encoding end, it may refer to the explanation provided in the aforementioned embodiments about the offset adjustment process for the BVP candidates in the BVP candidate list created by the decoding end. Therefore, it will not be repeated here.

[0577] In S230, matching may be performed on reference blocks corresponding to the candidate block vectors and / or reference blocks corresponding to the adjusted candidate block vectors, respectively, with the current block, to obtain a target block vector in each of the adjusted candidate block vectors.

[0578] For the encoding end, as compared to the decoding end there is also a BV search decision process as in operation S230.

[0579] Exemplarily, for each BVP candidate in the BVP candidate list, the current block to be encoded may determine the corresponding reference block based on each BVP candidate, and / or the corresponding image block (which may also serve as the reference block for the current block) may be determined based on each adjusted BVP candidate. Therefore, through existing block matching manners, the current block may be matched against each reference block to determine the target reference block that best matches (most similar or identical to) the image information of the current block. In other words, this process yields the relevant information needed to obtain the reference block for predicting the current block. For example, a BV between the target reference block and the current block may be determined based on a BVP candidate between the target reference block and the current block. The encoding end may further derive a BVD from the BVP and BV. Specific details may be found in the description in the aforementioned example, which will not be repeated here.

[0580] In S240, the current block may be encoded based on block vector index information of the target block vectors in the block vector candidate list to obtain a target bitstream.

[0581] Illustrated in conjunction with the preceding operations, the encoding end compiles index information and / or BVDs identifying the best BVP candidate from a BVP candidate list into the target bitstream via correlation syntax and sends it to the decoding end. Then, the decoding end may obtain the information by decoding the target bitstream, and subsequently determine the target BVP from the BVP candidate list constructed by the decoding end itself based on the index information. Depending on the specific application scenario, the decoding end may further decide whether to combine with BVD for processing. Whether to use BVD may also be transmitted syntactically from the encoding end to the decoding end, and then the decoding end may perform accordingly in response to the syntactic decoding result.

[0582] On the basis of the above embodiment, embodiments of the present disclosure explain the operations after obtaining the target block vector among each of the adjusted candidate block vectors, and the operations of encoding the current block based on the block vector index information of the target block vectors in the block vector candidate list to obtain a target bitstream. Specifically, the manner of the embodiment includes the following operations: determining the target reference block corresponding to the current block based on block matching result of a block matching process; determining a BVD based on a true BV between the current block and the target reference block (BVP) ; and encoding the block vector index information of the target block vector in the block vector candidate list and the BVD, to obtain the target bitstream.

[0583] It should be noted that, based on the various embodiments described in the present disclosure, adjustment schemes for BVP summarized in the present disclosure include, but are not limited to: (1) BVP list replacement scheme: replacing conventional BVP list construction techniques with the customized BVP candidate list construction techniques provided in the present disclosure. (2) BVP list addition scheme: in an IBC prediction mode, adding the customized BVP list construction techniques given in the present disclosure (i.e., the BVP candidate list construction scheme in the present disclosure coexists with the conventional BVP candidate list construction scheme, and syntactic elements in the syntax may be used to determine which scheme to choose) . (3) BVP adjustment addition scheme: adding a BVP offset adjustment technique given in the present disclosure to the existing BVP list construction technique. (4) Enhanced BVP replacement scheme: determining a scheme of BVP using the BVP list construction technique and the BVP offset adjustment technique given in the present disclosure and replacing the existing BVP list construction technique. (5) Enhanced BVP addition scheme: adding the BVP list construction technique and the BVP offset adjustment technique given in the present disclosure and a scheme for determining the BVP in the IBC prediction mode.

[0584] Based on the above embodiments, embodiments of the present disclosure illustrate some of the syntactic designs in the specific application scenarios of the present disclosure.

[0585] The BVP adjustment syntax design of the present disclosure includes, but is not limited to, (1) BVP adjustment syntax, (2) BVP adjustment program syntax, and (3) BVP adjustment syntax coding.

[0586] The BVP adjustment syntax is used to indicate in the encoder / decoder whether to enable the technical schemes described in the above embodiments of the present disclosure (which may be any single technical scheme or the complete application scheme) . The BVP adjustment syntax may be transmitted in syntactic structures including, but not limited to, video parameter set (VPS) , sequence parameter set (SPS) , picture parameter set (PPS) , picture header (PH) , a coding unit, etc.

[0587] The BVP adjustment program syntax includes, but is not limited to, BVP list syntax, BVP adjustment syntax, BVD syntax, etc.

[0588] The BVP list syntax includes, but is not limited to, BVP mode syntax, BVP indexed syntax, BVP chained syntax, BVP rearranged syntax, BVP precision processing syntax, etc. The BVP list syntax may specifically include a BVP list length syntax, which is used to determine a length of the BVP candidate list that needs to be created in the present disclosure. The encoding end may encode the length of the BVP candidate list created during the encoding process into the syntax, and then transmit the syntax to the decoding end through the bitstream. Upon decoding a BVP list length syntax, the decoding end may then create a BVP candidate list with the same length as the one in the encoding end. BVP list mode syntax: when the BVP list addition scheme is applied or a plurality of BVP candidate lists exist, the syntax may be used to indicate which specific BVP candidate list is utilized in the IBC prediction mode (e.g., the BVP candidate list constructed using the newly proposed list construction technique described in the present disclosure and / or the BVP candidate list constructed using existing list construction techniques) . BVP indexed syntax: used to indicate that one of the BVP candidates in the BVP candidate list is specifically used. BVP chained syntax: used to indicate whether a BVP chaining process is performed. BVP rearranged syntax: used to indicate whether to execute BVP rearrangement process for BVP candidates in the BVP candidate list. BVP rearrangement template syntax: used to express exactly which template is used if a plurality of pixel templates are present during the process of using a BVP rearrangement scheme. BVP precision processing syntax: used to express exactly which precision is used for processing when a plurality of precision processing of a BVP candidate is used.

[0589] BVD syntax may include, but is not limited to, adaptive BVD syntax. The adaptive BVD syntax means that when adaptive BVD technique is used, it is used to express whether BVD needs to be encoded and transmitted. If BVD is transmitted, then BV=BVP+BVD; otherwise, BV=BVP.

[0590] It should also be noted that, in the specific implementation of the present disclosure, syntax binarization manners may include, but are not limited to, unary code, truncated unary code, truncated Rice code, signed fixed-length coding, unsigned fixed-length coding, exponential Golomb coding, and other manners. Syntactic coding manners may include, but are not limited to, advanced entropy coding, bypass coding, or the like. Encoding modes are described as descriptors in the standard text, and the specific meanings may be referred to the corresponding standard text, which may not be repeated here.

[0591] Exemplarily, the specific process of using the syntax described above is illustrated in conjunction with a plurality of manners provided in the preceding embodiments.

[0592] Embodiment 1:

[0593] BVP list construction technique: as in Example 1 of the preceding embodiment, a conventional BVP list construction manner is used to construct a BVP candidate list with a length of seven.

[0594] BVP adjustment technique: the embodiment relates only to conventional BVP list construction techniques and does not enable offset adjustment.

[0595] BVD determination technique: BVD exists by default.

[0596] BVP adjustment application: BVP list replacement scheme, i.e., using the BVP list construction technique in the aforementioned embodiment (ascheme of constructing a list based on the existing manner and performing BVP candidate de-duplication and BVP candidate rearrangement) to replace the BVP list technique under an existing IBC prediction mode, and the BVP candidate de-duplication and BVP candidate rearrangement techniques are performed by default under the technique, which does not require the transmission of the encoding end of the corresponding syntax, and since BVP chaining and BVP precision processing are not used, there is also no need to transmit the syntax.

[0597] BVP syntactic design:

[0598] BVP adjustment syntax: a BVP list replacement syntax sps_new_bvp_ebable is used to signify whether the BVP list replacement scheme is enabled and is transmitted in the SPS as shown in Table 6 below.

[0599] When sps_new_bvp_ebable=0, it means that the BVP list replacement scheme is not enabled; when sps_msmvd_enable=1, it means that the BVP list replacement scheme is enabled. Table 6 BVP adjustment syntax

[0600] BVP indexed syntax: when the BVP list replacement scheme is enabled, new_bvp_idx in a syntax structure of the coding unit is used to denote the specific BVP candidate to be used as shown in the following Table 7, and IbcCuFlag is used to denote whether a current CU is in IBC mode. Table 7 BVP indexed syntax

[0601] Embodiment 2:

[0602] BVP list construction technique: same as Example 1 in the preceding embodiment.

[0603] BVP adjustment technique: the embodiment relates only to the BVP list construction technique, and does not enable offset adjustment.

[0604] BVD determination technology: BVD exists by default.

[0605] BVP adjustment application: i.e., the BVP list addition scheme, the BVP list construction technique in Example 1 is added to the existing IBC prediction mode.

[0606] BVP syntactic design:

[0607] BVP adjustment syntax: default implementation of the BVP addition scheme, so no BVP adjustment syntax is required.

[0608] BVP list mode syntax: a syntax bvp_list_index in the syntaxc structure of the coding unit is used to indicate whether to adopt the BVP list in the existing manner or a new BVP list added based on the present disclosure. When bvp_list_index=0, it means that the BVP list in the existing manner is adopted, and when bvp_list_index=1, it means that the new BVP list added in the present disclosure is adopted.

[0609] BVP indexed syntax: when the new BVP list is selected, new_bvp_idx is used to indicate the specific BVP candidate used.

[0610] The specific syntax is shown in Table 8 below, in which HbvpEmptyFlag, NumOfIntraHmvpCand, and cbvp_index are the existing related variables and syntaxes, which may not be repeated here. Table 8 BVP indexed syntax

[0611] Embodiment 3:

[0612] BVP list construction technique: refer to existing manners to build lists.

[0613] BVP adjustment technique: same as in the previous embodiments for direction and distance based offsets, and template based offset determination mode.

[0614] BVD determination technique: adaptive BVD technique is used when making BVP adjustments.

[0615] BVP adjustment application: the BVP adjustment addition scheme, i.e., adding the BVP offset adjustment process of the foregoing embodiment to the existing BVP list construction technique.

[0616] BVP syntactic design:

[0617] BVP adjustment syntax: a witch syntax sps_bvp_refine_ebable of the BVP adjustment addition scheme is used to flag whether a BVP offset adjustment addition scheme is enabled and is transmitted in the SPS, as shown below in Table 9.

[0618] When sps_bvp_refine_ebable=0, it means that the BVP offset adjustment addition scheme is not enabled; when sps_bvp_refine_ebable=1, it means that the BVP offset adjustment addition scheme is enabled. Table 9 BVP adjustment syntax

[0619] BVP adjustment mode syntax: when the BVP offset adjustment addition scheme is enabled, a syntax bvp_refine_flag in the syntax structure of the coding unit is used to express whether to execute the added BVP adjustment scheme, as shown in the following table 10. When bvp_refine_flag=0, it means that the BVP adjustment scheme is not executed, and when bvp_refine_flag=1, it means that the added BVP adjustment scheme is executed.

[0620] BVD execution syntax: when executing the added BVP adjustment scheme, a BVD execution syntax bvd_need_flag is used to express whether the BVD needs to be transmitted, when bvd_need_flag=0, it means that the BVD does not need to be transmitted, and when bvd_need_flag=1, it means that the BVD needs to be transmitted.

[0621] The specific syntax is shown in Table 10 below, in which mv_diff_x_abs_bv, mv_diff_x_sign_bv, mv_diff_y_abs_bv, and mv_diff_y_sign_bv are syntaxes for representing BVDs in existing manners and are not described here. Table 10 BVD execution syntax

[0622] Embodiment 4:

[0623] BVP list construction technique: same as example 1.

[0624] BVP adjustment technique: same as in the preceding embodiments of offset adjustment in direction and distance, and offset determination based on an indexed offset determination mode.

[0625] BVD determination technique: BVD exists by default;

[0626] BVP adjustment application: the enhanced BVP replacement scheme, i.e., using the BVP list construction technique from Example 1 and the BVP offset adjustment technique from the aforementioned embodiment (which adjusts offsets based on direction and distance and determines offsets based on indexing) to replace the BVP list construction technique in the existing manner.

[0627] BVP syntactic design:

[0628] BVP adjustment syntax: the enhanced BVP replacement scheme is implemented by default without the need for BVP adjustment syntax.

[0629] BVP indexed syntax: when the added BVP list is selected, new_bvp_idx is used to indicate the specific BVP candidate used.

[0630] BVP adjustment mode syntax: by default, BVP adjustment technique is executed without syntax.

[0631] BVP offset direction syntax: bvp_dir_idx is used to indicate the direction index in the preceding embodiment, specifically indicating that the bvp_dir_idxth predefined direction is used for the offset.

[0632] BVP offset distance syntax: bvp_dis_idx is used to indicate the distance index in the preceding embodiment, indicating that the bvp_dis_idxth predefined distance is used for offsetting.

[0633] The specific details are shown in Table 11 below. Table 11 BVP offset distance syntax

[0634] Embodiment 5:

[0635] BVP list construction technique: same as example 1.

[0636] BVP adjustment technique: same as in the previous embodiment of offsetting in direction and distance, determining the offset direction based on a template first, and then determining the offset distance based on an index.

[0637] BVD determination technology: BVD exists by default.

[0638] BVP adjustment application: the enhanced BVP addition scheme, i.e., within the existing IBC prediction mode, the BVP list construction technique from Example 1 is added, along with the BVP adjustment technique that involves offsetting in both direction and distance. This technique first determines the offset direction based on the template and then determines the offset distance based on indexing, thereby determining the BVP.

[0639] BVP syntactic design:

[0640] BVP adjustment syntax: a syntax sps_enhanced_bvp_ebable of the enhanced BVP addition scheme is used to flag whether the enhanced BVP addition scheme is enabled for transmission in the SPS, as Table 12 below shown.

[0641] When sps_enhanced_bvp_ebable=0, it means that the enhanced BVP addition scheme is not enabled; when sps_enhanced_bvp_ebable=1, it means that the enhanced BVP addition scheme is enabled. Table 12 BVP adjustment syntax

[0642] BVP mode syntax: when the enhanced BVP addition scheme is enabled, a syntax bvp_mode_flag in the syntax structure of the coding unit is used to indicate whether to perform an original BVP technique or an added enhanced BVP technique.

[0643] BVP indexed syntax: when a new enhanced BVP technique is performed, new_bvp_idx is used to denote the specific BVP candidate to be used under the technique.

[0644] BVP offset distance indexed syntax: a BVP offset distance syntax bvp_dis_idx is used to denote the specific BVP offset distance to be used when performing the new enhanced BVP technique. The specific details are shown in Table 13 below. Table 13 BVP offset distance indexed syntax

[0645] In summary, the BVP offset adjustment technique proposed in the embodiments of the present disclosure may effectively improve the accuracy of the BVP prediction, thereby reducing the syntactic overhead of the BVD transmission, and thus improving the compression effect. And the new BVP list construction technique designed in the present disclosure may likewise effectively improve the accuracy of BVP prediction.

[0646] It is further noted that executing body of the method for encoding and decoding based on intra-block copy may be a device for encoding and decoding based on intra-block copy. For example, the method for encoding and decoding based on intra-block copy may be executed by a terminal device, a server, or other processing device. The terminal device may be a user equipment (UE) , a computer, a mobile device, a user terminal, a terminal, a cellular telephone, a cordless telephone, a personal digital assistant (PDA) , a handheld device, a computing device, an in-vehicle device, a wearable device, or the like. In some possible implementations, the method for encoding and decoding based on intra-block copy may be realized by a processor calling computer-readable instructions stored in memory.

[0647] FIG. 37 is another exemplary modular diagram illustrating a device for decoding and encoding based on intra-block copy according to some embodiments of the present disclosure. As shown in FIG. 37, an exemplary device 3700 for encoding and decoding based on intra-block copy includes: a second list construction module 3710, a second offset adjustment module 3720, a second vector determination module 3730, and an encoding module 3740.

[0648] The second list construction module 3710 is configured to obtain a block vector candidate list based on block vectors of reference blocks corresponding to a current block to be encoded in an image to be encoded, the block vector candidate list including candidate block vectors, the reference blocks being determined in one or more encoded image blocks of the image to be encoded based on the current block.

[0649] The second offset adjustment module 3720 is configured to adjust offsets of the candidate block vectors using a predefined offset adjustment strategy to obtain adjusted candidate block vectors.

[0650] The second vector determination module 3730 is configured to perform matching on reference blocks corresponding to the candidate block vectors and / or reference blocks corresponding to the adjusted candidate block vectors, respectively, with the current block, to obtain a target block vector in each of the adjusted candidate block vectors.

[0651] The encoding module 3740 is configured to encode the current block based on block vector index information of the target block vectors in the block vector candidate list to obtain a target bitstream.

[0652] Functions of the individual modules may be found in the embodiment of the method for encoding and decoding based on intra-block copy in FIG. 36, and may not be repeated here.

[0653] FIG. 38 is an exemplary flowchart illustrating a video encoding process according to some other embodiments of the present disclosure. As shown in FIG. 38, process 3800 includes the following operations. In some embodiments, the process 3800 may be executed by a processor.

[0654] In 3810, in response to a prediction mode of a current block being a sub-block prediction mode, a template region of the current block may be divided to obtain at least one template sub-block.

[0655] Specific operations may be found in the instructions related to operation 2110, and may not be repeated here.

[0656] In 3820, first template costs for at least some of sub-mode candidates in the sub-block prediction mode may be determined.

[0657] Specific operations may be found in the instructions related to operation 2120, and may not be repeated here.

[0658] In 3830, the at least some of the sub-mode candidates may be sorted based on the first template costs of the at least some of the sub-mode candidates.

[0659] Specific operations may be found in the instructions related to operation 2130, and may not be repeated here.

[0660] In 3840, the current block may be encoded based on the at least some of the sub-mode candidates after sorting.

[0661] In some embodiments, an encoding end may determine an optimal prediction mode for the current block based on the at least some of the sub-mode candidates, and if the optimal prediction mode for the current block is derived from the at least some of the sub-mode candidates, encode one or more indexes of the sub-mode candidates redetermined under the optimal prediction mode.

[0662] In other embodiments, the encoding end may directly select a sub-mode candidate with the smallest first template cost among the at least some of the sub-mode candidates to encode the current block. For example, if the at least some of the sub-mode candidates are sorted in ascending order of the first template costs of the at least some of the sub-mode candidates, the encoding end may select a first sub-mode candidate among the at least some of the sub-mode candidates after reordering to encode the current block. As another example, if the at least some of the sub-mode candidates are sorted in descending order of the first template costs of the at least some of the sub-mode candidates, the encoding end may select a last sub-mode candidate among the at least some of the sub-mode candidates after reordering to encode the current block. In the embodiment, the encoding end and a decoding end may agree to directly select the sub-mode candidate with the smallest first template cost among the at least some of the sub-mode candidates. In this case, an index of a selected sub-mode candidate does not need to be transmitted. Of course, the encoding end may also transmit the index of the selected sub-mode candidate.

[0663] Specific operations may be found in the instructions related to operation 2140, and may not be repeated here.

[0664] FIG. 39 is an exemplary flowchart illustrating a video encoding process according to some other embodiments of the present disclosure. As shown in FIG. 39, process 3900 includes the following operations. In some embodiments, the process 3900 may be executed by a processor.

[0665] In 3910, a candidate list for a current block may be constructed.

[0666] Specific operations may be found in operation 2510, which may not be repeated here.

[0667] In 3920, the candidate list may be adjusted based on a template region of the current block.

[0668] Specific operations may be found in operation 2520, which may not be repeated here.

[0669] In 3930, the current block may be encoded based on an adjusted candidate list.

[0670] In some embodiments, an encoding end may encode the current block based on the adjusted candidate list.

[0671] In some embodiments, the encoding end may determine a best candidate for the current block based on a sorted candidate list, and if the best candidate for the current block is from the sorted candidate list, encode a redetermined index of the best candidate, to transmit a candidate (i.e., a sub-mode candidate or a motion information candidate) used for the current block to a decoding end.

[0672] In other embodiments, the encoding end and the decoding end may agree to simultaneously use a candidate at a predefined position in the adjusted candidate list, in which case the encoding end may not transmit the index of the candidate.

[0673] FIG. 40 is an exemplary flowchart illustrating a video encoding process according to some other embodiment of the present disclosure. As shown in FIG. 40, process 4000 includes the following operations. In some embodiments, the process 4000 may be executed by a processor.

[0674] In 4010, a candidate list for a current block may be constructed.

[0675] Specific details may be found in operation 2610, and may not be repeated here.

[0676] In 4020, the candidate list may be grouped to obtain at least two candidate groups.

[0677] Specific details may be found in operation 2620, and may not be repeated here.

[0678] In 4030, candidates in each group of at least one of the at least two candidate groups may be sorted, in an intra-group sort, based on second template costs of the candidates in the candidate list, and / or, may be sorted, in an inter-group sort, the at least two candidate groups to obtain a sorted candidate list.

[0679] Specific details may be found in operation 2630, and may not be repeated here.

[0680] In 4040, the current block may be encoded based on the sorted candidate list.

[0681] Specific details may be found in operation 2640, and may not be repeated here.

[0682] FIG. 41 is an exemplary flowchart illustrating a video encoding process according to some other embodiments of the present disclosure. As shown in FIG. 41, process 4100 includes the following operations. In some embodiments, the process 4100 may be performed by a processor.

[0683] In 4110, a weight matrix for a current block may be generated.

[0684] Specific operations may be found in operation 1110, and may not be repeated here.

[0685] During a video encoding process, in some embodiments, the processor may traverse all prediction modes determined by angle and reference weight configurations, determine an optimal prediction mode for the current block, and then directly determine the weight matrix of the current block based on the optimal prediction mode for the current block in operation 4110. The processor may determine the optimal prediction mode for the current block from all the prediction modes by techniques such as rate distortion optimization.

[0686] In other embodiments, the processor may select one prediction mode from all prediction modes determined by the angle and the reference weight configurations as the prediction mode for the current block, and then determine, in operation 4110, based directly on the prediction mode of the current block, the weight matrix of the current block.

[0687] Furthermore, the processor may derive pixel-by-pixel weights based on the prediction mode of the current block to obtain the weight matrix for the current block.

[0688] In 4120, a candidate list for the current block may be constructed.

[0689] Specific operations may be found in operation 1120, which may not be repeated here.

[0690] In 4130, based on a template region of the current block, the candidate list is adjusted to determine first motion information and second motion information of the current block.

[0691] Specific operations may be found in operation 1130, and may not be repeated here.

[0692] In some embodiments, the processor may traverse the candidate list based on the weight matrix of the current block, select a combination of motion information with the smallest cost during a traversal process as the first motion information and the second motion information for the current block. In this regard, the processor may determine the first motion information and the second motion information for the current block through techniques such as rate distortion optimization.

[0693] In other embodiments, the processor may select motion information of a first predefined position in the candidate list as the first motion information of the current block, and may select motion information of a second predefined position in the candidate list as the second motion information of the current block. When agreed upon by an encoding end and a decoding end, indexes of the first motion information and the second motion information do not need to be encoded. The decoding end may directly select the motion information at the first predefined position and the second predefined position according to the agreement, which may reduce the count of indexes of the motion information that need to be encoded, thereby reducing a bit rate required to encode the current block.

[0694] In video encoding, the processor may determine whether to adopt operation 4130 or other correcting manners to adjust the candidate list through techniques such as rate-distortion optimization. The processor may also determine the details during the adjustment process, such as the selection of the template region, a determination formula for determining a template cost, an optimal correction distance index, and / or an optimal correction direction index.

[0695] In 4140, a predicted value of the current block may be obtained by performing a weighted prediction on the current block based on the weight matrix of the current block, the first motion information, and the second motion information.

[0696] Specific operations may be found in operation 1140, and may not be repeated here.

[0697] In 4150, an encoding result of the current block may be obtained based on the predicted value of the current block. In some embodiments, the encoding end may obtain a residual value of the current block based on an original value and the predicted value of the current block; and encode the residual value of the current block to obtain the encoding result of the current block.

[0698] FIG. 42 is an exemplary flowchart illustrating a video encoding process according to some other embodiments of the present disclosure. As shown in FIG. 42, process 4200 includes the following operations. In some embodiments, the process 4200 may be performed by a processor.

[0699] In 4210, a weight matrix for a current block may be generated.

[0700] Specific operations may be found in operation 410, which may not be repeated here.

[0701] In 4220, a candidate list for the current block may be constructed.

[0702] Specific details may be found in operation 420, which may not be repeated here.

[0703] In 4230, motion information candidates in the candidate list may be sorted based on importance of at least some of the motion information candidates in the candidate list to obtain an adjusted candidate list.

[0704] In some embodiments, the processor may reorder the motion information candidates in the candidate list based on a template region, details of which may be found in operation 1130, and may not be repeated herein. First template costs are negatively correlated with the importance, i.e., the motion information candidates with relatively low first template costs are more important.

[0705] In other embodiments, the processor may determine the importance of each of the motion information candidates based on relative distances of the motion information candidates in the candidate list, and subsequently reorder the motion information candidates in the candidate list. Motion information candidates with closer distances (e.g., motion information candidates with smaller POC differences) are considered more important, and thus may be ranked ahead of motion information candidates with farther distances.

[0706] In 4240, first motion information and second motion information for the current block may be determined based on the reordered candidate list.

[0707] Specific operations may be found in operation 1130, and may not be repeated here.

[0708] In 4250, a predicted value of the current block may be obtained by performing a weighted prediction on the current block based on a weight matrix of the current block, the first motion information, and the second motion information.

[0709] Specific operations may be found in operation 1140, and may not be repeated here.

[0710] In 4260, an encoding result of the current block may be obtained based on the predicted value of the current block.

[0711] Specific operations may be found in operation 1150, and may not be repeated here.

[0712] The syntactic expressions described herein are described below in connection with specific embodiments.

[0713] Embodiment 6:

[0714] The key points of adopted manners are:

[0715] (1) The candidate list is constructed in the same way as the MVP candidate construction for affine AMVP.

[0716] (2) The candidates in the candidate list are sorted based on a template, and whether to apply sorting is set as an optional sub-mode.

[0717] (3) Each candidate is sequentially used as a basis for a searching process, which specifically includes two manners: the first is an iterative searching manner based on an optical flow formula, and the second adopts a manner of sequentially searching each CPMV.

[0718] An added syntax contains a first syntax to indicate that the adjustment manner is used, a second syntax to indicate whether to perform a sorting process, and a correction scheme syntax to indicate which searching manner is used.

[0719] The scheme serves as a sub-mode under affine AMVP. The marked positions in Table 14 below indicate modified conditions or additional conditions and syntax. Table 14 Schematic table of coding unit definition

[0720] The added syntax affine_template_flag (i.e., the first syntax) indicates whether to apply a template-based candidate adjustment manner, with a value of 1 indicating that the manner is applied and a value of 0 indicating the manner is not applied.

[0721] The added syntax affine_template_ajustment (i.e., the second syntax) indicates whether to perform a candidate order adjustment, with a value of 1 indicating that the candidate order adjustment process is performed and a value of 0 indicating that the candidate order adjustment process is not performed.

[0722] The added syntax affine_template_type (i.e., the correction scheme syntax) indicates the searching manner used, with a value of 1 indicating that the second manner is adopted and a value of 0 indicating that the first manner is adopted.

[0723] Additionally, transmission conditions need to be added for the syntax of other affine AMVP that requires transmission. If the manner proposed in the embodiment is not applied, a standard affine AMVP process is executed. The two manners compete as two modes for selection.

[0724] Embodiment 7:

[0725] The key points of adopted manners are:

[0726] (1) The candidate list is constructed in the same way as MV candidate construction for affine merge.

[0727] (2) The candidates in the candidate list are sorted based on the template.

[0728] (3) Each candidate after sorting is sequentially used as the basis for the searching process, and whether to apply the searching process is set as an optional sub-mode.

[0729] (4) Template selection: use only the top template, use only the left template, and use the top and left and top-left templates as three sub-modes.

[0730] The added syntax contains the first syntax to indicate that the manner is used, a third syntax to indicate whether to perform the searching process, and a region selection syntax to indicate which template is selected to use.

[0731] The scheme serves as a sub-mode under affine merge (skip / direct) . The marked positions in Table 15 below indicate modified conditions or additional conditions and syntax. Table 15 Schematic table of coding unit definition

[0732] The added syntax affine_template_flag (i.e., the first syntax) indicates whether to apply the template-based candidate adjustment manner, with a value of 1 indicating that the manner is applied and a value of 0 indicating that the manner is not applied.

[0733] The added syntax affine_template_search (i.e., the third syntax) indicates whether the candidate search adjustment is performed, with a value of 1 to indicating that the candidate search adjustment process is performed and a value of 0 indicating that the candidate search adjustment process is not performed.

[0734] The added syntax affine_template_area (i.e., the region selection syntax) indicates the selection of the template region, with a value of 0 indicating the use of the left and top and top-left templates, a value of 1 indicating the use of the top template only, and a value of 2 indicating the use o...

Claims

A video decoding method implemented on at least one machine, each of which has at least one processor and a storage device, the method comprises:constructing a candidate list for a current block;adjusting the candidate list to obtain an adjusted candidate list; anddecoding the current block based on the adjusted candidate list.The method of claim 1, wherein the candidate list includes motion information candidates.The method of claim 2, wherein the motion information candidate include at least one of a history-based candidate, an ultra motion vector expression candidate, an extended temporal motion vector prediction candidate, a spatial motion information candidate, a temporal motion information candidate, a spatial derivation candidate, a temporal derivation candidate, a coded tree unit boundary candidate, an affine motion information candidate, or a motion vector adaptive prediction candidate.The method of any one of claims 1-3, wherein the candidate list includes sub-mode candidates for a sub-block prediction technique.The method of claim 2, wherein the constructing a candidate list for a current block includes:determining a current motion information candidate for the current block;if the current motion information candidate and a motion information candidate in the candidate list point to a same reference frame and a difference of reference positions therebetween is greater than a predefined value, adding the current motion information candidate to the candidate list;if the current motion information candidate and the motion information candidate in the candidate list point to the same reference frame and the difference of reference positions therebetween is less than or equal to the predefined value, not adding the current motion information candidate to the candidate list.The method of claim 2, wherein the motion information candidates include unidirectional motion information, and the constructing a candidate list for a current block includes:determining a current motion information candidate for the current block;if the current motion information candidate includes bidirectional motion information, detaching at least one of forward motion information and backward motion information from the current motion information candidate to be added to the candidate list, or, not adding the current motion information candidate to the candidate list.The method of any one of claims 1-6, wherein the adjusting the candidate list to obtain an adjusted candidate list includes:sorting and / or correcting the candidate list based on a template region of the current block to obtain the adjusted candidate list.The method of claim 7, further comprising:determining, based on a first syntax of the current block in a bitstream, whether to perform sorting and / or correcting on the candidate list based on the template region of the current block.The method of claim 7, further comprising:determining, based on a second syntax of the current block in a bitstream, whether to performing sorting on the candidate list.The method of claim 7, further comprising:determining, based on a third syntax of the current block in a bitstream, whether to performing correcting on the candidate list; and / orif the candidate list is to be corrected, determining, based on the a correction scheme syntax for the current block in the bitstream, a correction scheme for correcting the current block.The method of claim 7, wherein the template region is determined by:deciphering a region selection syntax for the current block, and selecting, based on the region selection syntax, the template region from reconstructed pixel regions in at least one of a first direction or a second direction of the current block; orusing a reconstructed pixel region at a predefined position around the current block as the template region;wherein the first direction includes at least one of above the current block and below the current block, and the second direction includes at least one of on a left side of the current block or on a right side of the current block.The method of claim 7, wherein the sorting and / or correcting the candidate list based on a template region of the current block to obtain the adjusted candidate list includes:merely sorting the candidate list, or merely correcting the candidate list.The method of claim 7, wherein the candidate list includes motion information candidates, and the sorting the candidate list based on a template region of the current block to obtain the adjusted candidate list includes:sorting the motion information candidates in the candidate list based on importance of at least some of the motion information candidates in the candidate list to obtain the adjusted candidate list.The method of claim 7, wherein the sorting and / or correcting the candidate list based on a template region of the current block to obtain the adjusted candidate list includes:correcting the candidate list to obtain a corrected candidate list;sorting the corrected candidate list to obtain the adjusted candidate list.The method of claim 7, wherein the sorting and / or correcting the candidate list based on a template region of the current block to obtain the adjusted candidate list includes:sorting the candidate list to obtain a sorted candidate list;correcting the sorted candidate list to obtain the adjusted candidate list.The method of claim 15, wherein the candidate list includes affine motion information candidates,the correcting the sorted candidate list to obtain the adjusted candidate list includes:determining an affine motion information candidate from the sorted candidate list that has a same index value with motion information of the current block;correcting, based on the template region, the affine motion information candidate that has the same index value with motion information to obtain corrected motion information;the decoding the current block based on the adjusted candidate list includes:decoding the current block based on the corrected motion information.The method of claim 7, wherein the sorting the candidate list based on a template region of the current block to obtain the adjusted candidate list includes:sorting at least some candidates in the candidate list based on first template costs of the at least some candidates to re-index the at least some candidates.The method of claim 17, wherein the decoding the current block based on the adjusted candidate list includes:determining, from the at least some candidates, a candidate having a same index value with a candidate of the current block;decoding the current block based on the candidate having the same index value.The method of claim 7, wherein the candidate list includes motion information candidates, and the correcting the candidate list based on a template region of the current block to obtain the adjusted candidate list includes:correcting a motion information candidate to be corrected using a searching process, and determining a corrected motion information candidate based on a second template cost in the searching process, the second template cost in the searching process being determined based on a predicted value of the template region determined in the searching process.The method of claim 19, wherein the correcting a motion information candidate to be corrected using a searching process includes:performing one or more rounds of search for the motion information candidate to be corrected based on the template region to obtain the corrected motion information candidate;wherein:if a round count of the motion information candidate for a current round of search is equal to 1, determining a searching start point for the current round of search based on the motion information candidate to be corrected;if the round count of the current round of search is greater than 1, determining a searching result of a previous round of search as the searching start point in the current round of search;in each round of search for the motion information candidate, one or more second template costs of one or more of predefined positions around the searching start point are determined, and a searching result of the current round of search is determined based on the one or more second template costs of the one or more predefined positions.The method of claim 20, wherein the performing one or more rounds of search for the motion information candidate to be corrected based on the template region to obtain the corrected motion information candidate includes:if a position of the searching result of the current round of search is the same as a position of the searching start point of the current round of search, terminating the searching process and designating the motion information candidate corresponding to the searching start point of the current round of search as the corrected motion information candidate; orif the round count of the current round of search is equal to a first threshold, designating the motion information candidate corresponding to the position of the searching result of the current round of search as the corrected motion information candidate.The method of claim 20, wherein the one or more second template costs of one or more of predefined positions around the searching start point are determined by:if the position of the searching result is outside a predefined range around a position pointed to by the motion information candidate to be corrected, setting the position of the searching result to be invalid, or designating a second template cost of a position closest to the position of the searching result within the predefined range as a second template cost of the position of the searching result.The method of claim 20, further comprising:deciphering a second cost determination syntax for the current block, and determining a determination formula of the second template cost based on a value of the second cost determination syntax;substituting a reconstructed value of the template region and the predicted value of the template region at each searching position into the determination formula of the second template cost to obtain a second template cost for the motion information candidate.The method of claim 7, wherein the candidate list includes motion information candidates, and the sorting the candidate list based on a template region of the current block to obtain the adjusted candidate list includes:determining third template costs for at least some of the motion information candidates in the candidate list based on a predicted value of the template region, the predicted value of the template region being determined by predicting the template region based on the motion information candidate;sorting the at least some of the motion information candidates based on the third template costs of the at least some of the motion information candidates.The method of claim 24, wherein the sorting the at least some of the motion information candidates based on the third template costs of the at least some of the motion information candidates includes:retaining a predefined count of the motion information candidates with low third template costs to generate the adjusted candidate list.The method of claim 24, wherein the determining third template costs for at least some of the motion information candidates in the candidate list includes:predicting the template region using the motion information candidates to obtain the predicted value for the template region;determining the third template costs for the motion information candidates based on the predicted value and a reconstructed value of the template region.The method of claim 26,further comprising:deciphering a first cost determination syntax for the current block, and determining a determination formula for the third template costs based on a value of the first cost determination syntax;wherein the determining the third template costs for the motion information candidates based on the predicted value and a reconstructed value of the template region includes:substituting the predicted value of the template region predicted using the motion information candidates and the reconstructed value of the template region into the determination formula for the third template costs to obtain the third template costs for the motion information candidates.The method of claim 7, wherein the candidate list includes sub-mode candidates of a sub-block prediction technique, wherein the sorting the candidate list based on a template region of the current block to obtain the adjusted candidate list includes:sorting the at least some of the sub-mode candidates based on first template costs of at least some of the sub-mode candidates.The method of claim 28, wherein the sorting the at least some of the sub-mode candidates based on a first template cost of at least some of the sub-mode candidates includes:sorting the at least some of the sub-mode candidates in ascending order of the first template costs of the at least some of the sub-mode candidates.The method of claim 28, wherein the first template costs of the sub-mode candidates are determined based on the predicted value of the template region of the current block, the predicted value of the template region under a sub-mode candidate is determined from a combination of at least one predicted value of at least one template sub-block of the template region under the sub-mode candidate, the at least one predicted value of the at least one template sub-block under the sub-mode candidate is predicted based on motion information of the at least one template sub-block under the sub-mode candidate.The method of claim 30, wherein each of the first template costs corresponds to a template sub-block of the at least one template sub-block, and the each first template cost is determined by:determining motion information of the corresponding template sub-block under the sub-mode candidate based motion information of a current sub-block under the sub-mode candidate that is closest to the template sub-block, a mode of obtaining the motion information of the current sub-block under the sub-mode candidate that is closest to the template sub-block, and / or motion information of the template sub-block under the sub-mode candidate at a position corresponding to a reference block template of the current block;wherein a positional relationship between the reference block template and a reference block of the current block is equivalent to a positional relationship between the template region and the current block.The method of claim 31, wherein the determining motion information of the corresponding template sub-block under the sub-mode candidate includes at least one of the following:designating the motion information of the current sub-block closest to the template sub-block as the motion information of the template sub-block;obtaining the motion information of the template sub-block using a motion information acquisition manner for acquiring the motion information of the current sub-block closest to the template sub-block; if the motion information of the template sub-block is not obtained, designating the motion information of the current sub-block closest to the template sub-block or predefined motion information as the motion information of the template sub-block; ordetermining the motion information of the template sub-block based on motion information of a corresponding position of the template sub-block in the reference block template; if the motion information of the template sub-block is not obtained, designating the motion information of the current sub-block closest to the template sub-block or the predefined motion information as the motion information of the template sub-block.The method of claim 30, wherein the at least one of template sub-block is obtained by:in response to a prediction mode of the current block being a sub-block prediction mode, dividing the template region of the current block to obtain the at least one template sub-block.The method of claim 33, wherein the template region includes a first template region in a first direction of the current block and / or a second template region in a second direction of the current block, and the dividing the template region of the current block to obtain the at least one template sub-block includes at least one of:dividing the first template region into sub-blocks according to a width of the first template region to obtain the at least one template sub-block, wherein the first direction includes above the current block and / or below the current block, and the second direction includes on a left side of the current block and / or on a right side of the current block;dividing the second template region into sub-blocks according to a height of the second template region to obtain the at least one template sub-block; ordividing the template region into sub-blocks according to an extension line of a division line of sub-blocks of the current block to obtain the at least one template sub-block.The method of claim 7, wherein the adjusted candidate list includes a sorted candidate list, and the sorting the candidate list based on a template region of the current block to obtain the adjusted candidate list includes:grouping the candidate list to obtain at least two candidate groups;sorting, in an intra-group sort, candidates in each group of at least one of the at least two candidate groups based on fourth template costs of the candidates in the candidate list, and / or, sorting, in an inter-group sort, the at least two candidate groups to obtain the sorted candidate list.The method of claim 35, wherein the decoding the current block based on the adjusted candidate list includes:determining a candidate from the sorted candidate list that has a same index value with a best candidate of the current block; anddecoding the current block based on the candidate that has the same index value with the best candidate of the current block.The method of claim 35, wherein the fourth template costs are determined based on a predicted value of the template region of the current block, the predicted value of the template region being determined by predicting the template region based on the candidate.The method of claim 35, wherein the grouping the candidate list to obtain at least two candidate groups includes:deciphering a grouping syntax of the current block, and determining a grouping scheme for the candidate list based on a value of the grouping syntax;grouping the candidate list using the grouping scheme to obtain the at least two candidate groups.The method of claim 35, wherein the grouping the candidate list to obtain at least two candidate groups includes:grouping the candidate list based on an order of candidates in the candidate list; orgrouping the candidate list based on how the candidates in the candidate list are obtained.The method of claim 35, wherein the sorting, in an inter-group sort, the at least two candidate groups to obtain the sorted candidate list includes:sorting, in an inter-group sort, the at least two candidate groups based on a statistical value of fourth template costs for each group of the at least two candidate groups to obtain the sorted candidate list.The method of any one of claims 1-40, wherein the candidate list includes a block vector candidate list, and the block vector candidate list includes candidate block vectors.The method of claim 41, wherein the adjusting the candidate list to obtain an adjusted candidate list includes:determining one or more target candidate block vectors from the candidate block vectors of the block vector candidate list based on block vector index information of the candidate block vectors;adjusting one or more offsets of the one or more target candidate block vectors using a predefined offset adjustment strategy to obtain one or more adjusted candidate block vectors.The method of claim 42, wherein the offset is determined using an index determination mode, and the adjusting one or more offsets of the one or more target candidate block vectors using a predefined offset adjustment strategy to obtain one or more adjusted candidate block vectors includes:determining a corresponding offset distance and a corresponding offset direction based on an offset distance index and an offset direction index in the block vector index information of each of the one or more target candidate block vectors;performing directional offsetting and / or distance offsetting on the each target candidate block vector based on the offset distance and / or the offset direction, to obtain a target reference block; and designating a candidate block vector corresponding to the target reference block as an adjusted candidate block vector.The method of claim 42, wherein the predefined offset adjustment strategy includes an offset mode and an offset determination mode, the offset determination mode includes a template determination mode, and the adjusting one or more offsets of the one or more target candidate block vectors using a predefined offset adjustment strategy to obtain one or more adjusted candidate block vectors includes:performing offsetting on each of the one or more target candidate block vectors based on the offset mode to obtain an offset candidate block vector, the offset mode including directional offsetting and / or distance offsetting;determining one or more offset reference blocks corresponding to the current block based on the one or more offset candidate block vectors;determining, based on the template determination mode, an offset cost between the current block and each of the one or more offset reference blocks and / or a candidate reference block corresponding to the each target candidate block vector;determining, based on the one or more offset costs, a target reference block from the one or more offset reference blocks and / or the one or more candidate reference blocks; and designating a candidate block vector corresponding to the target reference block as the adjusted candidate block vector.The method of claim 44, whereinthe determining, based on the template determination mode, an offset cost between the current block and each of the one or more offset reference blocks and / or a candidate reference block corresponding to the each target candidate block vector includes:determining a first pixel cost between the current block and each of the one or more offset reference blocks based on a adjacent pixel template of the current block and a adjacent pixel template of the each offset reference block; and / ordetermining a second pixel cost between the current block and the candidate reference block based on one or more adjacent pixels of the current block and one or more adjacent pixels of the candidate reference block;the determining, based on the one or more offset costs, a target reference block from the one or more offset reference blocks and / or the one or more candidate reference blocks includes:determining the target reference block from the one or more offset reference blocks and / or the one or more candidate reference blocks based on the one or more first pixel costs and / or the one or more second pixel costs.The method of claim 41, wherein the decoding the current block based on the adjusted candidate list includes:determining a target block vector among the one or more target candidate block vectors and / or the one or more adjusted candidate block vectors;determining a predicted block corresponding to the current block based on the target block vector; anddesignating image information of the predicted block as predicted image information of the current block.The method of claim 46, wherein the determining a target block vector among the one or more target candidate block vectors and / or the one or more adjusted candidate block vectors includes:in response to a syntactic interpretation result of a bitstream, if the syntactic interpretation result indicates a block vector difference is received from an encoding end, designating a sum of a looked-up candidate block vector and the block vector difference as the target block vector;if the syntactic interpretation result indicates no block vector difference is received from the encoding end, designating the looked-up candidate block vector as the target block vector.The method of claim 41, wherein the constructing a candidate list for a current block includes:in response to receiving a bitstream from an encoding end, obtaining block vector index information corresponding to the current block of an image to be decoded in the bitstream, the image to be decoded includes the current block to be decoded and one or more decoded image blocks;constructing a block vector candidate list based on block vectors of reference blocks in the image to be decoded, the reference blocks being determined in the one or more decoded image blocks based on the current block.The method of claim 48, wherein the constructing a block vector candidate list based on block vectors of reference blocks in the image to be decoded includes:constructing an initial block vector candidate list based on the block vectors of the reference blocks, the initial block vector candidate list includes initial candidate block vectors;determining a pixel cost between the current block and each of the reference blocks based on one or more adjacent pixels of the current block and one or more adjacent pixels of a reference block corresponding to each of the initial candidate block vectors; andrearranging the initial candidate block vectors in the initial block vector candidate list based on the pixel costs to obtain the block vector candidate list.The method of claim 48, wherein the constructing a block vector candidate list based on block vectors of reference blocks in the image to be decoded includes:constructing a to-be-filled list;obtaining the block vector candidate list by selecting candidate block vectors from the block vectors of the reference blocks and filling the candidate block vectors into the to-be-filled list based on a predefined list filling strategy.The method of claim 50, wherein the obtaining the block vector candidate list by selecting candidate block vectors from the block vectors of the reference blocks and filling the candidate block vectors into the to-be-filled list based on a predefined list filling strategy includes:comparing a candidate block vector currently filled into the to-be-filled list with the candidate block vectors that have been filled into the to-be-filled list;in response to the to-be-filled list including a candidate block vector that is the same as the candidate block vector currently filled into the to-be-filled list, performing de-duplication on the to-be-filled list.The method of claim 50, wherein the obtaining the block vector candidate list by selecting candidate block vectors from the block vectors of the reference blocks and filling the candidate block vectors into the to-be-filled list based on a predefined list filling strategy includes:classifying the block vectors of the reference blocks to obtain a classification result;selecting, based on the classification result, the candidate block vectors to fill in the to-be-filled list from the block vectors of the reference blocks.The method of claim 52, whereinthe classifying the block vectors of the reference blocks to obtain a classification result includes:classifying the reference blocks based on block sizes of the reference blocks to obtain a size classification result;classifying the block vectors based on occurrence frequencies of the block vectors of the reference blocks to obtain a frequency classification result; andclassifying the reference blocks based on positions of the reference blocks relative to the current block to obtain a position classification result;the selecting, based on the classification result, the candidate block vectors to fill in the to-be-filled list from the block vectors of the reference blocks includes:determining, based on the size classification result, a block vector of a reference block with a block size greater than a predefined size threshold as the candidate block vector;determining, based on the frequency classification result, a block vector with an occurrence frequency greater than a predefined frequency threshold as the candidate block vector; anddetermining, based on the position classification result, a block vector of a reference block that matches a corresponding position of the current block as the candidate block vector.The method of claim 52, whereinafter selecting the candidate block vectors to fill in the to-be-filled list, the method further includes:in response to a count of candidate block vectors selected from the block vectors of the reference blocks being less than a to-be-filled count, determining one or more spatial reference blocks of the current block based on one or more predefined spatial positions, and sequentially filling, based on a predefined filling order for the one or more predefined spatial positions, block vectors of the one or more spatial reference blocks as candidate block vectors into the to-be-filled list.The method of claim 2, wherein the decoding the current block based on the adjusted candidate list includes:determining first motion information and second motion information of the current block based on the adjusted candidate list;obtaining a predicted value of the current block by performing a weighted prediction on the current block based on a weight matrix of the current block, the first motion information, and the second motion information; andobtaining a decoding result of the current block based on the predicted value of the current block.The method of claim 55, wherein the determining first motion information and second motion information of the current block based on the adjusted candidate list includes:reordering the candidate list based on a template region to obtain a reordered candidate list;determining the first motion information and the second motion information based on the reordered candidate list.The method of claim 55, wherein the determining first motion information and second motion information of the current block based on the adjusted candidate list includes:correcting at least one motion information candidate in the adjusted candidate list based on a template region to determine corrected first motion information and / or corrected second motion information.The method of claim 57, wherein the correcting at least one motion information candidate in the adjusted candidate list based on a template region to determine corrected first motion information and / or corrected second motion information includes:decoding a bitstream to determine indexes of the first motion information and the second motion information;determining first motion information to be corrected and / or second motion information to be corrected from the candidate list based on the indexes of the first motion information and the second motion information; andcorrecting the first motion information to be corrected and / or the second motion information to be corrected based on the template region to obtain the corrected first motion information and / or the corrected second motion information.The method of claim 58, wherein the correcting the first motion information to be corrected and / or the second motion information to be corrected based on the template region to obtain the corrected first motion information and / or the corrected second motion information includes:correcting the first motion information to be corrected and / or the second motion information to be corrected based on a correction angle and a correction direction to obtain preliminary corrected first motion information and / or preliminary corrected second motion information;correcting the preliminary corrected first motion information and / or the preliminary corrected second motion information based on the template region to obtain the corrected first motion information and / or the corrected second motion information.The method of claim 58, wherein the determining first motion information to be corrected and / or second motion information to be corrected from the candidate list based on the indexes of the first motion information and the second motion information includes:reordering the candidate list based on the template region to obtain a reordered candidate list;determining the first motion information to be corrected and / or the second motion information to be corrected from the reordered candidate list based on the indexes of the first motion information and the second motion information.The method of any one of claims 1-60, wherein the candidate list includes affine motion information candidates, and the decoding the current block based on the adjusted candidate list includes:determining an affine motion information candidate from the adjusted candidate list that has a same index value with the motion information of the current block;decoding the current block based on the affine motion information candidate with the same index value with the motion information of the current block.The method of any one of claims 1-61, wherein the adjusting the candidate list to obtain an adjusted candidate list includes:determining the adjusted candidate list based on the candidate list using a first model, the first model being a machine learning model.The method of any one of claims 1-62, wherein the decoding the current block based on the adjusted candidate list includes:determining the predicted block for the current block using a second model based on the adjusted candidate list and the current block, the second model being a machine learning model.A video coding method implemented on at least one machine, each of which has at least one processor and a storage device, the method comprising:constructing a candidate list for a current block;adjusting the candidate list to obtain an adjusted candidate list; andencoding the current block based on the adjusted candidate list.The method of claim 64, wherein the adjusting the candidate list to obtain an adjusted candidate list includes:sorting and / or correcting the candidate list based on a template region of the current block to obtain the adjusted candidate list.The method of claim 64, wherein the candidate list includes a block vector candidate list, and the block vector candidate list includes candidate block vectors.The method of claim 66, wherein:the constructing a candidate list for a current block includes:obtaining the block vector candidate list based on block vectors of reference blocks corresponding to a current block to be encoded in an image to be encoded, the reference blocks being determined in one or more encoded image blocks of the image to be encoded based on the current block;the adjusting the candidate list to obtain an adjusted candidate list includes:adjusting offsets of the candidate block vectors using a predefined offset adjustment strategy to obtain adjusted candidate block vectors;performing matching on reference blocks corresponding to the candidate block vectors and / or reference blocks corresponding to the adjusted candidate block vectors, respectively, with the current block, to obtain a target block vector in each of the adjusted candidate block vectors;the encoding the current block based on the adjusted candidate list includes:encoding the current block based on block vector index information of the target block vectors in the block vector candidate list to obtain a target bitstream.The method of any one of claims 64-67, wherein the candidate list includes affine motion information candidates.The method of claim 65, wherein the sorting and / or correcting the candidate list based on a template region of the current block to obtain the adjusted candidate list includes:sorting the candidate list based on the template region to obtain a sorted candidate list;correcting the sorted candidate list to obtain the adjusted candidate list.The method of claim 69, wherein the encoding the current block based on the adjusted candidate list includes:determining optimal motion information for the current block based on the adjusted candidate list;if the optimal motion information for the current block is derived from the adjusted candidate list, encode one or indexes that are redetermined by sorting the optimal motion information.The method of claim 65, wherein the sorting and / or correcting the candidate list based on a template region of the current block to obtain the adjusted candidate list includes:correcting the candidate list based on the template region to obtain a corrected candidate list;sorting the corrected candidate list to obtain the adjusted candidate list.The method of claim 65, wherein the sorting and / or correcting the candidate list based on a template region of the current block to obtain the adjusted candidate list includes:merely sorting the candidate list, or merely correcting the candidate list.The method of claim 71, wherein the encoding the current block based on the adjusted candidate list includes:determining optimal motion information for the current block based on the adjusted candidate list;if the optimal motion information for the current block is derived from the adjusted candidate list, encode one or more indexes that are redetermined by sorting the optimal motion information.The method of claim 68, wherein the encoding the current block based on the adjusted candidate list includes:determining optimal motion information for the current block based on the adjusted candidate list;in response to the optimal motion information coming from the adjusted candidate list or the candidate list before adjusting,encoding a first syntax of the current block to indicate whether to perform the adjustment of the candidate list based on a template region of the current block;encoding a second syntax for the current block to indicate whether to perform sorting of the adjusted candidate list; and / orencoding a third syntax of the current block to indicate whether to perform correction of the affine motion information candidates.The method of claim 65, wherein the template region is determined by:determining, from a plurality of template region selection manners, a template region selection manner for the current block, determining the template region of the current block using the template region selection manner for the current block, and writing the template region selection manner for the current block into a bitstream to indicate the template region selection manner selected for the current block; ortaking a reconstructed pixel region at a predefined position around the current block as the template region.The method of claim 65, wherein the candidate list includes affine motion information candidates, and the sorting the candidate list includes:determining fifth template costs of at least some of the affine motion information candidates in the candidate list based on a predicted value of the template region, the predicted value of the template region being determined by predicting the template region based on the affine motion information candidates;sorting the at least some of the affine motion information candidates based on the fifth template costs of the at least some of the affine motion information candidates.The method of claim 76, wherein the determining fifth template costs for at least some of the affine motion information candidates in the candidate list includes:deriving affine motion information for the template region using the affine motion information candidates;predicting the template region using the affine motion information to obtain the predicted value of the template region; anddetermining a fifth template cost of each of the at least some of the affine motion information candidates based on the predicted value and a reconstructed value of the template region.The method of claim 77, wherein the each affine motion information candidate includes motion information of a plurality of control points of the current block, and the deriving affine motion information for the template region using the affine motion information candidates includes:estimating affine motion information of each template sub-block in the template region based on the motion information of the plurality of control points and coordinates of the each template sub-block in the template region.The method of claim 65, wherein the candidate list includes affine motion information candidates, and the correcting the affine motion information candidates includes:correcting the affine motion information candidates using a searching process, and determining corrected affine motion information candidates based on a sixth template cost in the searching process, the sixth template cost of the searching process being determined based on a predicted value of the template region determined in the searching process.The method of claim 79, wherein the correcting the affine motion information candidates using a searching process includes one of:the sixth template cost includes a seventh template cost, the affine motion information candidates are corrected by: deriving the affine motion information of the template region using the affine motion information candidates; performing a plurality of adjustments on the affine motion information; obtaining the predicted value of the template region by predicting the template region using the affine motion information after each adjustment; determining the seventh template cost based on the predicted value of the template region; and determining the corrected affine motion information candidates based on the seventh template costs of the affine motion information obtained after the plurality of adjustments;the sixth template cost includes an eighth template cost, the affine motion information candidates are corrected by: performing a plurality of adjustments on the affine motion information candidates; obtaining the predicted value of the template region by predicting the template region using the affine motion information candidates after each adjustment; determining the eighth template cost based on the predicted value of the template region; and determining the corrected affine motion information candidates based on the eighth template costs of the affine motion information candidates obtained after the plurality of adjustments; orderiving motion information of template sub-blocks in the template region using the affine motion information candidates; searching for optimal offsets for the template sub-blocks based on the motion information of the template sub-blocks; fitting the affine motion information of the template region based on the optimal offsets of a plurality of searched template sub-blocks; and determining the corrected affine motion information candidates based on the affine motion information of the template region.The method of claim 80, wherein the performs a plurality of adjustments on the affine motion information includes:adjusting the affine motion information by performing a plurality of offsetting on the affine motion information based on one or more offset vectors; oradjusting the affine motion information iteratively based on one or more correction vectors that are determined based on an optical flow formula.The method of claim 81, wherein the adjusting the affine motion information iteratively based on one or more correction vectors that are determined based on an optical flow formula includes:deriving the one or more correction vectors for the affine motion information based on the optical flow formula;obtaining adjusted affine motion information based on the affine motion information and the one or more correction vectors of the affine motion information.The method of claim 82, wherein:the deriving the one or more correction vectors for the affine motion information based on the optical flow formula includes:determining gradients of a plurality of points in the template region based on the affine motion information;obtaining a set of coefficient solution equations by bringing the gradients, the predicted value, a reconstructed value, and coordinate information of the plurality of points in the template region into a coefficient solution equation;solving the set of coefficient solution equations to obtain coefficients of a correction vector determination formula;determining one or more correction vectors for control points in the template region using the coefficients of the correction vector determination formula and coordinates of the control points in the template region;the obtaining adjusted affine motion information based on the affine motion information and the one or more correction vectors of the affine motion information includes:adjusting motion information of the control points in the affine motion information by performing offsetting on the motion information based on the one or more correction vectors of the control points to obtain the adjusted affine motion information;wherein the set of coefficient solution equations is obtained by bringing the correction vector determination formula into the optical flow formula, and the correction vector determination formula is determined based on an affine formula.The method of claim 65, wherein the adjusted candidate list includes a sorted candidate list, and the sorting the candidate list based on a template region of the current block to obtain the adjusted candidate list includes:grouping the candidate list to obtain at least two candidate groups;sorting, in an intra-group sort, candidates in each group of at least one of the at least two candidate groups based on first template costs of the candidates in the candidate list, and / or, sorting, in an inter-group sort, the at least two candidate groups to obtain the sorted candidate list.The method of claim 65, wherein the candidate list includes sub-mode candidates of a sub-block prediction technique, and the sorting the candidate list based on a template region of the current block to obtain the adjusted candidate list includes:sorting at least some of the sub-mode candidates based on first template costs of the at least some of the sub-mode candidates in the candidate list to re-index the at least some of the sub-mode candidates.The method of claim 85, wherein the encoding the current block based on the adjusted candidate list includes:determining an optimal prediction mode for the current block based on the at least some of the sub-mode candidates, and if the optimal prediction mode for the current block is derived from the at least some of the sub-mode candidates, encoding one or more indexes of the sub-mode candidates redetermined under the optimal prediction mode.The method of claim 84, wherein the encoding the current block based on the adjusted candidate list includes:determining an optimal candidate for the current block based on the sorted candidate list, and if the optimal candidate for the current block is from the sorted candidate list, encoding a redetermined index of the optimal candidate.The method of claim 84, wherein:the method further includes:determining, from a plurality of grouping schemes, a grouping scheme for the candidate list;writing a grouping syntax of the current block to a bitstream to indicate the grouping scheme selected for the current block;the grouping the candidate list to obtain at least two candidate groups includes:grouping the candidate list using the grouping scheme.The method of claim 85, wherein the first template costs of the candidates include first template costs of sub-mode candidates, the first template costs of the sub-mode candidates are determined based on a predicted value of the template region of the current block, the predicted value of the template region under the sub-mode candidates is predicted based on a combination of at least one predicted value of at least one template sub-block under the sub-mode candidates, the at least one predicted value of the at least one template sub-block under the sub-mode candidates is predicted based on motion information of the at least one template sub-block under the sub-mode candidates.The method of claim 89, wherein the at least one template sub-block is obtained by:in response to a prediction mode of the current block being a sub-block prediction mode, dividing the template region of the current block to obtain the at least one template sub-block.The method of claim 64, wherein:the constructing a candidate list for a current block includes:constructing a first candidate list of the current block under a conventional prediction technique;the method further includes:writing a first syntax to a bitstream;wherein a value of the first syntax is used to indicate whether to perform adjusting on the first candidate list based on a template region of the current block; and encoding on the current block based on the adjusted candidate list.The method of claim 64, wherein:the constructing a candidate list for a current block includes:constructing a second candidate list for the current block, the second candidate list for the current block being independent of a first candidate list for the current block under a conventional prediction technique;the method further includes:writing a second syntax to a bitstream;wherein a value of the second syntax is used to indicate whether to perform the following operations in sequence:constructing the second candidate list for the current block;adjusting the candidate list based on the template region of the current block; andencoding the current block based on the adjusted candidate list.The method of claim 84, wherein fourth template costs of candidates in the candidate list are determined based on a predicted value of the template region of the current block, and the predicted value of the template region is determined by predicting the template region based on the candidates.The method of claim 65, wherein the sorting and / or correcting the candidate list based on a template region of the current block to obtain the adjusted candidate list includes:sorting the motion information candidates in the candidate list based on importance of at least some of the motion information candidates in the candidate list to obtain the adjusted candidate list.The method of any one of claims 64-94, wherein the encoding the current block based on the adjusted candidate list includes:determining first motion information and second motion information of the current block based on the adjusted candidate list;obtaining a predicted value of the current block by performing a weighted prediction on the current block based on a weight matrix of the current block, the first motion information, and the second motion information; andobtaining an encoding result of the current block based on the predicted value of the current block.An electronic device comprising a processor, the processor being configured to execute instructions to perform the method of any one of claims 1-95.A non-transitory computer readable storage medium, comprising at least one set of instructions, wherein when executed by at least one processor of a computer device, the at least one set of instructions directs the at least one processor to perform the method of any one of claims 1-95.

Citation Information

Patent Citations

  • Method and apparatus of reordering motion vector prediction candidate set for video coding

    CN110574377A

  • Method and apparatus of shared merge candidate list region for video coding

    CN112840653A

  • Video encoding / decoding method and device for constructing merge candidate list by generating pairwise merge candidates

    WO2023132615A1

  • Method and device for video coding using template matching-based inter prediction

    WO2024117694A1