Encoding / decoding method, code stream, encoder, decoder, and storage medium
By using weighted fusion of multiple reference blocks during the intra-frame block copying process and using different matching template information, the problem of prediction deviation caused by linear illumination changes in the existing technology is solved, and the prediction accuracy and editing of intra-frame block copying are improved. Decoding efficiency.
Patent Information
- Application Number
- PCT/CN2023/088538
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2023-04-14
- Publication Date
- 2024-10-17
AI Technical Summary
In the existing technology, during the intra-frame block copying process, when the best matching reconstructed block is directly used as the prediction block, there is a problem that the prediction deviation is large when linear illumination changes, resulting in low prediction accuracy.
During the search process of the reconstruction area, the weighted fusion of multiple reference blocks is used, and the reconstruction block information of different matching templates is used instead of simply relying on the template with the smallest matching cost. The prediction accuracy is improved by determining the weighted fusion weight parameters of the reference blocks. .
The prediction accuracy and encoding and decoding efficiency of intra-frame block copying are improved, the matching template information is fully utilized to adaptively allocate weight values, and the importance of different reconstructed blocks to the current block is considered, further improving the encoding and decoding performance.
Smart Images

Figure CN2023088538_17102024_PF_FP_ABST
Abstract
Description
Coding and decoding method, code stream, encoder, decoder and storage medium Technical Field
[0001] The present application relates 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] Intra Block Copy (IBC) is a block-level coding mode. Similar to inter-frame technology, the encoder performs motion search (for example, block matching) to find the best block vector (BV), also called motion vector (MV), for each coding block. The block vector is a vector pointing from the current block to the reference block.
[0003] However, in the actual encoding process, the relevant technology usually directly uses the reconstructed pixels of the best matching reconstructed block as the predicted pixels of the current coding block. However, due to incomplete consideration, it is not the optimal solution in some scenarios. For example, when there is a linear illumination change between the best matching reconstructed block and the current coding block, there will be a large deviation when the reconstructed pixels of the best matching reconstructed block are directly used as the predicted pixels of the current coding block, and the optimal prediction effect cannot be achieved, resulting in low prediction accuracy.
[0004] Summary of the Invention
[0005] The present application provides a coding and decoding method, a code stream, an encoder, a decoder, and a storage medium, which can fully utilize the reconstructed block information of different matching templates during the search process of the reconstruction area, rather than simply considering the reconstructed block information corresponding to the template with the lowest matching cost, thereby improving prediction accuracy and coding and decoding efficiency.
[0006] The technical solution of this 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] Determine N reference blocks of the current block; where N is an integer greater than 1;
[0009] Determining weighted fusion weight parameters of the N reference blocks;
[0010] Performing weighted fusion on the N reference blocks according to weighted fusion weight parameters of the N reference blocks to determine a prediction block for the current block;
[0011] A reconstructed block of the current block is determined according to the predicted 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] Determine N reference blocks of the current block; where N is an integer greater than 1;
[0014] Determining weighted fusion weight parameters of the N reference blocks;
[0015] Performing weighted fusion on the N reference blocks according to weighted fusion weight parameters of the N reference blocks to determine a prediction block for the current block;
[0016] A prediction residual of the current block is determined based on the prediction block of the current block.
[0017] In a third aspect, an embodiment of the present application 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:
[0018] The number of coefficients of the target filter, the shape of the target filter, the value of the first syntax element, and the value of the second syntax element; wherein the first syntax element is used to indicate the value of N, and the second syntax element is used to indicate whether the current block uses the fusion prediction mode.
[0019] In a fourth aspect, an embodiment of the present application provides an encoder, comprising a first determination unit and a first prediction unit; wherein:
[0020] The first determining unit is configured to determine N reference blocks of the current block; wherein N is an integer greater than 1;
[0021] The first determining unit is configured to determine a weighted fusion weight parameter of the N reference blocks;
[0022] The first prediction unit is configured to perform weighted fusion on the N reference blocks according to weighted fusion weight parameters of the N reference blocks to determine a prediction block for the current block;
[0023] The first determining unit is configured to determine a prediction residual of the current block according to a prediction block of the current block.
[0024] In a fifth aspect, an embodiment of the present application provides an encoder, comprising a first memory and a first processor; wherein:
[0025] a first memory for storing a computer program capable of running on the first processor;
[0026] The first processor is configured to execute the method according to the second aspect when running a computer program.
[0027] In a sixth aspect, an embodiment of the present application provides a decoder, comprising a second determination unit and a second prediction unit; wherein:
[0028] The second determining unit is configured to determine N reference blocks of the current block; wherein N is an integer greater than 1;
[0029] The second determining unit is further configured to determine a weighted fusion weight parameter of the N reference blocks;
[0030] The second prediction unit is configured to perform weighted fusion on the N reference blocks according to weighted fusion weight parameters of the N reference blocks to determine a prediction block of the current block;
[0031] The second determining unit is further configured to determine a reconstructed block of the current block according to the predicted block of the current block.
[0032] In a seventh aspect, an embodiment of the present application provides a decoder, comprising a second memory and a second processor; wherein:
[0033] a second memory for storing a computer program capable of running on the second processor;
[0034] The second processor is configured to execute the method according to the first aspect when running a computer program.
[0035] In an eighth aspect, an embodiment of the present application provides a computer-readable storage medium storing a computer program, which, when executed, implements the method described in the first aspect or the method described in the second aspect.
[0036] The embodiments of the present application provide a coding and decoding method, a bitstream, an encoder, a decoder, and a storage medium. The method includes: determining N reference blocks for a current block; wherein N is an integer greater than 1; determining weighted fusion weight parameters for the N reference blocks; performing weighted fusion on the N reference blocks based on the weighted fusion weight parameters to determine a prediction block for the current block; and determining a prediction residual or a reconstructed block for the current block based on the prediction block for the current block. In this way, during the search for a reconstruction area, the reconstructed block information of different matching templates is fully utilized, rather than simply considering the reconstructed block information corresponding to the template with the lowest matching cost, thereby improving prediction accuracy and coding and decoding efficiency.
[0037] Furthermore, the matching template information is fully utilized to adaptively assign weight values to the reference blocks, taking into account the different importance of different reconstructed block information to the current block prediction, further improving the prediction accuracy and encoding and decoding efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] FIG1 is a schematic diagram of a prediction process of an IBC technology;
[0039] FIG2 is a schematic diagram of a prediction process based on IBC technology;
[0040] Figure 3 is a schematic diagram of a template type;
[0041] FIG4 is a schematic diagram showing the locations of sources of spatially adjacent coding units;
[0042] FIG5 is a schematic diagram of the location of a BV candidate;
[0043] FIG6 is a schematic diagram of a template position of a reference block and a template position of a current block;
[0044] FIG7 is a schematic diagram of a clustering process of BVP candidates;
[0045] FIG8A is a schematic diagram of a search position of a diamond-shaped template;
[0046] FIG8B is a second schematic diagram of a search position of a diamond-shaped template;
[0047] FIG9 is a second schematic diagram of a BV prediction process;
[0048] FIG10 is a schematic diagram of a reference area of an IBC;
[0049] FIG11 is a second schematic diagram of a reference area of an IBC;
[0050] FIG12 is a third schematic diagram of a reference area of an IBC;
[0051] FIG13 is a schematic diagram of a search process based on template matching;
[0052] FIG14A is a schematic block diagram of an encoder provided in an embodiment of the present application;
[0053] FIG14B is a schematic block diagram of a decoder according to an embodiment of the present application;
[0054] FIG15 is a schematic diagram of a network architecture of a coding and decoding system provided in an embodiment of the present application;
[0055] FIG16 is a schematic diagram of a flow chart of a decoding method provided in an embodiment of the present application;
[0056] FIG17 is a schematic flow chart of a method for determining a reference block in an embodiment of the present application;
[0057] FIG18 is a schematic diagram of an IBC fusion process provided in an embodiment of the present application;
[0058] FIG19A is a schematic diagram of the composition of a filter coefficient provided in an embodiment of the present application;
[0059] FIG19B is a schematic diagram of the composition of a predicted pixel provided by an embodiment of the present application;
[0060] FIG20 is a schematic diagram of a flow chart of an encoding method provided in an embodiment of the present application;
[0061] FIG21 is a schematic diagram of the structure of an encoder provided in an embodiment of the present application;
[0062] FIG22 is a schematic diagram of a specific hardware structure of an encoder provided in an embodiment of the present application;
[0063] FIG23 is a schematic diagram of the structure of a decoder provided in an embodiment of the present application;
[0064] FIG24 is a schematic diagram of a specific hardware structure of a decoder provided in an embodiment of the present application;
[0065] FIG25 is a schematic diagram of the composition structure of a coding and decoding system provided in an embodiment of the present application. DETAILED DESCRIPTION
[0066] 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.
[0067] 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.
[0068] In the following description, reference is made to "some embodiments," which describe a subset of all possible embodiments. However, it is 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. It should also be noted that the terms "first, second, and third" 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 is understood that "first, second, and third" may be interchanged in a specific order or sequential order where permitted, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.
[0069] 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:
[0070] Coding Block (CB);
[0071] Block Matching (BM);
[0072] Coding Unit (CU);
[0073] Block Vector (BV);
[0074] Sum of Absolute Difference (SAD);
[0075] Sum of Absolute Transformed Difference (SATD);
[0076] Mean Square Error (MSE);
[0077] Sum of Squared Differences (SSD);
[0078] Mean Absolute Deviation (MAD);
[0079] Mean Square Differences (MSD);
[0080] Rate–distortion optimization (RDO);
[0081] Normalized Correlation Coefficient (NCC);
[0082] Peak Signal to Noise Ratio (PSNR);
[0083] H.266 / Versatile Video Coding (VVC);
[0084] VVC Test Model (VTM), a reference software testing platform for VVC;
[0085] Intra Template Matching Prediction (Intra TMP);
[0086] Beyond VVC's reference software testing platform (Enhanced Compression Model, ECM).
[0087] It can be understood that in a video image, a first color component, a second color component, and a third color component are generally used to represent a coding block. These three color components are a luminance component, a blue chrominance component, and a red chrominance component. Specifically, the luminance component is usually represented by the symbol Y, the blue chrominance component is usually represented by the symbol Cb or U, and the red chrominance component is usually represented by the symbol Cr or V. Thus, a video image can be represented in either the YCbCr format or the YUV format.
[0088] It can also be understood that IBC is an extended tool of VVC for the coding of video sequences of screen content types (Screen content coding), which significantly improves the coding efficiency of screen content sequences. IBC can also be understood as a special intra-frame prediction mode. Similar to the inter-frame prediction mode, the encoding end performs motion search (for example, block matching) to find the best block vector (Block Vector, BV) for each coding block, which can also be called a motion vector (Motion Vector, MV). The block vector is a vector pointing from the current block to the reference block. The difference between IBC technology and inter-frame technology is that the best block vector of IBC is obtained by searching in the reconstructed area of the frame where the current coding block is located (that is, the current coding frame), while the inter-frame motion vector is obtained by searching the adjacent reference frames of the current coding frame in the time domain.
[0089] IBC technology is used as a key tool for screen video coding in coding standards such as H.265 / HEVC SCC, H.266 / VVC, and AV1, AVS3, and EVC. The exploratory model ECM for the next-generation H.266 / VVC coding standard also continues to use IBC technology as a screen video coding tool, expanding it into a tool set with multiple modes. It has also been introduced to the coding of general natural video, making it a more versatile video coding tool.
[0090] Intra TMP is a special intra-frame prediction mode. Both the encoder and decoder use the coding block template (T) to search for the matching template (T_BEST) with the minimum cost within a predefined search range in the current image according to a preset cost function. The offset of the best matching template relative to the current coding block template is the best block vector (BEST Block Vector, BV_BEST). The reconstructed block (Ref Block) corresponding to the matching template is then used as the prediction block for the current coding block (Cur Block). The coding block template is usually selected from the reconstructed area adjacent to the current coding block.
[0091] For example, taking the adjacent reconstructed area of the current block as an example, as shown in Figure 1, the area filled with dark color represents the reconstructed area, the block filled with grid is the current block, and the adjacent area of the current block is the first template (T); the block filled with slashes is the reference block, and the adjacent area of the reference block is the second template (i.e., "reference template" or "matching template", T_BEST); wherein, the offset of the second template relative to the first template is the best block vector (BV_BEST), at this time, the reference block can be block copied as the prediction block of the current block.
[0092] In an embodiment of the present application, the preset cost function can be the sum of absolute error SAD, the sum of absolute transformation difference SATD, the mean square error MSE, the sum of squared errors SSD, the mean absolute difference MAD, the mean sum of squared errors MSD, rate-distortion optimization RDO, the normalized correlation coefficient NCC, etc., which are not specifically limited here.
[0093] For example, taking absolute error and SAD as examples, the cost function at this time is as follows:
[0094] Among them, Ti is the template in the search process, and M represents the number of pixels in the template.
[0095] The following is a detailed introduction to the prediction process of the Intra TMP technology in the related art.
[0096] The input of the IntraTMP technology: the position of the current block (xTbCmp, yTbCmp), the width of the current block nTbW, and the height of the current block nTbH.
[0097] Output of the IntraTMP technology: predicted value predSamples[x][y] of the current block, where x = 0..nTbW-1, y = 0..nTbH–1.
[0098] Specifically, the IntraTMP prediction process can be divided into four steps: determining the current template type, obtaining the reconstructed pixels of the current template, determining the block vector within a predefined search range, and generating the predicted value. This process yields the predicted value for the current block. It's important to note that the IntraTMP technique can be used to predict both luma and chroma components, and this is not specifically limited here.
[0099] See Figure 2, which shows a schematic diagram of a prediction process based on IBC technology. As shown in Figure 2, the basic process of reconstructing pixel values in the IBC mode includes:
[0100] S201: Obtain BV.
[0101] In practice, BV can be obtained in a variety of ways, so the bitstream can contain information about the BV acquisition mode and corresponding parameter information. For example, if the syntax element indicates IBC merge mode, the decoder constructs a merge list, parses the merge list option index, and then obtains the specific BV information from the corresponding option in the merge list based on the index. For another example, in normal IBC mode, the decoder obtains the specific BV information by parsing the value of the syntax element in the bitstream that describes BV or BV prediction difference.
[0102] S202: Obtain a predicted value using BV.
[0103] In actual implementation, the corresponding area pointed to by BV is usually copied to obtain the predicted value of the current block.
[0104] S203: Determine the reconstruction value.
[0105] In actual implementation, if there is a prediction residual, it is necessary to parse the bitstream to obtain the prediction residual, and then add the prediction residual to the predicted value to obtain the final reconstructed value.
[0106] In the embodiments of this application, there are many places involving the use of templates and template matching costs, which are explained here in a unified manner. The template type can be represented by refTemplateType, and the template types include but are not limited to the six types shown in Figure 3. Figure 3 shows a schematic diagram of a template type. As shown in Figure 3, the block filled with the grid is the current block, and the adjacent area of the current block is the template T. Six template types are shown here, which can be valid at the same time and selected for use by the syntax elements, or they can be used separately (for example, only type (a) in Figure 3 is used).
[0107] For example, the six template types are as follows:
[0108] When the upper left reference pixel, the upper reference pixel, and the left reference pixel are all available, the value of refTemplateType is 1, and the template shape is as shown in (a) of Figure 3;
[0109] When only the left reference pixel is available, the value of refTemplateType is 2, and the template shape is shown in (b) in Figure 3;
[0110] When only the upper reference pixel is available, the value of refTemplateType is 3, and the template shape is shown in (c) in Figure 3;
[0111] When only the left reference pixel and the upper left reference pixel are available, the value of refTemplateType is 4, and the template shape is shown in (d) in Figure 3;
[0112] When only the left reference pixel and the lower left reference pixel are available, the value of refTemplateType is 5, and the template shape is shown in (e) of Figure 3;
[0113] When only the upper reference pixel and the upper right reference pixel are available, the value of refTemplateType is 6, and the template shape is shown in (f) in Figure 3.
[0114] It should be noted that the template can be composed of reconstructed pixels from one or more areas of the top, upper right, left, lower left, or upper left of the current block. In addition, the template size can be pre-set. For example, when obtaining the left template, the template width templateW_size can be set to 4, and when obtaining the top template, the template height templateH_size can be set to 4.
[0115] It should also be noted that the portion of the reconstructed pixels to be obtained can be determined by the value of refTemplateType. For example, when the value of refTemplateType is 1, the reconstructed pixels of the left, upper-left, and upper sides of the current block are obtained; or, when the value of refTemplateType is 2, only the reconstructed pixels of the four left columns of the current block are obtained; or, when the value of refTemplateType is 3, only the reconstructed pixels of the four upper rows of the current block are obtained.
[0116] The following further illustrates the basic process of reconstructing pixel values in the IBC mode.
[0117] S1: Derivation of BV
[0118] (1) Brightness:
[0119] Input: luma position (xCb, yCb), which specifies the top left corner sample of the current coding block relative to the top left corner luma sample of the current picture, a variable cbWidth, which specifies the width of the current coding block in luma samples, and a variable cbHeight, which specifies the height of the current coding block in luma samples.
[0120] Output: Block Vector Luma (bvL)
[0121] The IBC mode can be roughly divided into two categories: IBC merge and IBC ABVP (similar to the merge and AMVP modes of the inter-frame mode in VVC). The process of obtaining BV can be regarded as the following three steps:
[0122] ①When deriving bvL, it is necessary to establish an IBC block vector candidate list bvCandList.
[0123] ② Then determine the candidate items in the selected list based on the code stream,
[0124] ③Finally, the final BV is determined based on the candidate.
[0125] The specific storage information of the IBC candidate includes at least one of the following information:
[0126] i. Prediction direction (L0 or L1, generally L0 is the default)
[0127] ii.BV information (horizontal and vertical components)
[0128] iii. Reference frame (default current image)
[0129] iv. Flip type (e.g., no flip, horizontal flip, and vertical flip)
[0130] v. Whether to use LIC (linear model)
[0131] The following describes the candidate list creation process (1). Taking the IBC merge list creation process as an example, the basic list creation process for IBC ABVP is the same as that for IBC merge, but the maximum number of candidates for each is different (for example, the IBC merge candidate list length is defined as 6, while the IBC ABVP candidate list length is defined as 2).
[0132] Step 1: Derivation of airspace candidates.
[0133] When the usage conditions are met (for example, the size condition IsGt4by4 is equal to TRUE: the variable IsGt4by4 is TRUE when the luma width multiplied by the height is greater than 16), the derivation process of spatial block vector candidates from neighboring coding units specified by the decoding specification is called with the luma coding block position (xCb, yCb), the luma coding block width cbWidth and the height cbHeight as input, and the output is the availability flags such as availableFlagA1, availableFlagB1 and the block vectors bvA1 and bvB1.
[0134] The availability check for each candidate is as follows: The following conditions are judged, and if all are met, the candidate is available:
[0135] Whether the offset position obtained by adding the current block position to the BVP does not exceed the picture boundary;
[0136] Whether the current block position plus the block position pointed to by BVP does not overlap the current block;
[0137] Whether the offset position obtained by adding the current block position to the BVP does not exceed the IBC available area;
[0138] Whether the current block position plus the block position pointed to by BVP has been rebuilt;
[0139] FIG4 is a schematic diagram of the locations of spatially adjacent coding unit sources provided in an embodiment of the present application. The relative positions of the adjacent blocks including A1 and B1 and the current coding block are shown in FIG4 . The traversal order may be A1->B1->B0->A0->B2.
[0140] Step 2: The airspace candidates are added to the candidate list.
[0141] When the usage condition is met (for example, the size condition IsGt4by4 is equal to TRUE), the block vector candidate list bvCandList is constructed as follows:
[0142] i=0
[0143] if(availableFlagA1)
[0144] bvCandList[i++]=bvA1
[0145] if(availableFlagB1)
[0146] bvCandList[i++]=bvB1
[0147] …
[0148] Step 3: Check the number of valid items in the candidate list.
[0149] The variable numCurrCand (the number of candidates currently obtained) is derived as follows:
[0150] If the usage condition is met (eg, the size condition IsGt4by4 is equal to TRUE), numCurrCand is set equal to the number of candidates in bvCandList; otherwise, numCurrCand is set to 0.
[0151] Step 4: If the candidate list does not reach the specified number of items (for example, the specified number of items for the IBC merge mode is 6, and the specified number of items for the IBC ABVP mode is 2), continue with historical candidate item derivation, availability detection, and addition.
[0152] When numCurrCand is less than MaxNumIbcMergeCand (the maximum number of candidates in IBC merge mode) and NumHmvpIbcCand (the maximum number of candidates for the historical best block vector (Hmvp) in IBC mode) is greater than 0, the derivation process of the history-based IBC block vector candidates specified in the decoding specification is called with bvCandList and numCurrCand as input and the modified bvCandList and numCurrCand as output.
[0153] Step 5: Continue to check the number of valid items in the candidate list and add other available candidates (such as pairwise average candidates, zero-valued BV candidates, etc.) until the specified number of items is reached.
[0154] For example, the pairwise average candidate can be constructed by using the first and second candidates: mvAvgLX=(mvCand0LX+mvCand1LX+1)>>1
[0155] A zero value BV can be set directly:
[0156] bvCandList[numCurrCand][0] is set equal to 0. (horizontal component of bv)
[0157] bvCandList[numCurrCand][1] is set equal to 0. (vertical component of bv)
[0158] Or a set of BVP candidates located in the IBC reference area as candidates that can be added. The coordinates of a set of BVP candidates are determined by the width and height of the current block and the ΔX and ΔY parameters, as shown in Figure 5.
[0159] Each time an item is added, numCurrCand increases by 1.
[0160] In this way, the basic block vector candidate list bvCandList is established.
[0161] Based on this list, in the IBC merge mode, the order of the list can also be sorted using a template, the order of the candidate list can be adjusted, the high spatial correlation can be fully utilized, the coding bit transmission can be reduced, and the coding efficiency can be effectively improved. For example, for the IBC merge mode, after the intermediate candidate list is constructed according to the above list construction method (note that the length of the intermediate candidate list can be greater than or equal to the maximum number of candidates in the IBC merge mode), all candidates in the list are re-sorted using the template, and sorted in order from small to large according to the template matching cost, and the first N (for example, N = 6) candidates in the sorted list are selected. The specific process is as follows: the SAD of the template position of the reference block pointed to by each candidate and the template position of the current block (as shown in Figure 6) is calculated, and they are sorted in ascending order, and the first 6 candidates are selected as the candidate list for IBC merge.
[0162] Based on this list, the IBC ABVP mode can also remove candidate redundancy based on the distance between candidates:
[0163] The number of candidates remains unchanged at two, and candidate lists are established for integer pixel and 4-pixel precision respectively.
[0164] If non-RRIBC mode is selected for IBC ABVP, as shown in Figure 7, if the number of valid BVP candidates exceeds two, up to six BVP candidates in the candidate list are clustered according to the Euclidean distance between them, and the radius (R) is a set of block vectors determined as a logarithmic function of the width (cbWidth) and height (cbHeight) of the current block. If the Euclidean distance between the reference positions pointed to by several BV candidates is less than R, they are clustered: R = log2((cbWidth·cbHeight)>>MIN_PU_SIZE)
[0165] The clustering method is performed in the order of the candidate list. In each class, the BVP with the lowest TM cost is selected as the representative candidate of the group. The representative candidates of all classes are then template-sorted, and the representative candidates of the first two groups are selected for the motion estimation process.
[0166] If RRIBC mode is selected for IBC ABVP, adjust the candidate horizontally or vertically to point to the boundary of the valid IBC search area according to the RRIBC mode
[0167] ② Determine the candidate items in the selected list based on the code stream
[0168] In IBV merge mode (general_merge_flag[xCb][yCb] is true) and IBC ABVP mode (general_merge_flag[xCb][yCb] is false), the candidate index bvIdx is derived as follows, where general_merge_flag indicates whether it is IBC merge mode:
[0169] bvIdx=general_merge_flag[xCb][yCb]? merge_idx[xCb][yCb]:mvp_l0_flag[xCb][yCb]
[0170] ③Determine the final BV based on the candidate
[0171] In IBC merge mode, the specific bvL can be obtained according to the index bvIdx and the block vector candidate list bvCandList: bvL[0]=bvCandList[bvIdx][0] bvL[1]=bvCandList[bvIdx][1]
[0172] This bvL is the final BV.
[0173] In IBC MBVD mode, similar to the MMVD in VVC's inter-frame technology, a candidate in the IBC merge list is used as the starting point, and a candidate is selected from the candidate point set corresponding to the predefined distance and direction set, and its corresponding block vector is used as the final BV.
[0174] For example, in IBC MBVD, the distance set is defined as {1-pel, 2-pel, 4-pel, 8-pel, 12pel, 16pel, 24pel, 32pel, 40pel, 48pel, 56pel, 64pel, 72pel, 80pel, 88pel, 96pel, 104pel, 112pel, 120pel, 128pel}, and the BVD directions are the positive and negative horizontal directions and the positive and negative vertical directions.
[0175] The base candidate is selected from the first five candidates in the reordered IBC merge list, and all possible MBVD refinement positions (i.e., 20×4 candidates) of each base candidate are reordered based on the SAD cost between the template and its reference at each refinement position. Finally, the first 8 refinement positions with the smallest template SAD are retained for MBVD index encoding. IBC-MBVD candidates do not inherit the flip type from RR-IBC encoded neighboring blocks. The MBVD index is binarized using a Rice code with parameter equal to 1.
[0176] In the IBC TM merge mode, after obtaining the bvL based on the above information, the TM can also be used to locally refine the BV. The specific operation is to search within a small range centered on the obtained bvL and select the optimal BV within the range as the final BV based on the minimum template matching cost.
[0177] The TM refinement of the candidate list for the IBC merge mode is carried out. The specific implementation process is as follows:
[0178] When building a candidate, the flip type defaults to no flip;
[0179] IBC TM merge mode In IBC merge mode, the transmission syntax element specifies whether to perform integer-pixel precision TM refinement. The location of the refined motion vector and the template used in each refinement step must comply with the reference area constraints.
[0180] A search is performed near the candidate's pointed position, using the SAD between the template of the reference block and the template of the current block to determine the optimal position. This includes, but is not limited to, the following search methods: the search range is [-8, 8], and a diamond search is first performed on integer pixels, searching eight points near the center position, as shown in Figure 8A. The maximum number of searches is 375. After the optimal position is determined for the first time, the search continues, searching five points at even-numbered positions and three points at odd-numbered positions in subsequent searches.
[0181] Taking Figure 8A as an example, starting from the red dot and moving counterclockwise, the search is performed in the order of indexes 0 to 7. Specifically, when the selected point is the optimal point, the search continues for five or three points in the shadow position. When the selected point is shown in Figure 8A, the search continues for five points. When the selected point is shown in Figure 8B, the search continues for three points.
[0182] After the above diamond search process, a whole-pixel cross search is performed only once. That is, after the diamond search finds the current optimal position, four positions with a distance of one pixel below, to the right, above, and to the left of the current optimal position are checked to update the final optimal position, that is, to update the refined candidate list.
[0183] For the IBC ABVP mode, the bvL obtained by indexing bvIdx and the block vector candidate list bvCandList is the predicted bvL. The actual bvL also needs to be added with the block vector difference (BVD). The generalized specific process is as follows:
[0184] Step 1: Get the horizontal and vertical components of BVD, where MvdL0 is the forward motion vector difference. bvd[0] = MvdL0[xCb][yCb][0] bvd[1] = MvdL0[xCb][yCb][1]
[0185] Step 2: Perform a rounding operation on the prediction bvL obtained above, wherein the right shift parameter AmvrShift is used for rounding, and the left shift parameter AmvrShift is used to increase the resolution.
[0186] Step 3: The true bvL is derived as follows, and its range needs to be controlled within -2 17 to 2 17 -1: u[0]=(bvL[0]+bvd[0]+2 18 )%2 18 bvL[0]=(u[0]>=2 17 )?(u[0]-2 18 ):u[0] u[1]=(bvL[1]+bvd[1]+2 18 )%2 18 bvL[1]=(u[1]>=2 17 )?(u[1]-2 18 ):u[1]
[0187] The method of obtaining BVD in step 1 can also be inferred from syntax elements obtained through other encoding methods. The BVD of IBC ABVP uses sub-pixels, whole pixels or 4 pixels as units. During encoding, its symbol can be predicted, and the suffix of the exponential Golomb code obtained after its binarization can also be predicted. Therefore, its syntax elements can be defined by multiple information of the BVD value: whether it is 0, prefix, symbol, and suffix. The combination and analysis of these information can obtain the actual value of BVD. The specific embodiments are as follows:
[0188] Context coding is used to identify whether BVD is 0. The value of (absolute value -1) is binarized using first-order exponential Golomb coding. The first five bins of the EG1 prefix are context coded, and the remaining prefixes are bypass coded. Up to four bins of the EG1 suffix use context coding to transmit prediction indices, and the remaining bins of the EG1 suffix use bypass coding. The two bins of the sign bit use context coding to transmit symbol prediction indices. Figure 9 shows the prediction process for a suffix bin with one horizontal and one vertical transmission prediction index, and a bin with one horizontal and one vertical transmission symbol index. The current block template and the template at the corresponding BV are sorted to derive the prediction indices for the suffix and symbol.
[0189] The final derived BV should be within the specified range (coordinate range in rows and columns).
[0190] For example, in VVC, the reference area of IBC is 128x128. For a 128x128 CTU, the reference area is shown in Figure 10. In ECM7.0, as shown in Figure 11, a box represents a CTU, a grid-filled box represents the CTU where the current block is located, and other shape-filled boxes represent their reference areas. Specifically, for the current block to be encoded, assuming it is located in CTU (m, n), the reference area includes CTUs with indices (m–2, n–2)…(W, n–2)…(0, n–1)…(W, n–1), (0, n)…(m, n). Where W represents the maximum horizontal index within the current tile, slice, or picture.
[0191] When the CTU size is 256, the reference area is adjusted, as shown in Figure 12. A box represents a CTU, a grid-filled box represents the CTU where the current block is located, and other shape-filled boxes represent their reference areas.
[0192] The range of block vector search (or local search) for each block is restricted to horizontally [–(C<<1), C>>2] and vertically [–C, C>>2] to accommodate the reference area extension, where C represents the CTU size.
[0193] (2) Chroma: In the IBC mode of the chroma component, the BV of the chroma can be derived based on the luma BV, and then prediction and reconstruction can be achieved based on this BV. The process of deriving the chroma BV based on the luma BV is as follows:
[0194] Input: bvL of luminance (1 / 16 pixel accuracy)
[0195] Output: bvC (Block Vector Chroma) of chroma (1 / 32 pixel accuracy)
[0196] The derivation process can be directly scaling, or using TM to refine after scaling. The scaling operation example is as follows: bvC[0] = ((bvL[0]>>(3+SubWidthC))*32) bvC[1] = ((bvL[1]>>(3+SubHeightC))*32)
[0197] The variables SubWidthC and SubHeightC depend on the chroma format sampling structure specified by the syntax element sps_chroma_format_idc, and the specific correspondence is as follows:
[0198] Table 1 Correspondence between sps_chroma_format_idc and chroma format sampling structure
[0199] The detailed operation example can be as follows:
[0200] TM is used for refinement. After obtaining the luma BV, the position of the chroma block and the BV are used to find the offset position. A template is then used to perform a detailed search near the offset position. The optimal BV is obtained by minimizing the TMcost, as shown in Figure 13.
[0201] S2: Use BV to obtain prediction samples
[0202] Input: Luma position (xCb, yCb), which specifies the top left corner sample of the current coding block relative to the top left corner luma sample of the current picture, a variable cbWidth, which specifies the width of the current coding block in luma samples, a variable cbHeight, which specifies the height of the current coding block in luma samples, a block vector bv, and a variable cIdx, which specifies the color component index of the current block.
[0203] Output: array predSamples of predicted samples.
[0204] An example of the derivation process of directly copying the prediction block is as follows:
[0205] When cIdx is equal to 0, that is, the luminance component, for x = xCb..xCb+cbWidth-1 and y = yCb..yCb+cbHeight-1: xVb = (x + (bvL[0]>>4)) & (IbcBufWidthY-1) yVb = (y + (bvL[1]>>4)) & (CtbSizeY-1) predSamples[x][y] = ibcVirBuf[0][xVb][yVb]
[0206] IbcBufWidthY is the width of the brightness pixels of the reconstructed buffer stored in IBC, CtbSizeY is the size of the CTU (Coding Tree Unit), and ibcVirBuf is the reconstructed pixels stored in IBC.
[0207] When cIdx is not equal to 0, that is, when it is a chroma component, for x = xCb / SubWidthC..xCb / SubWidthC+cbWidth / SubWidthC-1 and y = yCb / SubHeightC..yCb / SubHeightC+cbHeight / SubHeightC-1: xVb = (x + (bvC[0]>>4)) & (IbcBufWidthC-1) yVb = (y + (bvC[1]>>4)) & ((CtbSizeY / subHeightC)-1)
[0208] predSamples[x][y]=ibcVirBuf[cIdx][xVb][yVb]
[0209] In addition to the basic acquisition methods above, there is also an IBC flip mode method that requires horizontally or vertically flipping the prediction area to obtain the predicted value. For example, a syntax element indicates whether to flip the area and, if so, whether to flip horizontally or vertically. The decoder then reversely rearranges the pixels in the reference area horizontally or vertically according to the syntax to obtain the predicted pixel values of the coding block.
[0210] In addition to the above acquisition process, a template can also be used to establish a model between the current block and the predicted area. The predicted block is then processed according to the model to obtain the predicted value of the current block. For example, the IBC LIC mode, applied to IBC merge and IBC ABVP, uses a linear equation to compensate for local illumination changes. Similar to the LIC for inter-frame prediction in VVC, the parameters of the linear equation can be expressed as a scaling parameter α and an offset parameter β, that is, α*p[x]+β to compensate for illumination changes, where p[x] is the reference sample pointed to by the BV at position x in the current image. The linear model parameters are derived using the least squares method.
[0211] On the basis of the above-obtained prediction values, weighted prediction with other intra-frame prediction methods can also be implemented, and the result after weighted prediction is used as the final prediction result.
[0212] The weighted prediction method includes the inter-frame and intra-frame hybrid prediction CIIP method borrowed from VVC, that is, the result obtained by the above prediction process is weightedly combined with the prediction result obtained by the ordinary intra-frame directional prediction mode at each pixel position; it also includes the inter-frame geometric prediction mode GPM method borrowed from VVC, that is, based on a wedge division, the results obtained by using different prediction modes in different wedge areas, and weighted mixing in accordance with certain rules near the wedge division line.
[0213] An example of the operation process in IBC CIIP mode: the IBC prediction value of the current block is weightedly fused with the prediction value of a certain intra-frame mode. The IBC prediction part can be obtained by applying the conventional merge, TM merge, MBVD and ABVP modes.
[0214] For the case where the IBC prediction part is the conventional IBC merge, TM merge, and MBVD mode, the weight ratio of IBC prediction and intra prediction is 13:3. The intra mode includes the TIMD mode of the current block and the intra prediction mode at the candidate BV. If the second prediction mode in the intra mode is the same as the first prediction mode, it is determined whether the first prediction mode is the PLANAR mode. If so, the second prediction mode is replaced with the horizontal prediction mode, otherwise the second prediction mode is replaced with the PLANAR mode.
[0215] For the case where the IBC prediction part is the ABVP mode, the weight ratio of the IBC prediction and the intra-frame prediction is 1:1, and the TIMD mode is obtained as the first prediction mode of the intra-frame prediction mode. If the derived prediction mode is the horizontal prediction mode, PLANAR is obtained as the second prediction mode of the intra-frame prediction mode. Otherwise, the horizontal prediction mode is obtained as the second prediction mode of the intra-frame prediction mode.
[0216] Example of the operation process in IBC GPM mode: Conventional merge and TM merge can be applied to the IBC prediction part. For a single IBC partition and one INTRA partition, the intra prediction mode (IPM) candidate list is constructed using the same method as for inter GPM, and the IPM candidate list size is predefined as 3.
[0217] In specific implementation, there are 48 geometric partitioning modes, which can be divided into two geometric partitioning mode sets:
[0218] Table 2 The first geometric partitioning pattern set
[0219] Table 3 Second geometric partitioning pattern set
[0220] When using IBC GPM, the IBC GPM geometric partitioning mode set flag is transmitted to indicate whether the first or second geometric partitioning mode set is selected, followed by the geometric partitioning mode index. The IBC-GPM frame partition flag is then transmitted to indicate whether intra prediction is used for the first sub-partition. The intra prediction portion requires the transmission of the intra prediction mode index, and the IBC prediction portion requires the transmission of the MEGRE index.
[0221] S3: Obtain reconstruction samples
[0222] If there is a residual, the decoding process of the residual signal specified by the decoding specification is called.
[0223] Invokes the image reconstruction process for the specified color component as specified by the decoding specification.
[0224] The embodiments of the present application will be described in detail below with reference to the accompanying drawings.
[0225] Referring to FIG14A , which shows a block diagram of an encoder provided in an embodiment of the present application. As shown in FIG14A , the encoder (specifically, a “video 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, etc., wherein 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 .
[0226] Referring to FIG14B , which shows a block diagram of a decoder provided in an embodiment of the present application, as shown in FIG14B , the decoder (specifically, a "video 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 buffer unit 206. 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 coded as shown in FIG14A, a code stream of the video signal is outputted. The code stream is inputted into 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 a residual block 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 block of the current frame or picture. The motion compensation unit 204 determines prediction information for the video decoding block by analyzing the motion vector and other associated syntax elements, and uses the prediction information to generate the residual block. 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.
[0227] Furthermore, an embodiment of the present application also provides a network architecture of a coding and decoding system including an encoder and a decoder, wherein Figure 15 shows a schematic diagram of a network architecture of a coding and decoding system provided by an embodiment of the present application. As shown in Figure 15, the network architecture includes one or more electronic devices 13 to 1N and a communication network 01, wherein the electronic devices 13 to 1N can perform video interaction through the communication network 01. During implementation, the electronic device can be various types of devices with video coding and decoding functions. For example, the electronic device can include a smart phone, a tablet computer, a personal computer, a personal digital assistant, a navigator, a digital phone, a video phone, a television, a sensing device, a server, etc., which are not specifically limited here. In addition, the decoder or encoder described in the embodiment of the present application can be the above-mentioned electronic device.
[0228] It should be noted that the method of the embodiment of the present application is mainly applied to the intra-frame prediction unit 103 shown in Figure 14A and the intra-frame prediction unit 203 shown in Figure 14B. In other words, the embodiment of the present application can be applied to both the encoder and the decoder, or even to both the encoder and the decoder at the same time, but the embodiment of the present application is not specifically limited thereto.
[0229] It should also be noted that, when applied to the intra-frame prediction unit 103, the "current block" specifically refers to the coding block currently to be intra-frame predicted; when applied to the intra-frame prediction unit 203, the "current block" specifically refers to the decoding block currently to be intra-frame predicted.
[0230] To facilitate understanding of the technical solutions of the embodiments of the present application, the technical solutions of the present application are described in detail below through specific embodiments. The above related technologies can be arbitrarily combined with the technical solutions of the embodiments of the present application as optional solutions, and they all belong to the protection scope of the embodiments of the present application. The embodiments of the present application include at least part of the following contents. The present application provides a coding and decoding method, and more specifically provides an intra-frame block copy prediction fusion (IBC Fusion) technology, which determines the reference block through the block vector, performs weighted fusion of the reference block, and determines the prediction block of the current block.
[0231] In one embodiment of the present application, referring to FIG16 , a flowchart of a decoding method provided by an embodiment of the present application is shown. As shown in FIG16 , the method may include:
[0232] S1601: Determine N reference blocks for the current block; where N is an integer greater than 1;
[0233] In some embodiments, determining N reference blocks for the current block includes: determining a first block vector for the current block based on a block matching criterion; and determining a reference block for the current block based on the first block vector of the current block. In some embodiments, searching the position indicated by the first block vector to determine an optimal block vector, and determining the reference block indicated by the optimal block vector. In some embodiments, searching the position indicated by the first block vector to determine at least two block vectors, and determining at least two reference blocks indicated by the at least two block vectors.
[0234] In some embodiments, determining the N reference blocks of the current block includes: determining N block vectors of the current block according to a block matching criterion; and determining the N reference blocks of the current block according to the N block vectors of the current block.
[0235] In some embodiments, determining N reference blocks for a current block includes: constructing a block vector candidate list for the current block; determining a block vector for the current block based on the block vector candidate list; and determining a reference block for the current block based on the block vector of the current block. In practical applications, the block vector candidate list is a BV candidate list determined based on a block matching criterion, such as an IBC merge, IBC TMmerge, or IBC ABVP list.
[0236] In some embodiments, constructing a block vector candidate list for the current block includes constructing a first block vector candidate list for the current block based on a block matching criterion. Here, the first block vector candidate list may be an IBC merge list or an IBC ABVP list. The basic process for constructing an IBC ABVP list is the same as that for constructing an IBC merge list, but the maximum number of candidates differs (for example, the length of the IBC merge candidate list is defined as 6, while the length of the IBC ABVP candidate list is defined as 2).
[0237] Furthermore, determining the block vector of the current block based on the block vector candidate list includes: determining template matching parameters corresponding to at least some of the block vectors in the first block vector candidate list based on a template matching criterion; sorting at least some of the block vectors based on the template matching parameters to determine a sorted block vector candidate list; and determining the block vector of the current block based on the sorted block vector candidate list. Exemplarily, the first N block vectors in the sorted block vector candidate list are determined; or the first block vector in the sorted block vector candidate list is determined.
[0238] Figure 17 is a flow chart of a reference block determination method in an embodiment of the present application. As shown in Figure 17, the method includes: S1701: determining the value of N; S1702: determining the template matching parameters corresponding to the block vector based on the template matching criterion; S1703: determining N block vectors according to the template matching parameters; S1704: determining N reference blocks according to the N block vectors.
[0239] In some embodiments, after determining the number of candidate BVs N, it is necessary to select N relatively matching block vectors BV using a comparison criterion. For example, for an IBC merge list, a matching template is obtained based on block vector BVn, that is, based on template offsets pXn and pYn. The template matching cost is calculated and the BVs corresponding to the N matching templates with the lowest cost are recorded. These N matching templates are also referred to as reference templates. The template matching criterion can be one of the cost functions used to measure patterns, such as SAD, SATD, MSE, MAD, RDO, correlation coefficient, and PSNR.
[0240] For example, the template matching criterion is MAD (Mean Absolute Difference), which is calculated as follows:
[0241] Where refT is the matching template in the BV candidate list, curT is the current block template, M is the number of pixels of the current coding block template, and MAD(refT) is the mean absolute difference between the current coding block template curT and the matching template corresponding to the BV candidate.
[0242] The MAD-based screening criterion is: compare and record the block vectors BV corresponding to the N matching templates with the smallest MAD cost.
[0243] Specifically, for N candidate templates, the MAD between the nth candidate template and the current coding block template is as follows:
[0244] Where refTn is the n-th candidate template, MAD(refTn) is the mean absolute difference between the current block template curT and the n-th candidate template, n=0,…,N-1.
[0245] In some embodiments, constructing a block vector candidate list for the current block includes: constructing a first block vector candidate list for the current block based on a block matching criterion; and determining a second block vector candidate list by searching a search range pointed to by at least a portion of the block vectors in the first block vector candidate list based on a template matching criterion. Exemplarily, the first N block vectors in the second block vector candidate list are determined; or, alternatively, the first block vector in the second block vector candidate list is determined. Here, the first block vector candidate list may be an IBC merge or IBC ABVP list, wherein the basic establishment process for the IBC ABVP list is consistent with that for the IBC merge, but the maximum number of candidates differs (for example, the IBC merge candidate list length is defined as 6, while the IBC ABVP candidate list length is defined as 2). The second block vector candidate list may be an IBC TM merge. In the IBC TM merge mode, after obtaining the bvL based on the IBC merge, the BV can also be locally refined using the TM. Specifically, the search is performed within a small range centered on the obtained bvL, and the optimal one or more BVs within the range are selected as the final BV based on template matching parameters.
[0246] In other embodiments, determining a block vector for a current block based on a block vector candidate list includes: determining N block vectors for the current block based on the block vector candidate list. Exemplarily, the block vector candidate list includes at least N block vectors, determining the first N block vectors in the block vector candidate list; and determining N reference blocks to which the N block vectors point.
[0247] In some embodiments, the value of N is determined to be a preset value. In some embodiments, the value of N is determined based on the value of a first identification parameter of the current block. In some embodiments, a first syntax element of the current block is decoded; and the value of the first identification parameter is determined based on the value of the first syntax element. In some embodiments, at least two candidate values for N are determined; based on the at least two candidate values, a prediction template sample corresponding to each candidate value is determined; template matching parameters are determined between the prediction template sample and the template sample of the current block based on a template matching criterion; and the value of the first identification parameter is determined based on the template matching parameters.
[0248] It should be noted that N can be a constant preset by the codec, such as 2, 3, 4, or 5. N can also be within a certain range, such as any integer between 2 and 6. The range of N can be pre-set, and the value of N can be determined based on a template matching criterion. Alternatively, the optimal N value can be determined at the codec and transmitted to the decoder in the form of a bitstream. The cost function used to measure the performance of the fusion mode can be one of SAD, SATD, MSE, MAD, RDO, etc.
[0249] Obtain N block vectors BV, and directly obtain the reference block RefBlockn in the current image based on BVn, where the horizontal offset of BVn is pXn and the vertical offset is pYn, where n = 0, 1…, N-1.
[0250] It is implemented by simple translation copy. The specific operation is: for x = 0...nTbW-1, y = 0...nTbH-1, RefBlockn[x][y] = recSamples[x+pXn][y+pYn]
[0251] Where recSamples represents the reconstructed pixel values of the current image. After obtaining N reference blocks RefBlock, it is necessary to determine the weight parameter Wn for weighted fusion of the N reference blocks. The weighted fusion is achieved using the reference blocks RefBlockn and the weight parameter Wn.
[0252] In some embodiments, the value of N can be fixed to 2, that is, only the reference blocks corresponding to the BVs indexed 0 and 1 in the Merge list are weightedly fused. If the Merge list is IBCmerge, the order of the BV candidate list has been sorted by the block matching parameter (such as SAD), that is, the first two BVs in the order are the two with the smallest SAD cost. Weighted fusion of the reference blocks corresponding to the first two BVs in the BV candidate list is relatively accurate.
[0253] In some embodiments, the value of N can be fixed to 2. The template matching parameters (e.g., SAD) of the corresponding reference template and the current block template are calculated for the first M BVs in the Merge list, and the two with the smallest SAD cost are selected for weighted fusion. M is an integer greater than or equal to 2.
[0254] In some embodiments, the method further includes: determining whether the current block uses a fusion prediction mode according to a value of a second identification parameter of the current block.
[0255] In some embodiments, the method further includes: decoding a second syntax element of the current block; determining a value of a second identification parameter based on the value of the second syntax element; or determining at least two candidate prediction modes; determining a prediction template sample corresponding to each candidate prediction mode based on the at least two candidate prediction modes; determining template matching parameters of the prediction template sample and the template sample of the current block based on a template matching criterion; determining an optimal prediction mode based on the template matching parameters; and determining the value of the second identification parameter based on the optimal prediction mode.
[0256] In some embodiments, the value of the second identification information is a first value, which determines that the current block uses the fusion prediction mode; the value of the second identification information is a second value, which determines that the current block does not use the fusion prediction mode.
[0257] In some embodiments, the method further includes: when determining that the current block uses a fusion prediction mode, executing methods S1601 to S1604. In some embodiments, the method further includes: if the current block does not use a fusion prediction mode, determining a first reference block for the current block; and determining a prediction block for the current block based on the first reference block. Exemplarily, determining a first block vector for the current block, and determining the first reference block based on the first block vector.
[0258] Exemplarily, an isFusion_Flag (which can be understood as the second identification parameter or the second syntax element) is set. If it is 1, the two BVs with the best cost are derived by the template matching criterion at the encoding and decoding ends for weighted fusion. If it is 0, no weighted fusion is performed.
[0259] S1602: Determine weighted fusion weight parameters of N reference blocks;
[0260] It should be noted that before performing weighted fusion, the weighted fusion weight parameters Wn of the N reference blocks (which can be represented as RefBlock) must be determined. The weight parameters can be predefined values or adaptively calculated using template matching parameters, block matching parameters, pixel values, etc.
[0261] It should be noted that the weight parameters of different reference blocks may be equal or unequal. In some embodiments, determining the weighted fusion weight parameters of the N reference blocks includes: determining the weighted fusion weight parameters of the N reference blocks to be preset weight parameters.
[0262] In some embodiments, a weighted fusion weight parameter of the N reference blocks is determined based on the value of a third identification parameter. Exemplarily, the value of the third identification parameter is used to indicate a weighted fusion weight parameter or a group of weighted fusion weight parameters. The third identification parameter may be identification information of a weighted fusion weight parameter or identification information of a group of weighted fusion weight parameters. In some embodiments, the bitstream is decoded, a third syntax element is determined, and the value of the identification parameter is determined based on the value of the third syntax element.
[0263] In some embodiments, determining weighted fusion weight parameters of N reference blocks includes: determining a template sample of a current block, and determining reference template samples of N reference blocks; determining a matching reference sample based on the reference template samples of the N reference blocks; determining a weighted fusion weight parameter of a reconstructed reference sample corresponding to the matching reference sample based on the template sample of the current block and the matching reference sample; wherein the matching reference sample includes N reference template samples, and the weighted fusion weight parameter of the reconstructed reference sample includes the weighted fusion weight parameter of the N reference blocks.
[0264] Here, the matching reference samples are applied to the process of deriving weighted fusion weight parameters; the reconstructed reference samples are applied to the process of applying weighted fusion weight parameters, and a set of weighted fusion weight parameters derived from the matching reference samples are applied to the weighted fusion of the reconstructed reference samples corresponding to the matching reference samples.
[0265] In some embodiments, based on the template sample and the matching reference sample of the current block, the weighted fusion weight parameters of the reconstructed reference sample corresponding to the matching reference sample are determined, including: determining the template matching parameters based on the template sample and the matching reference sample of the current block; deriving the weight parameters based on the template matching parameters to determine the weighted fusion weight parameters of the reconstructed reference sample.
[0266] The template matching criterion can be one of the cost functions used to measure patterns, such as SAD, SATD, MSE, MAD, RDO, correlation coefficient, and PSNR. In other words, the template matching parameters are determined based on the selected template matching criterion. An optimization algorithm is used to find the optimal solution for the template matching parameters, and the weight parameters for the matched reference sample and the reconstructed reference sample are derived.
[0267] In some embodiments, based on the template sample of the current block and the matching reference sample, the weighted fusion weight parameters of the reconstructed reference sample corresponding to the matching reference sample are determined, including: determining the autocorrelation parameter based on the pixel reference value of the sample in the matching reference sample; determining the cross-correlation parameter based on the pixel reference value of the template sample of the current block and the pixel reference value of the sample in the matching reference sample; and determining the weighted fusion weight value of the candidate reconstructed sample corresponding to the matching reference sample based on the autocorrelation parameter and the cross-correlation parameter.
[0268] Exemplarily, the weighted fusion weight is derived by minimizing the MSE by matching the reconstructed value of the reference sample refTn with the pixel value of the template sample curT of the current block.
[0269] When the matching reference sample includes N reference blocks of reference template samples, only N weighted fusion weights need to be derived. For ease of description, the variable P is used here to record the number of weights, where P = N. All reference quantities involved in the calculation can be uniformly represented as refTp. Similarly, the reference block is uniformly referred to as the reconstruction reference sample refBlockp, where p = 0, 1..., P-1. The specific implementation is as follows:
[0270] Specifically, the MSE minimization process takes as input the autocorrelation matrix of the first P matching reference samples refT, the cross-correlation vector between the first P matching reference samples refT and the template sample curT of the current coding block, and outputs the weight of each sample in the matching reference sample corresponding to the reference block. The specific implementation is as follows: The MSE calculation formula is as follows:
[0271] For the same pixel position of each candidate template, that is, for m=0,1…,M-1:
[0272] In order to conveniently express the calculation formula of MSE, E is used here to represent the mean square error MSE, that is:
[0273] Minimize MSE to derive the weight w of the reference block corresponding to each reference template n The specific steps are as follows:
[0274] (1) First, w n Find the partial derivative and make it equal to 0:
[0275] Arranged:
[0276] (2) After determining the reference template samples refT0, refT1, ...refT P-1 Then expand the equation obtained in (1) into a matrix form:
[0277] Among them, for A, the pixel reference value in the reference template sample is represented by refT[i][j], and A represents the autocorrelation parameter of refT[i][j], which is as follows
[0278] For B, the pixel reference value in the template sample of the current block is represented by curT, and B represents the cross-correlation parameter of curT and refT[i][p], as follows:
[0279] (3) The autocorrelation parameters and cross-correlation parameters are known quantities. By solving the linear equations in (2), we can calculate the weights w0,…w of each candidate template corresponding to the reconstructed sample. P-1 .
[0280] In some embodiments, determining a matching reference sample based on reference template samples of N reference blocks includes: determining a first parameter sample; determining the matching reference sample based on the reference template samples of the N reference blocks and the first parameter sample; and reconstructing weighted fusion weight parameters for the reference sample further including weighted fusion weight parameters for the first parameter sample. That is, the matching reference sample processing includes the reference template samples of the N reference blocks and may also include the first parameter sample, thereby making the weight derivation process more flexible. Accordingly, the weighted fusion weight parameters for the reconstructed reference sample include weighted fusion weight parameters for the N reference blocks and weighted fusion weight parameters for the first parameter sample.
[0281] It should be noted that the first parameter sample includes parameters of multiple pixels, and the parameter of each pixel may be a preset constant or a non-constant, for example, a non-constant determined according to a reference template.
[0282] In some embodiments, the first parameter sample includes a first sample. Determining the first parameter sample includes: determining the first sample based on a first template sample among the reference template samples of the N reference blocks. The first template sample can be any one of the reference template samples of the N reference blocks, or a specific one.
[0283] In some embodiments, determining the first sample of the first template sample among the reference template samples of the N reference blocks includes: rounding off the square value of the pixel reference value of the first template sample to determine the pixel reference value of the first sample.
[0284] Exemplarily, the first sample can be a non-linear term sample, and the non-linear term sample can include multiple non-constant parameters. For example, the non-linear term sample can include non-linear parameters corresponding to each pixel point in the reference template sample. When deriving the weighted fusion weight, the non-linear term NonLinearTerm_T is constructed based on the reference template sample. Exemplarily, one reference template sample with the serial number 0 is selected from the reference template samples corresponding to N candidate BVs for construction.
[0285] Specifically: for m = 0, 1…, M - 1: NonLinearTerm_T n,m =(refT n,m *refT n,m +MidVal) >> bitDepth
[0286] where n is 0, 1, … or N - 1, representing a certain reference template sample among the N reference template samples; MidVal is 1 << (bitDepth - 1), and bitDepth is the image bit depth.
[0287] For each reference block corresponding to the N reference template samples, when applying the weighted fusion weight, the non-linear term NonLinearTerm_Block is constructed based on the reference block. Exemplarily, the reference block corresponding to the serial number 0 is selected to determine the non-linear term.
[0288] Specifically: for x = 0, 1…nTbW - 1, y = 0…nTbH - 1: NonLinearTerm_Block n,x,y =(refBlock n,x,y *refBlock n,x,y +MidVal) >> bitDepth
[0289] where n is 0, 1, … or N - 1, representing a certain reference block among the N reference blocks; MidVal is 1 << (bitDepth - 1), and bitDepth is the image bit depth.
[0290] In some embodiments, the first parameter sample includes a second sample; determining the first parameter sample includes: determining the second sample according to the image pixel range.
[0291] Exemplarily, the second sample can be the offset value Bias, and the offset value Bias in the process of deriving the weight and applying the weight can be any constant in the image pixel range [0, (1 << bitDepth) - 1]. Exemplarily, Bias is set to 1 << (bitDepth - 1).
[0292] Since BiasTerm is a constant, it needs to be expanded into a matrix representation as BiasTerm in the actual calculation process. Specifically:
[0293] For each of the N reference template samples: for m = 0, 1…, M-1, BiasTerm m =Bias
[0294] For each reference block corresponding to N reference template samples: for x = 0, 1 ... nTbW-1, y = 0 ... nTbH-1, BiasTerm x,y =Bias.
[0295] It should be noted that when adding the first sample or the second sample, N+1 weighted fusion weights need to be derived. For the convenience of description, the variable P is used to record the number of weighted weights, where P = N+1, and the reference template samples, the first sample / the second sample are uniformly referred to as matching reference samples refTN and refTN+1, so that all reference quantities involved in the calculation can be uniformly expressed as refTp; similarly, the reference block, the first sample / the second sample are uniformly referred to as the reconstructed reference sample refBlockp, where p = 0, 1…, P-1. Specifically, the MSE minimization process takes the autocorrelation matrix of the first P matching reference samples refT, the cross-correlation vector of the first P matching reference samples refT and the template sample curT of the current coding block as input, and outputs the weight of the reference block and the first sample weight / the second sample weight.
[0296] It should be noted that, in order to add the first sample and the second sample, N+2 weighted fusion weights need to be derived. For the convenience of description, the variable P is used to record the number of weighted weights, where P = N+2, and the reference template samples, the first sample and the second sample are uniformly referred to as matching reference samples refTN, refTN+1 and refTN+2, so that all reference quantities involved in the calculation can be uniformly expressed as refTp; similarly, the reference block, the first sample and the second sample are uniformly referred to as reconstructed reference samples refBlockp, where p = 0, 1…, P-1. Specifically, the MSE minimization process takes the autocorrelation matrix of the first P matching reference samples refT, the cross-correlation vector of the first P matching reference samples refT and the template sample curT of the current coding block as input, and outputs the weight of the reference block, the weight of the first sample and the weight of the second sample.
[0297] In other embodiments, determining the weighted fusion weight parameters of N reference blocks includes: determining the template sample of the current block, and determining the reference template samples of the N reference blocks; determining the template matching parameters of the template sample of the current block and the reference template sample based on the template matching criterion; and determining the weighted fusion weight parameters of the N reference blocks according to the weight model preset by the template matching parameters.
[0298] In some embodiments, the weight model can be constructed based on a nonlinear function, and the weight model can be understood as a nonlinear weight model. The input of the weight model is the template matching parameters between the template curT of the current block and the reference template refTn, and the output is the weight parameter. Exemplarily, the nonlinear function includes but is not limited to: a nonlinear normalization function, a nonlinear exponential normalization function, etc. The template matching parameters include but are not limited to SAD(refTn), MAD(refTn), correlation coefficient R(refTn), etc. between the current block template curT and the reference template refTn.
[0299] Exemplarily, the weight model is configured as follows: obtaining a first intermediate value based on the template matching parameter and the first offset value; determining a cumulative sum of N first intermediate values; and determining a weighted fusion weight value of the N reference blocks based on a ratio of the first intermediate value to the cumulative sum of the N first intermediate values. A calculation formula may be as follows:
[0300] The offset is a preset value, for example, the offset is 1.
[0301] Exemplarily, the weight model is configured as follows: determining the cumulative sum of template matching parameters of N reference template samples; and determining the weighted fusion weight value of the N reference blocks based on the ratio of the template matching parameter to the cumulative sum of the template matching parameters. A calculation formula can be as follows:
[0302] For example, the weight model is constructed based on the Softmax function. The control parameters of the weight model are determined according to the size of the current block and / or the template type. According to the current block, a calculation formula can be as follows:
[0303] Where S is a model control parameter. Under certain conditions, the parameter S can be adjusted to adjust the weight model. For example, the parameter S can be related to the current block size or the template type.
[0304] In addition to the above nonlinear weight model, the weighted fusion weights of each reference block can also be directly set to the average value, that is, the average value of the pixels of N reference blocks is calculated as the predicted value of the pixel of the current block. For example:
[0305] S1603: Perform weighted fusion on the N reference blocks according to their weighted fusion weight parameters to determine a prediction block for the current block;
[0306] The prediction block is obtained by weighted fusion based on each reference block and its corresponding weighted fusion weight parameter. Specifically, the pixel reference value of each reference block is multiplied by its corresponding weight parameter and then accumulated to obtain the current prediction value. The calculation formula is as follows:
[0307] For x = 0 ... nTbW-1, y = 0 ... nTbH-1, the predicted value is calculated as follows:
[0308] Each predicted value predSamples x,y The spatial storage is the output prediction block of IBC Fusion.
[0309] It should be noted that this application proposes an improved IBC process for determining the block vector BV and generating prediction values. Specifically, an IBC fusion technique is proposed. As shown in Figure 18, based on the N reference blocks determined by BVn, the N reference blocks are fused according to the corresponding weighted fusion parameters Wn to obtain the prediction block of the current block. This fully utilizes the reconstructed block information of different matching templates, improving prediction accuracy and encoding and decoding efficiency.
[0310] Furthermore, in some embodiments, before weighted fusion of the N reference blocks, the process further includes: correcting or enhancing the N reference blocks to determine the processed N reference blocks. Exemplarily, the N reference blocks are filtered to determine the filtered N reference blocks. The filtering scheme may be a traditional filtering method such as bilateral filtering or mean filtering, or a neural network-based filtering enhancement. The correction scheme may also utilize matching template information to correct the matched reconstructed blocks.
[0311] In some embodiments, the method further includes: determining a template sample of the current block; determining a matching reference sample based on the N reference template samples; and determining coefficients of a target filter based on the template sample of the current block and the matching reference samples.
[0312] In some embodiments, the coefficients of the target filter are determined based on the template samples and matching reference samples of the current block, including: determining template matching parameters based on the template samples and matching reference samples of the current block; and deriving weight parameters based on the template matching parameters to determine the coefficients of the target filter.
[0313] In some embodiments, based on the template samples of the current block and the matching reference samples, weighted fusion weight parameters of the reconstructed reference samples corresponding to the matching reference samples are determined, including: determining the autocorrelation parameters based on the pixel reference values of the samples in the matching reference samples; determining the cross-correlation parameters based on the pixel reference values of the template samples of the current block and the pixel reference values of the samples in the matching reference samples; and determining the coefficients of the target filter based on the autocorrelation parameters and the cross-correlation parameters.
[0314] In some embodiments, the matching reference sample further includes a second parameter sample. Exemplarily, the second parameter sample may be an offset value Bias, and the offset value Bias in the process of deriving the filtering coefficient may be any constant in the image pixel range [0, (1<<bitDepth)-1]. Exemplarily, Bias is set to 1<<(bitDepth-1).
[0315] The specific operation of the correction of the matching reconstruction block using the matching template information is as follows: For the matching reference sample refTn and its corresponding reconstructed reference sample RefBlockn, calculate the parameter vector Cn according to the template matching parameter between the reconstructed value of the matching reference sample refTn and the pixel value of the template sample curT of the current block, and use the parameter vector Cn to correct the reference block RefBlockn to obtain the finally corrected reference block RefBlock’ n 。
[0316] Exemplarily, the parameter vector Cn is derived by minimizing the MSE between the reconstructed value of the matching reference sample refTn and the pixel value of the template sample curT of the previous block. The parameter vector Cn can be regarded as an L-tap filter, and the specific method for obtaining the parameter vector Cn is as follows: For each candidate template refTn, where n = 0, 1…, N-1, specifically, the process of minimizing the MSE takes the autocorrelation matrix of the matching reference sample refT, and the cross-correlation vector between the matching reference sample refT and the template sample curT of the current coding block as inputs, and outputs the parameter vector Cn.
[0317] In some embodiments, first determine the matching reference sample for calculating the filter coefficient. The reconstructed value of the matching reference sample refTn and the pixel value of the template sample curT of the previous block are used to minimize the MSE for derivation, and a set of filter coefficients can be derived, that is:
[0318] To facilitate the representation of the calculation formula of MSE, here E is used to represent the mean square error MSE, that is:
[0319] where, refpredT k represents the input reconstructed pixel value, curT k represents the reconstructed pixel value of the current block template, K is the number of pixels in the template, k is a certain pixel in the template, and it can also be represented by (i, j) as the pixel coordinate position in the template, (i, j) ∈ R, c l represents the required filter coefficient. The filter coefficient c for each reference block is derived by minimizing the MSE l The specific steps are as follows:
[0320] (1) First, for cl Find the partial derivative and make it equal to 0:
[0321] Arranged:
[0322] (2) After determining the reference template sample refT n Then expand the equation obtained in (1) into a matrix form:
[0323] Among them, for A, the pixel reference value in the reference template sample is represented by refT[k][l], and A represents the autocorrelation parameter of refT[k][l], which is as follows
[0324] For B, the pixel reference value in the template sample of the current block is represented by curT[k], and B represents the cross-correlation parameter of curT[k] and refT[k][l], as follows:
[0325] (3) The autocorrelation parameters and cross-correlation parameters are both known quantities. Solving the linear equations in (2) can obtain the filter weight coefficients c0,…cL-1, that is, the filter coefficients of a candidate reconstructed block in the modified parameter vector Cn.
[0326] Corrected reference block RefBlock' n for:
[0327] For x=0…nTbW-1, y=0…nTbH-1:
[0328] In the embodiment of the present application, for the target filter, it is also necessary to determine the number of coefficients of the target filter and the shape of the target filter, etc. The number of coefficients of the target filter and the shape of the target filter can be preset fixed values or directly determined by the decoded code stream.
[0329] In some embodiments, for the number of coefficients of the target filter, the method may further include: the number of coefficients of the target filter is equal to a first preset value.
[0330] In some embodiments, for the number of coefficients of the target filter, the method may further include: decoding the code stream to determine the number of coefficients of the target filter.
[0331] It should be noted that the number of coefficients of the target filter can be represented by nTap. For example, the value of nTap can be 4, 5, 6, 7, 8, 9, etc., but is not specifically limited.
[0332] It should also be noted that the number of coefficients of the target filter can also be called the target filter tap number. Here, the number of coefficients of the target filter can be a preset constant value, or it can be determined by decoding the code stream, or even determined based on the syntax element identification information of the current block.
[0333] In some embodiments, regarding the shape of the target filter, the method may further include: the target filter is a one-dimensional or two-dimensional filter of a preset shape.
[0334] In some embodiments, regarding the shape of the target filter, the method may further include: decoding the code stream to determine the shape of the target filter.
[0335] In some embodiments, regarding the shape of the target filter, the method may further include: decoding the code stream, and determining a value of a filter shape parameter, wherein the filter shape parameter indicates the shape of the target filter.
[0336] It should be noted that the filter shape parameter can be represented by FilterIdx, which is used to indicate the shape of the target filter. For example, the shape of the target filter can be diamond, rectangle, cross, stripe, or even a one-dimensional filter or a two-dimensional filter, but is not specifically limited thereto.
[0337] Exemplarily, if the value of FilterIdx is equal to 0, the shape of the target filter is determined to be a diamond; if the value of FilterIdx is equal to 1, the shape of the target filter is determined to be a cross; if the value of FilterIdx is equal to 2, the shape of the target filter is determined to be a rectangle.
[0338] It should also be noted that the shape of the target filter may be a preset shape, or may be determined by decoding a code stream, or may even be determined according to syntax element identification information of the current block.
[0339] Assuming the number of filter taps, nTap, is 5, the shape of the filter (or "filter template") is shown in Figure 19A, where C0 to C4 are the tap coefficients of the filter. The dot filled with the grid corresponding to tap coefficient C0 represents the reconstructed pixel at the corresponding position of the predicted pixel in the reference block; the remaining white-filled dots represent the reconstructed pixels adjacent to the current spatial position in the reference block. Thus, based on the filter of Figure 19A, the resulting filtered pixels are shown as the black-filled dots in Figure 19B.
[0340] In some embodiments, the method further comprises: determining a first parameter sample, and a weighted fusion parameter of the first parameter sample;
[0341] The method includes performing weighted fusion on the N reference blocks according to weighted fusion weight parameters of the N reference blocks to determine a prediction block of the current block, including: performing weighted fusion on the N reference blocks and the first parameter sample according to the weighted fusion weight parameters of the N reference blocks and a weighted fusion value of the first parameter sample to determine the prediction block of the current block.
[0342] In some embodiments, the first parameter sample includes a first sample; and determining the first parameter sample includes: determining the first sample based on a first reference block among the N reference blocks.
[0343] In some embodiments, determining the first sample according to a first reference block among the N reference blocks includes rounding off the square of the pixel reference value of the first reference block to determine the pixel reference value of the first sample.
[0344] In some embodiments, the first parameter sample includes a second sample; and determining the first parameter sample includes determining the second sample based on an image pixel range. Exemplarily, the median of the image pixel range is used as the second sample. It should be noted that when the process of deriving weighted fusion weight parameters and the process of applying weighted fusion weight parameters include a second sample, the values of the second sample in the derivation process and the application process may be the same or different.
[0345] S1604: Determine a reconstructed block of the current block according to the predicted block of the current block.
[0346] In some embodiments, the method further includes: decoding a code stream to determine a prediction residual of a current block; and determining a reconstructed block of the current block according to the prediction block and the prediction residual of the current block.
[0347] In some embodiments, the template matching criterion may also be SAD, which is calculated as follows:
[0348] Where SAD(refT) is the sum of the absolute differences between the current template curT and the searched reference template. The SAD-based screening criterion is: compare and record the block vectors BV corresponding to the first N matching templates with the smallest SAD cost.
[0349] Specifically, for N reference templates, the SAD between the nth reference template and the current block template is as follows:
[0350] Medium SAD(refT n ) is the sum of the absolute errors between the template of the current block and the nth reference template.
[0351] In some embodiments, the template matching criterion may also be the NCC normalized correlation coefficient, which is calculated as follows:
[0352] Where refT is the matching template in the search process, curT is the current block template, M is the number of pixels of the current block template, refT Avg is the average pixel value of the reference template searched, curT Avg is the average pixel value of the current block template, and R(refT) is the correlation coefficient between the current block template and the searched reference template.
[0353] The NCC comparison criterion is: sort and record the block vectors BV corresponding to N reference templates with larger correlation coefficients R.
[0354] Specifically, for N reference templates, the correlation coefficient between the nth reference template and the current block template is as follows:
[0355] in is the average pixel value of the nth candidate template, R(refT n ) is the correlation coefficient between the current coding block template and the nth candidate template. It is worth mentioning that the range of the NCC normalized correlation coefficient R is [-1, 1]. The larger R is, the stronger the correlation is. It should be noted that the template matching criterion used in the embodiment of the present application can also use any other template matching criterion in the relevant technology, which will not be repeated here.
[0356] In some embodiments, in some embodiments, determining the N reference blocks of the current block further includes: determining the reference block of the current block based on other intra-frame prediction modes other than block matching. That is, a portion of the N reference blocks are determined based on block vectors, and a portion of the reference blocks are determined based on one or more other intra-frame prediction modes. The obtained multiple reference blocks are fused to determine the prediction block of the current block. It should be noted that the fusion scheme provided in the embodiments of the present application can also be implemented in conjunction with various sub-modes under IBC, including but not limited to ordinary IBC merge, IBC TM merge, MBVD, IBC CIIP, IBC ABVP, etc.
[0357] This technical solution fully utilizes the reconstructed block information from different matching templates during the reconstruction region search process, rather than simply considering the reconstructed block information corresponding to the template with the lowest matching cost. This improves prediction accuracy and encoding and decoding efficiency. Furthermore, this solution fully utilizes the matching template information to adaptively assign weights to reference blocks, taking into account the varying importance of different reconstructed block information for the current block prediction, further improving prediction accuracy and encoding and decoding efficiency.
[0358] In another embodiment of the present application, referring to FIG20 , a schematic flow chart of an encoding method provided by an embodiment of the present application is shown. As shown in FIG20 , the method may include:
[0359] S2001: Determine N reference blocks for the current block, where N is an integer greater than 1.
[0360] In some embodiments, determining N reference blocks for the current block includes: determining a first block vector for the current block based on a block matching criterion; and determining a reference block for the current block based on the first block vector of the current block. In some embodiments, searching the position indicated by the first block vector to determine an optimal block vector, and determining the reference block indicated by the optimal block vector. In some embodiments, searching the position indicated by the first block vector to determine at least two block vectors, and determining at least two reference blocks indicated by the at least two block vectors.
[0361] In some embodiments, determining the N reference blocks of the current block includes: determining N block vectors of the current block according to a block matching criterion; and determining the N reference blocks of the current block according to the N block vectors of the current block.
[0362] In some embodiments, determining N reference blocks for a current block includes: constructing a block vector candidate list for the current block; determining a block vector for the current block based on the block vector candidate list; and determining a reference block for the current block based on the block vector of the current block. In practical applications, the block vector candidate list is a BV candidate list determined based on a block matching criterion, such as an IBC merge, IBC TMmerge, or IBC ABVP list.
[0363] In some embodiments, constructing a block vector candidate list for the current block includes constructing a first block vector candidate list for the current block based on a block matching criterion. Here, the first block vector candidate list may be an IBC merge list or an IBC ABVP list. The basic process for constructing an IBC ABVP list is the same as that for constructing an IBC merge list, but the maximum number of candidates differs (for example, the length of the IBC merge candidate list is defined as 6, while the length of the IBC ABVP candidate list is defined as 2).
[0364] Furthermore, determining a block vector of the current block based on the block vector candidate list includes: determining template matching parameters corresponding to at least some of the block vectors in the first block vector candidate list based on a template matching criterion; sorting at least some of the block vectors based on the template matching parameters to determine a sorted block vector candidate list; and determining the block vector of the current block based on the sorted block vector candidate list.
[0365] In some embodiments, after determining the number of candidate BVs N, it is necessary to select N relatively matching block vectors BV using a comparison criterion. For example, for an IBC merge list, a matching template is obtained based on block vector BVn, that is, based on template offsets pXn and pYn. The template matching cost is calculated and the BVs corresponding to the N matching templates with the lowest cost are recorded. These N matching templates are also referred to as reference templates. The template matching criterion can be one of the cost functions used to measure patterns, such as SAD, SATD, MSE, MAD, RDO, correlation coefficient, and PSNR.
[0366] For example, the template matching criterion is MAD (Mean Absolute Difference), which is calculated as follows:
[0367] Where refT is the matching template in the BV candidate list, curT is the current block template, M is the number of pixels of the current coding block template, and MAD(refT) is the mean absolute difference between the current coding block template curT and the matching template corresponding to the BV candidate.
[0368] The MAD-based screening criterion is: compare and record the block vectors BV corresponding to the N matching templates with the smallest MAD cost.
[0369] Specifically, for N candidate templates, the MAD between the nth candidate template and the current coding block template is as follows:
[0370] Where refTn is the n-th candidate template, MAD(refTn) is the mean absolute difference between the current block template curT and the n-th candidate template, n=0,…,N-1.
[0371] In some embodiments, constructing a block vector candidate list for the current block includes: constructing a first block vector candidate list for the current block based on a block matching criterion; and searching a search range pointed to by at least some block vectors in the first block vector candidate list based on a template matching criterion to determine a second block vector candidate list. Here, the first block vector candidate list can be an IBC merge or an IBC ABVP list, wherein the basic establishment process of the IBC ABVP list is consistent with that of the IBC merge, but the maximum number of candidates of the two is inconsistent (for example, the length of the IBC merge candidate list is defined as 6, and the length of the IBC ABVP candidate list is defined as 2). The second block vector candidate list can be an IBC TMmerge. In the IBC TM merge mode, after obtaining the bvL according to the IBC merge, the BV can also be locally refined using the TM. The specific operation is to search within a small range centered on the obtained bvL, and select the optimal one or more BVs within the range as the final BV based on the template matching parameters.
[0372] In other embodiments, determining a block vector for a current block based on a block vector candidate list includes: determining N block vectors for the current block based on the block vector candidate list. Exemplarily, the block vector candidate list includes at least N block vectors, determining the first N block vectors in the block vector candidate list; and determining N reference blocks to which the N block vectors point.
[0373] In some embodiments, the value of N is determined to be a preset value. In some embodiments, the value of N is determined based on the value of a first identification parameter of the current block. In some embodiments, the value of a first syntax element is determined based on the value of the first identification parameter; the first syntax element is encoded, and the resulting coded bits are written into the bitstream. In some embodiments, the method further comprises: determining at least two candidate values for N; determining, based on the candidate values, a prediction block of the current block corresponding to the candidate values; determining the value of the first identification parameter based on the prediction block and the original block of the current block corresponding to the candidate values; or determining at least two candidate values for N; determining, based on the candidate values, a prediction template sample corresponding to the candidate value; determining, based on the candidate values, template matching parameters of the prediction template sample and the template sample of the current block based on the template matching criterion; determining the value of the first identification parameter based on the template matching parameters.
[0374] It should be noted that N can be a constant preset by the codec, such as 2, 3, 4, or 5. N can also be within a certain range, such as any integer between 2 and 6. The range of N can be pre-set, and the value of N can be determined based on a template matching criterion. Alternatively, the optimal N value can be determined at the codec and transmitted to the decoder in the form of a bitstream. The cost function used to measure the performance of the fusion mode can be one of SAD, SATD, MSE, MAD, RDO, etc.
[0375] Obtain N block vectors BV, and directly obtain the reference block RefBlockn in the current image based on BVn, where the horizontal offset of BVn is pXn and the vertical offset is pYn, where n = 0, 1…, N-1.
[0376] It is implemented by simple translation copy. The specific operation is: for x = 0...nTbW-1, y = 0...nTbH-1, RefBlockn[x][y] = recSamples[x+pXn][y+pYn]
[0377] Where recSamples represents the reconstructed pixel values of the current image. After obtaining N reference blocks RefBlock, it is necessary to determine the weight parameter Wn for weighted fusion of the N reference blocks. The weighted fusion is achieved using the reference blocks RefBlockn and the weight parameter Wn.
[0378] In some embodiments, the method further includes: determining whether the current block uses a fusion prediction mode according to a value of a second identification parameter of the current block.
[0379] In some embodiments, the method further includes: determining a value of a second syntax element based on a value of a second identification parameter of the current block; encoding the second syntax element of the current block. Alternatively, determining at least two candidate prediction modes; determining prediction template samples corresponding to the candidate prediction modes based on the at least two candidate prediction modes; determining template matching parameters between the prediction template samples and template samples of the current block based on a template matching criterion; determining an optimal prediction mode based on the template matching parameters; and determining a value of the second identification parameter based on the optimal prediction mode.
[0380] In some embodiments, the value of the second identification information is a first value, which determines that the current block uses the fusion prediction mode; the value of the second identification information is a second value, which determines that the current block does not use the fusion prediction mode.
[0381] In some embodiments, the method further includes: if the current block uses a fusion prediction mode, executing methods S1601 to S1604. In some embodiments, the method further includes: if the current block does not use a fusion prediction mode, determining a first reference block for the current block; and determining a prediction block for the current block based on the first reference block. Exemplarily, determining a first block vector for the current block, and determining the first reference block based on the first block vector.
[0382] Exemplarily, an isFusion_Flag (which can be understood as the second identification parameter or the second syntax element) is set. If it is 1, the two BVs with the best cost are derived by the template matching criterion at the encoding and decoding ends for weighted fusion. If it is 0, no weighted fusion is performed.
[0383] S2002: Determine weighted fusion weight parameters of N reference blocks;
[0384] It should be noted that before performing weighted fusion, the weighted fusion weight parameters Wn of the N reference blocks (which can be represented as RefBlock) must be determined. The weight parameters can be predefined values or adaptively calculated using template matching parameters, block matching parameters, pixel values, etc.
[0385] It should be noted that the weight parameters of different reference blocks may be equal or unequal. In some embodiments, determining the weighted fusion weight parameters of the N reference blocks includes: determining the weighted fusion weight parameters of the N reference blocks to be preset weight parameters.
[0386] In some embodiments, determining weighted fusion weight parameters of N reference blocks includes: determining a template sample of a current block, and determining reference template samples of N reference blocks; determining a matching reference sample based on the reference template samples of the N reference blocks; determining a weighted fusion weight parameter of a reconstructed reference sample corresponding to the matching reference sample based on the template sample of the current block and the matching reference sample; wherein the matching reference sample includes N reference template samples, and the weighted fusion weight parameter of the reconstructed reference sample includes the weighted fusion weight parameter of the N reference blocks.
[0387] Here, the matching reference samples are applied to the process of deriving weighted fusion weight parameters; the reconstructed reference samples are applied to the process of applying weighted fusion weight parameters, and a set of weighted fusion weight parameters derived from the matching reference samples are applied to the weighted fusion of the reconstructed reference samples corresponding to the matching reference samples.
[0388] In some embodiments, determining a matching reference sample based on the reference template samples of N reference blocks includes: determining a first parameter sample; determining a matching reference sample based on the reference template samples of the N reference blocks and the first parameter sample; and reconstructing the weighted fusion weight parameters of the reference sample also including the weighted fusion weight parameters of the first parameter sample.
[0389] In some embodiments, the first parameter sample includes a first sample; and determining the first parameter sample includes: determining the first sample according to a first template sample among the reference template samples of the N reference blocks.
[0390] In some embodiments, determining the first sample of the first template sample among the reference template samples of the N reference blocks includes: rounding off the square value of the pixel reference value of the first template sample to determine the pixel reference value of the first sample.
[0391] In some embodiments, the method further includes: determining template matching parameters of the template sample of the current block and the reference template sample based on a template matching criterion; and determining the template sample corresponding to the best template matching parameter as the first template sample.
[0392] In some embodiments, the first parameter sample includes: a second sample; and determining the first parameter sample includes: determining the second sample based on an image pixel range.
[0393] In some embodiments, based on the template sample and the matching reference sample of the current block, the weighted fusion weight parameters of the reconstructed reference sample corresponding to the matching reference sample are determined, including: determining the template matching parameters based on the template sample and the matching reference sample of the current block; deriving the weight parameters based on the template matching parameters to determine the weighted fusion weight parameters of the reconstructed reference sample.
[0394] In some embodiments, based on the template sample of the current block and the matching reference sample, the weighted fusion weight parameters of the reconstructed reference sample corresponding to the matching reference sample are determined, including: determining the autocorrelation parameter based on the pixel reference value of the sample in the matching reference sample; determining the cross-correlation parameter based on the pixel reference value of the template sample of the current block and the pixel reference value of the sample in the matching reference sample; and determining the weighted fusion weight value of the candidate reconstructed sample corresponding to the matching reference sample based on the autocorrelation parameter and the cross-correlation parameter.
[0395] In some embodiments, determining the weighted fusion weight parameters of the N reference blocks includes: determining the weighted fusion weight parameters of the N reference blocks as preset weight parameters.
[0396] In some embodiments, determining weighted fusion weight parameters of N reference blocks includes: determining a template sample of a current block, and determining reference template samples of N reference blocks; determining template matching parameters of the template sample of the current block and the reference template sample based on a template matching criterion; and determining weighted fusion weight parameters of the N reference blocks according to a weight model preset by the template matching parameters.
[0397] In some embodiments, the weight model is configured as follows: obtaining a first intermediate value based on the template matching parameters and the first offset value; determining the cumulative sum of N first intermediate values; and determining a weighted fusion weight value of N reference blocks based on the ratio of the first intermediate value to the cumulative sum of the N first intermediate values.
[0398] In some embodiments, the weight model is configured to: determine the cumulative sum of template matching parameters of N reference template samples; and determine the weighted fusion weight value of the N reference blocks based on the ratio of the template matching parameter to the cumulative sum of the template matching parameters.
[0399] In some embodiments, the weight model is configured to use the template matching parameters of the N reference template samples as input values of the Softmax function to determine the weighted fusion weight values of the N reference blocks.
[0400] In some embodiments, the method further comprises: determining a control parameter of the weight model according to a size of the current block.
[0401] In some embodiments, the method further comprises: weighting the control parameters of the model according to the template type of the current block.
[0402] In some embodiments, determining the weighted fusion weight parameter of N reference blocks includes: determining the weighted fusion weight parameter of the reference block to be one-N.
[0403] S2003: performing weighted fusion on the N reference blocks according to weighted fusion weight parameters of the N reference blocks to determine a prediction block for the current block;
[0404] The prediction block is obtained by weighted fusion based on each reference block and its corresponding weighted fusion weight parameter. Specifically, the pixel reference value of each reference block is multiplied by its corresponding weight parameter and then accumulated to obtain the current prediction value. The calculation formula is as follows:
[0405] For x = 0 ... nTbW-1, y = 0 ... nTbH-1, the predicted value is calculated as follows:
[0406] Each predicted value predSamples x,y The spatial storage is the output prediction block of IBC Fusion.
[0407] It should be noted that this application proposes an improved IBC process for determining the block vector BV and generating prediction values. Specifically, an IBC fusion technique is proposed. As shown in Figure 18, based on the N reference blocks determined by BVn, the N reference blocks are fused according to the corresponding weighted fusion parameters Wn to obtain the prediction block of the current block. This fully utilizes the reconstructed block information of different matching templates, improving prediction accuracy and encoding and decoding efficiency.
[0408] Further, in some embodiments, before performing weighted fusion on N reference blocks, it further includes: correcting or image enhancing the N reference blocks to determine the processed N reference blocks. Exemplarily, filtering the N reference blocks to determine the filtered N reference blocks. The filtering scheme can be a traditional filtering method such as bilateral filtering, mean filtering, etc., or filtering enhancement based on a neural network; the correction scheme can also use the matching template information to correct the matching reconstruction blocks.
[0409] In some embodiments, the method further includes: determining the template sample of the current block; determining the matching reference sample according to the N reference template samples; and determining the coefficients of the target filter according to the template sample of the current block and the matching reference sample.
[0410] In some embodiments, determining the coefficients of the target filter according to the template sample of the current block and the matching reference sample includes: determining the template matching parameter according to the template sample of the current block and the matching reference sample; and deriving the weight parameter according to the template matching parameter to determine the coefficients of the target filter.
[0411] In some embodiments, determining the weighted fusion weight parameter of the reconstruction reference sample corresponding to the matching reference sample according to the template sample of the current block and the matching reference sample includes: determining the autocorrelation parameter according to the pixel reference value of the sample in the matching reference sample; determining the cross-correlation parameter according to the pixel reference value of the template sample of the current block and the pixel reference value of the sample in the matching reference sample; and determining the coefficients of the target filter according to the autocorrelation parameter and the cross-correlation parameter.
[0412] In some embodiments, the matching reference sample further includes a second parameter sample. Exemplarily, the second parameter sample can be an offset value Bias, and the offset value Bias in the process of deriving the filtering coefficient can be any constant in the image pixel range [0, (1 << bitDepth) - 1]. Exemplarily, set Bias to 1 << (bitDepth - 1).
[0413] S2004: Determine the prediction residual of the current block according to the prediction block of the current block.
[0414] In some embodiments, the method further includes: encoding the prediction residual of the current block and writing the obtained encoded bits into the code stream.
[0415] This technical solution fully utilizes the reconstructed block information from different matching templates during the reconstruction region search process, rather than simply considering the reconstructed block information corresponding to the template with the lowest matching cost. This improves prediction accuracy and encoding and decoding efficiency. Furthermore, this solution fully utilizes the matching template information to adaptively assign weights to reference blocks, taking into account the varying importance of different reconstructed block information for the current block prediction, further improving prediction accuracy and encoding and decoding efficiency.
[0416] In another embodiment of the present application, based on the same inventive concept as the above embodiment, see FIG21, which shows a schematic diagram of the composition structure of an encoder provided by an embodiment of the present application. As shown in FIG21, the encoder 210 may include: a first determination unit 2101 and a first prediction unit 2102; wherein,
[0417] The first determining unit 2101 is configured to determine N reference blocks of the current block, where N is an integer greater than 1;
[0418] A first determining unit 2101 is configured to determine weighted fusion weight parameters of N reference blocks;
[0419] The first prediction unit 2102 is configured to perform weighted fusion on the N reference blocks according to weighted fusion weight parameters of the N reference blocks to determine a prediction block for the current block;
[0420] The first determining unit 2101 is configured to determine a prediction residual of the current block according to a prediction block of the current block.
[0421] It can be understood that each functional unit of the encoder also executes the encoding method described in any one of the aforementioned embodiments, which will not be described in detail here.
[0422] 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.
[0423] 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.
[0424] Therefore, an embodiment of the present application provides a computer-readable storage medium, which is applied to the encoder 210. The computer-readable storage medium stores a computer program, and when the computer program is executed by the first processor, it implements the encoding method described in any one of the aforementioned embodiments.
[0425] Based on the composition of the encoder 210 and the computer-readable storage medium, refer to Figure 22, which shows a specific hardware structure diagram of the encoder 210 provided in an embodiment of the present application. As shown in Figure 22, the encoder 210 may include: a first communication interface 2201, a first memory 2202 and a first processor 2203; each component is coupled together through a first bus system 2204. It can be understood that the first bus system 2204 is used to achieve connection and communication between these components. In addition to the data bus, the first bus system 2204 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 2204 in Figure 22. Among them,
[0426] The first communication interface 2201 is used to receive and send signals when sending and receiving information with other external network elements;
[0427] A first memory 2202 is used to store computer programs that can be run on the first processor 2103;
[0428] The first processor 2203 is configured to, when running the computer program, execute:
[0429] Determine N reference blocks of the current block; where N is an integer greater than 1;
[0430] Determine weighted fusion weight parameters of N reference blocks;
[0431] Perform weighted fusion on the N reference blocks according to their weighted fusion weight parameters to determine a prediction block for the current block;
[0432] A prediction residual of the current block is determined based on the prediction block of the current block.
[0433] It is understood that the first memory 2202 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 2202 of the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.
[0434] The first processor 2203 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 2203. The above-mentioned first processor 2203 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 as a hardware decoding processor, or can be executed 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, or electrically erasable programmable memory, registers, etc. The storage medium is located in the first memory 2202 , and the first processor 2203 reads the information in the first memory 2202 and completes the steps of the above method in combination with its hardware.
[0435] It is 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.
[0436] Optionally, as another embodiment, the first processor 2203 is further configured to execute the encoding method described in any one of the aforementioned embodiments when running the computer program.
[0437] This embodiment provides an encoder that, during the search for a reconstruction region, fully utilizes reconstructed block information from different matching templates, rather than simply considering the reconstructed block information corresponding to the template with the lowest matching cost, thereby improving prediction accuracy and coding efficiency. Furthermore, the encoder fully utilizes the matching template information to adaptively assign weights to reference blocks, taking into account the varying importance of different reconstructed block information for the prediction of the current block, further improving prediction accuracy and coding efficiency.
[0438] In another embodiment of the present application, based on the same inventive concept as the above embodiment, refer to FIG23 , which shows a schematic diagram of the structure of a decoder 230 provided by the embodiment of the present application. As shown in FIG23 , the decoder 230 may include: a second determination unit 2301 and a second prediction unit 2302; wherein,
[0439] The second determining unit 2301 is configured to determine N reference blocks of the current block; wherein N is an integer greater than 1;
[0440] The second determining unit 2301 is further configured to determine weighted fusion weight parameters of the N reference blocks;
[0441] The second prediction unit 2302 is configured to perform weighted fusion on the N reference blocks according to weighted fusion weight parameters of the N reference blocks to determine a prediction block for the current block;
[0442] The second determining unit 2301 is further configured to determine a reconstructed block of the current block according to the predicted block of the current block.
[0443] It can be understood that each functional unit of the decoder also performs the decoding method described in any one of the aforementioned embodiments, which will not be described in detail here.
[0444] It is understood that in this embodiment, a "unit" can be a portion of a circuit, a portion of a processor, a portion of a program or software, etc., and can also be a module or a non-modular system. Furthermore, the various components in this embodiment can be integrated into a single processing unit, or each unit can exist physically separately, or two or more units can be integrated into a single unit. The aforementioned integrated units can be implemented in the form of hardware or software functional modules.
[0445] If the integrated unit is implemented as a software functional module and not sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, this embodiment provides a computer-readable storage medium for use in decoder 230. The computer-readable storage medium stores a computer program that, when executed by the second processor, implements any of the decoding methods described in the aforementioned embodiments.
[0446] Based on the composition of the decoder 230 and the computer-readable storage medium, refer to Figure 24, which shows a specific hardware structure diagram of the decoder 230 provided in an embodiment of the present application. As shown in Figure 24, the decoder 230 may include: a second communication interface 2401, a second memory 2402 and a second processor 2403; each component is coupled together through a second bus system 2404. It can be understood that the second bus system 2404 is used to achieve connection and communication between these components. In addition to the data bus, the second bus system 2404 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 second bus system 2404 in Figure 24. Among them,
[0447] The second communication interface 2401 is used to receive and send signals during the process of sending and receiving information between other external network elements;
[0448] The second memory 2402 is used to store computer programs that can be run on the second processor 2403;
[0449] The second processor 2403 is configured to, when running the computer program, execute:
[0450] Determine N reference blocks of the current block; where N is an integer greater than 1;
[0451] Determine weighted fusion weight parameters of N reference blocks;
[0452] Perform weighted fusion on the N reference blocks according to their weighted fusion weight parameters to determine a prediction block for the current block;
[0453] A reconstructed block of the current block is determined according to the predicted block of the current block.
[0454] Optionally, as another embodiment, the second processor 2403 is further configured to execute the decoding method described in any one of the aforementioned embodiments when running the computer program.
[0455] It can be understood that the hardware functions of the second memory 2402 and the first memory 2202 are similar, and the hardware functions of the second processor 2403 and the first processor 2203 are similar; they will not be described in detail here.
[0456] This embodiment provides a decoder that fully utilizes the reconstructed block information of different matching templates during the reconstruction region search process, rather than simply considering the reconstructed block information corresponding to the template with the lowest matching cost, thereby improving prediction accuracy and decoding efficiency. Furthermore, the decoder fully utilizes the matching template information to adaptively assign weights to reference blocks, taking into account the varying importance of different reconstructed block information for the prediction of the current block, further improving prediction accuracy and decoding efficiency.
[0457] In yet another embodiment of the present application, referring to FIG25 , a schematic diagram of the structure of a coding and decoding system provided by an embodiment of the present application is shown. As shown in FIG25 , the coding and decoding system 250 may include an encoder 2501 and a decoder 2502 .
[0458] In the embodiment of the present application, the encoder 2501 may be the encoder described in any one of the aforementioned embodiments, and the decoder 2502 may be the decoder described in any one of the aforementioned embodiments.
[0459] It should be noted that, in this application, the terms "comprise," "include," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or apparatus comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a..." does not preclude the presence of other identical elements in the process, method, article, or apparatus comprising the element.
[0460] The serial numbers of the above embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0461] The methods disclosed in the several method embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments.
[0462] The features disclosed in the several product embodiments provided in this application can be arbitrarily combined without conflict to obtain new product embodiments.
[0463] The features disclosed in the several method or device embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments or device embodiments.
[0464] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims. Industrial Applicability
[0465] In an embodiment of the present application, a block vector candidate list for the current block is constructed; based on the block vector candidate list, N block vectors are determined; wherein N is an integer greater than 1; based on the N block vectors, the N reference blocks are determined; the N reference blocks are weightedly fused to determine the prediction block of the current block; and based on the prediction block of the current block, the prediction residual or reconstructed block of the current block is determined. In this way, during the search process for the reconstructed area, the reconstructed block information of different matching templates is fully utilized, rather than simply considering the reconstructed block information corresponding to the template with the lowest matching cost, thereby improving prediction accuracy and encoding and decoding efficiency. Furthermore, the matching template information is fully utilized to adaptively assign weight values to the reference blocks, taking into account the different importance of different reconstructed block information to the prediction of the current block, further improving prediction accuracy and encoding and decoding efficiency.
Claims
1. A decoding method, applied to a decoder, the method comprising: Determine N reference blocks of the current block; wherein N is an integer greater than 1; Determining weighted fusion weight parameters of the N reference blocks; Performing weighted fusion on the N reference blocks according to weighted fusion weight parameters of the N reference blocks to determine a prediction block of the current block; A reconstructed block of the current block is determined according to the predicted block of the current block.
2. The method according to claim 1, wherein: The determining of N reference blocks of the current block includes: Construct a block vector candidate list for the current block; Determining a block vector of a current block according to the block vector candidate list; According to the block vector of the current block, a reference block of the current block is determined.
3. The method according to claim 2, wherein: The step of constructing a block vector candidate list of the current block includes: Based on the block matching criteria, a first block vector candidate list of the current block is constructed.
4. The method according to claim 3, wherein: The step of determining the block vector of the current block according to the block vector candidate list includes: Based on a template matching criterion, determining template matching parameters corresponding to at least some of the block vectors in the first block vector candidate list; sorting the at least part of the block vectors according to the template matching parameters to determine a sorted candidate list of block vectors; A block vector of a current block is determined according to the sorted block vector candidate list.
5. The method according to claim 2, wherein: The step of constructing a block vector candidate list of the current block includes: Based on the block matching criterion, construct a first block vector candidate list of the current block; Based on the template matching criterion, a second block vector candidate list is determined according to a search range pointed to by at least part of the block vectors in the first block vector candidate list.
6. The method according to any one of claims 2 to 5, wherein: The step of determining the block vector of the current block according to the block vector candidate list includes: According to the block vector candidate list, N block vectors of the current block are determined.
7. The method according to any one of claims 1 to 6, wherein: The method further includes: determining that the value of N is a preset value.
8. The method according to any one of claims 1 to 6, wherein: The method further includes: determining a value of N according to a value of a first identification parameter of the current block.
9. The method according to claim 8, wherein: The method further comprises: Decoding a first syntax element of the current block; determining a value of the first identification parameter according to a value of the first syntax element; or, Determine at least two candidate values of N; determine the prediction template samples corresponding to the candidate values according to the candidate values; determine the template matching parameters of the prediction template samples and the template samples of the current block based on the template matching criteria; determine the value of the first identification parameter according to the template matching parameters.
10. The method according to any one of claims 1 to 9, wherein: The method further includes: determining whether the current block uses a fusion prediction mode according to a value of a second identification parameter of the current block.
11. The method according to claim 10, wherein: The method further comprises: Decoding a second syntax element of the current block; The value of the second identification parameter of the current block is determined according to the value of the second syntax element.
12. The method according to claim 10, wherein: The method further includes: if the current block uses a fusion prediction mode, determining the N reference blocks.
13. The method according to claim 12, wherein: The method further comprises: If the current block does not use the fusion prediction mode, determine the first reference block of the current block; A prediction block of the current block is determined according to the first reference block.
14. The method according to any one of claims 1 to 13, wherein: The determining of the weighted fusion weight parameters of the N reference blocks includes: Determine a template sample of the current block, and determine reference template samples of the N reference blocks; Determine a matching reference sample according to the reference template samples of the N reference blocks; Determine, according to the template sample of the current block and the matching reference sample, a weighted fusion weight parameter of the reconstructed reference sample corresponding to the matching reference sample; The matching reference samples include the N reference template samples, and the weighted fusion weight parameter of the reconstructed reference samples includes The weighted fusion weight parameters of the N reference blocks are included.
15. The method according to claim 14, wherein: The determining, according to the reference template samples of the N reference blocks, a matching reference sample comprises: determining a first parameter sample; Determining the matching reference sample according to the reference template samples of the N reference blocks and the first parameter sample; The weighted fusion weight parameters of the reconstructed reference samples also include the weighted fusion weight parameters of the first parameter samples.
16. The method according to claim 15, wherein: The first parameter sample includes a first sample; The determining the first parameter sample includes: determining the first sample according to a first template sample among the reference template samples of the N reference blocks.
17. The method according to claim 16, wherein: The first template sample among the reference template samples of the N reference blocks, determining the first sample, comprises: A rounding operation is performed on the square value of the pixel reference value of the first template sample to determine the pixel reference value of the first sample.
18. The method according to claim 16 or 17, wherein: The method further comprises: Based on the template matching criterion, determining the template matching parameters of the template sample of the current block and the reference template sample; It is determined that the template sample corresponding to the best template matching parameter is the first template sample.
19. The method according to any one of claims 15 to 18, wherein: The first parameter sample includes: a second sample; The determining the first parameter sample includes: determining the second sample according to an image pixel range.
20. The method according to any one of claims 14 to 19, wherein: The step of determining, according to the template sample of the current block and the matching reference sample, a weighted fusion weight parameter of a reconstructed reference sample corresponding to the matching reference sample comprises: Determine template matching parameters according to the template sample of the current block and the matching reference sample; A weight parameter is derived according to the template matching parameter to determine a weighted fusion weight parameter of the reconstructed reference sample.
21. The method according to any one of claims 14 to 20, wherein: The step of determining, according to the template sample of the current block and the matching reference sample, a weighted fusion weight parameter of a reconstructed reference sample corresponding to the matching reference sample comprises: Determining an autocorrelation parameter according to a pixel reference value of a sample in the matching reference sample; Determining a cross-correlation parameter according to a pixel reference value of a template sample of the current block and a pixel reference value of a sample in the matching reference sample; A weighted fusion weight value of the candidate reconstructed sample corresponding to the matching reference sample is determined according to the autocorrelation parameter and the cross-correlation parameter.
22. The method according to claim 1, wherein: The determining of the weighted fusion weight parameters of the N reference blocks includes: Determine the weighted fusion weight parameter of the N reference blocks as a preset weight parameter.
23. The method according to claim 1, wherein: The determining of the weighted fusion weight parameters of the N reference blocks includes: Determine a template sample of the current block, and determine reference template samples of the N reference blocks; Based on the template matching criterion, determining template matching parameters of the template sample of the current block and the reference template sample; According to the weight model preset by the template matching parameters, weighted fusion weight parameters of the N reference blocks are determined.
24. The method according to claim 23, wherein: The weight model configuration is: Obtaining a first intermediate value according to the template matching parameter and the first offset value; Determine a cumulative sum of N first intermediate values; The weighted fusion weight values of the N reference blocks are determined according to a ratio of the first intermediate value to the cumulative sum of the N first intermediate values.
25. The method according to claim 23, wherein: The weight model configuration is: Determining a cumulative sum of template matching parameters of the N reference template samples; The weighted fusion weight values of the N reference blocks are determined according to the ratio of the template matching parameter to the accumulated sum of the template matching parameters.
26. The method of claim 23, wherein: The weight model configuration is: The template matching parameters of the N reference template samples are used as input values of the Softmax function to determine weighted fusion weight values of the N reference blocks.
27. The method according to claim 26, wherein: The method further includes: determining control parameters of the weight model according to the size of the current block.
28. The method according to claim 26, wherein: The method further includes: controlling parameters of the weight model according to a template type of the current block.
29. The method of claim 1, wherein: The determining of the weighted fusion weight parameters of the N reference blocks includes: The weighted fusion weight parameter of the reference block is determined to be one-N.
30. The method of claim 1, wherein: Before performing weighted fusion on the N reference blocks, the method further includes: The N reference blocks are filtered to determine N filtered reference blocks.
31. The method according to claim 30, wherein: The method further comprises: Determine the template sample of the current block; Determine a matching reference sample according to the N reference template samples; The coefficients of the target filter are determined according to the template samples of the current block and the matching reference samples.
32. The method according to claim 31, wherein: The determining the coefficient of the target filter according to the template sample of the current block and the matching reference sample comprises: Determine template matching parameters according to the template sample of the current block and the matching reference sample; Weight parameters are derived according to the template matching parameters to determine coefficients of the target filter.
33. The method according to claim 31 or 32, wherein: The step of determining, according to the template sample of the current block and the matching reference sample, a weighted fusion weight parameter of a reconstructed reference sample corresponding to the matching reference sample comprises: Determining an autocorrelation parameter according to a pixel reference value of a sample in the matching reference sample; Determining a cross-correlation parameter according to a pixel reference value of a template sample of the current block and a pixel reference value of a sample in the matching reference sample; The coefficients of the target filter are determined according to the autocorrelation parameters and the cross-correlation parameters.
34. The method according to any one of claims 1 to 33, wherein: The method further comprises: Determining a first parameter sample and a weighted fusion parameter of the first parameter sample; The step of performing weighted fusion on the N reference blocks according to the weighted fusion weight parameters of the N reference blocks to determine a prediction block of the current block includes: According to the weighted fusion weight parameters of the N reference blocks and the weighted fusion values of the first parameter samples, the N reference blocks and the first parameter samples are weightedly fused to determine a prediction block of the current block.
35. The method of claim 34, wherein: The first parameter sample includes a first sample; The determining the first parameter sample includes: determining the first sample according to a first reference block among the N reference blocks.
36. The method of claim 35, wherein: The determining the first sample according to a first reference block among the N reference blocks includes: A square value of the pixel reference value of the first reference block is rounded to determine a pixel reference value of the first sample.
37. A method according to any one of claims 34 to 36, wherein: The first parameter sample includes: a second sample; The determining of the first parameter sample includes: determining the second sample according to an image pixel range.
38. A coding method, applied to an encoder, the method comprising: Determine N reference blocks of the current block; wherein N is an integer greater than 1; Determining weighted fusion weight parameters of the N reference blocks; Performing weighted fusion on the N reference blocks according to weighted fusion weight parameters of the N reference blocks to determine a prediction block of the current block; A prediction residual of the current block is determined according to the prediction block of the current block.
39. The method of claim 38, wherein: The determining of N reference blocks of the current block includes: Construct a block vector candidate list for the current block; Determining a block vector of a current block according to the block vector candidate list; According to the block vector of the current block, a reference block of the current block is determined.
40. The method of claim 39, wherein: The step of constructing a block vector candidate list of the current block includes: Based on the block matching criteria, a first block vector candidate list of the current block is constructed.
41. The method of claim 40, wherein: The step of determining the block vector of the current block according to the block vector candidate list includes: Based on a template matching criterion, determining template matching parameters corresponding to at least some of the block vectors in the first block vector candidate list; sorting the at least part of the block vectors according to the template matching parameters to determine a sorted candidate list of block vectors; A block vector of a current block is determined according to the sorted block vector candidate list.
42. The method of claim 39, wherein: The step of constructing a block vector candidate list of the current block includes: Based on the block matching criterion, construct a first block vector candidate list of the current block; Based on the template matching criterion, a second block vector candidate list is determined according to a search range pointed to by at least part of the block vectors in the first block vector candidate list.
43. The method according to any one of claims 39 to 42, wherein: The step of determining the block vector of the current block according to the block vector candidate list includes: According to the block vector candidate list, N block vectors of the current block are determined.
44. The method according to any one of claims 38 to 43, wherein: The method further includes: determining that the value of N is a preset value.
45. The method according to any one of claims 38 to 43, wherein: The method further includes: determining a value of N according to a value of a first identification parameter of the current block.
46. The method of claim 45, wherein: The method further comprises: Determine at least two candidate values of N; and determine, based on the candidate values, a prediction block of a current block corresponding to the candidate values; Determining a value of the first identification parameter according to a predicted block and an original block of the current block corresponding to the candidate value; or, Determine at least two candidate values of N; and determine, based on the candidate values, prediction template samples corresponding to the candidate values; Based on the template matching criterion, template matching parameters of the prediction template sample and the template sample of the current block are determined; and according to the template matching parameters, a value of the first identification parameter is determined.
47. The method of claim 46, wherein: The method further comprises: Determining a value of a first syntax element according to a value of a first identification parameter; The first syntax element is encoded, and the obtained encoded bits are written into a bitstream.
48. The method according to any one of claims 38 to 47, wherein: The method further includes: determining whether the current block uses a fusion prediction mode according to a value of a second identification parameter of the current block.
49. The method of claim 48, wherein: The method further comprises: Determining a value of the second syntax element according to a value of the second identification parameter of the current block; The second syntax element of the current block is encoded.
50. The method of claim 48, wherein: The method further includes: if the current block uses a fusion prediction mode, determining the N reference blocks.
51. The method of claim 50, wherein: The method further comprises: If the current block does not use the fusion prediction mode, determine the first reference block of the current block; A prediction block of the current block is determined according to the first reference block.
52. The method according to any one of claims 38 to 51, wherein: The determining of the weighted fusion weight parameters of the N reference blocks includes: Determine a template sample of the current block, and determine reference template samples of the N reference blocks; Determine a matching reference sample according to the reference template samples of the N reference blocks; Determine, according to the template sample of the current block and the matching reference sample, a weighted fusion weight parameter of the reconstructed reference sample corresponding to the matching reference sample; The matching reference samples include the N reference template samples, and the weighted fusion weight parameters of the reconstructed reference samples include the weighted fusion weight parameters of the N reference blocks.
53. The method of claim 52, wherein: The determining, according to the reference template samples of the N reference blocks, a matching reference sample comprises: determining a first parameter sample; Determining the matching reference sample according to the reference template samples of the N reference blocks and the first parameter sample; The weighted fusion weight parameters of the reconstructed reference samples also include the weighted fusion weight parameters of the first parameter samples.
54. The method of claim 53, wherein: The first parameter sample includes a first sample; The determining the first parameter sample includes: determining the first sample according to a first template sample among the reference template samples of the N reference blocks.
55. The method of claim 54, wherein: The first template sample among the reference template samples of the N reference blocks, determining the first sample, comprises: A rounding operation is performed on the square value of the pixel reference value of the first template sample to determine the pixel reference value of the first sample.
56. The method of claim 54 or 55, wherein: The method further comprises: Based on the template matching criterion, determining the template matching parameters of the template sample of the current block and the reference template sample; It is determined that the template sample corresponding to the best template matching parameter is the first template sample.
57. A method according to any one of claims 53 to 56, wherein: The first parameter sample includes: a second sample; The determining the first parameter sample includes: determining the second sample according to an image pixel range.
58. The method according to any one of claims 52 to 57, wherein: The step of determining, according to the template sample of the current block and the matching reference sample, a weighted fusion weight parameter of a reconstructed reference sample corresponding to the matching reference sample comprises: Determine template matching parameters according to the template sample of the current block and the matching reference sample; A weight parameter is derived according to the template matching parameter to determine a weighted fusion weight parameter of the reconstructed reference sample.
59. The method according to any one of claims 52 to 58, wherein: The step of determining, according to the template sample of the current block and the matching reference sample, a weighted fusion weight parameter of a reconstructed reference sample corresponding to the matching reference sample comprises: Determining an autocorrelation parameter according to a pixel reference value of a sample in the matching reference sample; Determining a cross-correlation parameter according to a pixel reference value of a template sample of the current block and a pixel reference value of a sample in the matching reference sample; A weighted fusion weight value of the candidate reconstructed sample corresponding to the matching reference sample is determined according to the autocorrelation parameter and the cross-correlation parameter.
60. The method of claim 38, wherein: The determining of the weighted fusion weight parameters of the N reference blocks includes: Determine the weighted fusion weight parameter of the N reference blocks as a preset weight parameter.
61. The method of claim 38, wherein: The determining of the weighted fusion weight parameters of the N reference blocks includes: Determine a template sample of the current block, and determine reference template samples of the N reference blocks; Based on the template matching criterion, determining template matching parameters of the template sample of the current block and the reference template sample; According to the weight model preset by the template matching parameters, weighted fusion weight parameters of the N reference blocks are determined.
62. The method of claim 61, wherein: The weight model configuration is: Obtaining a first intermediate value according to the template matching parameter and the first offset value; Determine a cumulative sum of N first intermediate values; The weighted fusion weight values of the N reference blocks are determined according to a ratio of the first intermediate value to the cumulative sum of the N first intermediate values.
63. The method of claim 61, wherein: The weight model configuration is: Determining a cumulative sum of template matching parameters of the N reference template samples; The weighted fusion weight values of the N reference blocks are determined according to the ratio of the template matching parameter to the accumulated sum of the template matching parameters.
64. The method of claim 61, wherein: The weight model configuration is: The template matching parameters of the N reference template samples are used as input values of the Softmax function to determine weighted fusion weight values of the N reference blocks.
65. The method of claim 61, wherein: The method further includes: determining control parameters of the weight model according to the size of the current block.
66. The method of claim 61, wherein: The method further includes: controlling parameters of the weight model according to a template type of the current block.
67. The method of claim 38, wherein: The determining of the weighted fusion weight parameters of the N reference blocks includes: The weighted fusion weight parameter of the reference block is determined to be one-N.
68. The method of claim 38, wherein: Before performing weighted fusion on the N reference blocks, the method further includes: The N reference blocks are filtered to determine N filtered reference blocks.
69. The method of claim 68, wherein: The method further comprises: Determine the template sample of the current block; Determine a matching reference sample according to the N reference template samples; The coefficients of the target filter are determined according to the template samples of the current block and the matching reference samples.
70. The method of claim 69, wherein: The determining the coefficient of the target filter according to the template sample of the current block and the matching reference sample comprises: Determine template matching parameters according to the template sample of the current block and the matching reference sample; Weight parameters are derived according to the template matching parameters to determine coefficients of the target filter.
71. The method of claim 69 or 70, wherein: The step of determining, according to the template sample of the current block and the matching reference sample, a weighted fusion weight parameter of a reconstructed reference sample corresponding to the matching reference sample comprises: Determining an autocorrelation parameter according to a pixel reference value of a sample in the matching reference sample; Determining a cross-correlation parameter according to a pixel reference value of a template sample of the current block and a pixel reference value of a sample in the matching reference sample; The coefficients of the target filter are determined according to the autocorrelation parameters and the cross-correlation parameters.
72. The method according to any one of claims 38 to 71, wherein: The method further comprises: Determining a first parameter sample and a weighted fusion parameter of the first parameter sample; The step of performing weighted fusion on the N reference blocks according to the weighted fusion weight parameters of the N reference blocks to determine a prediction block of the current block includes: According to the weighted fusion weight parameters of the N reference blocks and the weighted fusion values of the first parameter samples, the N reference blocks and the first parameter samples are weightedly fused to determine a prediction block of the current block.
73. The method of claim 72, wherein: The first parameter sample includes a first sample; The determining the first parameter sample includes: determining the first sample according to a first reference block among the N reference blocks.
74. The method of claim 73, wherein: The determining the first sample according to a first reference block among the N reference blocks includes: A square value of the pixel reference value of the first reference block is rounded to determine a pixel reference value of the first sample.
75. The method according to any one of claims 72 to 74, wherein: The first parameter sample includes: a second sample; The determining of the first parameter sample includes: determining the second sample according to an image pixel range.
76. A code stream, wherein The code stream is generated by bit encoding according to the information to be encoded; wherein the information to be encoded includes at least one of the following: The number of coefficients of the target filter, the shape of the target filter, the value of the first syntax element and the value of the second syntax element; wherein the first syntax element is used to indicate the value of N, and the second syntax element is used to indicate whether the current block uses a fusion prediction mode.
77. An encoder comprising a first determining unit and a first predicting unit; wherein: The first determination unit is configured to determine N reference blocks of the current block; wherein N is an integer greater than 1; The first determining unit is configured to determine a weighted fusion weight parameter of the N reference blocks; The first prediction unit is configured to perform weighted fusion on the N reference blocks according to weighted fusion weight parameters of the N reference blocks to determine a prediction block of the current block; The first determination unit is configured to determine a prediction residual of the current block according to a prediction block of the current block.
78. An encoder comprising a first memory and a first processor; wherein: The first memory is used to store a computer program that can be run on the first processor; The first processor is configured to execute the method according to any one of claims 38 to 75 when running the computer program.
79. A decoder comprising a second determination unit and a second prediction unit; wherein: The second determination unit is configured to determine N reference blocks of the current block; wherein N is an integer greater than 1; The second determining unit is further configured to determine a weighted fusion weight parameter of the N reference blocks; The second prediction unit is configured to perform weighted fusion on the N reference blocks according to weighted fusion weight parameters of the N reference blocks to determine a prediction block of the current block; The second determining unit is further configured to determine a reconstructed block of the current block according to the predicted block of the current block.
80. A decoder comprising a second memory and a second processor; wherein: The second memory is used to store a computer program that can be run on the second processor; The second processor is configured to execute the method according to any one of claims 1 to 37 when running the computer program.
81. A computer-readable storage medium, wherein: The computer-readable storage medium stores a computer program, which, when executed, implements the method according to any one of claims 1 to 37, or implements the method according to any one of claims 38 to 75.
Citation Information
Patent Citations
Video encoding and decoding method and apparatus using weighted prediction
CN101766030A
Method and apparatus for image encoding / decoding
CN108353166A
Method of block vector prediction for intra block copy mode coding
CN110099281A
Image encoding and decoding method using bidirectional prediction, and image encoding and decoding apparatus
CN113056919A
All-optical video sequence intra-frame prediction method based on gradient information
CN113610055A
Cited By
Decoding method, encoding method, and related apparatus
WO2026149311A1
