Coding method, code stream, encoder, decoder and storage medium
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-22
- Publication Date
- 2026-08-11
AI Technical Summary
In the existing video encoding technology, the transformation model obtained based on adjacent pixels cannot guarantee accuracy, resulting in a decrease in encoding and decoding efficiency.
At the encoding and decoding end, by building a transform model candidate list of the current block, the transform model and reference block are determined, and the reference block is transformed according to the transform model to improve the diversity and accuracy of inter-frame prediction.
Improves the diversity and accuracy of inter-frame prediction, thereby improving the encoding and decoding efficiency.
Smart Images

Figure CN122556080A_ABST
Abstract
Description
Coding and decoding method, code stream, encoder, decoder and storage medium Technical Field
[0001] The embodiments of the present application relate to the field of video coding and decoding technology, and in particular to a coding and decoding method, a bit stream, an encoder, a decoder, and a storage medium. Background Art
[0002] As demand for video display quality increases, high-resolution video, such as HD and UHD, has emerged. However, high-resolution video typically contains more information and therefore requires more bandwidth. To reduce bandwidth requirements, video coding standards involving video compression have been introduced.
[0003] In video coding standards, Local Illumination Compensation (LIC) technology is a block-level linear transformation technique. LIC assumes a linear relationship between the coding block and the reference block. It calculates a transformation model based on the adjacent pixels of the coding block and its reference block and applies this transformation model to the reference block, thereby improving prediction accuracy. However, existing technical solutions are incomplete. For example, the transformation model derived from adjacent pixels cannot guarantee accuracy, reducing encoding and decoding efficiency.
[0004] Summary of the Invention
[0005] The embodiments of the present application provide a coding and decoding method, a bit stream, an encoder, a decoder, and a storage medium, which can improve the diversity of inter-frame prediction, thereby improving coding and decoding efficiency.
[0006] The technical solution of the embodiment of the present application can be implemented as follows:
[0007] In a first aspect, an embodiment of the present application provides a decoding method, applied to a decoder, the method comprising:
[0008] Decoding the code stream to determine a value of the first syntax identification information;
[0009] When the first syntax identification information indicates that the current block uses the inter prediction mode, constructing a transform model candidate list for the current block;
[0010] Determine a transformation model for a current block based on the transformation model candidate list, and determine a reference block for the current block;
[0011] The reference block is transformed according to the transformation model to determine the prediction block of the current block.
[0012] In a second aspect, an embodiment of the present application provides an encoding method, applied to an encoder, the method comprising:
[0013] When the current block uses the inter prediction mode, construct a transform model candidate list for the current block;
[0014] Determine a transformation model for a current block based on the transformation model candidate list, and determine a reference block for the current block;
[0015] The reference block is transformed according to the transformation model to determine the prediction block of the current block.
[0016] In a third aspect, an embodiment of the present application provides a code stream, wherein the code stream is generated by bit encoding based on information to be encoded; wherein the information to be encoded includes at least one of the following:
[0017] The residual block of the current block, the transformation model index number of the current block, the first merge index number of the current block, the second merge index number of the current block, the motion information of the current block, the first transformation model index number and the second transformation model index number of the current block, the prediction direction information of the current block, the mode identification information of at least part of the candidate motion information in the first sorted merge candidate list, the value of the first syntax identification information, the value of the second syntax identification information, the value of the third syntax identification information, the value of the fourth syntax identification information, and the value of the fifth syntax identification information;
[0018] Among them, the first syntax identification information is used to indicate whether the current block uses the inter-frame prediction mode, the second syntax identification information is used to indicate whether the current block uses the method based on the transformation model candidate list, the third syntax identification information is used to indicate whether the current block uses the prediction mode based on the reference block transformation, the fourth syntax identification information is used to indicate whether the current block uses the inter-frame merge prediction mode, and the fifth syntax identification information is used to indicate whether the current block uses the intra-frame block copy mode.
[0019] In a fourth aspect, an embodiment of the present application provides an encoder, comprising a first construction unit, a first determination unit, and a first prediction unit, wherein:
[0020] A first constructing unit is configured to construct a transform model candidate list for the current block when the current block uses an inter-frame prediction mode;
[0021] a first determining unit configured to determine a transformation model of a current block based on a transformation model candidate list, and determine a reference block of the current block;
[0022] The first prediction unit is configured to transform the reference block according to the transformation model to determine a prediction block of the current block.
[0023] In a fifth aspect, an embodiment of the present application provides an encoder, comprising a first memory and a first processor; wherein,
[0024] a first memory for storing a computer program capable of running on the first processor;
[0025] The first processor is configured to execute the method according to the second aspect when running the computer program.
[0026] In a sixth aspect, an embodiment of the present application provides a decoder, comprising a decoding unit, a second construction unit, a second determination unit, and a second prediction unit, wherein:
[0027] A decoding unit configured to decode the code stream and determine a value of the first syntax identification information;
[0028] A second constructing unit is configured to construct a transform model candidate list for the current block when the first syntax identification information indicates that the current block uses the inter prediction mode;
[0029] a second determining unit configured to determine a transformation model of a current block based on the transformation model candidate list, and determine a reference block of the current block;
[0030] The second prediction unit is configured to transform the reference block according to the transformation model to determine a prediction block of the current block.
[0031] In a seventh aspect, an embodiment of the present application provides a decoder, the decoder comprising a second memory and a second processor; wherein,
[0032] a second memory for storing a computer program capable of running on the second processor;
[0033] The second processor is configured to execute the method according to the first aspect when running the computer program.
[0034] In an eighth aspect, an embodiment of the present application provides a computer-readable storage medium storing a computer program, which, when executed by at least one processor, implements the method described in the first aspect or the method described in the second aspect.
[0035] The embodiments of the present application provide a coding and decoding method, a bitstream, an encoder, a decoder, and a storage medium. At the encoding end, when the current block uses the inter-frame prediction mode, a list of candidate transform models for the current block is constructed; based on the list of candidate transform models, the transform model of the current block is determined, and the reference block of the current block is determined; the reference block is transformed according to the transform model to determine the prediction block of the current block. At the decoding end, the bitstream is decoded to determine the value of first syntax identification information; when the first syntax identification information indicates that the current block uses the inter-frame prediction mode, a list of candidate transform models for the current block is constructed; based on the list of candidate transform models, the transform model of the current block is determined, and the reference block of the current block is determined; the reference block is transformed according to the transform model to determine the prediction block of the current block. In this way, whether at the encoding end or the decoding end, when the current block uses the inter-frame prediction mode, it is first necessary to construct a list of candidate transform models for the current block, and then determine the transform model and reference block of the current block based on the list of candidate transform models. The reference block is transformed according to the transform model, thereby not only improving the diversity of inter-frame prediction, but also improving the accuracy of prediction, thereby improving coding and decoding efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] FIG1 is a flow chart of a hybrid coding framework;
[0037] FIG2 is a schematic diagram of template matching of an IntraTMP technology;
[0038] FIG3 is a schematic diagram of a matching block for determining a current block;
[0039] FIG4A is a second schematic diagram of template matching using the IntraTMP technology;
[0040] FIG4B is a third schematic diagram of template matching using the IntraTMP technology;
[0041] FIG5 is a schematic diagram of weighted fusion of an IntraTMP technology;
[0042] FIG6 is a schematic diagram of the structure of a filter;
[0043] FIG7 is a schematic diagram of a structure for determining filter coefficients;
[0044] FIG8A is a schematic diagram of a vertically quartered structure;
[0045] FIG8B is a schematic diagram of a structure divided into four equal parts horizontally;
[0046] FIG9 is a schematic diagram of current block prediction applied to LIC technology;
[0047] FIG10 is a schematic diagram of a linear relationship between a reference block and a prediction block;
[0048] FIG11 is a schematic diagram showing the positions of adjacent candidates and non-adjacent candidates of a current block;
[0049] FIG12 is a schematic diagram of current block prediction applied to the BVD technology;
[0050] FIG13 is a schematic diagram of a bidirectional matching method applied to DMVR technology;
[0051] FIG14 is a schematic block diagram of an encoder according to an embodiment of the present application;
[0052] FIG15 is a schematic block diagram of a decoder according to an embodiment of the present application;
[0053] FIG16 is a schematic diagram of a network architecture of a coding and decoding system provided in an embodiment of the present application;
[0054] FIG17 is a flowchart diagram 1 of a decoding method provided in an embodiment of the present application;
[0055] FIG18 is a second flow chart of a decoding method provided in an embodiment of the present application;
[0056] FIG19 is a third flow chart of a decoding method provided in an embodiment of the present application;
[0057] FIG20 is a fourth flow chart of a decoding method provided in an embodiment of the present application;
[0058] FIG21 is a fifth flow chart of a decoding method provided in an embodiment of the present application;
[0059] FIG22 is a sixth flow chart of a decoding method provided in an embodiment of the present application;
[0060] FIG23 is a seventh flowchart of a decoding method provided in an embodiment of the present application;
[0061] FIG24 is a flowchart diagram eight of a decoding method provided in an embodiment of the present application;
[0062] FIG25 is a flowchart diagram 1 of an encoding method provided in an embodiment of the present application;
[0063] FIG26 is a second flow chart of an encoding method provided in an embodiment of the present application;
[0064] FIG27 is a third flow chart of an encoding method provided in an embodiment of the present application;
[0065] FIG28 is a schematic diagram of the structure of an encoder provided in an embodiment of the present application;
[0066] FIG29 is a schematic diagram of a specific hardware structure of an encoder provided in an embodiment of the present application;
[0067] FIG30 is a schematic diagram of the structure of a decoder provided in an embodiment of the present application;
[0068] FIG31 is a schematic diagram of a specific hardware structure of a decoder provided in an embodiment of the present application;
[0069] Figure 32 is a schematic diagram of the composition structure of a coding and decoding system provided in an embodiment of the present application. DETAILED DESCRIPTION
[0070] In order to enable a more detailed understanding of the features and technical contents of the embodiments of the present application, the implementation of the embodiments of the present application is described in detail below with reference to the accompanying drawings. The attached drawings are for reference only and are not used to limit the embodiments of the present application.
[0071] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which this application pertains. The terms used herein are for the purpose of describing the embodiments of this application only and are not intended to limit this application.
[0072] In the following description, reference is made to “some embodiments”, which describes a subset of all possible embodiments, but it will be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0073] It should also be pointed out that the terms "first\second\third" involved in the embodiments of the present application are only used to distinguish similar objects and do not represent a specific ordering of the objects. It can be understood that "first\second\third" can be interchanged with a specific order or sequence where permitted, so that the embodiments of the present application described here can be implemented in an order other than that illustrated or described here.
[0074] In video images, a coding block (CB) is generally represented by a first color component, a second color component, and a third color component. These three color components are a luminance component, a blue chrominance component, and a red chrominance component. Specifically, the luminance component is typically represented by the symbol Y, the blue chrominance component is typically represented by the symbols Cb or U, and the red chrominance component is typically represented by the symbols Cr or V. Thus, video images can be represented in either the YCbCr or YUV format.
[0075] Before further explaining the embodiments of the present application in detail, the nouns and terms involved in the embodiments of the present application are explained first. The nouns and terms involved in the embodiments of the present application are subject to the following interpretations:
[0076] H.265 / High Efficiency Video Coding (HEVC);
[0077] H.266 / Versatile Video Coding (VVC);
[0078] VVC Test Model (VTM), a reference software testing platform for VVC;
[0079] Enhanced Compression Model (ECM) reference software test platform;
[0080] Joint Video Experts Team (JVET);
[0081] Intra Template Matching Prediction (IntraTMP);
[0082] Block Vector (BV);
[0083] Motion Vector (MV);
[0084] Motion Vector Difference (MVD);
[0085] Motion Vector Prediction (MVP);
[0086] Most Probable Mode (MPM);
[0087] Sum of Absolute Difference (SAD);
[0088] Sum of Absolute Transformed Difference (SATD);
[0089] Mean Squared Error (MSE);
[0090] Root Mean Square Error (RMSE);
[0091] Mean Absolute Error (MAE);
[0092] Mean Absolute Deviation (MAD);
[0093] Coding Unit (CU);
[0094] Coding Tree Unit (CTU);
[0095] Sequence Parameter Set (SPS);
[0096] Palette (PLT);
[0097] Merge;
[0098] Block Differential Pulse Coded Modulation (BDPCM);
[0099] Intra Block Copy (IBC);
[0100] Local Illumination Compensation (LIC);
[0101] Cross Component Merge (CCMerge);
[0102] Decoder-side Motion Vector Refinement (DMVR).
[0103] Currently, common video codec standards all adopt a block-based hybrid coding framework. Each image, sub-image, or frame in a video is divided into square maximum coding units (LCUs) or coding tree units (CTUs) of the same size (e.g., 256×256, 128×128, 64×64, etc.). Each LCU or CTU can be divided into rectangular CUs according to a rule. Coding units may also be divided into prediction units (PUs), transform units (TUs), etc. Specifically, as shown in Figure 1, the hybrid coding framework includes a prediction module 11, a transform and quantization module 12, an entropy coding module 13, an inverse quantization and inverse transform module 14, a loop filter module 15, and a decoded picture buffer module 16. The prediction module 11 may include an intra-frame prediction module 11a and an inter-frame prediction module 11b. The inter-frame prediction module 11b may include a motion estimation module and a motion compensation module. Because there is a strong correlation between adjacent pixels in a video image, intra-frame prediction is used in video codec technology to eliminate spatial redundancy between adjacent pixels. In addition, since there is a strong similarity between adjacent images in a video, the inter-image prediction method is used in video coding and decoding technology to eliminate the temporal redundancy between adjacent images, thereby improving coding efficiency.
[0104] The basic process of a video codec is as follows: On the encoder side, an image is divided into blocks. Intra-frame prediction or inter-frame prediction is used on the current block to generate a prediction block for the current block. The prediction block is subtracted from the original block to obtain a residual block. The residual block is transformed and quantized to obtain a quantization coefficient matrix. This quantization coefficient matrix is entropy-encoded and output to the bitstream. On the decoder side, intra-frame prediction or inter-frame prediction is used on the current block to generate a prediction block for the current block. The bitstream is then parsed to obtain a quantization coefficient matrix. This quantization coefficient matrix is inversely quantized and inversely transformed to obtain a residual block. The prediction block and residual block are added together to obtain a reconstructed block. The reconstructed blocks form a reconstructed image, which is then subjected to image-based or block-based loop filtering to obtain a decoded image. The encoder side also performs similar operations as the decoder side to obtain a decoded image. The decoded image can serve as a reference image for inter-frame prediction of subsequent images. Block division information, prediction, transform, quantization, entropy coding, loop filtering, and other mode or parameter information determined by the encoder are output to the bitstream if necessary. The decoding end determines the same block division information as the encoding end by parsing the bit stream and analyzing the existing information, as well as the mode information or parameter information such as prediction, transformation, quantization, entropy coding, and loop filtering, thereby ensuring that the decoded image obtained by the encoding end is the same as the decoded image obtained by the decoding end. The decoded image obtained by the encoding end is also usually called a reconstructed image. The current block can be divided into prediction units during prediction, and the current block can be divided into transformation units during transformation. The division of prediction units and transformation units can be different. The above is the basic process of the video codec under the block-based hybrid coding framework. With the development of technology, some modules or steps of the framework or process may be optimized. The embodiment of the present application is applicable to the basic process of the video codec under the block-based hybrid coding framework, but is not limited to the framework and process.
[0105] In addition, in the embodiments of the present application, the current block (CB) can be the current coding unit, the current prediction unit, or the current transform unit. Due to the need for parallel processing, the image can be divided into slices, etc. Slices in the same image can be processed in parallel, that is, there is no data dependency between them. "Frame" is a commonly used term, and it can generally be understood that a frame is an image. The frame described in the embodiments of the present application can also be replaced by an image or a slice, etc.
[0106] The following is a detailed introduction to several related prediction technologies.
[0107] (1) Intra-frame template matching prediction technology.
[0108] Intra-frame template matching prediction technology, referred to as IntraTMP technology, is a special intra-frame prediction coding tool, mainly used for screen content coding. IntraTMP is mainly implemented through the following process:
[0109] Select the reconstructed pixels of the L-shaped part adjacent to the current block as the template, search for the most similar template in the reconstructed area of the given current frame, and use the reconstructed block corresponding to the most similar template as the matching block, which is used as the prediction block for the current block. As shown in Figure 2, R1 to R4 in the figure are available IntraTMP search regions. Search for the matching block point by point in these regions in the raster scan order.
[0110] In addition, as shown in Figure 3, the matching block can be represented by the block vector BV from the current block to the matching block, and the similarity degree between templates is represented by the magnitude of the template error value. The smaller the template error value, the higher the similarity degree. For example, the Sum of Absolute Difference (SAD) is used to calculate the template error value. The smaller the SAD, the more similar the templates are.
[0111] Here, the codec indicates whether the current block is encoded using the IntraTMP mode through the flag bit intra_tmp_flag. If so, the same template matching process is performed at the decoding end to obtain the same prediction block at the decoding end, and there is no need to additionally encode the block vector information from the current block to the matching block.
[0112] (2) IntraTMP adaptation technology for camera-captured content.
[0113] Based on the existing IntraTMP technology, the IntraTMP adaption for camera-captured content technology proposes to perform template matching with a step size S (that is, every S points in the horizontal and vertical directions, S>1). As shown in Figure 4A, for example, in the search area, instead of searching for the matching block point by point according to the raster scan, it searches at intervals in the horizontal and vertical directions of the search area. Exemplarily, if the current block vector for template matching is (X0, Y0), then the next block vector for template matching should be (X0+S, Y0), and the ordinate of the block vector for template matching in the next row should be Y0+S. After completing the template matching, the best matching block can also be refined within a certain range. As shown in Figure 4B, here template matching is performed with a smaller step size S', where 1≤S'<S; thus, the matching result can be optimized. This technology effectively reduces the complexity of the IntraTMP mode while maintaining good coding efficiency. As shown in Figures 4A and 4B, the grid-filled area represents the template area; the arrow represents the block vector, and the dashed box represents the matching block.
[0114] (3) IntraTMP multi-candidate technology.
[0115] IntraTMP multi-candidate technology uses a template matching process to obtain N candidate matching blocks within the reference area, or to construct a candidate block list of length N. The candidate blocks in the list can be sorted according to the template error value between the candidate blocks and the current block. A candidate block in the list is selected as the final prediction block by index. For a coded block using IntraTMP multi-candidate technology, after decoding the IntraTMP flag intra_tmp_flag to true, it continues to decode intra_tmp_idx. The intra_tmp_idx syntax element can represent the index of the selected candidate block.
[0116] In one possible implementation, the template matching process for constructing the candidate block list is as follows:
[0117] The first step is to perform the first search with a certain step size, for example, both the horizontal step size and the vertical step size are 4. N optimal matching blocks with a certain spacing are obtained (the first N with the smallest template error value);
[0118] In the second step, a second search is performed in the N neighboring areas of the matching blocks obtained in the first step. These neighboring areas can be set to multiple non-overlapping areas based on the step size in the first step. M optimal matching blocks are obtained from these areas (which may include the matching blocks obtained in the first step).
[0119] The same construction process is used at the encoding and decoding ends to obtain a consistent list of candidate blocks.
[0120] Intra_tmp_idx may use fixed-length encoding or variable-length encoding, for example, truncated binary encoding.
[0121] In one possible implementation, the variable-length encoding method is:
[0122] The smaller the index (the smaller the intra_tmp_idx value), the smaller the template error value of the corresponding candidate block, and the greater the probability of being selected statistically. A shorter codeword can be set for a smaller intra_tmp_idx, as shown in Table 1.
[0123] Table 1
[0124] If the maximum value N of intra_tmp_idx is large, a codeword of the same length can be allocated to the larger intra_tmp_idx. For example, N is 15, as shown in Table 2.
[0125] Table 2
[0126] In Table 2 above, x can be obtained using truncated binary.
[0127] (4) IntraTMP fusion prediction technology.
[0128] Through intra-frame template matching, the template error values between the reconstructed block and the current block at different positions can be obtained. These reconstructed blocks can be represented by block vectors pointing to the reconstructed blocks from the current block. A candidate block vector list is constructed to record the block vectors with the smallest template error values during the template matching process. One or more block vectors are selected from the candidate block vector list based on conditions such as the block vector spacing and the template error value, and the reconstructed blocks they point to are used as the matching blocks for the current block. A weight value is determined for each matching block. These matching blocks are weighted and fused according to their weight values to obtain the final prediction block, realizing IntraTMP combined fusion prediction. The specific process is shown in Figure 5. The grid-filled area represents the template area, the diagonal-line-filled area represents the reconstructed area, the dot-filled area represents the search area, and the arrows represent the block vectors. For the current block, after matching block 1, matching block 2, and matching block 3 are determined based on different block vectors, matching block 1, matching block 2, and matching block 3 can be weighted and fused according to weight values W1, W2, and W3 to obtain the prediction block for the current block.
[0129] It should be noted that the number of matching blocks to be fused can be a fixed number or determined based on the size of the template error values of each matching block. For example, for the N available matching blocks, a threshold Threshold = minSAD << 1 is set, where minSAD is the minimum template error value among these matching blocks. Only matching blocks with a template error value less than or equal to this threshold are used in the fusion process. This method can determine the matching blocks for fusion.
[0130] After the matching blocks for fusion are determined, the weight of each matching block can be determined by using a preset fixed value, calculating based on the template error value, or deducing based on the template.
[0131] (5)IntraTMP filtering technology.
[0132] The matching block (also called reference block) obtained by intra-frame template matching is usually directly used as the prediction block of the current block. The prediction block can be filtered to improve the prediction effect. Here, a block-level flag can be used to indicate whether the current block uses the filtering process for the prediction block. There are many types of filters, and one possible filter form is as follows: PredC = c0C + c1N + c2S + c3E + c4W + c5B (1)
[0133] Where C is the pixel to be filtered, N is the pixel above it, S is the pixel below it, W is the pixel to its left, and E is the pixel to its right, as shown in Figure 6. B (Bias) is a fixed value, for example, B is the median of the pixel range. c0 to c5 are the filter coefficients.
[0134] In one possible implementation, the filter coefficients are determined by training the filter coefficients using a reference block template and a current block template. For example, the template area is the reconstruction area four rows above and four columns to the left of the current block. For the reference block, an additional row of areas above, below, to the left, and to the right of the template area is also required as a reference, as shown in Figure 7. If part of the additional area is not fully encoded, it can be copied from the template area. In Figure 7, the diagonally filled areas represent the additional row of areas above, below, to the left, and to the right of the reference template area.
[0135] In one possible implementation, a method for training filter coefficients is to calculate a set of coefficients so that the MSE (Mean Square Error) of the filtered reference block template and the current block template is minimized.
[0136] If the current block uses IntraTMP filtering, then the prediction block directly obtained from the reference block is filtered. One possible method is to filter each pixel in order from left to right and from top to bottom, and use the filtered value as the prediction value.
[0137] (6) Template-derived IntraTMP fusion technology.
[0138] IntraTMP fusion prediction can obtain multiple reference blocks through the intra-frame template matching process and perform weighted fusion on these reference blocks. The weight value is usually a predefined fixed value or calculated based on the template error of each reference block. For example, the template error values of the reference blocks are SAD1 to SADn, and one way to calculate the weight is: SADi = (SADi == 0)? 1:SADi (2) Wi=(SUM-SADi) / ((n-1)*SUM) (4)
[0139] Where n is the total number of reference blocks, and Wi is the weight value corresponding to the reference block with a template error value of SADi. The form of the prediction block after weighted fusion can be as follows:
[0140] The template-derived IntraTMP fusion method uses a method similar to filter coefficient training to obtain weights for fusion prediction based on the training of each reference block template and the current block template. For example, using 5 reference blocks for weighted fusion, the form is as follows:
[0141] Another weighted method is to calculate a set of coefficients so that the MSE of the reference block template fused with the current block template is minimized.
[0142] (7) Template-based intra-frame mode derivation technology.
[0143] The Template-Based Intra Mode Derivation (TIMD) technique uses the reconstructed pixels in the L-shaped region adjacent to the current block as a template. By traversing the MPM list, it calculates the predicted pixels of the template area under different intra prediction modes. The resulting template error between the predicted and reconstructed pixels under different intra prediction modes is expressed as the Sum of Absolute Transformed Difference (SATD). The optimal intra prediction mode is selected based on the template error. At the decoding end, the intra prediction mode is derived using the same derivation method, thereby reducing the coding bits of the mode information.
[0144] (8) Joint intra-frame and inter-frame prediction technology.
[0145] Combined Inter and Intra Prediction (CIIP) technology combines intra prediction and inter prediction to obtain the prediction block of the current block using a weighted combination of intra prediction blocks and inter prediction blocks. CIIP in ECM is combined with template-based prediction technology, and different weight values are assigned to different regions, further improving the accuracy of prediction. Specifically, its intra prediction block pred_intra is obtained by the TIMD mode, and the inter prediction block pred_inter is obtained by the template-based Merge mode. Based on the derived intra prediction mode and the position of the pixel to be predicted, the weight values wIntra and wInter are determined. The final prediction block Pred is calculated as follows: Pred = (wIntra*pred_intra+wInter*pred_inter+4)>>3 (7)
[0146] wIntra and wInter are determined by the intra prediction mode intra_dir derived from TIMD. ECM has 65 intra angular prediction modes (2≤intra_dir<=66). When 2≤intra_dir<34, the current block is divided into four equal parts vertically; when 34<=intra_dir<=66, the current block is divided into four equal parts horizontally. The weights wIntra and wInter for each region are shown in Table 3.
[0147] Table 3
[0148] When the image is divided into four equal parts vertically, the index of each region is shown in FIG8A ; when the image is divided into four equal parts horizontally, the index of each region is shown in FIG8B .
[0149] In particular, when intra_dir is equal to 0 or 1, the sub-region is not divided, and wIntra and wInter can be selected from (3, 1), (2, 2), (1, 3) according to the coding type (intra-frame or inter-frame) of the two coding blocks located on the left and the upper side.
[0150] (9) Adaptive reordering of merge candidates based on template error.
[0151] The adaptive reordering of merge candidates with template matching (ARMC-TM) technology is mainly used for inter-frame prediction. This technology proposes that in the process of constructing a merge list for inter-frame coding blocks, the error between the merge candidate and the template of the current block, such as SAD, can be calculated, and different merge candidates can be reordered according to the error. The index codeword corresponding to the merge candidate at the front of the list is shorter, thereby improving coding efficiency. When the motion information of a merge candidate is bidirectionally predicted, the template of the candidate can also be obtained by bidirectional prediction.
[0152] Furthermore, this technique proposes dividing the merge candidate list into multiple sublists, allowing for reordering of candidates within each sublist. To reduce complexity, certain sublists may not be reordered. For example, if the current sublist is not the first sublist but the last, the current sublist is not reordered.
[0153] (10) Intra-frame block copy technology.
[0154] Intra Block Copy (IBC) is an intra-frame prediction technique that uses block matching to obtain predicted pixels. Similar to inter-frame prediction, prediction is achieved by using a block vector pointing from the current block to a reference block. The difference is that the reference block for inter-frame prediction comes from the encoded reconstructed frame, while the reference block for IBC comes from the reconstructed portion of the current frame. Block vector information needs to be transmitted in the codestream, so similar to intra-frame prediction, there are IBC-AMVP mode and IBC-Merge mode.
[0155] IBC-AMVP mode: The predicted block vector is obtained by constructing a merge candidate list, and the reference block and the corresponding final block vector of the current block are obtained through hash search, full search, etc. The final block vector is encoded according to the predicted block vector to improve coding efficiency;
[0156] IBC-Merge mode: Prediction is performed using a constructed list of merge candidates. The best merge candidate in the list is selected through coding processes such as SATD and RDO. The block vector of the merge candidate is inherited to obtain the reference block for prediction. The index of the merge candidate in the list is encoded instead of the block vector itself, improving coding efficiency.
[0157] The merge candidate list can be composed of coding information such as adjacent and non-adjacent coded blocks, historical coded blocks, temporal coded blocks, and the average of candidate block vectors. After constructing the merge candidate list, the list can be reordered based on the template error value of each candidate in the list. The template error value can be obtained by the template error value between each candidate's reference block template and the current block template, such as the SAD value.
[0158] The merge candidate may include information such as the LIC flag. If the LIC flag of a candidate is true, the IBC-LIC technology is used for prediction when the current block selects the candidate.
[0159] Building on the IBC-Merge mode, there's the IBC-MBVD mode. For the merged BV candidates, the block vector difference (BVD) can be determined based on the offset and direction to modify the original BV. For example, if the direction is up, the offset is k, and the original BV is BV0 = (x0, y0), then the new BV0' after BVD can be expressed as: BV0' = (x0, y0 - k).
[0160] (11) Local illumination compensation technology.
[0161] Local Illumination Compensation (LIC) is a block-level linear transformation technology. As shown in Figure 9, the motion information between the current block and the reference block is MV, and LIC technology assumes that there is a linear relationship between the prediction block of the current block and the reference block, which can be expressed as: Pred = α·ref + β (8)
[0162] Among them, α and β can be derived from the pixels of the reconstructed area adjacent to the current block and the pixels of the reconstructed area adjacent to the reference block, and obtained by the least square method or other methods. In addition, the linear relationship shown in formula (8) is shown in Figure 10.
[0163] In addition, the threshold can be set, and different linear parameters can be selected according to the size relationship between the reference block pixels and the threshold, which can be expressed as:
[0164] (12) Non-adjacent candidates for Inter-Merge.
[0165] When constructing the merge list for inter-frame coding blocks in Merge mode, non-adjacent candidates can be added. Based on the size of the current block, non-adjacent points are selected and attempted to be merged candidates. The positions of non-adjacent points and the current block are shown in Figure 11. In Figure 11, the point-filled block is the current block. Points numbered 1-5 in Figure 11 are called adjacent candidates, and the rest are called non-adjacent candidates.
[0166] (13) Multimodal IBC-LIC technology.
[0167] The multi-modal IBC-LIC technique is further divided into multiple sub-methods based on the template area used to derive linear parameters and the number of linear transformation models. One example is to divide IBC-LIC into the following four methods:
[0168] ①Use L-shaped template area and single model;
[0169] ②Use the left template area and a single model;
[0170] ③ Use the template area on the right and a single model;
[0171] ④ Use L-shaped template area and two models (select different models for linear transformation according to the threshold).
[0172] A specific IBC-LIC sub-method can be selected by means of a code index.
[0173] (14) List-based IBC transformation prediction technology.
[0174] The list-based IBC transform prediction technology builds a candidate list of available transform models for the current block through the transform models of the coded blocks in adjacent and non-adjacent positions, historical transform models, time domain transform models, default transform models, etc., and then selects a specific transform model in the list according to the index written into the bitstream to transform the reference block of the current block to obtain the predicted block.
[0175] The current block encoded by Inter, IBC and IntraTMP can be transformed to obtain the prediction block. The transformation of the reference block can be as follows:
[0176] LIC transformation: The relationship between the predicted block pixels Pred(x,y) and the reference block pixels ref(x,y) is as follows: Pred(x,y)=α·ref(x,y)+β (10)
[0177] Multi-model LIC transformation: The relationship between the predicted block pixel Pred(x,y) and the reference block pixel ref(x,y) is as follows:
[0178] Among them, threshold is the reference pixel threshold, and different parameters are used to perform linear transformation on the reference block pixels that exceed the threshold.
[0179] Filter transformation: The relationship between the predicted block pixels Pred(x,y) and the reference block pixels is as follows: Pred(x,y)=c0C+c1N+c2S+c3E+c4W+c5B (12)
[0180] Where C is the reference block pixel at (x, y), N is the pixel above it, S is the pixel below it, W is the pixel to its left, and E is the pixel to its right, as shown in Figure 6. B (Bias) is a fixed value, for example, the median of the pixel range. c0 to c5 are the filter coefficients.
[0181] Accordingly, according to the above-mentioned various transformation forms, the required parameter information (such as α i ,β i ,c i , threshold, etc.) as the transformation model corresponding to the current block position. The candidate list of transformation models for the current block used in subsequent IBC encoding is constructed.
[0182] Before applying the transformation model in the list, you can calculate the offset value based on the pixel values of the current block and the reference block template area to adjust the predicted value, for example:
[0183] Assuming that the template contains N pixels, the template prediction Pred of each pixel is calculated based on the reference block template, and the total difference totalDiff and offset between the template prediction and the template pixel Rec of the current block are calculated as follows: totalDiff = ∑(Rec-Pred) (13) offset = totalDiff / N (14)
[0184] The final predicted value can be the transformed predicted value plus the offset. For example, if LIC transformation is used, then: Pred(x,y)=α·ref(x,y)+β+offset (15)
[0185] Here, you can determine whether the transformation models are the same as follows:
[0186] a. If the transformation type is different, then different;
[0187] b. If it is LIC transformation, the α coefficient is different;
[0188] c. If it is a multi-model LIC transformation, any α i If it is different, then it is different;
[0189] d. If it is a Filter transformation, any c i If it is different, then it is different;
[0190] e.Multiple models.
[0191] For example, a coding block adjacent to the current block is encoded using the IBC-LIC technique, which derives model parameters α1 and β1 from the template region. This transformation model (α1, β1) is saved and added to the list of available transformation model candidates when encoding the current block. This transformation model is then selected based on the index, and the predicted block is obtained through the following steps:
[0192] Step 1: Calculate the offset value of the model based on the current block, the reference block template, and the selected transformation model (α1, β1);
[0193] Step 2: Adjust the parameter according to the offset: β1 = β1 + offset;
[0194] Step 3: Calculate and obtain the predicted block: Pred = α1·ref + β1.
[0195] This technology has a block-level flag cu_ibc_model_merge_flag to indicate whether this technology is used, and an index cu_ibc_model_merge_idx to indicate the index of the selected transformation model in the list. One example is that this technology explicitly transmits the above syntax elements under both the IBC-AMVP and IBC-Merge models. In addition, when the coding block in IBC-Merge mode inherits the coding information of the encoded IBC-Model-Merge block, it only inherits the type information of the transformation model and needs to re-derive a new transformation model based on the template for prediction.
[0196] (15) Adaptive IBC-MBVD list construction technology.
[0197] This technology proposes an IBC-MBVD list construction technology with adaptive offset size. An MBVD list containing K candidates can be obtained by the following steps:
[0198] Step 1: Set the maximum offset value to N pixels, for example, N is 256. Set the number of possible directions D, for example, D is 4 (up, down, left, right). Set the starting interval of the search to M pixels, for example, M is 8. Set the size of the MBVD list K, for example, K is 8;
[0199] Step 2: Determine the reference block template error for each offset size along each direction, at intervals of M, with the offset not exceeding N. The K candidates with the smallest template error are saved in the MBVD list. A candidate is a combination of offset value and direction that can determine a specific reference block location.
[0200] Step 3: For each candidate in the list, determine the template error value of the candidate's new position with an offset of +-M / 2 along the direction. Save the K candidates with the smallest template errors in the MBVD list.
[0201] Step 4: Repeat step 3, dividing M by 2 each time until the value of M is 1 pixel.
[0202] (16)BVD prediction technology.
[0203] BVD prediction technology proposes predicting partial BVD information, such as the sign of the horizontal and vertical components and the values of some bits used to encode the BVD size. Each possible prediction corresponds to a possible BVD. These BVDs can be sorted based on the template error of the reference block corresponding to each possible BVD to determine the final BVD. One implementation method is to use a flag in the bitstream to indicate whether the BVD with the smallest template error value is used as the final BVD.
[0204] Exemplarily, as shown in FIG12 , for the current block, multiple block vectors can be searched and obtained. For these multiple block vectors, after obtaining the block vector prediction (BVP) represented by the bold solid line, multiple block vector differences (BVD) represented by the dotted line can be calculated; then, the BVD with the smallest template error value is selected from these BVDs as the final BVD.
[0205] (17) Bidirectional local illumination compensation technology.
[0206] This technology proposes that an inter-frame coding block using bidirectional prediction can derive two sets of linear transformation models for its reference blocks in List 0 and List 1 respectively. Compared with the LIC technology under unidirectional prediction, the bidirectional LIC technology can recursively derive the transformation models used by the two reference blocks. For example, first, the transformation model M0 corresponding to L0 is derived based on the current block template Tcur and the List 0 reference block template T0; then, Tcur is adjusted based on T0 and M0 to obtain Tcur', and then the transformation model M1 corresponding to L1 is derived from Tcur' and T1; finally, Tcur is adjusted based on T1 and M1 to obtain Tcur", and then the transformation model M0 corresponding to L0 is re-derived from Tcur" and T0. After obtaining M0 and M1, M0 and M1 can be used for the reference blocks corresponding to L0 and L1 respectively in the motion compensation stage to obtain the final prediction block.
[0207] (18) Decoding-side motion vector optimization technology.
[0208] Decoder-side Motion Vector Refinement (DMVR) technology optimizes the motion vector (MV) of a bidirectionally predicted inter-frame coded block based on the error between the two reference blocks. The MV is adjusted within a given range and the bidirectional matching error is calculated. The MV with the lowest bidirectional matching error is used as the optimization result, thereby improving prediction accuracy. As shown in Figure 13, the black-filled blocks represent the current block, the dashed blocks represent the reference blocks corresponding to the initial MV, and the solid blocks represent the reference blocks corresponding to the optimized MV.
[0209] In addition, the calculation of the bidirectional matching error can also refer to the size of the motion vector adjustment. For example, the bidirectional matching error can be calculated as bilCost = mvDistanceCost + sadCost or bilCost = satdCost * costFactor; where bilCost represents the bidirectional matching error, sadCost and SatdCost represent the SAD or SATD between the two reference blocks, mvDistanceCost represents the cost of adjusting the motion vector, and costFactor represents different factors corresponding to different adjustment sizes.
[0210] (19)Inter non-local illumination compensation technology.
[0211] Inter non-local illumination compensation (NL-IC) technology is mainly used for inter-frame prediction, which consists of two parts. First, after the encoding of the inter-frame coding block is completed, a linear transformation model can be calculated based on the reconstructed block of the current block and the reference block, and the transformation model can be saved as part of the motion information. Second, when the current block uses the inter-frame prediction mode, NL-IC candidates can be added to the merge list, where the NL-IC candidate refers to obtaining motion information from spatially adjacent and non-adjacent positions of the current block, and obtaining the transformation model of the position at the same time. If a NL-IC candidate is selected by the current block, the current block will use the transformation model of the NL-IC candidate to transform the reference block. Compared with the LIC technology that derives the transformation model based on the template, the NL-IC technology uses the transformation model calculated by the coded block and its reference block.
[0212] In one possible implementation, up to N NL-IC candidates can be added after the historical candidates in the merge list. The merge list is then reordered using ARMC-TM technology, and the final candidate is selected based on the merge index. When calculating the template error for an NL-IC candidate, the reference block template can be transformed using the transformation model corresponding to the candidate before performing the error calculation.
[0213] In summary, local illumination compensation techniques assume a linear relationship between the coding block and the reference block. Therefore, a transformation model is calculated based on the adjacent pixels of the coding block and its reference block, and this transformation model is applied to the reference block to improve prediction accuracy. However, the transformation model derived from adjacent pixels cannot guarantee accuracy. Another method for obtaining the transformation model is inheritance from coded blocks. Similar to obtaining motion information from coded blocks, the transformation model used for the coded blocks can be reused as a form of motion information. Among them, the list-based IBC transform prediction method proposes constructing a list of transformation models for multiple coded blocks and selecting a transformation model for the current block by index. This method only applies to intra-block copy prediction mode. In addition, this method does not provide a coding method for coding blocks with multiple components (e.g., Y, U, V), and therefore cannot be directly applied to inter-frame coded blocks (usually containing three components), reducing encoding and decoding efficiency.
[0214] Based on this, an embodiment of the present application provides a coding method, which constructs a candidate list of transformation models for the current block when the current block uses an inter-frame prediction mode; determines the transformation model of the current block based on the candidate list of transformation models, and determines the reference block of the current block; transforms the reference block according to the transformation model to determine the prediction block of the current block. An embodiment of the present application also provides a coding method, which decodes a bitstream and determines the value of first syntax identification information; constructs a candidate list of transformation models for the current block when the first syntax identification information indicates that the current block uses an inter-frame prediction mode; determines the transformation model of the current block based on the candidate list of transformation models, and determines the reference block of the current block; transforms the reference block according to the transformation model to determine the prediction block of the current block.
[0215] In this way, whether it is the encoding end or the decoding end, when the current block uses the inter-frame prediction mode, it is necessary to first construct a candidate list of transformation models for the current block, and then determine the transformation model and reference block of the current block based on this, and transform the reference block through the transformation model, which not only improves the diversity of inter-frame prediction, but also improves the accuracy of prediction, thereby improving the encoding and decoding efficiency.
[0216] The embodiments of the present application will be described in detail below with reference to the accompanying drawings.
[0217] Figure 14 is a block diagram of an encoder provided in an embodiment of the present application. As shown in Figure 14, the encoder 100 may include a transform and quantization unit 101, an intra-frame estimation unit 102, an intra-frame prediction unit 103, a motion compensation unit 104, a motion estimation unit 105, an inverse transform and inverse quantization unit 106, a filter control analysis unit 107, a filtering unit 108, an encoding unit 109, and a decoded image cache unit 110, among others. The filtering unit 108 may implement deblocking filtering and sample adaptive offset (SAO) filtering, and the encoding unit 109 may implement header information encoding and context-based adaptive binary arithmetic coding (CABAC).For the input original video signal, a video coding block can be obtained by dividing the coding tree unit (CTU). Then, the residual pixel information obtained after intra-frame or inter-frame prediction is transformed by the transformation and quantization unit 101, including transforming the residual information from the pixel domain to the transform domain and quantizing the obtained transform coefficients to further reduce the bit rate; the intra-frame estimation unit 102 and the intra-frame prediction unit 103 are used to perform intra-frame prediction on the video coding block. Specifically, the intra-frame estimation unit 102 and the intra-frame prediction unit 103 are used to determine the intra-frame prediction mode to be used to encode the video coding block; the motion compensation unit 104 and the motion estimation unit 105 are used to perform inter-frame prediction coding on the received video coding block relative to one or more blocks in one or more reference frames to provide temporal prediction information; the motion estimation performed by the motion estimation unit 105 is the process of generating a motion vector, which can estimate the motion of the video coding block. The motion compensation unit 104 then calculates the motion vector based on the motion vector determined by the motion estimation unit 105. After determining the intra-frame prediction mode, the intra-frame prediction unit 103 is further configured to provide the selected intra-frame prediction data to the encoding unit 109, and the motion estimation unit 105 also sends the calculated motion vector data to the encoding unit 109. In addition, the inverse transform and inverse quantization unit 106 is configured to reconstruct the video coding block and reconstruct a residual block in the pixel domain. The reconstructed residual block is subjected to the filter control analysis unit 107 and the filtering unit 108 to remove the block effect artifacts. The reconstructed residual block is then added to a predictive block in the frame of the decoded image buffer unit 110 to generate a reconstructed video coding block. The encoding unit 109 is configured to encode various coding parameters and quantized transform coefficients. In the CABAC-based coding algorithm, the context content can be based on adjacent coding blocks and can be used to encode information indicating the determined intra-frame prediction mode, and output the code stream of the video signal. The decoded image buffer unit 110 is configured to store the reconstructed video coding block for prediction reference. As the video image encoding proceeds, new reconstructed video encoding blocks are continuously generated, and these reconstructed video encoding blocks are stored in the decoded image buffer unit 110 .
[0218] FIG15 is a block diagram of a decoder provided by an embodiment of the present application. As shown in FIG15 , the decoder 200 includes a decoding unit 201, an inverse transform and inverse quantization unit 202, an intra-frame prediction unit 203, a motion compensation unit 204, a filtering unit 205, and a decoded image cache unit 206, among others. The decoding unit 201 can implement header information decoding and CABAC decoding, and the filtering unit 205 can implement deblocking filtering and SAO filtering. After the input video signal is encoded as shown in FIG14 , a bitstream of the video signal is output; the bitstream is input to the decoder 200 and first passes through the decoding unit 201 to obtain decoded transform coefficients; the transform coefficients are processed by the inverse transform and inverse quantization unit 202 to generate residual blocks in the pixel domain; the intra-frame prediction unit 203 can be used to generate prediction data for the current video decoding block based on the determined intra-frame prediction mode and data from the previously decoded blocks of the current frame or picture; the motion compensation unit 204 determines the prediction information for the video decoding block by analyzing the motion vector and other associated syntax elements, and uses The prediction information is used to generate a predictive block for the video decoding block being decoded; a decoded video block is formed by summing the residual block from the inverse transform and inverse quantization unit 202 with the corresponding predictive block generated by the intra-frame prediction unit 203 or the motion compensation unit 204; the decoded video signal passes through the filtering unit 205 to remove blocking artifacts, thereby improving video quality; the decoded video block is then stored in the decoded image buffer unit 206, which stores reference images used for subsequent intra-frame prediction or motion compensation, and is also used for outputting the video signal, thereby obtaining the restored original video signal.
[0219] Furthermore, FIG16 is a schematic diagram of a network architecture of a coding and decoding system provided in an embodiment of the present application. As shown in FIG16 , the network architecture includes one or more electronic devices 31 to 3N and a communication network 01, wherein the electronic devices 31 to 3N can perform video interaction through the communication network 01. During implementation, the electronic devices can be various types of devices with video coding and decoding functions. For example, the electronic devices can include smartphones, tablet computers, personal computers, personal digital assistants, navigators, digital phones, video phones, televisions, sensor devices, servers, etc., and are not specifically limited in the embodiments of the present application.
[0220] In an embodiment of the present application, a network architecture of a video encoding and decoding system including a decoding method and an encoding method is provided. The decoder or encoder in the embodiment of the present application can be the aforementioned electronic device. In other words, the electronic device in the embodiment of the present application has video encoding and decoding capabilities and can generally include a video encoder (i.e., an encoder) and a video decoder (i.e., a decoder).
[0221] It should also be noted that the embodiments of the present application are mainly applied to the intra-frame prediction part and / or inter-frame prediction part (indicated by a bold frame) as shown in Figure 14 and the intra-frame prediction part and / or inter-frame prediction part (indicated by a bold frame) as shown in Figure 15. In other words, the embodiments of the present application can be applied to both the encoder and the decoder, and can even be applied to both the encoder and the decoder at the same time.
[0222] It should also be noted that when the embodiment of the present application is applied to the encoder as shown in Figure 14, the "current block" specifically refers to the encoding block to be predicted at the moment; when the embodiment of the present application is applied to the decoder as shown in Figure 15, the "current block" specifically refers to the decoding block to be predicted at the moment.
[0223] In one embodiment of the present application, FIG17 is a flowchart diagram of a decoding method provided in an embodiment of the present application. As shown in FIG17 , the method may include:
[0224] S1701: Decode a code stream and determine a value of first syntax identification information.
[0225] It should be noted that in the embodiments of the present application, the method is applied to a decoder. Specifically, based on the structure of decoder 200 shown in FIG15 , the decoding method of the embodiments of the present application can be applied to intra-frame prediction and / or inter-frame prediction, and is primarily applied to inter-frame prediction methods based on inherited transform models, thereby increasing the diversity of inter-frame prediction.
[0226] It should also be noted that, in the embodiments of the present application, the first syntax identification information is used to indicate whether the current block uses the inter-frame prediction mode, which can be represented by cu_prediction_mode. In some embodiments, if the value of the first syntax identification information is a first value, it is determined that the first syntax identification information indicates that the current block uses the inter-frame prediction mode; if the value of the first syntax identification information is a second value, it is determined that the first syntax identification information indicates that the current block does not use the inter-frame prediction mode.
[0227] Here, the first value is different from the second value, and the first value and the second value can be in parameter form or in numeric form. Specifically, the first syntax identification information can be a parameter written in the profile or a flag value, which is not specifically limited here. For example, the first value can be 1 and the second value can be 0; or, the first value can be 0 and the second value can be 1; or, the first value can be true and the second value can be false; or, the first value can be false and the second value can be true.
[0228] In a specific embodiment, taking the first value as 1 and the second value as 0 as an example, if the value of cu_prediction_mode obtained through decoding is 1, then it can be determined that the first syntax identification information indicates that the current block uses the inter-frame prediction mode; if the value of cu_prediction_mode obtained through decoding is 0, then it can be determined that the first syntax identification information indicates that the current block does not use the inter-frame prediction mode.
[0229] S1702: When the first syntax identification information indicates that the current block uses the inter prediction mode, construct a transform model candidate list for the current block.
[0230] It should be noted that, in the embodiment of the present application, when the current block uses the inter-frame prediction mode, it is necessary to further determine whether the current block uses the method based on the transformation model candidate list. Here, a syntax element (such as the second syntax identification information) can also be used to indicate whether the current block uses the method based on the transformation model candidate list.
[0231] In some embodiments, based on the decoding method shown in FIG. 17 , for S1702 , referring to FIG. 18 , the method may include:
[0232] S1801: When the first syntax identification information indicates that the current block uses the inter-frame prediction mode, decode the code stream and determine the value of the second syntax identification information.
[0233] S1802: When the second syntax identification information indicates that the current block uses a method based on a transformation model candidate list, construct a transformation model candidate list for the current block.
[0234] It should also be noted that, in the embodiments of the present application, the second syntax identification information is used to indicate whether the current block uses the method based on the transformation model candidate list, which can be represented by cu_model_merge_flag. In some embodiments, if the value of the second syntax identification information is a first value, it is determined that the second syntax identification information indicates that the current block uses the method based on the transformation model candidate list; if the value of the second syntax identification information is a second value, it is determined that the second syntax identification information indicates that the current block does not use the method based on the transformation model candidate list.
[0235] Here, the first value is different from the second value, and the first value and the second value can be in parameter form or in numeric form. Specifically, the second syntax identification information can also be a parameter written in the profile, or can also be the value of a flag, which is not specifically limited here. For example, the first value can be 1 and the second value can be 0; or the first value can be 0 and the second value can be 1; or the first value can be true and the second value can be false; or the first value can be false and the second value can be true.
[0236] In a specific embodiment, taking the first value as 1 and the second value as 0 as an example, if the value of cu_model_merge_flag obtained through decoding is 1, it can be determined that the second syntax identification information indicates that the current block uses a method based on the transformation model candidate list; if the value of cu_model_merge_flag obtained through decoding is 0, it can be determined that the second syntax identification information indicates that the current block does not use a method based on the transformation model candidate list.
[0237] It should also be noted that, in the embodiment of the present application, the second syntax identification information can be decoded using an entropy decoding method based on a context model. In some embodiments, the method can further include: decoding the code stream based on the context model to determine the value of the second syntax identification information.
[0238] It should also be noted that in this embodiment of the present application, both cu_model_merge_flag and cu_prediction_mode are block-level syntax elements for the current block. For example, cu_prediction_mode is first decoded. If the value of cu_prediction_mode is 1, the current block is determined to use inter-frame prediction mode, and cu_model_merge_flag is then decoded. If the value of cu_model_merge_flag is 1, the current block is determined to use a transform model based on a transform model candidate list, and a transform model candidate list needs to be constructed for the current block.
[0239] In some embodiments, constructing a transformation model candidate list for the current block may include: determining at least one candidate transformation model for the current block; and determining a transformation model candidate list for the current block based on the at least one candidate transformation model.
[0240] In a specific embodiment, determining at least one candidate transformation model for the current block may include at least one of the following:
[0241] Determine available transformation models for neighboring locations of the current block;
[0242] Determine an available transform model in the time domain of the current block;
[0243] Determine available transformation models for non-adjacent locations of the current block;
[0244] Determine an available transformation model in the time domain after the translation of the current block;
[0245] Determine the available transformation models for the history;
[0246] Determines the preset transformation model.
[0247] It should be noted that in the embodiment of the present application, if the value of cu_model_merge_flag is 1, it indicates that a transformation model candidate list needs to be constructed for the current block, which can be recorded as mode1List, and the maximum length can be set to N, where N is a positive integer.
[0248] It should also be noted that, in an embodiment of the present application, for the preset transformation model, it may include: determining the transformation model corresponding to the local illumination compensation mode of the current block as the preset transformation model; or adjusting the existing candidate transformation model in the transformation model candidate list, and determining the adjusted candidate transformation model as the preset transformation model.
[0249] That is to say, in the embodiment of the present application, the preset transformation model here is used as the default transformation model, which can be the model parameter (α Y0 , β Y0 , α U0 , β U0 , α V0 , β V0 ) can also be a LIC transformation model obtained by adjusting the candidate transformation models already in the mode1List list, etc.
[0250] In some embodiments, the transformation model candidate list may include transformation models in the following candidate order: ① available transformation models at adjacent locations; ② available transformation models in the time domain; ③ available transformation models at non-adjacent locations; ④ available transformation models in the time domain after translation; ⑤ available transformation models in the past; and ⑥ preset transformation models.
[0251] In some embodiments, for the transformation model candidate list, the method further includes: after determining a new candidate transformation model for the current block, comparing the new candidate transformation model with existing candidate transformation models in the transformation model candidate list; and if the new candidate transformation model is different from any of the existing candidate transformation models in the transformation model candidate list, adding the new candidate transformation model to the transformation model candidate list. In this way, when adding a transformation model, redundancy can be avoided by comparing it with the existing candidate transformation models in the mode1List list.
[0252] In some embodiments, for the transformation model candidate list, the method further includes: determining a derived transformation model of the current block when constructing the transformation model candidate list of the current block; and adding the derived transformation model to the transformation model candidate list.
[0253] In embodiments of the present application, a derived transformation model can be selected as one of the candidate transformation models. For example, the transformation model candidate list can be adjusted to {LIC, LIC_LEFT, LIC_TOP, LIC_MM, Filter, Model0, Model1...}. LIC, LIC_LEFT...Filter, etc. represent different template-based derivation methods for derived transformation models, while Model0, etc. represent transformation models inherited from spatial and temporal domains to construct the transformation model candidate list.
[0254] S1703 : Determine a transformation model for the current block based on the transformation model candidate list, and determine a reference block for the current block.
[0255] It should be noted that in an embodiment of the present application, the transformation model of the current block may be first determined based on the transformation model candidate list, and then the reference block of the current block may be determined based on the transformation model; or, the reference block of the current block may be first determined, and then the transformation model of the current block may be determined based on the reference block and the transformation model candidate list.
[0256] In one possible implementation, a transformation model for a current block is determined based on a transformation model candidate list, and a reference block for the current block is determined. Referring to FIG. 19 , the method may include:
[0257] S1901: Decode the code stream and determine the transformation model index number of the current block.
[0258] S1902: Determine a transformation model for the current block according to the transformation model index number and the transformation model candidate list.
[0259] S1903: Determine a reference block for the current block according to the transformation model and the first merge candidate list.
[0260] It should be noted that in an embodiment of the present application, when determining the transformation model of the current block based on the transformation model candidate list, the transformation model index number of the current block can be determined by decoding the code stream; then, the transformation model of the current block is determined based on the transformation model index number and the transformation model candidate list.
[0261] It should also be noted that in this embodiment of the present application, the transformation model index number can be represented by cu_model_merge_idx, which is used to indicate the number of the transformation model in the transformation model candidate list. Among them, the value range of cu_model_merge_idx can be less than or equal to the maximum transformation model candidate list length. For decoding cu_model_merge_idx, a variable-length decoding method can be used, and the smaller the index, the shorter the corresponding codeword. Exemplarily, the value range of cu_model_merge_idx is n, and the truncated binary code decoding method is used here.
[0262] Exemplarily, in an implementation, the description of the syntax elements is as follows:
[0263] In this way, a certain transformation model can be determined according to cu_model_merge_idx. For example, if the value of cu_model_merge_idx is equal to idx, modelList[idx] is determined to be the transformation model of the current block.
[0264] It can be understood that in an embodiment of the present application, for the first merge candidate list, the method also includes: determining at least one candidate motion information of the current block; constructing a first merge candidate list based on the at least one candidate motion information of the current block; wherein the candidate motion information is used to indicate the candidate reference block of the current block and / or the template of the candidate reference block.
[0265] In some embodiments, constructing a first merge candidate list based on at least one candidate motion information of the current block may include one of the following:
[0266] Constructing a first merge candidate list based on at least one candidate motion information determined in an inter-frame merge mode;
[0267] Constructing a first merge candidate list based on at least one candidate motion information determined by a template matching method of a motion vector;
[0268] Constructing a first merge candidate list based on at least one candidate motion information determined in a bidirectional matching manner of motion vectors;
[0269] Constructing a first merge candidate list based on at least one candidate motion information determined by means of motion vector difference;
[0270] A first merge candidate list is constructed based on at least one candidate motion information determined in a motion vector difference merging manner.
[0271] It should be noted that, in the embodiment of the present application, the first merge candidate list here can be a constructed Inter Merge list, or can be constructed based on lists such as MV template matching, MV bidirectional matching, MVD prediction, and MMVD candidate sorting. In other words, the transformation model determined according to modelList[idx] can be used in the Merge list during inter-frame prediction to perform template transformation of the reference block, and can also be used in processes such as MV template matching, MV bidirectional matching, MVD prediction, and MMVD candidate sorting to perform template transformation of the reference block, so as to obtain a transformed error value, which is used to replace the template error in the related art.
[0272] In a specific embodiment, determining the reference block of the current block based on the transformation model and the first merge candidate list may include: performing template error calculation on at least one candidate reference block indicated in the first merge candidate list according to the transformation model to determine the error value of the at least one candidate reference block; determining the minimum error value from the error values of the at least one candidate reference block, and determining the candidate reference block corresponding to the minimum error value as the reference block of the current block.
[0273] In the embodiment of the present application, for the first merge candidate list, referring to FIG. 20 , the method may include:
[0274] S2001 , transforming a template of at least one candidate reference block indicated in a first merging candidate list according to a transformation model to obtain a transformation template of the at least one candidate reference block.
[0275] S2002 : performing template error calculation on the template of the current block and the transformed template of at least one candidate reference block respectively based on a preset criterion, and determining an error value of the at least one candidate reference block.
[0276] S2003 , sorting the first merging candidate list according to the error value of at least one candidate reference block to determine a first sorted merging candidate list.
[0277] S2004: Determine a reference block for the current block according to the first sorted merge candidate list.
[0278] It should be noted that, in this embodiment of the present application, the candidate motion information in the first merge candidate list may correspond to a candidate reference block. Determining the error value of the at least one candidate reference block may specifically include transforming the template of the at least one candidate reference block indicated in the first merge candidate list according to a transformation model to obtain a transformed template of the at least one candidate reference block; and performing template error calculation on the template of the current block and the transformed template of the at least one candidate reference block based on a preset criterion to determine the error value of the at least one candidate reference block.
[0279] It should also be noted that, in the embodiment of the present application, the preset criteria include at least one of: absolute error and SAD, absolute transformation error and SATD, mean square error MSE, root mean square error RMSE, mean absolute error MAE and mean absolute deviation MAD.
[0280] For example, using absolute error and SAD as an example, the reference block template in the first merge candidate list process is transformed according to the determined transformation model, and then the first merge candidate list is reordered according to the transformed template error. For example, the transformation model of the current block is modelList[idx], the template corresponding to the nth candidate motion information is Tn, and the template of the current block is Tcur. The template error can be calculated using SAD. First, Tn is transformed according to modelList[idx] to obtain Tn', and then the SAD between Tn' and Tcur is calculated to obtain the template error SADn of the candidate motion information. According to this step, the template error SADi of each candidate motion information in the first merge candidate list is obtained, 0≤i<N. The N candidate motion information in the first merge candidate list can then be reordered according to SADi. The smaller the SADi, the smaller the index value after sorting. In addition, if a candidate motion information corresponds to bidirectional prediction, the template of the candidate motion information can be obtained by bidirectional prediction; the template error calculation can be based on the three YUV components or only a single component; it can also be consistent with the reordering process of the Inter Merge list in the related art.
[0281] It should also be noted that, in an embodiment of the present application, for determining the reference block of the current block, the method also includes: decoding the code stream to determine the first merge index number of the current block; and determining the reference block of the current block based on the first merge index number and the first sorted merge candidate list.
[0282] Here, the first merge candidate list includes N candidate motion information, the first merge index sequence number is used to indicate the number of the target motion information of the current block in the first sorted merge candidate list, and the target motion information can point to the reference block of the current block.
[0283] In some embodiments, the method further includes: decoding the code stream to determine the mode identification information of at least part of the candidate motion information in the first sorted merge candidate list; sorting at least part of the candidate motion information in the first sorted merge candidate list according to the mode identification information of at least part of the candidate motion information to determine the second sorted merge candidate list.
[0284] It should be noted that, in the embodiment of the present application, after the first merge candidate list is reordered, some of the candidates in the list may be further sorted based on the mode identification information (e.g., mode flags such as the LIC flag) of at least some of the candidate motion information to obtain a second sorted merge candidate list. For example, if the LIC flag of a certain candidate motion information is true, it is placed at the front of the list; if the LIC flags of multiple candidate motion information are true, the order of these candidate motion information may remain relatively unchanged.
[0285] In another specific embodiment, the method further includes: decoding the code stream to determine the first merge index number of the current block; and determining the reference block of the current block according to the first merge index number and the first sorted merge candidate list or the second sorted merge candidate list.
[0286] Here, the first merge index number is used to indicate the number of the target merge candidate for the current block in the first sorted merge candidate list or the second sorted merge candidate list, and the target merge candidate can point to the reference block of the current block. In this way, after decoding and obtaining the first merge index number of the current block, the reference block of the current block can be determined based on the selected target merge candidate.
[0287] In another specific embodiment, the method further includes: when the current block uses the DMVR mode, determining at least one group of candidate reference blocks for the current block according to the first merge candidate list, each group of candidate reference blocks including two candidate reference blocks; transforming the two candidate reference blocks in each group of candidate reference blocks according to the transformation model, and determining two transformed reference blocks in each group of candidate reference blocks; performing matching error calculation on the two transformed reference blocks in each group of candidate reference blocks, and determining the error value corresponding to each group of candidate reference blocks; and determining, based on the error value corresponding to each group of candidate reference blocks, a group of candidate reference blocks with the smallest error value as the reference block of the current block.
[0288] It should be noted that in an embodiment of the present application, the two reference blocks of the candidate motion vector (for example, selected from the first merge candidate list) in the DMVR process can also be transformed according to the determined transformation model, and then the error value (for example, the SAD between the two reference blocks) is calculated based on the two transformed reference blocks and the final optimization result is determined. For example, a group of candidate reference blocks with the smallest error value can be determined as the final reference blocks.
[0289] In another possible implementation, a transformation model for a current block is determined based on a transformation model candidate list, and a reference block for the current block is determined. Referring to FIG. 21 , the method may include:
[0290] S2101, decoding the code stream and determining the motion information of the current block.
[0291] S2102: Determine a reference block for the current block based on the motion information.
[0292] S2103 , sorting the transformation model candidate list according to the reference block, and determining a sorted transformation model candidate list.
[0293] S2104: Decode the code stream and determine the transformation model index number of the current block.
[0294] S2105 : Determine the transformation model of the current block according to the transformation model index number and the sorted transformation model candidate list.
[0295] It should be noted that, in the embodiment of the present application, decoding the code stream to determine the reference block of the current block may specifically involve decoding the code stream to determine the motion information of the current block; and then determining the reference block of the current block based on the motion information.
[0296] It should also be noted that, in an embodiment of the present application, the transformation model of the current block is determined based on the reference block and the transformation model candidate list. Specifically, the transformation model candidate list can be sorted according to the reference block to determine the sorted transformation model candidate list; and the code stream can be decoded to determine the transformation model index number of the current block; and then the transformation model of the current block can be determined based on the transformation model index number and the sorted transformation model candidate list.
[0297] That is to say, in an embodiment of the present application, when the current block uses the inter-frame prediction mode, the motion information and reference block of the current block can be obtained based on the decoded code stream, and then the transformation model candidate list can be reordered based on the reference block. Combined with the transformation model index number written into the code stream, the transformation model of the current block can be determined.
[0298] It is also understandable that in this embodiment of the present application, to save coding bits, the transformation model index number is no longer transmitted in the bitstream. In a specific embodiment, the method further includes: performing template error calculation based on the reference block and at least one candidate transformation model in the transformation model candidate list to determine an error value for the at least one candidate transformation model; determining a minimum error value from the error values of the at least one candidate transformation model, and determining the candidate transformation model corresponding to the minimum error value as the transformation model for the current block.
[0299] That is to say, in the embodiment of the present application, the transformation model with the smallest error value can be used as the final selected transformation model. At this time, the transformation model index number is no longer written into the bitstream, thereby further improving the encoding efficiency.
[0300] In another specific embodiment, the method further includes: determining a candidate transformation model at a preset list position based on the sorted transformation model candidate list; and determining the candidate transformation model at the preset list position as the transformation model of the current block.
[0301] It should be noted that in the embodiment of the present application, the preset list position can be a specific position in the sorted transformation model candidate list, such as the first element position, the last element position, etc. in the list, which is not specifically limited here.
[0302] For example, if the transformation model candidate list is sorted based on the smaller the template error, the smaller the index number, then the first element position can be used as the preset list position, and the transformation model corresponding to index number 0 in the sorted transformation model candidate list is directly determined as the final transformation model. Alternatively, if the transformation model candidate list is sorted based on the smaller the template error, the larger the index number, then the last element position can be used as the preset list position, and the transformation model corresponding to index number N-1 in the sorted transformation model candidate list is directly determined as the final transformation model, where N represents the length of the transformation model candidate list.
[0303] In some embodiments, sorting the transformation model candidate list according to the reference block to determine the sorted transformation model candidate list may include: performing template error calculation based on the reference block and at least one candidate transformation model in the transformation model candidate list to determine the error value of at least one candidate transformation model; sorting the transformation model candidate list according to the error value of at least one candidate transformation model to determine the sorted transformation model candidate list.
[0304] It should be noted that, in an embodiment of the present application, performing template error calculation based on the reference block and at least one candidate transformation model in the transformation model candidate list to determine the error value of at least one candidate transformation model may include: transforming the template of the reference block according to at least one candidate transformation model to obtain the transformation template of at least one reference block; performing error calculation on the template of the current block and the transformation template of at least one reference block based on preset criteria to determine the error value of at least one candidate transformation model.
[0305] It should also be noted that, in the embodiment of the present application, the preset criteria include at least one of: absolute error and SAD, absolute transformation error and SATD, mean square error MSE, root mean square error RMSE, mean absolute error MAE and mean absolute deviation MAD.
[0306] Exemplarily, still taking the absolute error and SAD as an example, the list of transformation model candidates is sorted according to the determined reference block. For example, the template of the current block is Tcur, the template of the reference block is Tref, a certain transformation model candidate is modelList[i], and the template error is calculated using SAD. First, Tref is transformed according to modelList[i] to obtain Tref_i, and then the SAD between Tref_i and Tcur is calculated to obtain the template error SADi of the transformation model candidate. According to this step, the template error SADi of each transformation model candidate in the transformation model candidate list is obtained, 0≤i<N. The N transformation model candidates in the list are reordered according to SADi. The smaller the SADi, the smaller the index value after sorting. In addition, if the current block uses bidirectional prediction, the template of the reference block can be obtained by bidirectional prediction; the calculation of the template error can calculate the three YUV components or only a single component; it can also be consistent with the reordering process of the conventional Inter Merge list.
[0307] It can also be understood that in an embodiment of the present application, when the current block uses a method based on a transformation model candidate list, if the current block is bidirectionally predicted, the transformation model index number of the current block is two, for example, the first transformation model index number and the second transformation model index number.
[0308] In a specific embodiment, decoding the bitstream and determining the transformation model index number of the current block may include: decoding the bitstream and determining prediction direction information of the current block; and when the prediction direction information indicates that the current block is bidirectionally predicted, decoding the bitstream and determining a first transformation model index number and a second transformation model index number of the current block.
[0309] In another specific embodiment, decoding the bitstream and determining the transformation model index number of the current block may include: decoding the bitstream and determining the first transformation model index number of the current block; and when the prediction direction information indicates that the current block is bidirectionally predicted, decoding the bitstream and determining the second transformation model index number of the current block.
[0310] It should be noted that, in an embodiment of the present application, the first transformation model index number can be used to represent the number of the transformation model corresponding to the reference block of the current block in the first reference image list in the sorted transformation model candidate list, and the second transformation model index number can be used to represent the number of the transformation model corresponding to the reference block of the current block in the second reference image list in the sorted transformation model candidate list.
[0311] It should also be noted that, in an embodiment of the present application, the prediction direction information can be represented by pu_inter_dir. For example, if the value of pu_inter_dir is equal to 3, it indicates that the current block is bidirectionally predicted. In addition, the first transformation model index number can be represented by cu_model_merge_idx0, which can be the index number of the transformation model corresponding to the reference block of the current block in the first reference image list (List0), or the index number of the transformation model corresponding to the reference block of the current block in the forward prediction direction; the second transformation model index number can be represented by cu_model_merge_idx1, which can be the index number of the transformation model corresponding to the reference block of the current block in the second reference image list (List1), or the index number of the transformation model corresponding to the reference block of the current block in the backward prediction direction. In other words, cu_model_merge_idx0 and cu_model_merge_idx1 respectively represent the index numbers of the transformation models corresponding to the reference blocks or reference block templates in different prediction directions (or in different reference image lists).
[0312] Exemplarily, in one implementation, the syntax elements are described as follows:
[0313] Alternatively, in another implementation, the syntax elements are described as follows:
[0314] In this way, after constructing the transformation model candidate list of the current block, the transformation model and the reference block of the current block can be determined.
[0315] S1704: transform the reference block according to the transformation model to determine a prediction block for the current block.
[0316] It should be noted that in the embodiment of the present application, the transformation model of the current block may be determined first, and the transformation model may be combined with the construction process of the first merge candidate list to obtain the final target merge candidate to thereby determine the final reference block, and then the reference block may be transformed according to the transformation model of the current block to obtain the prediction block of the current block. Alternatively, the motion information and reference block of the current block may be first decoded, and then the transformation model candidate list may be reordered according to the template of the reference block. The transformation model of the current block may be determined by the transformation model index number obtained by decoding, and then the reference block may be transformed according to the transformation model to obtain the prediction block of the current block.
[0317] In some embodiments, after determining the prediction block of the current block, the method may further include: decoding the code stream to determine the residual block of the current block; and determining the reconstructed block of the current block according to the prediction block and the residual block of the current block.
[0318] It should also be noted that, in the embodiment of the present application, determining the reconstructed block of the current block based on the prediction block and the residual block of the current block may include performing an addition operation on the prediction block and the residual block of the current block to determine the reconstructed block of the current block. In this way, after determining the prediction block of the current block, the decoding process of the current block can be completed by combining the residual information obtained through decoding.
[0319] In some embodiments, the method further includes: saving the transformation model of the current block. In this way, the saved transformation model of the current block can be used in a subsequent decoding process, for example, to construct a candidate list of transformation models for a subsequent decoding block.
[0320] It should also be noted that in the embodiments of the present application, the transformation model candidate list constructed by this technical solution can be applied to blocks using the inter-frame prediction mode as well as to blocks using the IBC mode, without specific limitation here.
[0321] The embodiment of the present application provides a decoding method, which decodes a bitstream and determines the value of a first syntax identification information; when the first syntax identification information indicates that the current block uses an inter-frame prediction mode, constructs a list of candidate transformation models for the current block; determines the transformation model of the current block based on the list of candidate transformation models, and determines the reference block of the current block; transforms the reference block according to the transformation model to determine the prediction block of the current block. In this way, when decoding to determine that the current block uses an inter-frame prediction mode, it is first necessary to construct a list of candidate transformation models for the current block, and then determine the transformation model and reference block of the current block based on the list, and transform the reference block through the transformation model, thereby not only improving the diversity of inter-frame prediction, but also improving the accuracy of prediction, thereby improving encoding and decoding efficiency.
[0322] In another embodiment of the present application, based on the decoding method described in the above embodiment, FIG22 is a sixth decoding diagram provided by the embodiment of the present application. As shown in FIG22 , the method may include:
[0323] S2201: Decode a code stream and determine a value of third syntax identification information.
[0324] S2202: When the third syntax identification information indicates that the current block uses a prediction mode based on reference block transformation, decode the code stream and determine a value of the second syntax identification information.
[0325] S2203 : When the second syntax identification information indicates that the current block uses a method based on a transformation model candidate list, construct a second merge candidate list for the current block.
[0326] S2204: Determine a transformation model and a reference block of the current block according to the second merge candidate list.
[0327] S2205: Transform the reference block according to the transformation model to determine a prediction block for the current block.
[0328] It should be noted that, in the embodiment of the present application, the third syntax identification information is used to indicate whether the current block uses a prediction mode based on a reference block transform, which can be represented by cu_lic_flag. In some embodiments, if the value of the third syntax identification information is a first value, it is determined that the third syntax identification information indicates that the current block uses a prediction mode based on a reference block transform; if the value of the third syntax identification information is a second value, it is determined that the third syntax identification information indicates that the current block does not use a prediction mode based on a reference block transform.
[0329] It should also be noted that, in the embodiments of the present application, the second syntax identification information is used to indicate whether the current block uses the method based on the transformation model candidate list, which can be represented by cu_model_merge_flag. In some embodiments, if the value of the second syntax identification information is a first value, it is determined that the second syntax identification information indicates that the current block uses the method based on the transformation model candidate list; if the value of the second syntax identification information is a second value, it is determined that the second syntax identification information indicates that the current block does not use the method based on the transformation model candidate list.
[0330] In some embodiments, based on the decoding method shown in FIG. 22 , for S2201, referring to FIG. 23 , the method may include:
[0331] S2301: Decode a code stream and determine a value of fourth syntax identification information.
[0332] S2302: When the fourth syntax identification information indicates that the current block uses the inter-frame merging prediction mode, decode the code stream and determine the value of the third syntax identification information.
[0333] It should be noted that, in the embodiment of the present application, the fourth syntax identification information is used to indicate whether the current block uses the inter-frame merge prediction mode, which can be represented by pu_merge_flag. In some embodiments, if the value of the fourth syntax identification information is a first value, it is determined that the fourth syntax identification information indicates that the current block uses the inter-frame merge prediction mode; if the value of the fourth syntax identification information is a second value, it is determined that the fourth syntax identification information indicates that the current block does not use the inter-frame merge prediction mode.
[0334] Here, the first value is different from the second value, and the first value and the second value can be in parameter form or in digital form. Specifically, whether it is the second syntax identification information, the third syntax identification information or the fourth syntax identification information, it can be a parameter written in the profile, or it can be the value of a flag, which is not specifically limited here. For example, the first value can be 1 and the second value can be 0; or, the first value can be 0 and the second value can be 1; or, the first value can be true and the second value can be false; or, the first value can be false and the second value can be true.
[0335] Exemplarily, when decoding a bitstream, if it is determined that the values of cu_lic_flag and cu_model_merge_flag are both 1, it indicates that the current block uses a prediction method that inherits the transform model. The value of pu_merge_flag is decoded. If the value of pu_merge_flag is 1, it is determined that the current block uses an inter-frame merge prediction mode. Then, the value of cu_lic_flag is decoded. If the value of cu_lic_flag is 1, it is determined that the current block uses a prediction mode that transforms the reference block. The value of cu_model_merge_flag is decoded. If the value of cu_model_merge_flag is 1, it is determined that the current block uses a method based on a transform model candidate list, that is, the transform model can be determined by inheriting the transform model from the decoded block. If the value of cu_model_merge_flag is 0, it is determined that the current block does not use a method based on a transform model candidate list. In this case, the transform model can be calculated using template derivation.
[0336] In some embodiments, when the value of cu_lic_flag is 1 and the value of cu_model_merge_flag is 1, indicating that the current block uses the present technical solution, a second merge candidate list for the current block can be constructed. In some embodiments, the method may include: determining candidate merge information corresponding to a predefined position of the current block; wherein the candidate merge information includes motion information and a transformation model; and when the candidate merge information corresponding to the predefined position meets a preset candidate condition, adding the candidate merge information corresponding to the predefined position to the second merge candidate list.
[0337] In a specific embodiment, the candidate merge information corresponding to the predefined position satisfies a preset candidate condition, which may include: motion information corresponding to the predefined position is available, and a transformation model is stored in the predefined position.
[0338] That is to say, in an embodiment of the present application, for the construction of the second merge candidate list, each merge candidate may include a corresponding transformation model. Exemplarily, taking the addition of spatially adjacent candidates as an example, a predefined spatial position is checked, and if the motion information corresponding to the position is available, a further check is made as to whether the transformation model is saved at the position. If the above conditions are met, the motion information and transformation model corresponding to the position are added to the second merge candidate list as one of the available merge candidates. Similarly, merge candidates of spatial, temporal, historical, average, default and other types may also be added to the second merge candidate list.
[0339] It should also be noted that the first merge candidate list constructed in the aforementioned embodiment only contains candidate motion information, while the candidate motion information in the second merge candidate list constructed here includes a transformation model.
[0340] In some embodiments, for determining a transformation model and a reference block of a current block according to the second merge candidate list, referring to FIG. 24 , the method may include:
[0341] S2401: Determine an error value of at least one candidate merging information in a second merging candidate list.
[0342] S2402 , sort at least one candidate merging information in the second merging candidate list according to the error value to determine a third sorted merging candidate list.
[0343] S2403: Decode the code stream and determine the second merge index number of the current block.
[0344] S2404 : Determine target merge information of the current block according to the second merge index sequence number and the third sorted merge candidate list, and determine a transformation model and a reference block of the current block according to the target merge information.
[0345] It should be noted that, in the embodiment of the present application, for determining the error value of at least one candidate merge information in the second merge candidate list, the first candidate merge information is any one of the at least one candidate merge information. The following is an illustrative description using the first candidate merge information as an example.
[0346] In one possible implementation, the first candidate merge information may include first motion information and a first transformation model. Accordingly, the method includes: determining a template of a first reference block indicated by the first motion information based on the first motion information and the first transformation model included in the first candidate merge information; transforming the template of the first reference block according to the first transformation model to determine the transformation template of the first reference block; and calculating a template error between the template of the current block and the transformation template of the first reference block based on a preset criterion to determine an error value of the first candidate merge information.
[0347] It should be noted that, in the embodiment of the present application, the preset criteria include at least one of: absolute error and SAD, absolute transformation error and SATD, mean square error MSE, root mean square error RMSE, mean absolute error MAE and mean absolute deviation MAD.
[0348] It should also be noted that, in the embodiment of the present application, for the second merge candidate list, the second merge candidate list obtained can be reordered according to the template error, and then the selected merge candidate (i.e., target merge information) is determined based on the second merge index sequence number and the reordered third sorted merge candidate list. Specifically, when calculating the template error of a certain merge candidate, the reference block template obtained can be transformed accordingly based on the transformation model of the merge candidate, and then the template error can be calculated.
[0349] In another possible implementation, when the current block uses the DMVR mode, the first candidate merge information may include two motion information and two transformation models, such as the first motion information and the first transformation model and the second motion information and the second transformation model. Accordingly, the method includes: when the current block uses the DMVR mode, determining the first motion information and the first transformation model and the second motion information and the second transformation model included in the first candidate merge information; transforming the reference block indicated by the first motion information according to the first transformation model to determine a first transformed reference block; and transforming the reference block indicated by the second motion information according to the second transformation model to determine a second transformed reference block; performing matching error calculation on the first transformed reference block and the second transformed reference block to determine an error value of the first candidate merge information.
[0350] It should be noted that in the embodiment of the present application, the two reference blocks in the DMVR process can be transformed according to the transformation model of the merged candidate, and then the error value (e.g., the SAD between the two reference blocks) can be calculated based on the two transformed reference blocks to determine the final optimization result. In addition, the transformation model can also transform the reference block template used in processes such as MV template matching, MVD prediction, and MMVD candidate sorting to obtain the transformed template error, which is used to replace the template error of the related art.
[0351] It should also be noted that, in the embodiment of the present application, the construction of the second merge candidate list may include one of the following:
[0352] Constructing a second merge candidate list based on at least one candidate motion information determined in the inter-frame merging manner and a corresponding transformation model;
[0353] Constructing a second merge candidate list based on at least one candidate motion information determined by a template matching method of a motion vector and a corresponding transformation model;
[0354] Constructing a second merge candidate list based on at least one candidate motion information determined in a bidirectional matching manner of motion vectors and a corresponding transformation model;
[0355] Constructing a second merge candidate list based on at least one candidate motion information determined in a motion vector difference manner and a corresponding transformation model;
[0356] A second merge candidate list is constructed based on at least one candidate motion information determined by the motion vector difference merging method and a corresponding transformation model.
[0357] It should be noted that in the embodiment of the present application, the second merge candidate list here can be a constructed Inter Merge list, or it can be constructed based on MV template matching, MV bidirectional matching, MVD prediction, MMVD candidate sorting and other lists, except that the merge candidates therein have a transformation model.
[0358] In this way, the reference block template used in the Inter Merge list, MV template matching, MVD prediction, MMVD candidate sorting and other processes can be transformed according to the transformation model of the merge candidate to obtain the transformed template error; then, at least one candidate merge information in the second merge candidate list is sorted according to the template error to determine the third sorted merge candidate list; combined with the second merge index number determined by decoding, the motion information and transformation model of the current block can be obtained, wherein the reference block can be determined based on the motion information.
[0359] It should also be noted that in this embodiment of the present application, the second merge index number can be represented by cu_merge_idx. The second merge index number is used to indicate the number of the target merge information of the current block in the third sorted merge candidate list. Based on the cu_merge_idx written into the bitstream, the target merge information of the current block can be determined, and then the transformation model and reference block of the current block can be determined.
[0360] Exemplarily, in an implementation, the description of the syntax elements is as follows:
[0361] In a specific embodiment, the method further includes: if the motion information in the second merge candidate list is adjusted, determining that the transformation model corresponding to the motion information remains unchanged.
[0362] In another specific embodiment, the method also includes: if the motion information in the second merge candidate list is adjusted, determining the updated reference block of the current block based on the adjusted motion information; adjusting the model parameters of the transformation model corresponding to the motion information based on the template of the current block and the template of the updated reference block to obtain the adjusted transformation model.
[0363] It should be noted that, in an embodiment of the present application, the motion information (motion vector) in the second merge candidate list can be adjusted, while the corresponding transformation model remains unchanged. Exemplarily, there are n basic merge candidates in the MMVD method, and after a certain basic merge candidate is selected, the motion vector is offset to construct an MVD merge candidate. The transformation model corresponding to these newly added merge candidates is the same as the transformation model of the basic merge candidate. Exemplarily, the MV template matching method performs template matching on a certain merge candidate in the adjacent area pointed to by its motion vector, and optimizes the merge candidate based on the template error. It should be noted that the transformation model of the optimized merge candidate can remain unchanged. However, in some cases, some model parameters in the transformation model can also be changed while changing the motion information. For example, the updated reference block of the current block can be determined based on the adjusted motion information; then the model parameters of the transformation model corresponding to the motion information are adjusted based on the template of the current block and the template of the updated reference block. Exemplarily, the template of the reference block determined based on the adjusted motion information is Tref, the template of the current block is Tcur, and the model parameters of the transformation model are (α Y , β Y ). Then according to Tcur, Tref and α Y Derived β Y ′, use (α Y , β Y ′) instead of (α Y , β Y ) to obtain the adjusted transformation model.
[0364] It should also be noted that, in an embodiment of the present application, after transforming the reference block according to the transformation model and determining the prediction block of the current block, the method further includes: decoding the code stream to determine the residual block of the current block; and determining the reconstructed block of the current block based on the prediction block and the residual block of the current block.
[0365] In the embodiment of the present application, the prediction block and the residual block of the current block can be added to determine the reconstructed block of the current block. In this way, after determining the prediction block of the current block, the decoding process of the current block can be completed by combining the residual information obtained by decoding.
[0366] In an embodiment of the present application, the transformation model of the current block can also be saved. In this way, the saved transformation model of the current block can be used in subsequent decoding processes, such as constructing a transformation model candidate list for subsequent decoding blocks or a second merge candidate list with the transformation model.
[0367] It should also be noted that in the embodiments of the present application, the transformation model candidate list constructed by this technical solution can be applied to blocks using the inter-frame prediction mode as well as to blocks using the IBC mode, without specific limitation here.
[0368] An embodiment of the present application provides a decoding method that, when the current block uses a prediction mode based on a reference block transform and the current block uses a method based on a transform model candidate list, constructs a second merge candidate list for the current block; determines the transform model and reference block of the current block based on the second merge candidate list; and transforms the reference block based on the transform model to determine the prediction block of the current block. In this way, when decoding determines that the current block uses an inter-frame prediction mode, it is first necessary to construct a transform model candidate list for the current block, and then determine the transform model and reference block of the current block based on the list. The reference block is transformed using the transform model, thereby not only improving the diversity of inter-frame prediction, but also improving the accuracy of prediction, thereby improving encoding and decoding efficiency.
[0369] In another embodiment of the present application, based on the decoding method described in the aforementioned embodiment, for the current block, there may be multiple components (such as a first color component, a second color component, and a third color component), or a single component (such as the first color component); or unidirectional prediction or bidirectional prediction may be used. For example, the first color component may be a Y component, the second color component may be a U component, and the third color component may be a V component, but this is not specifically limited.
[0370] In some embodiments, when the component to be processed of the current block is at least one of the first color component, the second color component, and the third color component, the method may further include:
[0371] When there is only one component to be processed in the current block and the current block is unidirectionally predicted, the transformation model used by the component to be processed is saved as a candidate transformation model;
[0372] When there is one component to be processed in the current block and the current block is bidirectionally predicted, the transformation model used by the component to be processed is saved as two candidate transformation models;
[0373] When there are three components to be processed in the current block and the current block is unidirectionally predicted, the transformation models used by the first color component, the second color component, and the third color component are saved as a candidate transformation model;
[0374] When there are three components to be processed in the current block and the current block is bidirectionally predicted, the transformation models used by the first color component, the second color component, and the third color component are saved as two candidate transformation models.
[0375] It should be noted that, in the embodiment of the present application, the component to be processed of the current block may be one, such as the Y component; or it may be multiple, such as including three components Y, U, and V; and the prediction direction information here may be unidirectional prediction or bidirectional prediction. The following is a schematic explanation of these situations.
[0376] In a possible implementation, the current block has only Y component, which is a unidirectional prediction, and the transformation model used by the component can be saved as a transformation model candidate. For example, in the inter-frame prediction mode, the current block is a unidirectional prediction, and when the LIC mode is used for decoding, the transformation model candidate (α Y0 , β Y0 ); For example, in the inter-frame prediction mode, the current block is unidirectionally predicted, and when the LIC multi-model mode is used for decoding, the transform model candidate (α Y0 , β Y0 , α Y1 , β Y1 , Threshold). Among them, (α Y0 , β Y0 ) and (α Y1 , β Y1 ) are the two transformation models used by the current block, and Threshold is the threshold used to determine which transformation model should be applied to a pixel in the current block.
[0377] In another possible implementation, the current block has three components, Y, U, and V, and is unidirectionally predicted. The transformation models used by the three components can be saved as a transformation model candidate. For example, in the inter-frame prediction mode, the current block is unidirectionally predicted. When the LIC mode is used for decoding, the transformation model candidate (α Y0 , β Y0 , α U0 , β U0 , α V0 , β V0 ), where (α Y0 , β Y0 )、(α U0 , β U0 ) and (α V0 , β V0 ) are the transformation models used by the reference blocks of the current block on the Y, U, and V components. If the subsequent decoded block selects this transformation model, (α Y0 , β Y0 )、(α U0 , β U0 ) and (α V0 , β V0 ) are applied to the Y, U, and V components of its reference block respectively.
[0378] In another possible implementation, the current block has only Y component and is bidirectionally predicted, and the transform model used by the component can be saved as two transform model candidates. For example, in inter-frame prediction mode, the current block is bidirectionally predicted and is decoded using LIC mode, then two transform model candidates (α and α) can be saved. Y0 , β Y0 ) and (α Y1 , β Y1 ), which come from the transformation models used by the forward reference block and the backward reference block of the current block on the Y component.
[0379] In another possible implementation, the current block has three components, Y, U, and V, and is bidirectionally predicted. The transformation models used by the three components can be saved as two transformation model candidates. For example, in the inter-frame prediction mode, the current block is bidirectionally predicted, and when the LIC mode is used for decoding, two transformation model candidates (α Y0 , β Y0 , α U0 , β U0 , α V0 , β V0 ) and (α Y1 , β Y1 , α U1 , β U1 , α V1 , β V1 ), which come from the transformation models used by the forward reference block and the backward reference block of the current block on the Y, U, and V components respectively.
[0380] In some embodiments, the method further includes: when there are three components to be processed in the current block, saving the transformation model used for one of the first, second, and third color components. In this case, the method further includes: determining the type of transformation model used for one of the color components; and performing model derivation based on adjacent reconstructed pixels of the current block and adjacent reconstructed pixels of the reference block to determine the transformation models used for the remaining two of the first, second, and third color components, wherein the type of transformation model used for the remaining two color components is the same as the type of transformation model used for the one of the color components.
[0381] In another possible implementation, the current block has three components, Y, U, and V. The transformation model used by only one of the components can be saved as a transformation model candidate. For example, in the inter-frame prediction mode, the current block is unidirectionally predicted. When the LIC mode is used for decoding, the transformation model derived from the template is (α Y0 , β Y0 , α U0 , βU0 , α V0 , β V0 ), where (α Y0 , β Y0 ), (α U0 , β U0 ) and (α V0 , β V0 ) are the transformation models used by the reference blocks of the current block on the Y, U, and V components. Here you can only save (α Y0 , β Y0 ) is used by the subsequent decoded blocks. If the subsequent decoded blocks select this transformation model, (α Y0 , β Y0 ) is applied to the Y component of its reference block, and the transformation model for the U and V components is re-derived based on the template. It should be noted that the derived transformation model for the U and V components is of the same type as the transformation model saved for the Y component.
[0382] In some embodiments, the method further includes: when the current block is bidirectionally predicted, if the two candidate transformation models to be saved are the same, saving one of the two candidate transformation models.
[0383] That is, in this embodiment of the present application, if the current block is bidirectionally predicted, two transform model candidates need to be saved. If the two transform models are the same, only one transform model candidate can be saved. However, it should be noted that when constructing the transform model candidate list for the subsequent decoded block, the two transform models can be added in sequence.
[0384] In short, in the embodiment of the present application, when the current block is decoded using the LIC mode or the present technical solution, after determining the transformation model of the current block, the transformation model can be saved. If the current block has three components, Y, U, and V, the transformation models used by these three components can be saved as a transformation model candidate (i.e., a transformation model candidate has transformation models for the three component reference blocks, respectively, of Y, U, and V). For example, in the inter-frame prediction mode, the current block is unidirectionally predicted. When the LIC mode is used for decoding, the transformation model candidate (α Y0 , β Y0 , α U0 , β U0 , α V0 , β V0 ), where (α Y0 , β Y0 )、(α U0 , β U0 ) and (α V0 , β V0) are the transform models used by the reference blocks of the current block on the Y, U, and V components respectively. For example, in the inter-frame prediction mode, the current block is bidirectionally predicted. When decoding using the LIC mode, two transform model candidates (α Y0 , β Y0 , α U0 , β U0 , α V0 , β V0 ) and (α Y1 , β Y1 , α U1 , β U1 , α V1 , β V1 ), corresponding to the transformation models used by the forward reference block and the backward reference block of the current block respectively. If the two transformation models are the same, only one transformation model candidate can be saved.
[0385] In some embodiments, the method may further include: determining first motion information of the current block; determining a first reference block of the current block based on the first motion information; adjusting model parameters of a transformation model based on a template of the current block and a template of the first reference block to obtain an adjusted transformation model; transforming the reference block based on the adjusted transformation model to determine a prediction block of the current block.
[0386] It should be noted that, in the embodiment of the present application, the parameters of the transformation model can be updated according to the first motion information of the current block (for example, the motion information corresponding to a certain merge candidate list, the motion information finally used by the current block, etc.). For example, according to the motion information, the template of the reference block is determined to be Tref, the template of the current block is determined to be Tcur, and a candidate transformation model in the transformation model candidate list is determined to be (α Y , β Y ). Then according to Tcur, Tref and α Y Derived β Y ′, use (α Y , β Y ′) instead of (α Y , β Y ) to obtain the updated transformation model.
[0387] In some embodiments, the type of transformation model may include at least one of the following: a type of linear model, a type of filtering model, a type of multi-model, and a combination of different types.
[0388] It should be noted that in the embodiment of the present application, the type of transformation model can be a linear model (α, β), or a Filter model, a LIC multi-model, etc., and different types of transformation models can be included at the same time to construct a transformation model candidate list.
[0389] In some embodiments, the method further includes: performing model derivation based on adjacent reconstructed pixels of the current block and adjacent reconstructed pixels of the reference block, or performing model derivation based on the reconstructed block of the current block and the reference block to determine the derivation model of the current block; and saving the transformation model of the current block and the derivation model of the current block.
[0390] It should be noted that in the embodiments of the present application, after determining the reconstructed block of the current block, a transformation model can be re-derived based on the reconstructed block of the current block and the reference block. Alternatively, a current block that does not itself use a transformation model can also use this method to obtain and save a transformation model; a current block that itself uses a transformation model can replace the original transformation model with the new transformation model to save it, or both the new and old transformation models can be saved.
[0391] In some embodiments, in this technical solution and the existing list-based IBC transform prediction technology, if the decoding flag indicates that the current block uses bidirectional prediction, two transform model index numbers can be passed. For example, as shown below:
[0392] or,
[0393] Here, pu_inter_dir indicates the prediction direction of the current block. For example, pu_inter_dir == 3 indicates that the current block uses bidirectional prediction. cu_model_merge_idx0 and cu_model_merge_idx1 represent the index numbers corresponding to the transform models used for reference blocks or reference block templates in different prediction directions (or in different reference image lists).
[0394] In some embodiments, in addition to transmitting the transformation model index number in the code stream, the transformation model with the smallest template error value can also be used as the final selected transformation model. In this case, the index number is not transmitted, which can save coding bits.
[0395] In some embodiments, the method further includes: determining first information of the current block; when the first information satisfies a first condition, performing a model derivation based on adjacent reconstructed pixels of the current block and adjacent reconstructed pixels of the reference block, or performing a model derivation based on the reconstructed block and the reference block of the current block to determine the derivation model of the current block; wherein the first information includes at least one of the following: the position of the current block, the size of the current block, the adjacent block information of the current block, and the decoded syntax identification information of the current block.
[0396] It should be noted that in the embodiments of the present application, a condition may be added to determine whether to derive a transformation model based on the reconstructed block. For example, whether to perform the step of determining the derivation model of the current block may be determined based on the size of the current block, block-level, or frame-level flags. The derivation model of the current block may be derived based on adjacent reconstructed pixels of the current block and adjacent reconstructed pixels of a reference block, or may be derived based on a reconstructed block of the current block and a reference block.
[0397] In some embodiments, the method further includes: determining third information of the current block; when the third information satisfies a third condition, executing a step of saving the transformation model of the current block; wherein the third information includes at least one of the following: the position of the current block, the size of the current block, the adjacent block information of the current block, and the decoded syntax identification information of the current block.
[0398] It should be noted that in the embodiments of the present application, a condition can also be added to determine whether to save the transformation model. For example, if the current block uses a transformation model to transform the reference block, the size of the current block, block-level, frame-level flags, etc. can be used to determine whether to save the transformation model or save the transformation model to the historical transformation model list.
[0399] In some embodiments, the method further includes: determining second information of the current block; when the second information satisfies a second condition, executing a decoding code stream to determine a value of the second syntax identification information; wherein the second information includes at least one of the following: the position of the current block, the size of the current block, the adjacent block information of the current block, and the decoded syntax identification information of the current block.
[0400] It should be noted that each embodiment of the present technical solution may add a judgment condition when decoding the cu_model_merge_flag syntax element. For example, whether to decode cu_model_merge_flag can be determined based on the relevant syntax elements of the decoded block. If not, the value of cu_model_merge_flag is 0. The position of the decoded block can be a neighboring block of the current block. For example, the left side of the upper left corner of the current block is (x, y), and the width and height are w, h. Then the coding blocks located at (x–1, y+h–1), (x+w–1, y–1), (x–1, y+h), (x+w, y–1), (x–1, y–1) can be checked. The judgment condition can be that the prediction mode related syntax elements (such as cu_lic_flag, cu_model_merge_flag) of a certain decoded block (or a certain number of decoded blocks) are true. Exemplarily, whether to decode cu_model_merge_flag is determined according to other decoded syntax elements of the current block, the position or size of the current block, a frame-level flag or a sequence-level flag, and the like.
[0401] In some embodiments, the present technical solution may add a judgment condition to indicate whether a specific process in the present technical solution is applied. For example, if the size of the current block exceeds a certain threshold, the process of transforming the template of the reference block based on the transformation model is not performed.
[0402] In some embodiments, if the decoded cu_model_merge_flag is true, indicating that the current block uses an inter prediction method based on the inherited transform model, the implementation of the merge list construction, MMVD list construction, DMVR, and other methods for the current block can be different from when cu_model_merge_flag is false. For example, the size of the construction list and the candidate information may be different. In other words, judgments based on cu_model_merge_flag are introduced into various inter prediction processes.
[0403] In some embodiments, the method further comprises: determining a derived transformation model of the current block when constructing the transformation model candidate list of the current block; and adding the derived transformation model to the transformation model candidate list.
[0404] It should be noted that, in an embodiment of the present application, the method further includes: decoding the code stream, determining the value of the fifth syntax identification information; when the fifth syntax identification information indicates that the current block uses the intra-frame block copy mode, executing the step of constructing a candidate list of transformation models for the current block.
[0405] It should also be noted that, in the embodiment of the present application, if the value of the fifth syntax identification information is a first value, it is determined that the fifth syntax identification information indicates that the current block uses the intra block copy mode; if the value of the fifth syntax identification information is a second value, it is determined that the fifth syntax identification information indicates that the current block does not use the intra block copy mode. The first value is different from the second value. For example, the first value can be 1 and the second value can be 0; or the first value can be true (true) and the second value can be false (false); this is not limited here.
[0406] That is to say, in the embodiment of the present application, whether it is the inter-frame prediction mode or the intra-frame block copy mode, when constructing the transformation model candidate list, the derived transformation model can be used as one of the candidate transformation models. For example, the transformation model candidate list constructed in the above embodiment can be modified to {LIC, LIC_LEFT, LIC_TOP, LIC_MM, Filter, Model0, Model1...}. Among them, LIC, LIC_LEFT...Filter, etc. represent different methods of deducing transformation models based on templates, and Model0, etc. represent transformation models inherited from the spatial domain, time domain, etc. For example, if the value of cu_model_merge_idx is equal to 0, it indicates that the current block uses the LIC prediction method, and the specific implementation process can be the same as the LIC technology of the related art.
[0407] An embodiment of the present application provides a decoding method, which can construct a corresponding transformation model candidate list for each of the multiple components or a single component of the current block, and apply the transformation model. For example, the transformation model is combined with the Merge list construction, motion vector optimization and prediction in inter-frame prediction, and other processes involving template error and two-way matching error calculation, thereby not only improving the diversity of inter-frame prediction, but also improving the accuracy of prediction, thereby improving the encoding and decoding efficiency.
[0408] In another embodiment of the present application, FIG25 is a flow chart of a coding method provided in an embodiment of the present application. As shown in FIG25 , the method may include:
[0409] S2501: When the current block uses the inter prediction mode, construct a transform model candidate list for the current block.
[0410] It should be noted that in the embodiments of the present application, the method is applied to an encoder. Specifically, based on the structure of the encoder 100 shown in FIG14 , the decoding method of the embodiments of the present application can be applied to the intra-frame prediction part and / or the inter-frame prediction part, and is mainly applied to the inter-frame prediction method of the inherited transformation model, which can improve the diversity of inter-frame prediction.
[0411] It should also be noted that, in the embodiment of the present application, constructing a candidate list of transformation models for the current block may include: determining at least one candidate transformation model for the current block; and determining a candidate list of transformation models for the current block based on the at least one candidate transformation model.
[0412] In a specific embodiment, determining at least one candidate transformation model for the current block may include at least one of the following:
[0413] Determine available transformation models for neighboring locations of the current block;
[0414] Determine an available transform model in the time domain of the current block;
[0415] Determine available transformation models for non-adjacent locations of the current block;
[0416] Determine an available transformation model in the time domain after the translation of the current block;
[0417] Determine the available transformation models for the history;
[0418] Determines the preset transformation model.
[0419] It should also be noted that, in an embodiment of the present application, if the current block uses the inter-frame prediction mode, and it is determined that the current block uses a method based on a transformation model candidate list, then a transformation model candidate list can be constructed for the current block, recorded as mode1List, and the maximum length can be set to N, where N is a positive integer.
[0420] In some embodiments, for the preset transformation model, it can include: determining the transformation model corresponding to the local illumination compensation mode of the current block as the preset transformation model; or adjusting the candidate transformation model already in the transformation model candidate list, and determining the adjusted candidate transformation model as the preset transformation model.
[0421] That is to say, in the embodiment of the present application, the preset transformation model here is used as the default transformation model, which can be the model parameter (α Y0 , β Y0 , α U0 , β U0 , α V0 , β V0 ) can also be a LIC transformation model obtained by adjusting the candidate transformation models already in the mode1List list, etc.
[0422] In some embodiments, the transformation model candidate list may include transformation models in the following candidate order: ① available transformation models at adjacent locations; ② available transformation models in the time domain; ③ available transformation models at non-adjacent locations; ④ available transformation models in the time domain after translation; ⑤ available transformation models in the past; and ⑥ preset transformation models.
[0423] In some embodiments, for the transformation model candidate list, the method further includes: after determining a new candidate transformation model for the current block, comparing the new candidate transformation model with existing candidate transformation models in the transformation model candidate list; and if the new candidate transformation model is different from any of the existing candidate transformation models in the transformation model candidate list, adding the new candidate transformation model to the transformation model candidate list. In this way, when adding a transformation model, redundancy can be avoided by comparing it with the existing candidate transformation models in the mode1List list.
[0424] In some embodiments, for the transformation model candidate list, the method further includes: determining a derived transformation model of the current block when constructing the transformation model candidate list of the current block; and adding the derived transformation model to the transformation model candidate list.
[0425] In this embodiment of the present application, a derived transformation model can also be used as one of the candidate transformation models. For example, the transformation model candidate list can be adjusted to {LIC, LIC_LEFT, LIC_TOP, LIC_MM, Filter, Model0, Model1...}. LIC, LIC_LEFT...Filter, etc. represent different template-based derivation methods for derived transformation models, and Model0, etc. represent transformation models inherited from spatial and temporal domains to construct the transformation model candidate list.
[0426] S2502 : Determine a transformation model for the current block based on the transformation model candidate list, and determine a reference block for the current block.
[0427] It should be noted that in an embodiment of the present application, the transformation model of the current block may be first determined based on the transformation model candidate list, and then the reference block of the current block may be determined based on the transformation model; or, the reference block of the current block may be first determined, and then the transformation model of the current block may be determined based on the reference block and the transformation model candidate list.
[0428] In one possible implementation, a transformation model of a current block is determined based on a transformation model candidate list, and a reference block of the current block is determined. The method may include: determining the transformation model of the current block based on the transformation model candidate list; and determining the reference block of the current block according to the transformation model and a first merge candidate list.
[0429] In some embodiments, for determining the transformation model of the current block, referring to FIG. 26 , the method may further include:
[0430] S2601 , performing coding cost calculation on at least one candidate transformation model in the transformation model candidate list to determine a cost result of each of the at least one candidate transformation model.
[0431] S2602 : Determine a minimum cost result from the respective cost results of at least one candidate transformation model, and determine the candidate transformation model corresponding to the minimum cost result as the transformation model of the current block.
[0432] S2603: Determine the transformation model index number of the current block according to the transformation model of the current block.
[0433] S2604: Encode the transformation model index number of the current block, and write the obtained coded bits into the bitstream.
[0434] It should be noted that in the embodiment of the present application, the cost result can be determined according to the cost result of Rate Distortion Optimization (RDO), or according to the cost result of Sum of Absolute Difference (SAD), or even according to the cost result of Sum of Absolute Transformed Difference (SATD), but no limitation is made here.
[0435] It should also be noted that in this embodiment of the present application, after determining the transformation model for the current block, the number of the transformation model in the transformation model candidate list, i.e., the transformation model index, can be further determined. The transformation model index indicates the number of the transformation model for the current block in the transformation model candidate list. The encoder encodes the transformation model index for the current block and writes it into the bitstream.
[0436] It should also be noted that in this embodiment of the present application, the transformation model index number can be represented by cu_model_merge_idx, which is used to indicate the number of the transformation model in the transformation model candidate list. The value range of cu_model_merge_idx can be less than or equal to the maximum transformation model candidate list length. For encoding cu_model_merge_idx, a variable-length encoding method can be used, and the smaller the index, the shorter the corresponding codeword. Exemplarily, the value range of cu_model_merge_idx is n, and a truncated binary code encoding method is used here.
[0437] It can be understood that in an embodiment of the present application, for the first merge candidate list, the method also includes: determining at least one candidate motion information of the current block; constructing a first merge candidate list based on the at least one candidate motion information of the current block; wherein the candidate motion information is used to indicate the candidate reference block of the current block and / or the template of the candidate reference block.
[0438] In some embodiments, constructing a first merge candidate list based on at least one candidate motion information of the current block may include one of the following:
[0439] Constructing a first merge candidate list based on at least one candidate motion information determined in an inter-frame merge mode;
[0440] Constructing a first merge candidate list based on at least one candidate motion information determined by a template matching method of a motion vector;
[0441] Constructing a first merge candidate list based on at least one candidate motion information determined in a bidirectional matching manner of motion vectors;
[0442] Constructing a first merge candidate list based on at least one candidate motion information determined by means of motion vector difference;
[0443] A first merge candidate list is constructed based on at least one candidate motion information determined in a motion vector difference merging manner.
[0444] It should be noted that, in the embodiment of the present application, the first merge candidate list here can be a constructed Inter Merge list, or can be constructed based on a list such as MV template matching, MV bidirectional matching, MVD prediction, MMVD candidate sorting, etc. In other words, the determined transformation model can be used in the Merge list during inter-frame prediction to perform template transformation of the reference block, and can also be used in processes such as MV template matching, MV bidirectional matching, MVD prediction, MMVD candidate sorting, etc. to perform template transformation of the reference block to obtain a transformed error value, which is used to replace the template error in the related art.
[0445] In a specific embodiment, determining the reference block of the current block based on the transformation model and the first merge candidate list may include: performing template error calculation on at least one candidate reference block indicated in the first merge candidate list according to the transformation model to determine the error value of the at least one candidate reference block; determining the minimum error value from the error values of the at least one candidate reference block, and determining the candidate reference block corresponding to the minimum error value as the reference block of the current block.
[0446] In an embodiment of the present application, the candidate motion information in the first merge candidate list may correspond to a candidate reference block. Determining an error value for at least one candidate reference block may include: transforming a template of at least one candidate reference block indicated in the first merge candidate list according to a transformation model to obtain a transformed template for the at least one candidate reference block; and performing template error calculation on the template of the current block and the transformed template of the at least one candidate reference block based on a preset criterion to determine the error value for the at least one candidate reference block.
[0447] It should also be noted that, in the embodiment of the present application, after the first merge candidate list is constructed, it can be reordered. The method further includes: sorting the first merge candidate list according to the error value of at least one candidate reference block to determine a first sorted merge candidate list.
[0448] It should also be noted that, in the embodiment of the present application, the preset criteria include at least one of: absolute error and SAD, absolute transformation error and SATD, mean square error MSE, root mean square error RMSE, mean absolute error MAE and mean absolute deviation MAD.
[0449] For example, using absolute error and SAD as an example, the reference block template in the first merge candidate list process is transformed according to the determined transformation model, and then the first merge candidate list is reordered according to the transformed template error. For example, the transformation model of the current block is modelList[idx], the template corresponding to the nth candidate motion information is Tn, and the template of the current block is Tcur. The template error can be calculated using SAD. First, Tn is transformed according to modelList[idx] to obtain Tn', and then the SAD between Tn' and Tcur is calculated to obtain the template error SADn of the candidate motion information. According to this step, the template error SADi of each candidate motion information in the first merge candidate list is obtained, 0≤i<N. The N candidate motion information in the first merge candidate list can then be reordered according to SADi. The smaller the SADi, the smaller the index value after sorting. In addition, if a candidate motion information corresponds to bidirectional prediction, the template of the candidate motion information can be obtained by bidirectional prediction; the template error calculation can be based on the three YUV components or only a single component; it can also be consistent with the reordering process of the Inter Merge list in the related art.
[0450] In some embodiments, the method further includes: determining a first merge index number of the current block based on a reference block of the current block; wherein the first merge index number is used to indicate the number of the motion information corresponding to the reference block in the first sorted merge candidate list; encoding the first merge index number, and writing the obtained encoded bits into the bitstream.
[0451] Here, the first merge candidate list may include N merge candidates, and the first merge index serial number is specifically used to indicate the number of the target merge candidate of the current block in the first sorted merge candidate list, and the target merge candidate may point to the reference block of the current block.
[0452] In some embodiments, the method further includes: determining pattern identification information of at least part of the candidate motion information in the first sorted merge candidate list; sorting at least part of the candidate motion information in the first sorted merge candidate list according to the pattern identification information of at least part of the candidate motion information, and determining a second sorted merge candidate list.
[0453] It should be noted that, in the embodiment of the present application, after the first merge candidate list is reordered, some of the candidates in the list may be further sorted based on the mode identification information (e.g., mode flags such as the LIC flag) of at least some of the candidate motion information to obtain a second sorted merge candidate list. For example, if the LIC flag of a certain candidate motion information is true, it is placed at the front of the list; if the LIC flags of multiple candidate motion information are true, the order of these candidate motion information may remain relatively unchanged.
[0454] It should also be noted that in this embodiment of the present application, the method further includes encoding the mode identification information of at least a portion of the candidate motion information in the first ranked merge candidate list, and writing the resulting coded bits into the bitstream. In this way, the decoding end can determine the mode identification information of at least a portion of the candidate motion information by decoding the bitstream, thereby determining whether to further rank some of the candidates in the list.
[0455] In another specific embodiment, the method further includes: determining a first merge index number of the current block based on a reference block of the current block; wherein the first merge index number is used to indicate the number of the motion information corresponding to the reference block in the first sorted merge candidate list or the second sorted merge candidate list; encoding the first merge index number and writing the obtained encoded bits into the bitstream.
[0456] Here, the first merge index number is specifically used to indicate the number of the target merge candidate for the current block in the first sorted merge candidate list or the second sorted merge candidate list, and the target merge candidate can point to the reference block of the current block. In this way, at the decoding end, after obtaining the first merge index number of the current block by decoding the bitstream, the reference block of the current block can be determined based on the selected target merge candidate.
[0457] In another specific embodiment, the reference block of the current block is determined according to the transformation model and the first merge candidate list. The method may also include: when the current block uses the DMVR mode, determining at least one group of candidate reference blocks for the current block according to the first merge candidate list, each group of candidate reference blocks including two candidate reference blocks; transforming the two candidate reference blocks in each group of candidate reference blocks according to the transformation model to determine the two transformed reference blocks in each group of candidate reference blocks; performing matching error calculation on the two transformed reference blocks in each group of candidate reference blocks to determine the error value corresponding to each group of candidate reference blocks; and determining, according to the error value corresponding to each group of candidate reference blocks, a group of candidate reference blocks with the smallest error value as the reference block of the current block.
[0458] It should be noted that in an embodiment of the present application, the two reference blocks of the candidate motion vector (for example, selected from the first merge candidate list) in the DMVR process can also be transformed according to the determined transformation model, and then the error value (for example, the SAD between the two reference blocks) is calculated based on the two transformed reference blocks and the final optimization result is determined. For example, a group of candidate reference blocks with the smallest error value can be determined as the final reference blocks.
[0459] In another possible implementation, determining a transformation model for a current block based on a transformation model candidate list and determining a reference block for the current block may include: determining a reference block for the current block; and determining the transformation model for the current block based on the reference block and the transformation model candidate list. Determining the reference block for the current block may involve performing a matching search in a reference image of the current block to determine an optimal MV, and then determining the reference block for the current block based on the optimal MV; or determining the reference block for the current block may involve performing a template search based on the MV.
[0460] In some embodiments, the method further includes: determining motion information of the current block based on the reference block; encoding the motion information of the current block, and writing the resulting coded bits into the bitstream. Thus, the decoder can obtain the motion information of the current block by decoding the bitstream, and can then determine the reference block for the current block based on this motion information without performing a search process.
[0461] It should be noted that in embodiments of the present application, the list of candidate transformation models may be sorted based on the reference block to determine a sorted list of candidate transformation models. In some embodiments, this sorting process may specifically include: calculating a template error based on the reference block and at least one candidate transformation model in the list of candidate transformation models to determine an error value for the at least one candidate transformation model; and sorting the list of candidate transformation models based on the error value of the at least one candidate transformation model to determine a sorted list of candidate transformation models.
[0462] In a specific embodiment, the method may further include: determining a transformation model index number of the current block; wherein the transformation model index number is used to indicate the number of the transformation model of the current block in the sorted transformation model candidate list; encoding the transformation model index number of the current block, and writing the obtained coded bits into the bitstream.
[0463] In this way, when the current block uses the inter-frame prediction mode, the decoding end can first decode to obtain the motion information and reference block of the current block, and then reorder the transformation model candidate list according to the reference block. Combined with the transformation model index number written into the bitstream, the transformation model of the current block can be determined.
[0464] It is also understandable that in this embodiment of the present application, to save coding bits, the transformation model index number is no longer transmitted in the bitstream. In another specific embodiment, the method further includes: performing template error calculation based on the reference block and at least one candidate transformation model in the transformation model candidate list to determine an error value for the at least one candidate transformation model; determining a minimum error value from the error values of the at least one candidate transformation model, and determining the candidate transformation model corresponding to the minimum error value as the transformation model for the current block.
[0465] That is to say, in the embodiment of the present application, the transformation model with the smallest error value can be used as the final selected transformation model. At this time, the transformation model index number is no longer written into the bitstream, thereby further improving the coding efficiency.
[0466] In another specific embodiment, determining the transformation model of the current block based on the reference block and the transformation model candidate list may include: sorting the transformation model candidate list according to the reference block to determine the sorted transformation model candidate list; determining the candidate transformation model at a preset position based on the sorted transformation model candidate list; and determining the candidate transformation model at the preset position as the transformation model of the current block.
[0467] It should be noted that in the embodiment of the present application, the preset list position can be a specific position in the sorted transformation model candidate list, such as the first element position, the last element position, etc. in the list, which is not specifically limited here.
[0468] For example, if the transformation model candidate list is sorted based on the smaller the template error, the smaller the index number, then the first element position can be used as the preset list position, and the transformation model corresponding to index number 0 in the sorted transformation model candidate list is directly determined as the final transformation model. Alternatively, if the transformation model candidate list is sorted based on the smaller the template error, the larger the index number, then the last element position can be used as the preset list position, and the transformation model corresponding to index number N-1 in the sorted transformation model candidate list is directly determined as the final transformation model, where N represents the length of the transformation model candidate list.
[0469] It should also be noted that, in an embodiment of the present application, performing template error calculation based on the reference block and at least one candidate transformation model in the transformation model candidate list to determine the error value of at least one candidate transformation model may include: transforming the template of the reference block according to the at least one candidate transformation model to obtain the transformation template of the at least one reference block; performing error calculation on the template of the current block and the transformation template of the at least one reference block based on preset criteria to determine the error value of the at least one candidate transformation model.
[0470] It should also be noted that, in the embodiment of the present application, the preset criteria include at least one of: absolute error and SAD, absolute transformation error and SATD, mean square error MSE, root mean square error RMSE, mean absolute error MAE and mean absolute deviation MAD.
[0471] Exemplarily, still taking the absolute error and SAD as an example, the list of transformation model candidates is sorted according to the determined reference block. For example, the template of the current block is Tcur, the template of the reference block is Tref, a certain transformation model candidate is modelList[i], and the template error is calculated using SAD. First, Tref is transformed according to modelList[i] to obtain Tref_i, and then the SAD between Tref_i and Tcur is calculated to obtain the template error SADi of the transformation model candidate. According to this step, the template error SADi of each transformation model candidate in the transformation model candidate list is obtained, 0≤i<N. The N transformation model candidates in the list are reordered according to SADi. The smaller the SADi, the smaller the index value after sorting. In addition, if the current block uses bidirectional prediction, the template of the reference block can be obtained by bidirectional prediction; the calculation of the template error can calculate the three YUV components or only a single component; it can also be consistent with the reordering process of the conventional Inter Merge list.
[0472] It can also be understood that in an embodiment of the present application, when the current block uses a method based on a transformation model candidate list, if the current block is bidirectionally predicted, the transformation model index number of the current block is two, for example, the first transformation model index number and the second transformation model index number.
[0473] In some embodiments, the method may further include: when the current block is bidirectionally predicted, determining the first transformation model index number and the second transformation model index number of the current block; encoding the first transformation model index number and the second transformation model index number, and writing the obtained encoding bits into the bitstream.
[0474] It should be noted that, in an embodiment of the present application, the first transformation model index number can be used to represent the number of the transformation model corresponding to the reference block of the current block in the first reference image list in the sorted transformation model candidate list, and the second transformation model index number can be used to represent the number of the transformation model corresponding to the reference block of the current block in the second reference image list in the sorted transformation model candidate list.
[0475] It should also be noted that, in an embodiment of the present application, when the current block is bidirectionally predicted, the first transformation model index number and the second transformation model index number of the current block may be encoded, and the resulting coded bits may be written into the bitstream; alternatively, the first transformation model index number of the current block may be encoded first, and the resulting coded bits may be written into the bitstream; and then, when the current block is bidirectionally predicted, the second transformation model index number of the current block may be encoded, and the resulting coded bits may be written into the bitstream.
[0476] It should also be noted that, in an embodiment of the present application, the method may further include: determining prediction direction information of the current block; encoding the prediction direction information of the current block, and writing the obtained encoding bits into the bitstream.
[0477] It should also be noted that, in an embodiment of the present application, the prediction direction information can be represented by pu_inter_dir. For example, if the value of pu_inter_dir is equal to 3, it indicates that the current block is bidirectionally predicted. In addition, the first transformation model index number can be represented by cu_model_merge_idx0, which can be the index number of the transformation model corresponding to the reference block of the current block in the first reference image list (List0), or the index number of the transformation model corresponding to the reference block of the current block in the forward prediction direction; the second transformation model index number can be represented by cu_model_merge_idx1, which can be the index number of the transformation model corresponding to the reference block of the current block in the second reference image list (List1), or the index number of the transformation model corresponding to the reference block of the current block in the backward prediction direction. In other words, cu_model_merge_idx0 and cu_model_merge_idx1 respectively represent the index numbers of the transformation models corresponding to the reference blocks or reference block templates in different prediction directions (or in different reference image lists).
[0478] In this way, after constructing the transformation model candidate list of the current block, the transformation model and the reference block of the current block can be determined.
[0479] S2503: transform the reference block according to the transformation model to determine a prediction block for the current block.
[0480] It should be noted that in the embodiment of the present application, the transformation model of the current block may be determined first, and the transformation model may be combined with the construction process of the first merge candidate list to obtain the final target merge candidate to thereby determine the final reference block, and then the reference block may be transformed according to the transformation model of the current block to obtain the prediction block of the current block. Alternatively, the motion information and reference block of the current block may be first decoded, and then the transformation model candidate list may be reordered according to the template of the reference block. The transformation model of the current block may be determined by the transformation model index number obtained by decoding, and then the reference block may be transformed according to the transformation model to obtain the prediction block of the current block.
[0481] In some embodiments, after determining the prediction block of the current block, the method may further include: determining an initial block of the current block; and determining a residual block of the current block according to the initial block of the current block and the prediction block of the current block.
[0482] It should also be noted that, in an embodiment of the present application, determining the residual block of the current block based on the initial block of the current block and the predicted block of the current block may include: performing a subtraction operation on the initial block of the current block and the predicted block of the current block to determine the residual block of the current block.
[0483] In some embodiments, the method may further include: encoding the residual block of the current block and writing the obtained coded bits into the bitstream, thereby completing the encoding process of the current block.
[0484] In some embodiments, the method further includes: saving the transformation model of the current block. In this way, the saved transformation model of the current block can be used in subsequent encoding processes, for example, to construct a candidate list of transformation models for subsequent encoding blocks.
[0485] It is also understandable that in the embodiments of the present application, whether the current block uses the inter-frame prediction mode can be indicated by the first syntax identification information. In some embodiments, the method further includes: determining a value of the first syntax identification information; encoding the value of the first syntax identification information, and writing the resulting coded bits into the bitstream.
[0486] In an embodiment of the present application, the first syntax identification information may be represented by cu_prediction_mode, and the first syntax identification information is used to indicate whether the current block uses the inter-frame prediction mode. If the current block uses the inter-frame prediction mode, the value of the first syntax identification information is determined to be a first value; if the current block does not use the inter-frame prediction mode, the value of the first syntax identification information is determined to be a second value.
[0487] It is also understandable that in embodiments of the present application, whether the method based on the transform model candidate list is used for the current block can be indicated by the second syntax identification information. In some embodiments, the method further includes: determining a value of the second syntax identification information; encoding the value of the second syntax identification information, and writing the resulting encoded bits into the bitstream.
[0488] In this embodiment of the present application, the second syntax identification information may be represented by cu_model_merge_flag, and the second syntax identification information is used to indicate whether the current block uses the method based on the transformation model candidate list. If the current block uses the method based on the transformation model candidate list, the value of the second syntax identification information is determined to be a first value; if the current block does not use the method based on the transformation model candidate list, the value of the second syntax identification information is determined to be a second value.
[0489] Here, the first value is different from the second value, and the first value and the second value can be in parameter form or in numeric form. Specifically, whether the first syntax identification information or the second syntax identification information can be a parameter written in the profile or a flag value, which is not specifically limited here. For example, the first value can be 1 and the second value can be 0; or the first value can be 0 and the second value can be 1; or the first value can be true and the second value can be false; or the first value can be false and the second value can be true.
[0490] It should also be noted that, in embodiments of the present application, the second syntax identification information may be encoded using an entropy encoding method based on a context model. In some embodiments, the method may further include: encoding the value of the second syntax identification information based on the context model, and writing the resulting encoded bits into the bitstream.
[0491] In another possible implementation, the method may further include: when the current block uses a prediction mode based on a reference block transformation and the current block uses a method based on a transformation model candidate list, constructing a second merge candidate list for the current block; determining the transformation model and reference block of the current block according to the second merge candidate list; and transforming the reference block according to the transformation model to determine the prediction block of the current block.
[0492] It should be noted that, in an embodiment of the present application, the third syntax identification information can be used to indicate whether the current block uses a prediction mode based on reference block transformation, and the fourth syntax identification information can be used to indicate whether the current block uses an inter-frame merge prediction mode.
[0493] In some embodiments, the method further includes: determining a value of third syntax identification information; encoding the value of the third syntax identification information, and writing the obtained encoded bits into the bitstream.
[0494] In an embodiment of the present application, the third syntax identification information may be represented by cu_lic_flag. If the current block uses a prediction mode based on a reference block transform, the value of the third syntax identification information is determined to be a first value; if the current block does not use a prediction mode based on a reference block transform, the value of the third syntax identification information is determined to be a second value.
[0495] In some embodiments, the method further includes: determining a value of fourth syntax identification information; encoding the value of the fourth syntax identification information, and writing the obtained encoded bits into the bitstream.
[0496] In an embodiment of the present application, the fourth syntax flag information may be represented by pu_merge_flag. If the current block uses the inter-frame merge prediction mode, the value of the fourth syntax flag information is determined to be a first value; if the current block does not use the inter-frame merge prediction mode, the value of the fourth syntax flag information is determined to be a second value.
[0497] Here, the first value is different from the second value, and the first value and the second value can be in parameter form or in numeric form. Specifically, both the third syntax identification information and the fourth syntax identification information can be parameters written into the profile or the value of a flag, and are not specifically limited here. For example, the first value can be 1 and the second value can be 0; or the first value can be 0 and the second value can be 1; or the first value can be true and the second value can be false; or the first value can be false and the second value can be true.
[0498] It should also be noted that, in the embodiment of the present application, it is first determined whether the current block uses the inter-frame prediction mode. When the current block uses the inter-frame prediction mode, it is further determined whether the current block uses the inter-frame merge prediction mode; when the current block uses the inter-frame merge prediction mode, it is further determined whether the current block uses the prediction mode for transforming the reference block; when the current block uses the prediction mode for transforming the reference block, it is further determined whether the current block uses the method based on the transformation model candidate list; when the current block uses the method based on the transformation model candidate list, a second merge candidate list for the current block can be constructed at this time.
[0499] In some embodiments, constructing a second merge candidate list for the current block may include: determining candidate merge information corresponding to a predefined position of the current block; wherein the candidate merge information includes motion information and a transformation model; when the candidate merge information corresponding to the predefined position meets a preset candidate condition, adding the candidate merge information corresponding to the predefined position to the second merge candidate list.
[0500] In a specific embodiment, the candidate merge information corresponding to the predefined position satisfies a preset candidate condition, which may include: motion information corresponding to the predefined position is available, and a transformation model is stored in the predefined position.
[0501] That is to say, in an embodiment of the present application, for the construction of the second merge candidate list, each merge candidate may include a corresponding transformation model. Exemplarily, taking the addition of spatially adjacent candidates as an example, a predefined spatial position is checked, and if the motion information corresponding to the position is available, a further check is made as to whether the transformation model is saved at the position. If the above conditions are met, the motion information and transformation model corresponding to the position are added to the second merge candidate list as one of the available merge candidates. Similarly, merge candidates of spatial, temporal, historical, average, default and other types may also be added to the second merge candidate list.
[0502] It should also be noted that the first merge candidate list constructed in the aforementioned embodiment only contains candidate motion information, while the candidate motion information in the second merge candidate list constructed here includes a transformation model.
[0503] In some embodiments, determining the transformation model and reference block of the current block based on the second merge candidate list may include: performing encoding cost calculation on at least one candidate merge information in the second merge candidate list to determine the cost result of each of the at least one candidate merge information; determining the minimum cost result from the cost results of each of the at least one candidate merge information, and determining the candidate merge information corresponding to the minimum cost result as the target merge information of the current block; and determining the transformation model and reference block of the current block based on the target merge information.
[0504] It should be noted that, in the embodiment of the present application, the transformation model and reference block of the current block are determined based on the target merging information. Specifically, the target merging information includes motion information and the corresponding transformation model, and the motion information can indicate the reference block of the current block.
[0505] In some embodiments, after determining the target merge information of the current block, referring to FIG. 27 , the method may further include:
[0506] S2701: Determine an error value of at least one candidate merging information in a second merging candidate list.
[0507] S2702 , sort at least one candidate merging information in the second merging candidate list according to the error value to determine a third sorted merging candidate list.
[0508] S2703 , determining a second merge index number of the current block, where the second merge index number is used to indicate the number of the target merge information of the current block in the third sorted merge candidate list.
[0509] S2704: Encode the second merge index number of the current block, and write the obtained coded bits into the bitstream.
[0510] It should be noted that in this embodiment of the present application, the transformation model and reference block of the current block are determined based on the target merge information. Thus, for the decoder, after decoding and obtaining the second merge index number of the current block, the transformation model and reference block of the current block can be directly determined by combining the third sorted merge candidate list.
[0511] It should also be noted that, in the embodiment of the present application, for determining the error value of at least one candidate merge information in the second merge candidate list, the first candidate merge information is any one of the at least one candidate merge information. The following is an illustrative description using the first candidate merge information as an example.
[0512] In one possible implementation, the first candidate merge information may include first motion information and a first transformation model. Accordingly, the method includes: determining a template of a first reference block indicated by the first motion information based on the first motion information and the first transformation model included in the first candidate merge information; transforming the template of the first reference block according to the first transformation model to determine the transformation template of the first reference block; and calculating a template error between the template of the current block and the transformation template of the first reference block based on a preset criterion to determine an error value of the first candidate merge information.
[0513] It should be noted that, in the embodiment of the present application, the preset criteria include at least one of: absolute error and SAD, absolute transformation error and SATD, mean square error MSE, root mean square error RMSE, mean absolute error MAE and mean absolute deviation MAD.
[0514] It should also be noted that, in the embodiment of the present application, for the second merge candidate list, the second merge candidate list obtained can be reordered according to the template error, and then the selected merge candidate (i.e., target merge information) is determined based on the second merge index sequence number and the reordered third sorted merge candidate list. Specifically, when calculating the template error of a certain merge candidate, the reference block template obtained can be transformed accordingly based on the transformation model of the merge candidate, and then the template error can be calculated.
[0515] In another possible implementation, when the current block uses the DMVR mode, the first candidate merge information may include two motion information and two transformation models, such as the first motion information and the first transformation model, and the second motion information and the second transformation model. Accordingly, the method includes: when the current block uses the DMVR mode, determining the first motion information and the first transformation model, and the second motion information and the second transformation model included in the first candidate merge information; transforming the reference block indicated by the first motion information according to the first transformation model to determine a first transformed reference block; and transforming the reference block indicated by the second motion information according to the second transformation model to determine a second transformed reference block; and performing matching error calculation on the first transformed reference block and the second transformed reference block to determine an error value for the first candidate merge information.
[0516] It should be noted that in the embodiment of the present application, the two reference blocks in the DMVR process can be transformed according to the transformation model of the merged candidate, and then the error value (e.g., the SAD between the two reference blocks) can be calculated based on the two transformed reference blocks to determine the final optimization result. In addition, the transformation model can also transform the reference block template used in processes such as MV template matching, MVD prediction, and MMVD candidate sorting to obtain the transformed template error, which is used to replace the template error of the related art.
[0517] It should also be noted that, in the embodiment of the present application, the construction of the second merge candidate list may include one of the following:
[0518] Constructing a second merge candidate list based on at least one candidate motion information determined in the inter-frame merging manner and a corresponding transformation model;
[0519] Constructing a second merge candidate list based on at least one candidate motion information determined by a template matching method of a motion vector and a corresponding transformation model;
[0520] Constructing a second merge candidate list based on at least one candidate motion information determined in a bidirectional matching manner of motion vectors and a corresponding transformation model;
[0521] Constructing a second merge candidate list based on at least one candidate motion information determined in a motion vector difference manner and a corresponding transformation model;
[0522] A second merge candidate list is constructed based on at least one candidate motion information determined by the motion vector difference merging method and a corresponding transformation model.
[0523] It should be noted that in the embodiment of the present application, the second merge candidate list here can be a constructed Inter Merge list, or it can be constructed based on MV template matching, MV bidirectional matching, MVD prediction, MMVD candidate sorting and other lists, except that the merge candidates therein have a transformation model.
[0524] In this way, according to the transformation model of the merge candidate, the reference block template used in the Inter Merge list, MV template matching, MVD prediction, MMVD candidate sorting and other processes can be transformed to obtain the transformed template error; then, according to the template error, at least one candidate merge information in the second merge candidate list is sorted to determine the third sorted merge candidate list.
[0525] It should also be noted that in this embodiment of the present application, the second merge index number can be represented by cu_merge_idx. The second merge index number is used to indicate the number of the target merge information of the current block in the third sorted merge candidate list. Based on the cu_merge_idx written into the bitstream, the target merge information of the current block can be determined, and then the transformation model and reference block of the current block can be determined.
[0526] In a specific embodiment, the method further includes: if the motion information in the second merge candidate list is adjusted, determining that the transformation model corresponding to the motion information remains unchanged.
[0527] In another specific embodiment, the method also includes: if the motion information in the second merge candidate list is adjusted, determining the updated reference block of the current block based on the adjusted motion information; adjusting the model parameters of the transformation model corresponding to the motion information based on the template of the current block and the template of the updated reference block to obtain the adjusted transformation model.
[0528] It should be noted that, in an embodiment of the present application, the motion information (motion vector) in the second merge candidate list can be adjusted, while the corresponding transformation model remains unchanged. Exemplarily, there are n basic merge candidates in the MMVD method, and after a certain basic merge candidate is selected, the motion vector is offset to construct an MVD merge candidate. The transformation model corresponding to these newly added merge candidates is the same as the transformation model of the basic merge candidate. Exemplarily, the MV template matching method performs template matching on a certain merge candidate in the adjacent area pointed to by its motion vector, and optimizes the merge candidate based on the template error. It should be noted that the transformation model of the optimized merge candidate can remain unchanged. However, in some cases, some model parameters in the transformation model can also be changed while changing the motion information. For example, the updated reference block of the current block can be determined based on the adjusted motion information; then the model parameters of the transformation model corresponding to the motion information are adjusted based on the template of the current block and the template of the updated reference block. Exemplarily, the template of the reference block determined based on the adjusted motion information is Tref, the template of the current block is Tcur, and the model parameters of the transformation model are (α Y , β Y ). Then according to Tcur, Tref and α Y Derived β Y ′, use (α Y , β Y ′) instead of (α Y , β Y ) to obtain the adjusted transformation model.
[0529] It should also be noted that in this embodiment of the present application, the transformation model of the current block can also be saved. This saved transformation model of the current block can be used in subsequent encoding processes, such as constructing a transformation model candidate list for subsequent encoding blocks or a second merge candidate list containing the transformation model.
[0530] It should also be noted that in the embodiments of the present application, the transformation model candidate list constructed by this technical solution can be applied to blocks using the inter-frame prediction mode as well as to blocks using the IBC mode, without specific limitation here.
[0531] It is also understandable that in the embodiments of the present application, for the current block, there may be multiple components (such as a first color component, a second color component, and a third color component), or a single component (such as the first color component); or unidirectional prediction or bidirectional prediction may be used. For example, the first color component may be a Y component, the second color component may be a U component, and the third color component may be a V component, but this is not specifically limited.
[0532] In some embodiments, when the component to be processed of the current block is at least one of the first color component, the second color component, and the third color component, the method may further include:
[0533] When there is only one component to be processed in the current block and the current block is unidirectionally predicted, the transformation model used by the component to be processed is saved as a candidate transformation model;
[0534] When there is one component to be processed in the current block and the current block is bidirectionally predicted, the transformation model used by the component to be processed is saved as two candidate transformation models;
[0535] When there are three components to be processed in the current block and the current block is unidirectionally predicted, the transformation models used by the first color component, the second color component, and the third color component are saved as a candidate transformation model;
[0536] When there are three components to be processed in the current block and the current block is bidirectionally predicted, the transformation models used by the first color component, the second color component, and the third color component are saved as two candidate transformation models.
[0537] It should be noted that, in the embodiment of the present application, the component to be processed of the current block may be one, such as the Y component; or it may be multiple, such as including three components Y, U, and V; and the prediction direction information here may be unidirectional prediction or bidirectional prediction. The following is a schematic explanation of these situations.
[0538] In a possible implementation, the current block has only Y component, which is unidirectional prediction, and the transformation model used by the component can be saved as a transformation model candidate. For example, in the inter-frame prediction mode, when the current block is unidirectionally predicted and LIC mode is used for encoding, the transformation model candidate (α Y0 , β Y0 ); For example, in the inter-frame prediction mode, the current block is unidirectionally predicted and encoded using the LIC multi-model mode, the transform model candidate (α Y0 , β Y0 , α Y1 , β Y1 , Threshold). Among them, (α Y0 , β Y0 ) and (α Y1 , β Y1 ) are the two transformation models used by the current block, and Threshold is the threshold used to determine which transformation model should be applied to a pixel in the current block.
[0539] In another possible implementation, the current block has three components, Y, U, and V, and is unidirectionally predicted. The transformation models used by the three components can be saved as a transformation model candidate. For example, in the inter-frame prediction mode, the current block is unidirectionally predicted and LIC mode is used for encoding, then the transformation model candidate (α Y0 , β Y0 , α U0 , β U0 , α V0 , β V0 ), where (α Y0 , β Y0 )、(α U0 , β U0 ) and (α V0 , β V0 ) are the transformation models used by the reference blocks of the current block on the Y, U, and V components. If the subsequent coded block selects this transformation model, (α Y0 , β Y0 )、(α U0 , β U0 ) and (α V0 , β V0 ) are applied to the Y, U, and V components of its reference block respectively.
[0540] In another possible implementation, the current block has only Y component and is bidirectionally predicted, and the transform model used by the component can be saved as two transform model candidates. For example, in inter-frame prediction mode, when the current block is bidirectionally predicted and LIC mode is used for encoding, two transform model candidates (α and α) can be saved. Y0 , β Y0 ) and (α Y1 , β Y1 ), which come from the transformation models used by the forward reference block and the backward reference block of the current block on the Y component.
[0541] In another possible implementation, the current block has three components, Y, U, and V, and is bidirectionally predicted. The transformation models used by the three components can be saved as two transformation model candidates. For example, in the inter-frame prediction mode, when the current block is bidirectionally predicted and LIC mode is used for encoding, two transformation model candidates (α Y0 , β Y0 , α U0 , β U0 , α V0 , β V0 ) and (α Y1 , β Y1 , α U1 , β U1 , α V1 , βV1 ), which come from the transformation models used by the forward reference block and the backward reference block of the current block on the Y, U, and V components respectively.
[0542] In some embodiments, the method further includes: when there are three components to be processed in the current block, saving the transformation model used for one of the first, second, and third color components. In this case, the method further includes: determining the type of transformation model used for one of the color components; and performing model derivation based on adjacent reconstructed pixels of the current block and adjacent reconstructed pixels of the reference block to determine the transformation models used for the remaining two of the first, second, and third color components, wherein the type of transformation model used for the remaining two color components is the same as the type of transformation model used for the one of the color components.
[0543] In another possible implementation, the current block has three components, Y, U, and V, and the transformation model used by only one of the components can be saved as a transformation model candidate. For example, in the inter-frame prediction mode, the current block is unidirectionally predicted and encoded using the LIC mode, the transformation model derived from the template is (α Y0 , β Y0 , α U0 , β U0 , α V0 , β V0 ), where (α Y0 , β Y0 )、(α U0 , β U0 ) and (α V0 , β V0 ) are the transformation models used by the reference blocks of the current block on the Y, U, and V components. Here you can only save (α Y0 , β Y0 ) is used by the subsequent coded blocks. If the subsequent coded blocks select this transformation model, (α Y0 , β Y0 ) is applied to the Y component of its reference block, and the transformation model for the U and V components is re-derived based on the template. It should be noted that the derived transformation model for the U and V components is of the same type as the transformation model saved for the Y component.
[0544] In some embodiments, the method further includes: when the current block is bidirectionally predicted, if the two candidate transformation models to be saved are the same, saving one of the two candidate transformation models.
[0545] That is, in this embodiment of the present application, if the current block is bidirectionally predicted, two transform model candidates need to be saved. If the two transform models are the same, only one transform model candidate can be saved. However, it should be noted that when constructing the transform model candidate list for the subsequent coded block, the two transform models can be added in sequence.
[0546] In short, in the embodiment of the present application, when the current block is encoded using the LIC mode or the present technical solution, after determining the transformation model of the current block, the transformation model can be saved. If the current block has three components, Y, U, and V, the transformation models used by these three components can be saved as a transformation model candidate (i.e., a transformation model candidate has transformation models for the three component reference blocks, respectively, of Y, U, and V). For example, in the inter-frame prediction mode, the current block is unidirectionally predicted, and when the LIC mode is used for encoding, the transformation model candidate (α Y0 , β Y0 , α U0 , β U0 , α V0 , β V0 ), where (α Y0 , β Y0 )、(α U0 , β U0 ) and (α V0 , β V0 ) are the transform models used by the reference blocks of the current block on the Y, U, and V components respectively. For example, in the inter-frame prediction mode, the current block is bidirectionally predicted and encoded using the LIC mode, then two transform model candidates (α Y0 , β Y0 , α U0 , β U0 , α V0 , β V0 ) and (α Y1 , β Y1 , α U1 , β U1 , α V1 , β V1 ), corresponding to the transformation models used by the forward reference block and the backward reference block of the current block respectively. If the two transformation models are the same, only one transformation model candidate can be saved.
[0547] In some embodiments, the method may further include: determining first motion information of the current block; determining a first reference block of the current block based on the first motion information; adjusting model parameters of a transformation model based on a template of the current block and a template of the first reference block to obtain an adjusted transformation model; transforming the reference block based on the adjusted transformation model to determine a prediction block of the current block.
[0548] It should be noted that, in the embodiment of the present application, the parameters of the transformation model can be updated according to the first motion information of the current block (for example, the motion information corresponding to a certain merge candidate list, the motion information finally used by the current block, etc.). For example, according to the motion information, the template of the reference block is determined to be Tref, the template of the current block is determined to be Tcur, and a candidate transformation model in the transformation model candidate list is determined to be (α Y , β Y ). Then according to Tcur, Tref and α Y Derived β Y ′, use (α Y , β Y ′) instead of (α Y , β Y ) to obtain the updated transformation model.
[0549] In some embodiments, the type of transformation model may include at least one of the following: a type of linear model, a type of filtering model, a type of multi-model, and a combination of different types.
[0550] It should be noted that in the embodiment of the present application, the type of transformation model can be a linear model (α, β), or a Filter model, a LIC multi-model, etc., and different types of transformation models can be included at the same time to construct a transformation model candidate list.
[0551] In some embodiments, the method further includes: performing model derivation based on adjacent reconstructed pixels of the current block and adjacent reconstructed pixels of the reference block, or performing model derivation based on the reconstructed block of the current block and the reference block to determine the derivation model of the current block; and saving the transformation model of the current block and the derivation model of the current block.
[0552] It should be noted that in the embodiments of the present application, after determining the reconstructed block of the current block, a transformation model can be re-derived based on the reconstructed block of the current block and the reference block. Alternatively, a current block that does not itself use a transformation model can also use this method to obtain and save a transformation model; a current block that itself uses a transformation model can replace the original transformation model with the new transformation model to save it, or both the new and old transformation models can be saved.
[0553] In some embodiments, in addition to transmitting the transformation model index number in the code stream, the transformation model with the smallest template error value can also be used as the final selected transformation model. In this case, the index number is not transmitted, which can save coding bits.
[0554] In some embodiments, the method further includes: determining first information of the current block; when the first information satisfies a first condition, performing a model derivation based on adjacent reconstructed pixels of the current block and adjacent reconstructed pixels of a reference block, or performing a model derivation based on a reconstructed block of the current block and a reference block to determine a derivation model of the current block; wherein the first information includes at least one of the following: the position of the current block, the size of the current block, the adjacent block information of the current block, and the encoded syntax identification information of the current block.
[0555] It should be noted that in the embodiments of the present application, a condition may be added to determine whether to derive a transformation model based on the reconstructed block. For example, whether to perform the step of determining the derivation model of the current block may be determined based on the size of the current block, block-level, or frame-level flags. The derivation model of the current block may be derived based on adjacent reconstructed pixels of the current block and adjacent reconstructed pixels of a reference block, or may be derived based on a reconstructed block of the current block and a reference block.
[0556] In some embodiments, the method further includes: determining second information of the current block; when the second information satisfies a second condition, performing encoding processing on the value of the second syntax identification information, and writing the obtained coded bits into the bitstream; wherein the second information includes at least one of the following: the position of the current block, the size of the current block, the adjacent block information of the current block, and the encoded syntax identification information of the current block.
[0557] It should be noted that various embodiments of this technical solution may add judgment conditions when encoding the cu_model_merge_flag syntax element. For example, whether to encode the cu_model_merge_flag into the bitstream may be determined based on the relevant syntax elements of the coded block. The coded block may be located adjacent to the current block. For example, the left upper left corner of the current block is (x, y), and the width and height are w, h. The coded blocks located at (x–1, y+h–1), (x+w–1, y–1), (x–1, y+h), (x+w, y–1), and (x–1, y–1) may be checked. The judgment condition may be that the prediction mode-related syntax elements (such as cu_lic_flag and cu_model_merge_flag) for a certain coded block (or a certain number of coded blocks) are true. For example, whether to encode the cu_model_merge_flag into the bitstream may be determined based on other coded syntax elements of the current block, the position or size of the current block, a frame-level flag or a sequence-level flag, and so on.
[0558] In some embodiments, the present technical solution may add a judgment condition to indicate whether a specific process in the present technical solution is applied. For example, if the size of the current block exceeds a certain threshold, the process of transforming the template of the reference block based on the transformation model is not performed.
[0559] In some embodiments, if the current block uses an inter-frame prediction method based on a legacy transform model, the implementation of merge list construction, MMVD list construction, DMVR, and other methods for the current block may differ from when the current block does not use an inter-frame prediction method based on a legacy transform model. For example, the size of the construction list and candidate information may differ. In other words, judgments based on cu_model_merge_flag are introduced into various inter-frame prediction processes.
[0560] In some embodiments, the method further includes: determining third information of the current block; when the third information satisfies a third condition, executing a step of saving the transformation model of the current block; wherein the third information includes at least one of the following: the position of the current block, the size of the current block, the adjacent block information of the current block, and the encoded syntax identification information of the current block.
[0561] It should be noted that in the embodiments of the present application, a condition can also be added to determine whether to save the transformation model. For example, if the current block uses a transformation model to transform the reference block, the size of the current block, block-level, frame-level flags, etc. can be used to determine whether to save the transformation model or save the transformation model to the historical transformation model list.
[0562] In some embodiments, the method further comprises: determining a derived transformation model of the current block when constructing the transformation model candidate list of the current block; and adding the derived transformation model to the transformation model candidate list.
[0563] In some embodiments of the present invention, the method further includes: when the current block uses the intra block copy mode, executing the step of constructing a transformation model candidate list for the current block.
[0564] It should be noted that, in embodiments of the present application, the fifth syntax identification information may be used to indicate whether the current block uses intra block copy mode. In some embodiments, the method further includes: determining a value of the fifth syntax identification information; encoding the value of the fifth syntax identification information, and writing the resulting encoded bits into the bitstream.
[0565] It should also be noted that, in this embodiment of the present application, with respect to the value of the fifth syntax identification information, if the current block uses the intra block copy mode, the value of the fifth syntax identification information is determined to be a first value; if the current block does not use the intra block copy mode, the value of the fifth syntax identification information is determined to be a second value. The first value is different from the second value. For example, the first value can be 1 and the second value can be 0; or the first value can be true and the second value can be false; this is not limited here.
[0566] That is to say, in the embodiment of the present application, whether it is the inter-frame prediction mode or the intra-frame block copy mode, when constructing the transformation model candidate list, the derived transformation model can be used as one of the candidate transformation models. For example, the transformation model candidate list constructed in the above embodiment can be modified to {LIC, LIC_LEFT, LIC_TOP, LIC_MM, Filter, Model0, Model1...}. Among them, LIC, LIC_LEFT...Filter, etc. represent different methods of deducing transformation models based on templates, and Model0, etc. represent transformation models inherited from the spatial domain, time domain, etc. For example, if the value of cu_model_merge_idx is equal to 0, it indicates that the current block uses the LIC prediction method, and the specific implementation process can be the same as the LIC technology of the related art.
[0567] In another embodiment of the present application, the embodiment of the present application further provides a code stream, which is generated by bit encoding based on information to be encoded; wherein the information to be encoded includes at least one of the following:
[0568] The residual block of the current block, the transformation model index number of the current block, the first merge index number of the current block, the second merge index number of the current block, the motion information of the current block, the first transformation model index number and the second transformation model index number of the current block, the prediction direction information of the current block, the mode identification information of at least part of the candidate motion information in the first sorted merge candidate list, the value of the first syntax identification information, the value of the second syntax identification information, the value of the third syntax identification information, the value of the fourth syntax identification information and the value of the fifth syntax identification information.
[0569] In an embodiment of the present application, the first syntax identification information is used to indicate whether the current block uses the inter-frame prediction mode, the second syntax identification information is used to indicate whether the current block uses the method based on the transformation model candidate list, the first syntax identification information is used to indicate whether the current block uses the prediction mode based on the reference block transformation, the fourth syntax identification information is used to indicate whether the current block uses the inter-frame merge prediction mode, and the fifth syntax identification information is used to indicate whether the current block uses the intra-frame block copy mode.
[0570] An embodiment of the present application provides an encoding method that, when the current block uses an inter-frame prediction mode, constructs a list of candidate transform models for the current block; determines the transform model of the current block based on the list of candidate transform models, and determines a reference block for the current block; and transforms the reference block according to the transform model to determine a prediction block for the current block. In other words, when the current block uses an inter-frame prediction mode, it is first necessary to construct a list of candidate transform models for the current block, and then determine the transform model and reference block for the current block based on the list. The reference block is transformed using the transform model, thereby not only improving the diversity of inter-frame prediction, but also improving the accuracy of prediction, thereby improving encoding and decoding efficiency.
[0571] In another embodiment of the present application, based on the encoding method and decoding method described in the aforementioned embodiments, it mainly includes: obtaining the transformation model of the current block by constructing a list; the transformation model can be used for the transformation of the reference block, template error calculation and other processes.
[0572] In a specific embodiment, in inter-frame prediction mode, a transform model candidate list is constructed for the current block. The transform model for the current block is determined by writing the candidate index into the bitstream. The selected transform model is used in the Merge list construction, MMVD list construction, MV template matching, MV bidirectional matching, MVD prediction, and other processes during inter-frame prediction to complete the decoding of the current block.
[0573] Exemplarily, the syntax elements are described as follows:
[0574] The specific implementation process is as follows:
[0575] Step 1: If a coding block is encoded using the LIC technology or the present technical solution, the transformation model used by its reference block can be saved after the encoding is completed. If the coding block has three components, Y, U, and V, the transformation models used by the three components can be saved as a transformation model candidate (i.e., a transformation model candidate has transformation models for the three component reference blocks, respectively, Y, U, and V). For example, if an inter-frame coding block is unidirectionally predicted and encoded using the LIC mode, the transformation model candidate (α Y0 , β Y0 , α U0 , β U0 , α V0 , β V0 ), where (α Y0 , β Y0 )、(α U0 , β U0 ) and (α V0 , β V0) are the transform models used by the reference blocks on the Y, U, and V components of the coding block. For example, if an inter-frame coding block is bidirectionally predicted and coded using the LIC mode, two transform model candidates (α Y0 , β Y0 , α U0 , β U0 , α V0 , β V0 ) and (α Y1 , β Y1 , α U1 , β U1 , α V1 , β V1 ), which correspond to the transformation models used by the forward reference block and the backward reference block of the coding block respectively. If the two transformation models are the same, only one transformation model candidate can be saved;
[0576] Step 2: Decode the current block. Decode cu_prediction_mode to determine if the current block uses inter-frame prediction mode; decode cu_model_merge_flag. If cu_model_merge_flag is true, it indicates that the transformation model is determined by building a candidate list of transformation models. Further decode cu_model_merge_idx to determine which transformation model in the list is used; if cu_model_merge_flag is false, it indicates that the prediction method of this technical solution is not used.
[0577] Step 3, cu_model_merge_flag can use the entropy coding method based on the context model. The value range of cu_model_merge_idx can be less than or equal to the maximum transform model candidate list length, and variable length coding can be used. The smaller the index, the shorter the corresponding codeword. For example, the value range of cu_model_merge_idx is n, and truncated binary code is used;
[0578] Step 4: If cu_model_merge_flag is true, a list of transform model candidates is constructed for the current block, which can be denoted as modelList, with a maximum length of N. The list can be composed of the following candidates in order:
[0579] a) Available transformation models of adjacent locations;
[0580] b) Available transformation models in the time domain;
[0581] c) available transformation models for non-adjacent locations;
[0582] d) Available transformation models in the time domain after translation;
[0583] e) historically available transformation models;
[0584] f) default transformation model;
[0585] The default transformation model may include: parameters (α Y0 , β Y0 , α U0 , β U0 , α V0 , β V0 ) of the LIC transformation model, and the transformation model obtained by adjusting the transformation models in the list. When adding a transformation model, it can be compared with the models in the list to prevent redundancy;
[0586] Step 5: Determine a transformation model based on cu_model_merge_idx. For example, if the value of cu_model_merge_idx is equal to idx, then modelList[idx] is determined to be the transformation model of the current block.
[0587] In step 6, the reference block template in the Inter Merge candidate list process can be transformed according to modelList[idx], and then the Inter Merge candidate list can be reordered according to the transformed template error. For example, the transformation model of the current block is modelList[idx], the template of the nth Merge candidate is Tn, the template of the current block is Tcur, and the template error is calculated using SAD. First, Tn is transformed according to modelList[idx] to obtain Tn', and then the SAD between Tn' and Tcur is calculated to obtain the template error SADn of the Merge candidate. According to this step, the template error SADi of each Merge candidate is obtained, 0≤i<N. The N Merge candidates in the list are reordered according to SADi. The smaller the SADi, the smaller the index value after sorting; if a candidate corresponds to bidirectional prediction, the template of the Merge candidate can be obtained by bidirectional prediction; the calculation of the template error can calculate the three YUV components or only a single component, which can be consistent with the reordering process of the conventional Inter Merge list;
[0588] Step 7: After the inter-merge candidate list is reordered in step 6, some candidates in the inter-merge candidate list can be further sorted based on the LIC flag and other mode flags in the merge candidate. For example, if the LIC flag of a merge candidate is true, it will be sorted to the front of the list. If the LIC flag of multiple merge candidates is true, the order of these candidates can remain relatively unchanged;
[0589] In step 8, the two reference blocks in the DMVR process of the candidate motion vector (determined from the Merge candidate) can be transformed according to modelList[idx], and then the error value (for example, the SAD between the two blocks) is calculated based on the two transformed reference blocks to determine the final optimization result;
[0590] Step 9, referring to step 6, can transform the reference block template used in the MV template matching, MVD prediction, MMVD candidate sorting and other processes according to modelList[idx], and obtain the transformed template error to replace the original template error;
[0591] Step 10: Determine the transform model for the current block based on steps 1 to 9, and combine this transform model with inter-frame decoding processes such as Merge list construction to obtain the final motion information and thus determine the final reference block. Transform the reference block according to the transform model of the current block to obtain the prediction block of the current block. Combined with the residual information obtained by decoding, the decoding of the current block is completed.
[0592] Step 11: Save the transformation model used by the current block for subsequent encoding, for example, to construct a candidate list of transformation models for subsequent encoding blocks.
[0593] In another specific embodiment, in inter-frame prediction mode, a list of candidate transformation models is constructed for the current block. The motion information and reference block of the current block are first determined based on the decoded information. The list of candidate transformation models is then reordered based on the template of the reference block. The transformation model for the current block is determined by writing the candidate index into the bitstream. The reference block is transformed based on the transformation model to obtain a prediction block, completing the decoding of the current block.
[0594] Exemplarily, the syntax elements are described as follows:
[0595] The specific implementation process is as follows:
[0596] Step 12, same as steps 1 to 4, decode the cu_model_merge_flag and cu_model_merge_idx syntax elements to complete the construction of the current block transform model candidate list;
[0597] Step 13, determining the motion information of the current block and the reference block according to the decoded information;
[0598] In step 14, the list of transformation model candidates can be sorted according to the reference block. For example, the template of the current block is Tcur, the reference block template is Tref, a certain transformation model candidate is modelList[i], and the template error is calculated using SAD. First, Tref is transformed according to modelList[i] to obtain Tref_i, and then the SAD between Tref_i and Tcur is calculated to obtain the template error SADi of the transformation model candidate. According to this step, the template error SADi of each transformation model candidate is obtained, 0≤i<N. The N transformation model candidates in the list are reordered according to SADi. The smaller the SADi, the smaller the index value after sorting; if the current block uses bidirectional prediction, the reference block template can be obtained by bidirectional prediction; the calculation of the template error can calculate the three YUV components or only a single component, which can be consistent with the reordering process of the conventional Inter Merge list;
[0599] Step 15: Determine the transform model selected for the current block based on cu_model_merge_idx; transform the reference block based on the transform model of the current block to obtain the prediction block of the current block. Combined with the residual information obtained by decoding, the decoding of the current block is completed;
[0600] Step 16: Save the transformation model used by the current block for subsequent encoding, for example, to construct a candidate list of transformation models for subsequent encoding blocks.
[0601] In another specific embodiment, in the inter-frame prediction mode, a Merge candidate list with a transformation model is constructed for the current block, and the motion information and transformation model of the current block are determined by writing the candidate index of the bitstream to complete the decoding of the current block.
[0602] Exemplarily, the syntax elements are described as follows:
[0603] The specific implementation process is as follows:
[0604] Step 17, same as step 1, if a coding block is encoded using the LIC technology or the present technical solution, the transformation model used by its reference block can be saved after encoding is completed and used for subsequent coding blocks;
[0605] Step 18: Decode cu_lic_flag and cu_model_merge_flag. If both are true, it indicates that the current block uses the prediction method of the inherited transform model. Decode the current block. Decode pu_merge_flag to determine that the current block uses the inter-frame merge prediction mode. Decode cu_lic_flag. If cu_lic_flag is true, it indicates that the prediction mode of transforming the reference block is used. Decode cu_model_merge_flag. If cu_model_merge_flag is true, it indicates that the transform model is determined by inheriting from the coded block. If cu_model_merge_flag is false, it indicates that the transform model is calculated by template derivation.
[0606] Step 19: If cu_lic_flag is true and cu_model_merge_flag is true, it indicates that the prediction method of this scheme is used. Construct a merge candidate list, where each merge candidate can contain a corresponding transformation model. For example, add spatial adjacent candidates. Check the predefined spatial position, and if the motion information corresponding to the position is available, further check whether the transformation model is saved at the position. If the above conditions are met, the motion information and transformation model of the position are added to the merge candidate list as one of the available merge candidates; similarly, there can be merge candidates of spatial, temporal, historical, average, default and other types;
[0607] In step 20, referring to step 6, the merge candidate list obtained in step 19 can be reordered based on the template error, and the selected merge candidate can be determined based on the merge index and the reordered merge list. When calculating the template error of a particular merge candidate, the reference block template obtained from the merge candidate is transformed accordingly based on the transformation model of the merge candidate.
[0608] Step 21, referring to steps 8 and 9, the two reference blocks in the DMVR process can be transformed according to the transformation model of the merged candidate, and then the error value (for example, the SAD between the two blocks) is calculated based on the two reference blocks after the transformation and the final optimization result is determined; the reference block template used in the MV template matching, MVD prediction, MMVD candidate sorting and other processes is transformed to obtain the transformed template error, which is used to replace the original template error;
[0609] In step 22, steps 20 and 21, the motion information (motion vector) can be adjusted, while the corresponding transformation model remains unchanged. For example, the MMVD method has n basic merge candidates. After selecting a basic merge candidate, the motion vector is offset to construct an MVD merge candidate. The transformation models corresponding to these newly added merge candidates are the same as the transformation models of the basic merge candidates. For example, the MV template matching method performs template matching on a merge candidate in the neighboring area pointed to by its motion vector, and optimizes the merge candidate according to the template error value. The transformation model of the optimized merge candidate remains unchanged; alternatively, some model parameters of the transformation model can be modified while adjusting the motion information (motion vector).
[0610] Step 23: Based on steps 17-21, the final motion information and transformation model are obtained. The reference block is transformed according to the transformation model of the current block to obtain the prediction block of the current block. Combined with the residual information obtained by decoding, the decoding of the current block is completed.
[0611] Step 24: Save the transformation model used for the current block for subsequent encoding, for example, to construct a transformation model candidate list for subsequent encoding blocks.
[0612] It should be noted that, compared to the previous two specific embodiments, this specific embodiment does not require the transmission of transform model indices. Instead, transform models are mapped one-to-one to merge candidates in merge mode, requiring only the merge index number to be transmitted. This specific embodiment can be indicated by cu_lic_flag and cu_model_merge_flag to construct a new merge candidate list, and the transform model corresponding to the merge candidate can be used in processes involving reference block templates, such as MVD prediction.
[0613] In another specific embodiment, the current block in the prediction modes such as IBC and Inter may have multiple color components (e.g., Y component, U component, and V component) or a single color component (e.g., Y component), and may be unidirectional or bidirectionally predicted. Saving the transformation model, building the transformation model list, and applying the transformation model may be implemented as follows:
[0614] (a) The current block only has the Y component, which is a unidirectional prediction. The transformation model used by this component can be saved as a transformation model candidate. For example, if an inter-frame coding block is a unidirectional prediction and is coded using the LIC mode, the transformation model candidate (α Y0 , β Y0 ); For example, if an inter-frame coding block is unidirectionally predicted and coded using LIC multi-model mode, the transformation model candidate (α Y0 , β Y0 , α Y1 , β Y1, Threshold). Among them (α Y0 , β Y0 ) and (α Y1 , β Y1 ) are the two transformation models used by the current block, and Threshold is the threshold used to determine which transformation model should be applied to a pixel in the block;
[0615] (b) The current block has three components, Y, U, and V, and is unidirectionally predicted. The transformation models used by the three components can be saved as a transformation model candidate. For example, if an inter-frame coding block is unidirectionally predicted and coded using the LIC mode, the transformation model candidate (α Y0 , β Y0 , α U0 , β U0 , α V0 , β V0 ), where (α Y0 , β Y0 )、(α U0 , β U0 ) and (α V0 , β V0 ) are the transformation models used by the reference blocks of the current block on the Y, U, and V components. If the subsequent coding block selects this transformation model, (α Y0 , β Y0 )、(α U0 , β U0 ) and (α V0 , β V0 ) are applied to the three components of its reference block respectively;
[0616] (c) The current block has three components, Y, U, and V, and is bidirectionally predicted. The transformation models used by the three components can be saved as two transformation model candidates. For example, if an inter-frame coding block is bidirectionally predicted and coded using the LIC mode, two transformation model candidates (α Y0 , β Y0 , α U0 , β U0 , α V0 , β V0 ) and (α Y1 , β Y1 , α U1 , β U1 , α V1 , β V1 ), which are transformation models used by the forward reference block and the backward reference block of the current block respectively. If the two transformation models are the same, only one transformation model candidate can be saved. When constructing the transformation model candidate list for subsequent coding blocks, the two transformation models can be added in sequence;
[0617] (d) The current block has three components, Y, U, and V. The transformation model used by only one component can be saved as a transformation model candidate. For example, a certain inter-frame coding block is unidirectionally predicted and coded using the LIC mode. The transformation model derived from the template is (α Y0 , β Y0 , α U0 , β U0 , α V0 , β V0 ), where (α Y0 , β Y0 )、(α U0 , β U0 ) and (α V0 , β V0 ) are the transformation models used by the reference blocks of the current block on the Y, U, and V components. You can only save (α Y0 , β Y0 ) for subsequent coding blocks. If the subsequent coding block selects this transformation model, it can use (α Y0 , β Y0 ) is applied to the Y component of its reference block, and the transformation model for the U and V components is re-derived based on the template.
[0618] In the embodiments of the present application, the specific implementation of the aforementioned embodiments is elaborated in detail through the above embodiments. According to the technical solutions of the aforementioned embodiments, it can be seen that a transformation model candidate list is constructed for the current block, and the transformation model of the current block is determined by the transformation model index number; in addition, the transformation model is combined with the Merge list construction, motion vector optimization and prediction in inter-frame prediction, etc., involving template error and two-way matching error calculation processes, and the transformed template error is used to replace the template error of the related technology; in this way, the transformation model information of the encoded block is utilized, and a method for constructing a candidate list and using a transformation model for encoding indexes is proposed here, which can improve the diversity of inter-frame prediction and thus improve the coding efficiency.
[0619] In yet another embodiment of the present application, based on the same inventive concept as the aforementioned embodiment, FIG28 is a schematic diagram of the composition structure of an encoder provided in an embodiment of the present application. As shown in FIG28 , the encoder 280 may include a first construction unit 2801, a first determination unit 2802, and a first prediction unit 2803, wherein:
[0620] The first constructing unit 2801 is configured to construct a transform model candidate list for the current block when the current block uses the inter prediction mode;
[0621] A first determining unit 2802 is configured to determine a transformation model of a current block based on a transformation model candidate list, and determine a reference block of the current block;
[0622] The first prediction unit 2803 is configured to transform the reference block according to the transformation model to determine a prediction block of the current block.
[0623] In some embodiments, the first determining unit 2802 is further configured to determine a transformation model of the current block based on the transformation model candidate list; and determine a reference block of the current block according to the transformation model and the first merge candidate list.
[0624] In some embodiments, the first determination unit 2802 is further configured to perform encoding cost calculation on at least one candidate transformation model in the transformation model candidate list to determine the cost result of each of the at least one candidate transformation model; and determine the minimum cost result from the cost results of each of the at least one candidate transformation model, and determine the candidate transformation model corresponding to the minimum cost result as the transformation model of the current block.
[0625] In some embodiments, referring to FIG. 28 , the encoder 280 further includes an encoding unit 2804 , wherein:
[0626] The first determination unit 2802 is further configured to determine the transformation model index number of the current block; wherein the transformation model index number is used to indicate the number of the transformation model of the current block in the transformation model candidate list; the encoding unit 2804 is configured to encode the transformation model index number of the current block and write the obtained encoded bits into the bitstream.
[0627] In some embodiments, the first determination unit 2802 is further configured to determine at least one candidate motion information of the current block; the first construction unit 2801 is further configured to construct a first merged candidate list based on at least one candidate motion information of the current block; wherein the candidate motion information is used to indicate the candidate reference block of the current block and / or the template of the candidate reference block.
[0628] In some embodiments, the first construction unit 2801 is further configured to construct a first merge candidate list based on at least one candidate motion information determined by the inter-frame merging method; construct a first merge candidate list based on at least one candidate motion information determined by the template matching method of the motion vector; construct a first merge candidate list based on at least one candidate motion information determined by the bidirectional matching method of the motion vector; construct a first merge candidate list based on at least one candidate motion information determined by the motion vector difference method; and construct a first merge candidate list based on at least one candidate motion information determined by the motion vector difference merging method.
[0629] In some embodiments, the first determination unit 2802 is further configured to perform template error calculation on at least one candidate reference block indicated in the first merge candidate list according to the transformation model to determine the error value of the at least one candidate reference block; and determine the minimum error value from the error values of the at least one candidate reference block, and determine the candidate reference block corresponding to the minimum error value as the reference block of the current block.
[0630] In some embodiments, the first determination unit 2802 is further configured to transform the template of at least one candidate reference block indicated in the first merge candidate list according to a transformation model to obtain a transformation template of at least one candidate reference block; and perform template error calculation on the template of the current block and the transformation template of at least one candidate reference block based on preset criteria to determine the error value of at least one candidate reference block.
[0631] In some embodiments, the first determining unit 2802 is further configured to sort the first merge candidate list according to the error value of at least one candidate reference block to determine a first sorted merge candidate list.
[0632] In some embodiments, the first determination unit 2802 is further configured to determine pattern identification information of at least part of the candidate motion information in the first sorted merge candidate list; and sort at least part of the candidate motion information in the first sorted merge candidate list according to the pattern identification information of at least part of the candidate motion information to determine the second sorted merge candidate list.
[0633] In some embodiments, the encoding unit 2804 is further configured to encode the mode identification information of at least part of the candidate motion information in the first sorted merging candidate list, and write the obtained coded bits into the bitstream.
[0634] In some embodiments, the first determination unit 2802 is further configured to determine the first merge index number of the current block based on the reference block of the current block; wherein the first merge index number is used to indicate the number of the motion information corresponding to the reference block in the first sorted merge candidate list or the second sorted merge candidate list; the encoding unit 2804 is further configured to encode the first merge index number and write the obtained encoded bits into the bitstream.
[0635] In some embodiments, the first determination unit 2802 is further configured to determine, when the current block uses the DMVR mode, at least one group of candidate reference blocks for the current block according to the first merged candidate list, each group of candidate reference blocks including two candidate reference blocks; transform the two candidate reference blocks in each group of candidate reference blocks according to the transformation model to determine the two transformed reference blocks in each group of candidate reference blocks; perform matching error calculation on the two transformed reference blocks in each group of candidate reference blocks to determine the error value corresponding to each group of candidate reference blocks; and determine, based on the error value corresponding to each group of candidate reference blocks, a group of candidate reference blocks with the smallest error value as the reference block of the current block.
[0636] In some embodiments, the first determining unit 2802 is further configured to determine a reference block of the current block; and determine a transformation model of the current block according to the reference block and the transformation model candidate list.
[0637] In some embodiments, the first determining unit 2802 is further configured to determine motion information of the current block based on the reference block; the encoding unit 2804 is further configured to encode the motion information of the current block and write the obtained coded bits into the bitstream.
[0638] In some embodiments, the first determination unit 2802 is further configured to perform template error calculation based on the reference block and at least one candidate transformation model in the transformation model candidate list to determine the error value of at least one candidate transformation model; and determine the minimum error value from the error values of at least one candidate transformation model, and determine the candidate transformation model corresponding to the minimum error value as the transformation model of the current block.
[0639] In some embodiments, the first determination unit 2802 is further configured to sort the transformation model candidate list according to the reference block to determine the sorted transformation model candidate list; determine the candidate transformation model at a preset position according to the sorted transformation model candidate list; and determine the candidate transformation model at the preset position as the transformation model of the current block.
[0640] In some embodiments, the first determination unit 2802 is further configured to determine the transformation model index number of the current block; wherein the transformation model index number is used to indicate the number of the transformation model of the current block in the sorted transformation model candidate list; the encoding unit 2804 is further configured to encode the transformation model index number of the current block and write the obtained encoded bits into the bitstream.
[0641] In some embodiments, the first determination unit 2802 is further configured to perform template error calculation based on the reference block and at least one candidate transformation model in the transformation model candidate list to determine the error value of at least one candidate transformation model; and sort the transformation model candidate list according to the error value of at least one candidate transformation model to determine the sorted transformation model candidate list.
[0642] In some embodiments, the first determination unit 2802 is further configured to transform the template of the reference block according to at least one candidate transformation model to obtain the transformation template of at least one reference block; and perform error calculation on the template of the current block and the transformation template of at least one reference block based on preset criteria to determine the error value of at least one candidate transformation model.
[0643] In some embodiments, the first determination unit 2802 is further configured to determine the first transformation model index number and the second transformation model index number of the current block when the current block is bidirectionally predicted; the encoding unit 2804 is further configured to encode the first transformation model index number and the second transformation model index number, and write the obtained encoding bits into the bitstream; wherein the first transformation model index number is used to represent the number of the transformation model corresponding to the reference block of the current block in the first reference image list in the sorted transformation model candidate list, and the second transformation model index number is used to represent the number of the transformation model corresponding to the reference block of the current block in the second reference image list in the sorted transformation model candidate list.
[0644] In some embodiments, the first prediction unit 2803 is further configured to determine prediction direction information of the current block; the encoding unit 2804 is further configured to encode the prediction direction information of the current block and write the obtained encoding bits into the bitstream.
[0645] In some embodiments, the first determining unit 2802 is further configured to determine at least one candidate transformation model for the current block; and determine a transformation model candidate list for the current block according to the at least one candidate transformation model.
[0646] In some embodiments, the first determination unit 2802 is further configured to determine an available transformation model for an adjacent position of the current block; determine an available transformation model for the time domain of the current block; determine an available transformation model for a non-adjacent position of the current block; determine an available transformation model for the time domain after translation of the current block; determine an available transformation model for history; and determine a preset transformation model.
[0647] In some embodiments, the first determination unit 2802 is further configured to determine the transformation model corresponding to the local illumination compensation mode of the current block as the preset transformation model; or, to adjust the candidate transformation model already in the transformation model candidate list and determine the adjusted candidate transformation model as the preset transformation model.
[0648] In some embodiments, the first determination unit 2802 is further configured to, after determining a new candidate transformation model for the current block, compare the new candidate transformation model with the candidate transformation models already in the transformation model candidate list; and when the new candidate transformation model is different from the candidate transformation models already in the transformation model candidate list, add the new candidate transformation model to the transformation model candidate list.
[0649] In some embodiments, the first determination unit 2802 is further configured to determine a value of first syntax identification information; wherein the first syntax identification information is used to indicate whether the current block uses an inter-frame prediction mode; the encoding unit 2804 is further configured to encode the value of the first syntax identification information and write the obtained encoded bits into the bitstream.
[0650] In some embodiments, the first determination unit 2802 is further configured to determine a value of second syntax identification information; wherein the second syntax identification information is used to indicate whether the current block uses a method based on a transformation model candidate list; the encoding unit 2804 is further configured to encode the value of the second syntax identification information and write the obtained encoded bits into the bitstream.
[0651] In some embodiments, the encoding unit 2804 is further configured to perform encoding processing on the value of the second syntax identification information based on the context model, and write the obtained encoded bits into the bitstream.
[0652] In some embodiments, the first construction unit 2801 is further configured to construct a second merge candidate list for the current block when the current block uses a prediction mode based on a reference block transformation and the current block uses a method based on a transformation model candidate list; the first determination unit 2802 is further configured to determine the transformation model and reference block of the current block based on the second merge candidate list; the first prediction unit 2803 is further configured to transform the reference block according to the transformation model to determine the prediction block of the current block.
[0653] In some embodiments, the first determination unit 2802 is further configured to determine a value of third syntax identification information; wherein the third syntax identification information is used to indicate whether the current block uses a prediction mode based on reference block transformation; the encoding unit 2804 is further configured to encode the value of the third syntax identification information and write the obtained encoding bits into the bitstream.
[0654] In some embodiments, the first determination unit 2802 is further configured to determine a value of fourth syntax identification information; wherein the fourth syntax identification information is used to indicate whether the current block uses the inter-frame merge prediction mode; the encoding unit 2804 is further configured to encode the value of the fourth syntax identification information and write the obtained encoding bits into the bitstream.
[0655] In some embodiments, the first determination unit 2802 is further configured to determine candidate merge information corresponding to a predefined position of the current block; wherein the candidate merge information includes motion information and a transformation model; and when the candidate merge information corresponding to the predefined position meets a preset candidate condition, the candidate merge information corresponding to the predefined position is added to the second merge candidate list.
[0656] In some embodiments, the candidate merge information corresponding to the predefined position meets a preset candidate condition, including: the motion information corresponding to the predefined position is available, and a transformation model is stored in the predefined position.
[0657] In some embodiments, the first determination unit 2802 is further configured to perform encoding cost calculation on at least one candidate merge information in the second merge candidate list to determine the cost result of each of the at least one candidate merge information; determine the minimum cost result from the cost results of each of the at least one candidate merge information, and determine the candidate merge information corresponding to the minimum cost result as the target merge information of the current block; and determine the transformation model and reference block of the current block based on the target merge information.
[0658] In some embodiments, the first determination unit 2802 is further configured to determine an error value of at least one candidate merge information in the second merge candidate list; and sort at least one candidate merge information in the second merge candidate list according to the error value to determine a third sorted merge candidate list.
[0659] In some embodiments, the first determination unit 2802 is further configured to determine a second merge index number of the current block; wherein the second merge index number is used to indicate the number of the target merge information of the current block in the third sorted merge candidate list; the encoding unit 2804 is further configured to encode the second merge index number of the current block and write the obtained encoded bits into the bitstream.
[0660] In some embodiments, the first determination unit 2802 is further configured to determine the template of the first reference block indicated by the first motion information based on the first motion information and the first transformation model included in the first candidate merge information; transform the template of the first reference block according to the first transformation model to determine the transformation template of the first reference block; and perform template error calculation on the template of the current block and the transformation template of the first reference block based on a preset criterion to determine the error value of the first candidate merge information; wherein the first candidate merge information is any one of the at least one candidate merge information.
[0661] In some embodiments, the first determination unit 2802 is further configured to determine the first motion information and the first transformation model as well as the second motion information and the second transformation model included in the first candidate merge information when the current block uses the DMVR mode; transform the reference block indicated by the first motion information according to the first transformation model to determine the first transformed reference block; and transform the reference block indicated by the second motion information according to the second transformation model to determine the second transformed reference block; and perform matching error calculation on the first transformed reference block and the second transformed reference block to determine the error value of the first candidate merge information; wherein the first candidate merge information is any one of the at least one candidate merge information.
[0662] In some embodiments, the first construction unit 2801 is further configured to construct a second merge candidate list based on at least one candidate motion information determined by the inter-frame merging method and the corresponding transformation model; construct a second merge candidate list based on at least one candidate motion information determined by the motion vector template matching method and the corresponding transformation model; construct a second merge candidate list based on at least one candidate motion information determined by the motion vector bidirectional matching method and the corresponding transformation model; construct a second merge candidate list based on at least one candidate motion information determined by the motion vector difference method and the corresponding transformation model; and construct a second merge candidate list based on at least one candidate motion information determined by the motion vector difference merging method and the corresponding transformation model.
[0663] In some embodiments, the first determining unit 2802 is further configured to determine that the transformation model corresponding to the motion information remains unchanged if the motion information in the second merge candidate list is adjusted.
[0664] In some embodiments, the first determination unit 2802 is further configured to determine the updated reference block of the current block based on the adjusted motion information if the motion information in the second merge candidate list is adjusted; and adjust the model parameters of the transformation model corresponding to the motion information based on the template of the current block and the template of the updated reference block to obtain the adjusted transformation model.
[0665] In some embodiments, the preset criterion includes at least one of the following: SAD, SATD, MSE, RMSE, MAE, and MAD.
[0666] In some embodiments, the first determining unit 2802 is further configured to save the transformation model of the current block.
[0667] In some embodiments, the first determination unit 2802 is further configured to, when there is one component to be processed in the current block and the current block is unidirectionally predicted, save the transformation model used by the component to be processed as a candidate transformation model; when there is one component to be processed in the current block and the current block is bidirectionally predicted, save the transformation model used by the component to be processed as two candidate transformation models; when there are three components to be processed in the current block and the current block is unidirectionally predicted, save the transformation models used by the first color component, the second color component, and the third color component as one candidate transformation model; and when there are three components to be processed in the current block and the current block is bidirectionally predicted, save the transformation models used by the first color component, the second color component, and the third color component as two candidate transformation models.
[0668] In some embodiments, the first determining unit 2802 is further configured to save the transformation model used by one of the first color component, the second color component, and the third color component when there are three components to be processed in the current block.
[0669] In some embodiments, the first determination unit 2802 is further configured to determine the type of transformation model used by one of the color components; and to perform model derivation based on the adjacent reconstructed pixels of the current block and the adjacent reconstructed pixels of the reference block to determine the transformation models used by the remaining two color components of the first color component, the second color component, and the third color component, and the type of transformation model used by the remaining two color components is the same as the type of transformation model used by one of the color components.
[0670] In some embodiments, the first determining unit 2802 is further configured to, when the current block is bidirectionally predicted, save one of the two candidate transformation models if the two candidate transformation models to be saved are the same.
[0671] In some embodiments, the first determination unit 2802 is further configured to determine the first motion information of the current block; determine the first reference block of the current block based on the first motion information of the current block; and adjust the model parameters of the transformation model based on the template of the current block and the template of the first reference block to obtain an adjusted transformation model; the first prediction unit 2801 is further configured to transform the reference block according to the adjusted transformation model to determine the prediction block of the current block.
[0672] In some embodiments, the type of transformation model includes at least one of the following: a type of linear model, a type of filtering model, a type of multi-model, and a combination of different types.
[0673] In some embodiments, the first determination unit 2802 is further configured to perform model derivation based on the reconstructed pixels adjacent to the current block and the reconstructed pixels adjacent to the reference block, or to perform model derivation based on the reconstructed block and the reference block of the current block to determine the derivation model of the current block; and save the transformation model of the current block and the derivation model of the current block.
[0674] In some embodiments, the first determination unit 2802 is further configured to determine first information of the current block; and when the first information satisfies the first condition, perform a step of performing model derivation based on adjacent reconstructed pixels of the current block and adjacent reconstructed pixels of the reference block, or perform model derivation based on the reconstructed block and the reference block of the current block to determine the derivation model of the current block; wherein the first information includes at least one of the following: the position of the current block, the size of the current block, the adjacent block information of the current block, and the encoded syntax identification information of the current block.
[0675] In some embodiments, the first determination unit 2802 is further configured to determine second information of the current block; the encoding unit 2804 is further configured to perform encoding processing on the value of the second syntax identification information and write the obtained encoded bits into the bitstream when the second information meets the second condition; wherein the second information includes at least one of the following: the position of the current block, the size of the current block, the adjacent block information of the current block, and the encoded syntax identification information of the current block.
[0676] In some embodiments, the first determination unit 2802 is further configured to determine third information of the current block; and when the third information satisfies a third condition, perform a step of saving the transformation model of the current block; wherein the third information includes at least one of the following: the position of the current block, the size of the current block, the adjacent block information of the current block, and the encoded syntax identification information of the current block.
[0677] In some embodiments, the first determining unit 2802 is further configured to determine a derived transformation model of the current block when constructing the transformation model candidate list of the current block; and add the derived transformation model to the transformation model candidate list.
[0678] In some embodiments, the first constructing unit 2801 is further configured to execute the step of constructing a transformation model candidate list for the current block when the current block uses the intra block copy mode.
[0679] In some embodiments, the first determination unit 2802 is further configured to determine a value of fifth syntax identification information; wherein the fifth syntax identification information is used to indicate whether the current block uses the intra-frame block copy mode; the encoding unit 2804 is further configured to encode the value of the fifth syntax identification information and write the obtained encoded bits into the bitstream.
[0680] In some embodiments, the first determining unit 2802 is further configured to determine an initial block of the current block; and determine a residual block of the current block according to the initial block of the current block and the predicted block of the current block.
[0681] In some embodiments, the encoding unit 2804 is further configured to perform encoding processing on the residual block of the current block and write the obtained encoding bits into the bitstream.
[0682] It is understandable that in the embodiments of the present application, a "unit" can be a portion of a circuit, a portion of a processor, a portion of a program or software, etc., and of course it can also be a module, or it can be non-modular. Moreover, the various components in this embodiment can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into a single unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional modules.
[0683] If the integrated unit is implemented as a software functional module and is not sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this embodiment, or the portion that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, server, or network device, etc.) or a processor to execute all or part of the steps of the method described in this embodiment. The aforementioned storage medium includes various media that can store program code, such as a USB flash drive, a mobile hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0684] Therefore, an embodiment of the present application provides a computer-readable storage medium, which is applied to the encoder 280. The computer-readable storage medium stores a computer program, and when the computer program is executed by the first processor, it implements the method described in any one of the aforementioned embodiments.
[0685] Based on the composition of the above-mentioned encoder 280 and the computer-readable storage medium, Figure 29 is a schematic diagram of the specific hardware structure of an encoder provided by an embodiment of the present application. As shown in Figure 29, the encoder 280 may include: a first communication interface 2901, a first memory 2902 and a first processor 2903; each component is coupled together through a first bus system 2904. It can be understood that the first bus system 2904 is used to realize the connection and communication between these components. In addition to the data bus, the first bus system 2904 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, various buses are labeled as the first bus system 2904 in Figure 29. Among them,
[0686] The first communication interface 2901 is used to receive and send signals when sending and receiving information with other external network elements;
[0687] A first memory 2902 is used to store computer programs that can be run on the first processor 2903;
[0688] The first processor 2903 is configured to, when running the computer program, execute:
[0689] When the current block uses the inter-frame prediction mode, a transformation model candidate list of the current block is constructed; a transformation model of the current block is determined based on the transformation model candidate list, and a reference block of the current block is determined; the reference block is transformed according to the transformation model to determine a prediction block of the current block.
[0690] It is understood that the first memory 2902 in the embodiment of the present application can be a volatile memory or a non-volatile memory, or can include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory can be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct RAM bus random access memory (DRRAM). The first memory 2902 of the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.
[0691] The first processor 2903 may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed by hardware integrated logic circuits or software instructions in the first processor 2903. The above-mentioned first processor 2903 can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. The various methods, steps, and logic block diagrams disclosed in the embodiments of this application can be implemented or executed. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in the embodiments of this application can be directly implemented and executed by a hardware decoding processor, or by a combination of hardware and software modules in the decoding processor. The software module can be located in a storage medium mature in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, etc. The storage medium is located in the first memory 2902 , and the first processor 2903 reads the information in the first memory 2902 and completes the steps of the above method in combination with its hardware.
[0692] It is to be understood that these embodiments described in the present application can be implemented with hardware, software, firmware, middleware, microcode or its combination.For hardware implementation, the processing unit can be implemented in one or more application specific integrated circuits (Application Specific Integrated Circuits, ASIC), digital signal processor (Digital Signal Processing, DSP), digital signal processing equipment (DSP Device, DSPD), programmable logic device (Programmable Logic Device, PLD), field programmable gate array (Field-Programmable Gate Array, FPGA), general-purpose processor, controller, microcontroller, microprocessor, other electronic units for performing functions described in the present application or its combination.For software implementation, the technology described in the present application can be realized by the module (such as process, function etc.) that performs functions described in the present application. The software code can be stored in a memory and executed by a processor. The memory can be implemented in the processor or outside the processor.
[0693] Optionally, as another embodiment, the first processor 2903 is further configured to execute the method described in any one of the aforementioned embodiments when running the computer program.
[0694] An embodiment of the present application provides an encoder. When the current block uses the inter-frame prediction mode, it is first necessary to construct a candidate list of transformation models for the current block, and then determine the transformation model and reference block of the current block based on the list. The reference block is transformed by the transformation model, which not only improves the diversity of inter-frame prediction, but also improves the accuracy of prediction, thereby improving the encoding and decoding efficiency.
[0695] In another embodiment of the present application, based on the same inventive concept as the above embodiment, FIG30 is a schematic diagram of the structure of a decoder provided by the embodiment of the present application. As shown in FIG30 , the decoder 300 may include a decoding unit 3001, a second construction unit 3002, a second determination unit 3003 and a second prediction unit 3004; wherein,
[0696] The decoding unit 3001 is configured to decode the code stream and determine the value of the first syntax identification information;
[0697] The second constructing unit 3002 is configured to construct a transform model candidate list for the current block when the first syntax identification information indicates that the current block uses the inter prediction mode;
[0698] A second determining unit 3003 is configured to determine a transformation model of a current block based on the transformation model candidate list, and determine a reference block of the current block;
[0699] The second prediction unit 3004 is configured to transform the reference block according to the transformation model to determine a prediction block of the current block.
[0700] In some embodiments, the second determining unit 3003 is further configured to determine a transformation model of the current block based on the transformation model candidate list; and determine a reference block of the current block according to the transformation model and the first merge candidate list.
[0701] In some embodiments, the decoding unit 3001 is further configured to decode the code stream and determine the transformation model index number of the current block; the second determination unit 3003 is further configured to determine the transformation model of the current block according to the transformation model index number and the transformation model candidate list.
[0702] In some embodiments, the second determination unit 3003 is further configured to determine at least one candidate motion information of the current block; the second construction unit 3002 is further configured to construct a first merged candidate list based on at least one candidate motion information of the current block; wherein the candidate motion information is used to indicate the candidate reference block of the current block and / or the template of the candidate reference block.
[0703] In some embodiments, the second construction unit 3002 is further configured to construct a first merge candidate list based on at least one candidate motion information determined by the inter-frame merging method; construct a first merge candidate list based on at least one candidate motion information determined by the template matching method of the motion vector; construct a first merge candidate list based on at least one candidate motion information determined by the bidirectional matching method of the motion vector; construct a first merge candidate list based on at least one candidate motion information determined by the motion vector difference method; and construct a first merge candidate list based on at least one candidate motion information determined by the motion vector difference merging method.
[0704] In some embodiments, the second determination unit 3003 is further configured to perform template error calculation on at least one candidate reference block indicated in the first merge candidate list according to the transformation model to determine the error value of at least one candidate reference block; and determine the minimum error value from the error values of at least one candidate reference block, and determine the candidate reference block corresponding to the minimum error value as the reference block of the current block.
[0705] In some embodiments, the second determination unit 3003 is further configured to transform the template of at least one candidate reference block indicated in the first merge candidate list according to a transformation model to obtain a transformation template of at least one candidate reference block; and perform template error calculation on the template of the current block and the transformation template of at least one candidate reference block based on preset criteria to determine the error value of at least one candidate reference block.
[0706] In some embodiments, the second determining unit 3003 is further configured to sort the first merge candidate list according to the error value of at least one candidate reference block to determine a first sorted merge candidate list.
[0707] In some embodiments, the decoding unit 3001 is further configured to decode the code stream and determine the mode identification information of at least part of the candidate motion information in the first sorted merge candidate list; the second determination unit 3003 is further configured to sort at least part of the candidate motion information in the first sorted merge candidate list according to the mode identification information of at least part of the candidate motion information and determine the second sorted merge candidate list.
[0708] In some embodiments, the decoding unit 3001 is further configured to decode the code stream and determine the first merge index number of the current block; the second determination unit 3003 is further configured to determine the reference block of the current block based on the first merge index number and the first sorted merge candidate list or the second sorted merge candidate list.
[0709] In some embodiments, the second determination unit 3003 is further configured to determine, when the current block uses the DMVR mode, at least one group of candidate reference blocks for the current block according to the first merged candidate list, each group of candidate reference blocks including two candidate reference blocks; transform the two candidate reference blocks in each group of candidate reference blocks according to the transformation model to determine the two transformed reference blocks in each group of candidate reference blocks; perform matching error calculation on the two transformed reference blocks in each group of candidate reference blocks to determine the error value corresponding to each group of candidate reference blocks; and determine, based on the error value corresponding to each group of candidate reference blocks, a group of candidate reference blocks with the smallest error value as the reference block of the current block.
[0710] In some embodiments, the decoding unit 3001 is further configured to decode the code stream and determine a reference block of the current block; the second determination unit 3003 is further configured to determine a transformation model of the current block based on the reference block and the transformation model candidate list.
[0711] In some embodiments, the decoding unit 3001 is further configured to decode the code stream and determine motion information of the current block; and the second determining unit 3003 is further configured to determine a reference block of the current block according to the motion information.
[0712] In some embodiments, the second determination unit 3003 is further configured to sort the transformation model candidate list according to the reference block to determine the sorted transformation model candidate list; the decoding unit 3001 is further configured to decode the code stream to determine the transformation model index number of the current block; the second determination unit 3003 is further configured to determine the transformation model of the current block based on the transformation model index number and the sorted transformation model candidate list.
[0713] In some embodiments, the second determination unit 3003 is further configured to perform template error calculation based on the reference block and at least one candidate transformation model in the transformation model candidate list to determine the error value of at least one candidate transformation model; and determine the minimum error value from the error values of at least one candidate transformation model, and determine the candidate transformation model corresponding to the minimum error value as the transformation model of the current block.
[0714] In some embodiments, the second determining unit 3003 is further configured to determine a candidate transformation model at a preset list position based on the sorted transformation model candidate list; and determine the candidate transformation model at the preset list position as the transformation model of the current block.
[0715] In some embodiments, the second determination unit 3003 is further configured to perform template error calculation based on the reference block and at least one candidate transformation model in the transformation model candidate list to determine the error value of at least one candidate transformation model; and sort the transformation model candidate list according to the error value of at least one candidate transformation model to determine the sorted transformation model candidate list.
[0716] In some embodiments, the second determination unit 3003 is further configured to transform the template of the reference block according to at least one candidate transformation model to obtain the transformation template of at least one reference block; and perform error calculation on the template of the current block and the transformation template of at least one reference block based on preset criteria to determine the error value of at least one candidate transformation model.
[0717] In some embodiments, the decoding unit 3001 is further configured to decode the code stream to determine the prediction direction information of the current block; and when the prediction direction information indicates that the current block is bidirectionally predicted, decode the code stream to determine the first transformation model index number and the second transformation model index number of the current block; wherein the first transformation model index number is used to represent the number of the transformation model corresponding to the reference block of the current block in the first reference image list in the sorted transformation model candidate list, and the second transformation model index number is used to represent the number of the transformation model corresponding to the reference block of the current block in the second reference image list in the sorted transformation model candidate list.
[0718] In some embodiments, the decoding unit 3001 is further configured to decode the code stream to determine the first transformation model index number of the current block; and when the prediction direction information indicates that the current block is bidirectionally predicted, decode the code stream to determine the second transformation model index number of the current block.
[0719] In some embodiments, the second determining unit 3003 is further configured to determine at least one candidate transformation model for the current block; and determine a transformation model candidate list for the current block according to the at least one candidate transformation model.
[0720] In some embodiments, the second determination unit 3003 is further configured to determine the available transformation models of adjacent positions of the current block; determine the available transformation models of the time domain of the current block; determine the available transformation models of non-adjacent positions of the current block; determine the available transformation models of the time domain after translation of the current block; determine the available transformation models of history; and determine a preset transformation model.
[0721] In some embodiments, the second determination unit 3003 is further configured to determine the transformation model corresponding to the local illumination compensation mode of the current block as the preset transformation model; or, to adjust the candidate transformation model already in the transformation model candidate list, and determine the adjusted candidate transformation model as the preset transformation model.
[0722] In some embodiments, the second determination unit 3003 is further configured to, after determining a new candidate transformation model for the current block, compare the new candidate transformation model with the candidate transformation models already in the transformation model candidate list; and when the new candidate transformation model is different from the candidate transformation models already in the transformation model candidate list, add the new candidate transformation model to the transformation model candidate list.
[0723] In some embodiments, the decoding unit 3001 is further configured to decode the code stream and determine the value of the second syntax identification information; the second construction unit 3002 is further configured to execute the step of constructing the transformation model candidate list of the current block when the second syntax identification information indicates that the current block uses a method based on the transformation model candidate list.
[0724] In some embodiments, the decoding unit 3001 is further configured to decode the code stream based on the context model and determine the value of the second syntax identification information.
[0725] In some embodiments, the decoding unit 3001 is further configured to decode the code stream and determine the value of the third syntax identification information; and when the third syntax identification information indicates that the current block uses a prediction mode based on a reference block transform, decode the code stream and determine the value of the second syntax identification information; the second construction unit 3002 is further configured to construct a second merge candidate list for the current block when the second syntax identification information indicates that the current block uses a method based on a transform model candidate list; the second determination unit 3003 is further configured to determine the transform model and reference block of the current block based on the second merge candidate list; the second prediction unit 3004 is further configured to transform the reference block according to the transform model and determine the prediction block of the current block.
[0726] In some embodiments, the decoding unit 3001 is further configured to decode the code stream and determine the value of the fourth syntax identification information; and when the fourth syntax identification information indicates that the current block uses the inter-frame merge prediction mode, perform the steps of decoding the code stream and determining the value of the third syntax identification information.
[0727] In some embodiments, the second determination unit 3003 is further configured to determine candidate merge information corresponding to a predefined position of the current block; wherein the candidate merge information includes motion information and a transformation model; and when the candidate merge information corresponding to the predefined position meets a preset candidate condition, the candidate merge information corresponding to the predefined position is added to the second merge candidate list.
[0728] In some embodiments, the candidate merge information corresponding to the predefined position meets a preset candidate condition, including: the motion information corresponding to the predefined position is available, and a transformation model is stored in the predefined position.
[0729] In some embodiments, the second determination unit 3003 is further configured to determine an error value of at least one candidate merge information in the second merge candidate list; and sort at least one candidate merge information in the second merge candidate list according to the error value to determine a third sorted merge candidate list; the decoding unit 3001 is further configured to decode the code stream and determine the second merge index number of the current block; the second determination unit 3003 is further configured to determine the target merge information of the current block based on the second merge index number and the third sorted merge candidate list, and determine the transformation model and reference block of the current block based on the target merge information.
[0730] In some embodiments, the second determination unit 3003 is further configured to determine the template of the first reference block indicated by the first motion information based on the first motion information and the first transformation model included in the first candidate merge information; transform the template of the first reference block according to the first transformation model to determine the transformation template of the first reference block; and perform template error calculation on the template of the current block and the transformation template of the first reference block based on a preset criterion to determine the error value of the first candidate merge information; wherein the first candidate merge information is any one of the at least one candidate merge information.
[0731] In some embodiments, the second determination unit 3003 is further configured to determine the first motion information and the first transformation model as well as the second motion information and the second transformation model included in the first candidate merge information when the current block uses the DMVR mode; transform the reference block indicated by the first motion information according to the first transformation model to determine the first transformed reference block; and transform the reference block indicated by the second motion information according to the second transformation model to ...
Claims
1. A decoding method, applied to a decoder, the method comprising: Decoding a bitstream to determine a value of first syntax identification information; When the first syntax identification information indicates that an inter prediction mode is used for a current block, constructing a candidate list of transform models for the current block; Determining a transform model for the current block based on the candidate list of transform models, and determining a reference block for the current block; Performing a transform on the reference block according to the transform model to determine a predicted block for the current block.
2. The method according to claim 1, wherein The determining the transform model for the current block based on the candidate list of transform models, and determining the reference block for the current block includes: Determining a transform model for the current block based on the candidate list of transform models; Determining a reference block for the current block according to the transform model and a first merge candidate list.
3. The method according to claim 2, wherein, The determining a transform model for the current block based on the candidate list of transform models includes: Decoding a bitstream to determine an index number of a transform model for the current block; Determining a transform model for the current block according to the index number of the transform model and the candidate list of transform models.
4. The method according to claim 2, wherein The method further comprises: Determining at least one candidate motion information for the current block; Constructing the first merge candidate list according to the at least one candidate motion information for the current block; wherein the candidate motion information is used to indicate candidate reference blocks for the current block and / or templates of candidate reference blocks.
5. The method according to claim 4, wherein The constructing the first merge candidate list according to the at least one candidate motion information for the current block includes one of the following: Constructing the first merge candidate list according to at least one candidate motion information determined based on an inter-frame merge method; Constructing the first merge candidate list according to at least one candidate motion information determined based on a template matching method of motion vectors; Constructing the first merge candidate list according to at least one candidate motion information determined based on a bidirectional matching method of motion vectors; Constructing the first merge candidate list according to at least one candidate motion information determined based on a motion vector difference method; Constructing the first merge candidate list according to at least one candidate motion information determined based on a motion vector difference merge method.
6. The method according to claim 2, wherein, The determining a reference block for the current block according to the transform model and the first merge candidate list includes: Calculating a template error for at least one candidate reference block indicated in the first merge candidate list according to the transform model to determine an error value of the at least one candidate reference block; Determining a minimum error value from the error values of the at least one candidate reference block, and determining the candidate reference block corresponding to the minimum error value as the reference block for the current block.
7. The method according to claim 6, wherein, The calculating a template error for at least one candidate reference block indicated in the first merge candidate list according to the transform model to determine an error value of the at least one candidate reference block includes: Performing a transform on a template of at least one candidate reference block indicated in the first merge candidate list according to the transform model to obtain a transformed template of the at least one candidate reference block; Based on a preset criterion, template error calculations are respectively performed on the template of the current block and the transformed templates of the at least one candidate reference block to determine the error values of the at least one candidate reference block.
8. The method according to claim 6, wherein The method further includes: Sorting the first merge candidate list according to the error values of the at least one candidate reference block to determine a first sorted merge candidate list.
9. The method according to claim 8, wherein The method further includes: Decoding a bitstream to determine the mode identification information of at least some of the candidate motion information in the first sorted merge candidate list; Sorting at least some of the candidate motion information in the first sorted merge candidate list according to the mode identification information of the at least some candidate motion information to determine a second sorted merge candidate list.
10. The method according to claim 9, wherein, The method further includes: Decoding a bitstream to determine the first merge index number of the current block; Determining the reference block of the current block according to the first merge index number and the first sorted merge candidate list or the second sorted merge candidate list.
11. The method according to claim 2, wherein, The determining the reference block of the current block according to the transformation model and the first merge candidate list includes: When the current block uses the Decoder-side Motion Vector Refinement (DMVR) mode, determining at least one group of candidate reference blocks of the current block according to the first merge candidate list, and each group of candidate reference blocks includes two candidate reference blocks; Performing transformation on the two candidate reference blocks in each group of candidate reference blocks according to the transformation model to determine two transformed reference blocks in each group of candidate reference blocks; Performing matching error calculation on the two transformed reference blocks in each group of candidate reference blocks to determine the error value corresponding to each group of candidate reference blocks; Determining the group of candidate reference blocks with the smallest error value as the reference block of the current block according to the error value corresponding to each group of candidate reference blocks.
12. The method according to claim 1, wherein, The determining the transformation model of the current block based on the transformation model candidate list and determining the reference block of the current block includes: Decoding a bitstream to determine the reference block of the current block; Determining the transformation model of the current block according to the reference block and the transformation model candidate list.
13. The method according to claim 12, wherein, The decoding a bitstream to determine the reference block of the current block includes: Decoding a bitstream to determine the motion information of the current block; Determining the reference block of the current block according to the motion information.
14. The method according to claim 12, wherein, The determining the transformation model of the current block according to the reference block and the transformation model candidate list includes: Sorting the transformation model candidate list according to the reference block to determine a sorted transformation model candidate list; Decoding a bitstream to determine the transformation model index number of the current block; Determining the transformation model of the current block according to the transformation model index number and the sorted transformation model candidate list.
15. The method according to claim 12, wherein, The determining the transformation model of the current block according to the reference block and the transformation model candidate list includes: Performing template error calculation on the reference block and at least one candidate transformation model in the transformation model candidate list to determine the error value of the at least one candidate transformation model; Determine the minimum error value from the error values of the at least one candidate transformation model, and determine the candidate transformation model corresponding to the minimum error value as the transformation model of the current block.
16. The method according to claim 14, wherein, The method further includes: Based on the sorted candidate list of transformation models, determine the candidate transformation model at a preset list position; Determine the candidate transformation model at the preset list position as the transformation model of the current block.
17. The method according to claim 14, wherein The sorting the candidate list of transformation models according to the reference block to determine the sorted candidate list of transformation models includes: Perform template error calculation according to the reference block and at least one candidate transformation model in the candidate list of transformation models to determine the error values of the at least one candidate transformation model; Sort the candidate list of transformation models according to the error values of the at least one candidate transformation model to determine the sorted candidate list of transformation models.
18. The method according to claim 15 or 17, wherein The performing template error calculation according to the reference block and at least one candidate transformation model in the candidate list of transformation models to determine the error values of the at least one candidate transformation model includes: Perform transformation on the templates of the reference block respectively according to the at least one candidate transformation model to obtain at least one transformed template of the reference block; Based on a preset criterion, perform error calculation on the template of the current block and the at least one transformed template of the reference block respectively to determine the error values of the at least one candidate transformation model.
19. The method according to claim 14, wherein, The decoding the code stream to determine the index number of the transformation model of the current block includes: Decode the code stream to determine the prediction direction information of the current block; When the prediction direction information indicates that the current block is bi-directionally predicted, decode the code stream to determine the first transformation model index number and the second transformation model index number of the current block; Wherein, the first transformation model index number is used to represent the number of the transformation model corresponding to the reference block of the current block in the first reference image list in the sorted candidate list of transformation models, and the second transformation model index number is used to represent the number of the transformation model corresponding to the reference block of the current block in the second reference image list in the sorted candidate list of transformation models.
20. The method according to claim 19, wherein The method further includes: Decode the code stream to determine the first transformation model index number of the current block; When the prediction direction information indicates that the current block is bi-directionally predicted, decode the code stream to determine the second transformation model in dex number.
21. The method according to any one of claims 1 to 20, wherein, The constructing the candidate list of transformation models of the current block includes: Determine at least one candidate transformation model of the current block; According to the at least one candidate transformation model, determine the candidate list of transformation models of the current block.
22. The method according to claim 21, wherein, The determining at least one candidate transformation model of the current block includes at least one of the following: Determine the available transformation models at adjacent positions of the current block; Determine the available transformation models in the time domain of the current block; Determine the available transformation models at non-adjacent positions of the current block; Determine the available transformation models in the time domain after translation of the current block; Determine the available transformation models in history; Determine the preset transformation model.
23. The method according to claim 22, wherein, The determining the preset transformation model includes: Determine the transformation model corresponding to the local illumination compensation mode of the current block as the preset transformation model; Or, Adjust the existing candidate transformation models in the candidate transformation model list, and determine the adjusted candidate transformation model as the preset transformation model.
24. The method according to claim 21, wherein, The method further includes: After determining the new candidate transformation model of the current block, compare the new candidate transformation model with the existing candidate transformation models in the candidate transformation model list; When the new candidate transformation model is different from all the existing candidate transformation models in the candidate transformation model list, add the new candidate transformation model to the candidate transformation model list.
25. The method according to any one of claims 1 to 24, wherein The method further includes: Decode the bitstream to determine the value of the second syntax identification information; When the second syntax identification information indicates that the current block uses the method based on the candidate transformation model list, perform the step of constructing the candidate transformation model list of the current block.
26. The method according to claim 25, wherein The decoding the bitstream to determine the value of the second syntax identification information includes: Decode the bitstream based on the context model to determine the value of the second syntax identification information.
27. The method according to any one of claims 1 to 24, wherein The method further includes: Decode the bitstream to determine the value of the third syntax identification information; When the third syntax identification information indicates that the current block uses the prediction mode based on reference block transformation, decode the bitstream to determine the value of the second syntax identification information; When the second syntax identification information indicates that the current block uses the method based on the candidate transformation model list, construct the second merge candidate list of the current block; According to the second merge candidate list, determine the transformation model and the reference block of the current block; Transform the reference block according to the transformation model to determine the prediction block of the current block.
28. The method according to claim 27, wherein, The method further includes: Decode the bitstream to determine the value of the fourth syntax identification information; When the fourth syntax identification information indicates that the current block uses the inter-frame merge prediction mode, perform the step of decoding the bitstream to determine the value of the third syntax identification information.
29. The method according to claim 27, wherein, The constructing the second merge candidate list of the current block includes: Determine the candidate merge information corresponding to the predefined position of the current block; wherein, the candidate merge information includes motion information and a transformation model; When the candidate merge information corresponding to the predefined position meets the preset candidate conditions, add the candidate merge information corresponding to the predefined position to the second merge candidate list.
30. The method according to claim 29, wherein The candidate merge information corresponding to the predefined position meets the preset candidate conditions, including: The motion information corresponding to the predefined position is available, and a transformation model is stored at the predefined position.
31. The method according to claim 27, wherein, The according to the second merge candidate list, determining the transformation model and the reference block of the current block includes: Determine the error value of at least one candidate merge information in the second merge candidate list; Sort at least one candidate merge information in the second merge candidate list according to the error value to determine the third sorted merge candidate list; Decode the bitstream to determine the second merge index number of the current block; Determine the target merging information of the current block according to the second merging index number and the third sorted merging candidate list, and determine the transformation model and reference block of the current block according to the target merging information.
32. The method according to claim 31, wherein The determining the error value of at least one candidate merging information in the second merging candidate list includes: Based on the first motion information and the first transformation model included in the first candidate merging information, determine the template of the first reference block indicated by the first motion information; Transform the template of the first reference block according to the first transformation model to determine the transformed template of the first reference block; Based on a preset criterion, calculate the template error between the template of the current block and the transformed template of the first reference block to determine the error value of the first candidate merging information; Wherein, the first candidate merging information is any one of the at least one candidate merging information.
33. The method according to claim 31, wherein, The determining the error value of at least one candidate merging information in the second merging candidate list includes: When the DMVR mode is used for the current block, determine the first motion information and the first transformation model, and the second motion information and the second transformation model included in the first candidate merging information; Transform the reference block indicated by the first motion information according to the first transformation model to determine the first transformed reference block; and transform the reference block indicated by the second motion information according to the second transformation model to determine the second transformed reference block; Calculate the matching error between the first transformed reference block and the second transformed reference block to determine the error value of the first candidate merging information; Wherein, the first candidate merging information is any one of the at least one candidate merging information.
34. The method according to claim 27, wherein, The constructing the second merging candidate list of the current block includes one of the following: Construct the second merging candidate list based on at least one candidate motion information determined by the inter-frame merging method and the corresponding transformation model; Construct the second merging candidate list based on at least one candidate motion information determined by the template matching method of motion vectors and the corresponding transformation model; Construct the second merging candidate list based on at least one candidate motion information determined by the bidirectional matching method of motion vectors and the corresponding transformation model; Construct the second merging candidate list based on at least one candidate motion information determined by the motion vector difference method and the corresponding transformation model; Construct the second merging candidate list based on at least one candidate motion information determined by the motion vector difference merging method and the corresponding transformation model.
35. The method according to claim 27, wherein, The method further includes: If the motion information in the second merging candidate list is adjusted, determine that the transformation model corresponding to the motion information remains unchanged.
36. The method according to claim 27, wherein The method further includes: If the motion information in the second merging candidate list is adjusted, determine the updated reference block of the current block according to the adjusted motion information; Adjust the model parameters of the transformation model corresponding to the motion information according to the template of the current block and the template of the updated reference block to obtain the adjusted transformation model.
37. The method according to claim 7, 18 or 32, wherein, The preset criteria at least include one of the following: sum of absolute differences SAD, sum of absolute transform differences SATD, mean square error MSE, root mean square error RMSE, mean absolute error MAE, and mean absolute deviation MAD.
38. The method according to claim 1, wherein The method further includes: Saving the transformation model of the current block.
39. The method according to any one of claims 1 to 38, wherein, When at least one of the components to be processed of the current block is the first color component, the second color component, and the third color component, the method further includes: When the component to be processed of the current block is one and the current block is unidirectionally predicted, saving the transformation model used by the component to be processed as a candidate transformation model. When the component to be processed of the current block is one and the current block is bidirectionally predicted, saving the transformation model used by the component to be processed as two candidate transformation models. When the components to be processed of the current block are three and the current block is unidirectionally predicted, Saving the transformation models used by the first color component, the second color component, and the third color component as a candidate transformation model.
40. The method according to claim 39, wherein, The method further includes: When the components to be processed of the current block are three, saving the transformation model used by one of the first color component, the second color component, and the third color component.
41. The method according to claim 40, wherein The method further includes: Determining the type of the transformation model used by the one color component. Deriving models based on the reconstructed pixels adjacent to the current block and the reconstructed pixels adjacent to the reference block to determine the transformation models used by the remaining two color components among the first color component, the second color component, and the third color component, and the types of the transformation models used by the remaining two color components are the same as the type of the transformation model used by the one color component.
42. The method according to claim 39, wherein, The method further includes: When the current block is bidirectionally predicted, if the two candidate transformation models to be saved are the same, saving one of the two candidate transformation models.
43. The method according to claim 1, wherein The method further includes: Determining the first motion information of the current block. Determining the first reference block of the current block according to the first motion information. Adjusting the model parameters of the transformation model according to the template of the current block and the template of the first reference block to obtain an adjusted transformation model. Transforming the reference block according to the adjusted transformation model to determine the predicted block of the current block.
44. The method according to claim 1, wherein The types of the transformation model include at least one of the following: the type of a linear model, the type of a filtering model, the type of a multi-model, and combinations of different types.
45. The method according to claim 1, wherein The method further includes: Deriving models based on the reconstructed pixels adjacent to the current block and the reconstructed pixels adjacent to the reference block, or deriving models based on the reconstructed block of the current block and the reference block to determine the derived model of the current block. Save the transform model and the derivation model of the current block.
46. The method according to claim 45, wherein, The method further includes: Determine first information of the current block; When the first information satisfies a first condition, perform the step of deriving a model based on the reconstructed pixels adjacent to the current block and the reconstructed pixels adjacent to the reference block, or deriving a model based on the reconstructed block of the current block and the reference block, and determine the derivation model of the current block; Wherein, the first information includes at least one of the following: the position of the current block, the size of the current block, the adjacent block information of the current block, the decoded syntax identification information of the current block.
47. The method according to claim 25, wherein, The method further includes: Determine second information of the current block; When the second information satisfies a second condition, perform the step of decoding the bitstream and determining the value of the second syntax identification information; Wherein, the second information includes at least one of the following: the position of the current block, the size of the current block, the adjacent block information of the current block, the decoded syntax identification information of the current block.
48. The method according to claim 38, wherein, The method further includes: Determine third information of the current block; When the third information satisfies a third condition, perform the step of saving the transform model of the current block; Wherein, the third information includes at least one of the following: the position of the current block, the size of the current block, the adjacent block information of the current block, the decoded syntax identification information of the current block.
49. The method according to any one of claims 1 to 48, wherein, The method further includes: When constructing a candidate list of transform models of the current block, determine the derived transform model of the current block; Add the derived transform model to the candidate list of transform models.
50. The method according to claim 49, wherein, The method further includes: Decode the bitstream and determine the value of the fifth syntax identification information; When the fifth syntax identification information indicates that the current block uses the intra block copy mode, perform the step of constructing the candidate list of transform models of the current block.
51. An encoding method, applied to an encoder, the method includes: When the current block uses an inter prediction mode, construct a candidate list of transform models of the current block; Based on the candidate list of transform models, determine the transform model of the current block and determine the reference block of the current block; Perform a transform on the reference block according to the transform model to determine the prediction block of the current block.
52. The method according to claim 51, wherein, The determining the transform model of the current block and determining the reference block of the current block based on the candidate list of transform models includes: Based on the candidate list of transform models, determine the transform model of the current block; According to the transform model and the first merge candidate list, determine the reference block of the current block.
53. The method according to claim 52, wherein, The determining the transform model of the current block based on the candidate list of transform models includes: Calculate the encoding cost of at least one candidate transform model in the candidate list of transform models, and determine the respective cost results of the at least one candidate transform model; Determine the minimum cost result from the respective cost results of the at least one candidate transform model, and determine the candidate transform model corresponding to the minimum cost result as the transform model of the current block.
54. The method according to claim 53, wherein, The method further includes: Determine the transformation model index number of the current block; wherein, the transformation model index number is used to indicate the number of the transformation model of the current block in the transformation model candidate list; Perform encoding processing on the transformation model index number of the current block, and write the obtained encoded bits into the code stream.
55. The method according to claim 52, wherein, The method further includes: Determine at least one candidate motion information of the current block; Construct the first merge candidate list according to at least one candidate motion information of the current block; wherein, the candidate motion information is used to indicate the candidate reference block of the current block and / or the template of the candidate reference block.
56. The method according to claim 55, wherein, The constructing the first merge candidate list according to at least one candidate motion information of the current block includes one of the following: Construct the first merge candidate list based on at least one candidate motion information determined by the inter-frame merge method; Construct the first merge candidate list based on at least one candidate motion information determined by the template matching method of the motion vector; Construct the first merge candidate list based on at least one candidate motion information determined by the bidirectional matching method of the motion vector; Construct the first merge candidate list based on at least one candidate motion information determined by the motion vector difference method; Construct the first merge candidate list based on at least one candidate motion information determined by the motion vector difference merge method.
57. The method according to claim 52, wherein The determining the reference block of the current block according to the transformation model and the first merge candidate list includes: Calculate the template error of at least one candidate reference block indicated in the first merge candidate list according to the transformation model, and determine the error value of the at least one candidate reference block; Determine the minimum error value from the error values of the at least one candidate reference block, and determine the candidate reference block corresponding to the minimum error value as the reference block of the current block.
58. The method according to claim 57, wherein, The calculating the template error of at least one candidate reference block indicated in the first merge candidate list according to the transformation model, and determining the error value of the at least one candidate reference block includes: Transform the template of at least one candidate reference block indicated in the first merge candidate list according to the transformation model to obtain the transformed template of the at least one candidate reference block; Based on a preset criterion, calculate the template error of the template of the current block and the transformed templates of the at least one candidate reference block respectively, and determine the error value of the at least one candidate reference block.
59. The method according to claim 57, wherein, The method further includes: Sort the first merge candidate list according to the error values of the at least one candidate reference block to determine the first sorted merge candidate list.
60. The method according to claim 59, wherein, The method further includes: Determine the mode identification information of at least part of the candidate motion information in the first sorted merge candidate list; Sort at least part of the candidate motion information in the first sorted merge candidate list according to the mode identification information of the at least part of the candidate motion information to determine the second sorted merge candidate list.
61. The method according to claim 60, wherein, The method further includes: Perform encoding processing on the mode identification information of at least part of the candidate motion information in the first sorted merge candidate list, and write the obtained encoded bits into the code stream.
62. The method according to claim 60, wherein, The method further includes: Determine a first merge index number of the current block according to the reference block of the current block; wherein, the first merge index number is used to indicate the position of the motion information corresponding to the reference block in the first sorted merge candidate list or the second sorted merge candidate list number; Perform encoding processing on the first merge index number, and write the obtained encoded bits into the bitstream.
63. The method according to claim 52, wherein, The determining the reference block of the current block according to the transform model and the first merge candidate list includes: When the current block uses the DMVR mode, determine at least one set of candidate reference blocks of the current block according to the first merge candidate list, and each set of candidate reference blocks includes two candidate reference blocks; Perform transformation on the two candidate reference blocks in each set of candidate reference blocks according to the transform model to determine two transformed reference blocks in each set of candidate reference blocks; Calculate the matching error between the two transformed reference blocks in each set of candidate reference blocks to determine the error value corresponding to each set of candidate reference blocks; According to the error value corresponding to each set of candidate reference blocks, determine the set of candidate reference blocks with the minimum error value as the reference block of the current block.
64. The method according to claim 51, wherein, The determining the transform model of the current block based on the transform model candidate list and determining the reference block of the current block includes: Determine the reference block of the current block; Determine the transform model of the current block according to the reference block and the transform model candidate list.
65. The method according to claim 64, wherein, The method further includes: Determine the motion information of the current block based on the reference block; Perform encoding processing on the motion information of the current block, and write the obtained encoded bits into the bitstream.
66. The method according to claim 64, wherein, The determining the transform model of the current block according to the reference block and the transform model candidate list includes: Calculate the template error according to the reference block and at least one candidate transform model in the transform model candidate list to determine the error value of the at least one candidate transform model; Determine the minimum error value from the error values of the at least one candidate transform model, and determine the candidate transform model corresponding to the minimum error value as the transform model of the current block.
67. The method according to claim 64, wherein, The determining the transform model of the current block according to the reference block and the transform model candidate list includes: Sort the transform model candidate list according to the reference block to determine the sorted transform model candidate list; Determine the candidate transform model at a preset position according to the sorted transform model candidate list; Determine the candidate transform model at the preset position as the transform model of the current block.
68. The method according to claim 67, wherein The method further includes: Determine the transform model index number of the current block; wherein, the transform model index number is used to indicate the number of the transform model of the current block in the sorted transform model candidate list; Perform encoding processing on the transform model index number of the current block, and write the obtained encoded bits into the bitstream.
69. The method according to claim 67, wherein, The sorting the transform model candidate list according to the reference block to determine the sorted transform model candidate list includes: Calculate the template error according to at least one candidate transformation model in the reference block and the candidate transformation model list, and determine the error value of the at least one candidate transformation model; Sort the candidate transformation model list according to the error values of the at least one candidate transformation model, and determine the sorted candidate transformation model list.
70. The method according to claim 66 or 69, wherein, The calculating the template error according to at least one candidate transformation model in the reference block and the candidate transformation model list, and determining the error value of the at least one candidate transformation model includes: Transform the templates of the reference block according to the at least one candidate transformation model respectively to obtain transformed templates of at least one reference block; Based on a preset criterion, calculate the error between the template of the current block and the transformed templates of the at least one reference block respectively, and determine the error value of the at least one candidate transformation model.
71. The method according to claim 67, wherein, The method further includes: When the current block is bi-directionally predicted, determine the first transformation model index number and the second transformation model index number of the current block; Perform encoding processing on the first transformation model index number and the second transformation model index number, and write the obtained encoded bits into the bitstream; Wherein, the first transformation model index number is used to represent the number of the transformation model corresponding to the reference block of the current block in the first reference image list in the sorted candidate transformation model list, and the second transformation model index number is used to represent the current block in the second reference image list, the number of the transformation model corresponding to the reference block in the sorted candidate transformation model list.
72. The method according to claim 71, wherein, The method further includes: Determine the prediction direction information of the current block; Perform encoding processing on the prediction direction information of the current block, and write the obtained encoded bits into the bitstream.
73. The method according to any one of claims 51 to 72, wherein, The constructing the candidate transformation model list of the current block includes: Determine at least one candidate transformation model of the current block; According to the at least one candidate transformation model, determine the candidate transformation model list of the current block.
74. The method according to claim 73, wherein, The determining at least one candidate transformation model of the current block includes at least one of the following: Determine the available transformation models at the adjacent positions of the current block; Determine the available transformation models in the time domain of the current block; Determine the available transformation models at non-adjacent positions of the current block; Determine the available transformation models in the time domain after translation of the current block; Determine the available transformation models in history; Determine the preset transformation model.
75. The method according to claim 74, wherein, The determining the preset transformation model includes: Determine the transformation model corresponding to the local illumination compensation mode of the current block as the preset transformation model; Or, Adjust the existing candidate transformation models in the candidate transformation model list, and determine the adjusted candidate transformation model as the preset transformation model.
76. The method according to claim 73, wherein, The method further includes: After determining the new candidate transformation model of the current block, compare the new candidate transformation model with the existing candidate transformation models in the candidate transformation model list; When the new candidate transformation model is different from all the existing candidate transformation models in the candidate transformation model list, add the new candidate transformation model to the candidate transformation model list.
77. The method according to claim 51, wherein, The method further includes: Determine the value of the first syntax identification information; wherein, the first syntax identification information is used to indicate whether the current block uses an inter-frame prediction mode; Perform encoding processing on the value of the first syntax identification information, and write the obtained encoded bits into the bitstream.
78. The method according to claim 51, wherein, The method further includes: Determine the value of the second syntax identification information; wherein, the second syntax identification information is used to indicate whether the current block uses a method based on a transform model candidate list; Perform encoding processing on the value of the second syntax identification information, and write the obtained encoded bits into the bitstream.
79. The method according to claim 78, wherein, The method further includes: Perform encoding processing on the value of the second syntax identification information based on a context model, and write the obtained encoded bits into the bitstream.
80. The method according to any one of claims 51 to 79, wherein, The method further includes: When the current block uses a prediction mode based on reference block transform and the current block uses a method based on a transform model candidate list, construct a second merge candidate list for the current block; According to the second merge candidate list, determine the transform model and reference block of the current block; Perform transform on the reference block according to the transform model to determine the prediction block of the current block.
81. The method according to claim 80, wherein, The method further includes: Determine the value of the third syntax identification information; wherein, the third syntax identification information is used to indicate whether the current block uses a prediction mode based on reference block transform; Perform encoding processing on the value of the third syntax identification information, and write the obtained encoded bits into the bitstream.
82. The method according to claim 80, wherein, The method further includes: Determine the value of the fourth syntax identification information; wherein, the fourth syntax identification information is used to indicate whether the current block uses an inter-frame merge prediction mode; Perform encoding processing on the value of the fourth syntax identification information, and write the obtained encoded bits into the bitstream.
83. The method according to claim 80, wherein, The constructing the second merge candidate list for the current block includes: Determine the candidate merge information corresponding to the predefined position of the current block; wherein, the candidate merge information includes motion information and a transform model; When the candidate merge information corresponding to the predefined position meets a preset candidate condition, add the candidate merge information corresponding to the predefined position to the second merge candidate list.
84. The method according to claim 83, wherein, The candidate merge information corresponding to the predefined position meets a preset candidate condition, including: The motion information corresponding to the predefined position is available, and a transform model is stored at the predefined position.
85. The method according to claim 80, wherein, The according to the second merge candidate list, determining the transform model and reference block of the current block, includes: Calculate the encoding cost of at least one candidate merge information in the second merge candidate list, and determine the cost result of each of the at least one candidate merge information; Determine the minimum cost result from the cost results of each of the at least one candidate merge information, and determine the candidate merge information corresponding to the minimum cost result as the target merge information of the current block; Determine the transform model and reference block of the current block according to the target merge information.
86. The method according to claim 85, wherein The method further includes: Determine the error value of at least one candidate merge information in the second merge candidate list; Sort at least one candidate merge information in the second merge candidate list according to the error value to determine a third sorted merge candidate list.
87. The method according to claim 86, wherein, The method further includes: Determining a second merging index number of the current block; wherein the second merging index number is used to indicate the number of the target merging information of the current block in the third sorted merging candidate list; Encoding the second merging index number of the current block, and writing the obtained encoded bits into the code stream.
88. The method according to claim 86, wherein, The determining the error value of at least one candidate merging information in the second merging candidate list includes: Based on the first motion information and the first transformation model included in the first candidate merging information, determining a template of a first reference block indicated by the first motion information; Transforming the template of the first reference block according to the first transformation model to determine a transformed template of the first reference block; Calculating a template error between the template of the current block and the transformed template of the first reference block based on a preset criterion to determine the error value of the first candidate merging information; wherein the first candidate merging information is any one of the at least one candidate merging information.
89. The method according to claim 86, wherein The determining the error value of at least one candidate merging information in the second merging candidate list includes: When the current block uses the DMVR mode, determining the first motion information and the first transformation model, and the second motion information and the second transformation model included in the first candidate merging information; Transforming the reference block indicated by the first motion information according to the first transformation model to determine a first transformed reference block; and transforming the reference block indicated by the second motion information according to the second transformation model to determine a second transformed reference block; Calculating a matching error between the first transformed reference block and the second transformed reference block to determine the error value of the first candidate merging information; wherein the first candidate merging information is any one of the at least one candidate merging information.
90. The method according to claim 80, wherein, The constructing the second merging candidate list of the current block includes one of the following: Constructing the second merging candidate list based on at least one candidate motion information determined by an inter-frame merging method and the corresponding transformation model; Constructing the second merging candidate list based on at least one candidate motion information determined by a template matching method of motion vectors and the corresponding transformation model; Constructing the second merging candidate list based on a bidirectional matching method of motion vectors and at least one candidate motion information and the corresponding transformation model; Constructing the second merging candidate list based on a motion vector difference method and at least one candidate motion information and the corresponding transformation model; Constructing the second merging candidate list based on a motion vector difference merging method and at least one candidate motion information and the corresponding transformation model.
91. The method according to claim 80, wherein The method further includes: If the motion information in the second merging candidate list is adjusted, determining that the transformation model corresponding to the motion information remains unchanged.
92. The method according to claim 80, wherein The method further includes: If the motion information in the second merging candidate list is adjusted, determining an updated reference block of the current block according to the adjusted motion information; Adjust the model parameters of the transformation model corresponding to the motion information according to the template of the current block and the template of the updated reference block, so as to obtain an adjusted transformation model.
93. The method according to claim 58, 70 or 88, wherein, The preset criterion includes at least one of the following: Sum of Absolute Differences SAD, Sum of Absolute Transform Differences SATD, Mean Square Error MSE, Root Mean Square Error RMSE, Mean Absolute Error MAE, and Mean Absolute Deviation MAD.
94. The method according to claim 51, wherein The method further includes: Save the transformation model of the current block.
95. The method according to any one of claims 51 to 94, wherein, When at least one of the components to be processed of the current block is the first color component, the second color component, and the third color component, the method further includes: When the component to be processed of the current block is one and the current block is unidirectionally predicted, save the transformation model used by the component to be processed as a candidate transformation model. When the component to be processed of the current block is one and the current block is bidirectionally predicted, save the transformation model used by the component to be processed as two candidate transformation models. When the components to be processed of the current block are three and the current block is unidirectionally predicted, save the transformation models used by the first color component, the second color component, and the third color component as a candidate transformation model. When the components to be processed of the current block are three and the current block is bidirectionally predicted, save the transformation models used by the first color component, the second color component, and the third color component as two candidate transformation models.
96. The method according to claim 95, wherein, The method further includes: When the components to be processed of the current block are three, save the transformation model used by one of the first color component, the second color component, and the third color component.
97. The method according to claim 96, wherein, The method further includes: Determine the type of the transformation model used by the one color component. Perform model derivation according to the reconstructed pixels adjacent to the current block and the reconstructed pixels adjacent to the reference block to determine the transformation models used by the remaining two color components among the first color component, the second color component, and the third color component, and the types of the transformation models used by the remaining two color components are the same as the type of the transformation model used by the one color component.
98. The method according to claim 95, wherein The method further includes: When the current block is bidirectionally predicted, if the two candidate transformation models to be saved are the same, save one of the two candidate transformation models.
99. The method according to claim 51, wherein, The method further includes: Determine the first motion information of the current block. Determine the first reference block of the current block according to the first motion information of the current block. Adjust the model parameters of the transformation model according to the template of the current block and the template of the first reference block to obtain an adjusted transformation model. Transform the reference block according to the adjusted transformation model to determine the predicted block of the current block.
100. The method according to claim 51, wherein, The type of the transformation model includes at least one of the following: the type of a linear model, the type of a filtering model, the type of a multi-model, and combinations of different types.
101. The method according to claim 51, wherein, The method further includes: Derive a model based on the reconstructed pixels adjacent to the current block and the reconstructed pixels adjacent to the reference block, or derive a model based on the reconstructed block of the current block and the reference block, and determine the derived model of the current block; Save the transform model of the current block and the derived model of the current block.
102. The method according to claim 101, wherein, The method further includes: Determine first information of the current block; When the first information meets a first condition, perform the step of deriving a model based on the reconstructed pixels adjacent to the current block and the reconstructed pixels adjacent to the reference block, or deriving a model based on the reconstructed block of the current block and the reference block, and determine the derived model of the current block; Wherein, the first information includes at least one of the following: the position of the current block, the size of the current block, the adjacent block information of the current block, the encoded syntax flag information of the current block.
103. The method according to claim 78, wherein, The method further includes: Determine second information of the current block; When the second information meets a second condition, perform the step of encoding the value of the second syntax flag information and writing the obtained encoded bits into the bitstream; Wherein, the second information includes at least one of the following: the position of the current block, the size of the current block, the adjacent block information of the current block, the encoded syntax flag information of the current block.
104. The method according to claim 94, wherein, The method further includes: Determine third information of the current block; When the third information meets a third condition, perform the step of saving the transform model of the current block; Wherein, the third information includes at least one of the following: the position of the current block, the size of the current block, the adjacent block information of the current block, the encoded syntax flag information of the current block.
105. The method according to claim 51, wherein, The method further includes: When constructing a candidate list of transform models of the current block, determine the derived transform model of the current block; Add the derived transform model to the candidate list of transform models.
106. The method according to claim 51, wherein The method further includes: When the current block uses the intra block copy mode, perform the step of constructing a candidate list of transform models of the current block.
107. The method according to claim 106, wherein, The method further includes: Determine the value of a fifth syntax flag information; wherein, the fifth syntax flag information is used to indicate whether the current block uses the intra block copy mode; Encode the value of the fifth syntax flag information and write the obtained encoded bits into the bitstream.
108. The method according to any one of claims 51 to 107, wherein The method further includes: Determine the initial block of the current block; Determine the residual block of the current block according to the initial block of the current block and the predicted block of the current block.
109. The method according to claim 108, wherein The method further includes: Encode the residual block of the current block and write the obtained encoded bits into the bitstream.
110. A bitstream, wherein, The bitstream is generated by performing bit encoding on the information to be encoded; wherein, the information to be encoded includes at least one of the following: the residual block of the current block, the transform model index number of the current block, the first merge index number of the current block, the second merge index number of the current block, the motion information of the current block, the first transform model index number and the second transform model index number of the current block, the prediction direction information of the current block, the pattern identification information of at least some of the candidate motion information in the first sorted merge candidate list, the value of the first syntax identification information, the value of the second syntax identification information, the value of the third syntax identification information, the value of the fourth syntax identification information, and the value of the fifth syntax identification information; Wherein, the first syntax identification information is used to indicate whether the current block uses the inter-frame prediction mode, the second syntax identification information is used to indicate whether the current block uses the method based on the transform model candidate list, the third syntax identification information is used to indicate whether the current block uses the prediction mode based on the reference block transform, the fourth syntax identification information is used to indicate whether the current block uses the inter-frame merge prediction mode, and the fifth syntax identification information is used to indicate whether the current block uses the intra-block copy mode.
111. An encoder, comprising a first construction unit, a first determination unit, and a first prediction unit, wherein: The first construction unit is configured to construct a transform model candidate list for the current block when the current block uses the inter-frame prediction mode; The first determination unit is configured to determine the transform model of the current block based on the transform model candidate list and determine the reference block of the current block; The first prediction unit is configured to perform a transform on the reference block according to the transform model to determine the prediction block of the current block.
112. An encoder, comprising a first memory and a first processor, wherein: The first memory is used to store a computer program that can run on the first processor; The first processor is configured to execute the method according to any one of claims 51 to 109 when running the computer program.
113. A decoder, comprising a decoding unit, a second construction unit, a second determination unit, and a second prediction unit, wherein: The decoding unit is configured to decode the bitstream and determine the value of the first syntax identification information; The second construction unit is configured to construct a transform model candidate list for the current block when the first syntax identification information indicates that the current block uses the inter-frame prediction mode; The second determination unit is configured to determine the transform model of the current block based on the transform model candidate list and determine the reference block of the current block; The second prediction unit is configured to perform a transform on the reference block according to the transform model to determine the prediction block of the current block.
114. A decoder, comprising a second memory and a second processor, wherein: The second memory is used to store a computer program that can run on the second processor; The second processor is configured to execute the method according to any one of claims 1 to 50 when running the computer program.
115. A computer-readable storage medium, wherein, The computer-readable storage medium stores a computer program, and when the computer program is executed by at least one processor, it implements the method described in any one of claims 1 to 50, or the method described in any one of claims 51 to 109.