Encoding method, decoding method, encoders, decoders and storage mediums
By acquiring and adjusting the block vector information of the reference block, the block vector determination process of the current block is optimized, which solves the problem of insufficient accuracy in the block vector prediction mode and improves coding efficiency.
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
- Filing Date
- 2025-01-06
- Publication Date
- 2026-07-09
AI Technical Summary
In block vector-based prediction mode, when the current block is predicted using the block vector of the encoded/reconstructed coding unit, the prediction information and the final prediction value may be inaccurate, affecting coding efficiency.
By obtaining the block vector information of the reference block of the current block, the block vector of the current block is determined, thereby improving the accuracy of the prediction model. This includes refining the search for block vectors and determining the template cost value. The block vector information is then used for adjustment and scaling to optimize the use of block vectors.
This improves coding efficiency and ensures the accuracy and effectiveness of block vector-based prediction patterns.
Smart Images

Figure CN2025070893_09072026_PF_FP_ABST
Abstract
Description
Encoding / decoding methods, encoders, decoders, and storage media Technical Field
[0001] This application relates to the field of video encoding and decoding technology, specifically to an encoding and decoding method, an encoder, a decoder, and a storage medium. Background Technology
[0002] In some block vector (BV) based prediction modes, the current block uses the block vectors of the encoded / reconstructed coding units (CUs) to participate in the prediction, and the final prediction value is obtained.
[0003] However, under certain circumstances, using the selected BV in prediction can lead to inaccurate prediction information and final prediction values, thereby affecting coding efficiency. Summary of the Invention
[0004] This application provides an encoding / decoding method, encoder, decoder, and storage medium to improve the accuracy of block vector prediction, thereby increasing encoding efficiency.
[0005] The technical solution of this application embodiment can be implemented as follows:
[0006] In a first aspect, embodiments of this application provide a decoding method applied to a decoder, the method comprising:
[0007] Obtain the block vector information of the reference block of the current block. The block vector information includes the block vector and / or block vector related information.
[0008] Determine the block vector of the current block based on the block vector information of the reference block;
[0009] Determine the predicted value of the current block based on the block vector of the current block.
[0010] Secondly, embodiments of this application provide an encoding method applied to an encoder, the method comprising:
[0011] Obtain the block vector information of the reference block of the current block. The block vector information includes the block vector and / or block vector related information.
[0012] Determine the block vector of the current block based on the block vector information of the reference block;
[0013] Determine the predicted value of the current block based on the block vector of the current block.
[0014] Thirdly, embodiments of this application provide an encoder, which includes a first acquisition unit, a first determination unit, and a first prediction unit; wherein:
[0015] The first acquisition unit is configured to acquire the block vector information of the reference block of the current block, wherein the block vector information includes the block vector and / or block vector related information;
[0016] The first determining unit is configured to determine the block vector of the current block based on the block vector information of the reference block;
[0017] The first prediction unit is configured to determine the predicted value of the current block based on the block vector of the current block.
[0018] Fourthly, embodiments of this application provide an encoder, which includes a first memory and a first processor; wherein,
[0019] A first memory for storing computer programs that can run on a first processor;
[0020] The first processor is used to execute the method described in the second aspect when running a computer program.
[0021] Fifthly, embodiments of this application provide a decoder, which includes...
[0022] A second acquisition unit, a second determination unit, and a second prediction unit; wherein:
[0023] The second acquisition unit is configured to acquire the block vector information of the reference block of the current block, wherein the block vector information includes the block vector and / or block vector related information;
[0024] The second determining unit is configured to determine the block vector of the current block based on the block vector information of the reference block;
[0025] The second prediction unit is configured to determine the predicted value of the current block based on the block vector of the current block.
[0026] Sixthly, embodiments of this application provide a decoder, which includes a second memory and a second processor; wherein,
[0027] The second memory is used to store computer programs that can run on the second processor;
[0028] The second processor is used to execute the methods described in the first aspect when running a computer program.
[0029] In a seventh aspect, embodiments of this application provide a computer-readable storage medium that stores a bitstream generated by such encoding method.
[0030] Eighthly, embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed, implements the method as described in the first aspect or the method as described in the second aspect.
[0031] This application provides an encoding / decoding method, encoder, decoder, and storage medium. Whether at the encoding or decoding end, the block vector information of the reference block of the current block is obtained. The block vector information includes the block vector and / or block vector-related information. The block vector of the current block is determined by the block vector information of the reference block, thereby improving the accuracy of the prediction mode based on the block vector and thus improving the encoding efficiency. Attached Figure Description
[0032] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:
[0033] Figure 1 is a schematic block diagram of an encoder provided in an embodiment of this application;
[0034] Figure 2 is a schematic block diagram of a decoder provided in an embodiment of this application;
[0035] Figure 3 is a schematic diagram of the network architecture of an encoding / decoding system provided in an embodiment of this application;
[0036] Figure 4 is a flowchart illustrating a decoding method provided in an embodiment of this application;
[0037] Figure 5 is a schematic diagram of the horizontal flipping adjustment of the reference block BV in an embodiment of this application;
[0038] Figure 6 is a schematic diagram of the vertical flipping adjustment of the reference block BV in an embodiment of this application;
[0039] Figure 7 is a schematic diagram of adjusting the upper template tBV and the left template lBV without flipping them in an embodiment of this application;
[0040] Figure 8 is a schematic diagram of the upper template tBV and the left template lBV after horizontal flipping adjustment in the embodiment of this application;
[0041] Figure 9 is a schematic diagram of the upper template tBV and the left template lBV after vertical flipping adjustment in the embodiment of this application;
[0042] Figure 10 is a schematic diagram of block copy prediction based on BV in an embodiment of this application;
[0043] Figure 11 is a schematic diagram of the predicted block of the current block in an embodiment of this application without the need for flipping;
[0044] Figure 12 is a schematic diagram of the predicted block of the current block in the case of horizontal flipping in an embodiment of this application;
[0045] Figure 13 is a schematic diagram of the predicted block of the current block in the case of vertical flipping in an embodiment of this application;
[0046] Figure 14 is a schematic diagram of the prediction process of the decoding end SGPM in the embodiment of this application;
[0047] Figure 15 is a schematic diagram of the available partitioning modes of SGPM in the embodiments of this application;
[0048] Figure 16 is a schematic diagram of deriving SGPM-related information of the coding block using a template in an embodiment of this application;
[0049] Figure 17 is a schematic diagram of the process by which the decoding end determines the SGPM combination mode in an embodiment of this application.
[0050] Figure 18 is a schematic diagram of the SGPM combination mode index in an embodiment of this application;
[0051] Figure 19 is a flowchart illustrating an encoding method provided in an embodiment of this application;
[0052] Figure 20 is a schematic diagram of the prediction process of the encoding end SGPM in the embodiment of this application;
[0053] Figure 21 is a schematic diagram of the process of determining the SGPM combination mode at the encoding end in an embodiment of this application;
[0054] Figure 22 is a schematic diagram of the composition structure of an encoder provided in an embodiment of this application;
[0055] Figure 23 is a schematic diagram of the specific hardware structure of an encoder provided in an embodiment of this application;
[0056] Figure 24 is a schematic diagram of the composition structure of a decoder provided in an embodiment of this application;
[0057] Figure 25 is a schematic diagram of the specific hardware structure of a decoder provided in an embodiment of this application;
[0058] Figure 26 is a schematic diagram of the composition structure of an encoding and decoding system provided in an embodiment of this application. Detailed Implementation
[0059] The technical solutions of the embodiments of this application will now be described with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application.
[0060] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.
[0061] In the following description, references are 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.
[0062] It should also be noted that the terms "first, second, and third" used in the embodiments of this application are only used to distinguish similar objects and do not represent a specific order of objects. It is understood that "first, second, and third" can be interchanged in a specific order or sequence where permitted, so that the embodiments of this application described herein can be implemented in an order other than that illustrated or described herein.
[0063] In video images, a coding block (CB) is typically represented by a first image component, a second image component, and a third image component. These three image components are a luma component, a blue chroma component, and a red chroma component, respectively. Specifically, the luma component is usually represented by the symbol Y, the blue chroma component is usually represented by the symbol Cb or U, and the red chroma component is usually represented by the symbol Cr or V. Thus, video images can be represented in YCbCr format or YUV format.
[0064] Before providing a further detailed description of the embodiments of this application, the nouns and terms used in the embodiments of this application will be explained. The nouns and terms used in the embodiments of this application shall be interpreted as follows:
[0065] Moving Picture Experts Group (MPEG)
[0066] The next-generation video coding standard H.266 / Versatile Video Coding (VVC)
[0067] Beyond VVC's reference software testing platform (Enhanced Compression Model, ECM)
[0068] Coding Unit (CU)
[0069] Block Vector (BV)
[0070] Intra-template matching prediction (Intra TMP)
[0071] Intra Block Copy (IBC)
[0072] Decoder-side intra-mode derivation (DIMD)
[0073] Block Vector Guided DIMD (BVG-DIMD) for Decoder-Side Intra-Mode Derivation
[0074] Convolutional Cross-Component Model (CCCM)
[0075] Block Vector Guided Convolutional Cross-Component Prediction Mode (BVG-CCCM)
[0076] Cross-Component Linear Mode (CCLM);
[0077] Decoder-Derived Cross-Component Prediction (DDCCP) is exported from the decoder.
[0078] Histogram of Gradient (HoG)
[0079] Cross-Component Prediction (CCP)
[0080] Extrapolation filter-based intra prediction (EIP)
[0081] Block Vector Guided EIP (BVG-EIP)
[0082] Template-based Intra Mode Derivation (TIMD)
[0083] Block Vector Guided TIMD (BVG-TIMD) is a template-based intra-frame mode derivation method.
[0084] Spatial Geometric Partitioning Mode (SGPM)
[0085] Matrix Weighted Intra Prediction (MIP)
[0086] Direct Block Vector (DBV)
[0087] Sum of Absolute Difference (SAD)
[0088] Sum of Absolute Transform-based Difference (SATD)
[0089] Rate-Distortion Optimization (RDO).
[0090] It's understandable that digital video compression technology primarily compresses massive amounts of digital video data to facilitate transmission and storage. With the surge in internet video and increasing demands for video clarity, while existing digital video compression standards can save considerable video data, there is still a need to pursue better digital video compression technologies to reduce the bandwidth and traffic pressure on digital video transmission.
[0091] 1) Video coding framework
[0092] Referring to Figure 1, which shows a schematic block diagram of an encoder provided in an embodiment of this application. As shown in Figure 1, 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 and analysis unit 107, a filtering unit 108, an encoding unit 109, and a decoded image buffer unit 110, etc., wherein the filtering unit 108 can implement deblocking filtering and sample adaptive offset (SAO) filtering, and the encoding unit 109 can implement header information encoding and context-based adaptive binary arithmetic coding (CABAC).For the input raw video signal, a video coding block can be obtained by partitioning it through a Coding Tree Unit (CTU). Then, the residual pixel information obtained after intra-frame or inter-frame prediction is transformed by the transform and quantization unit 101, including transforming the residual information from the pixel domain to the transform domain and quantizing the resulting 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 of the received video coding block relative to one or more blocks in one or more reference frames to provide time prediction information. The motion estimation performed by the motion estimation unit 105 is a process of generating motion vectors, which can estimate the motion of the video coding block. Then, the motion compensation unit 104 is used to perform the motion estimation based on the motion vectors determined by the motion estimation unit 105. The motion compensation is performed. After determining the intra-prediction mode, the intra-prediction unit 103 is also used to provide the selected intra-prediction data to the coding unit 109, and the motion estimation unit 105 also sends the calculated motion vector data to the coding unit 109. In addition, the inverse transform and inverse quantization unit 106 is used to reconstruct the video coding block, reconstruct the residual block in the pixel domain, and remove the block artifacts by the filter control analysis unit 107 and the filtering unit 108. Then, the reconstructed residual block is added to a predictive block in the frame of the decoding image buffer unit 110 to generate the reconstructed video coding block. The coding unit 109 is used 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-prediction mode and output the bitstream of the video signal. The decoding image buffer unit 110 is used to store the reconstructed video coding block for prediction reference. As video image encoding proceeds, new reconstructed video encoding blocks are continuously generated, and these reconstructed video encoding blocks are stored in the decoding image buffer unit 110.
[0093] Referring to Figure 2, it shows a schematic block diagram of a decoder provided in an embodiment of this application. As shown in Figure 2, 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, etc., wherein the decoding unit 201 can perform header information decoding and CABAC decoding, and the filtering unit 205 can perform deblocking filtering and SAO filtering. After the input video signal undergoes the encoding process shown in Figure 1, the output video signal bitstream is generated. This bitstream is input into the decoder 200, first passing through the decoding unit 201 to obtain the decoded transform coefficients. These transform coefficients are then processed by the inverse transform and inverse quantization unit 202 to generate residual blocks in the pixel domain. The intra-frame prediction unit 203 can generate prediction data for the current video decoding block based on the determined intra-frame prediction mode and data from previously decoded blocks in the current frame or image. The motion compensation unit 204 determines the prediction information for the video decoding block by analyzing motion vectors and other associated syntax elements, and uses... The prediction information is used to generate a predictive block of the video block being decoded; the 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-prediction unit 203 or the motion compensation unit 204; the decoded video signal is passed through the filtering unit 205 to remove block artifacts, which can improve video quality; then the decoded video block is stored in the decoding image buffer unit 206, which stores reference images for subsequent intra-prediction or motion compensation, and is also used for the output of the video signal, thus obtaining the recovered original video signal.
[0094] Furthermore, this application embodiment also provides a network architecture for an encoding / decoding system including an encoder and a decoder. Figure 3 shows a schematic diagram of such a network architecture. As shown in Figure 3, the network architecture includes one or more electronic devices 13 to 1N and a communication network 01. The electronic devices 13 to 1N can perform video interaction through the communication network 01. During implementation, the electronic devices can be various types of devices with video encoding / decoding capabilities. For example, the electronic devices may include smartphones, tablets, personal computers, personal digital assistants, navigators, digital phones, video phones, televisions, sensing devices, servers, etc., without specific limitations. Additionally, the decoder or encoder described in this application embodiment can be one of the aforementioned electronic devices.
[0095] It should be noted that the method of this application embodiment is mainly applied to the intra-prediction unit 103 part shown in FIG1 and the intra-prediction unit 203 part shown in FIG2. That is to say, the embodiment of this application can be applied to the encoder, the decoder, or even the encoder and the decoder at the same time, but the embodiment of this application is not specifically limited.
[0096] It should also be noted that when applied to the intra-prediction unit 103, "current block" specifically refers to the coding block currently to be intra-predicted; when applied to the intra-prediction unit 203, "current block" specifically refers to the decoding block currently to be intra-predicted.
[0097] 2) Spatial Geometric Partitioning Model (SGPM)
[0098] Spatial Geometric Partitioning Mode (SGPM) divides a coded block into two geometric partitions using partition lines. These two partitions are obtained using different intra-prediction modes. Specifically, two prediction blocks are obtained using two different intra-prediction modes, and then weighted and fused to obtain the final prediction value. The weighting is typically determined based on the direction and position of the partition lines to reflect the partitioning. Furthermore, SGPM allows partitions to use block vector (BV) based prediction modes. That is, the combination of intra-prediction modes for the two partitions in SGPM can be: traditional intra-prediction mode M0 + traditional intra-prediction mode M1, or traditional intra-prediction mode M0 + BV-based prediction mode. Or based on BV prediction model +Based on BV prediction model
[0099] The intra-prediction mode (IPM) candidate list in SGPM includes L1 (e.g., L1=3) traditional intra-prediction modes and no more than L2 (e.g., L2=6) BV-based prediction modes. BV-based prediction modes obtain multiple neighboring CUs of the current block. If the prediction mode of a neighboring CU is Intra TMP or IBC mode, its BV is checked for validity (or availability) for the current block. If valid, its BV is added to the BV list. For SGPM modes, if any partition mode is a BV-based prediction mode, block copy prediction is performed based on the current block's BV to obtain the predicted block under the BV-based prediction mode.
[0100] When using SGPM mode, the SGPM geometric partitioning mode index is identified by syntax elements, and then the intra-prediction modes of the two sub-partitions are signaled.
[0101] 3) Regression-based SGPM (R-SGPM) is an intra-prediction mode that incorporates two intra-prediction modes and adaptively derives fusion weights. Similar to SGPM, R-SGPM first determines a list of candidate intra-prediction modes (e.g., traditional intra-prediction mode and BV-based prediction mode). Then, it constructs a list of candidate combined intra-prediction modes based on the candidate intra-prediction mode list and sorts them using template cost. If the current block selects one of the combined intra-prediction modes of R-SGPM, two prediction blocks are obtained based on the corresponding two intra-prediction modes. The weight matrix is then derived from the template to determine the final predicted value after weighted fusion. Specifically, the prediction process is as follows: First, based on the predicted and reconstructed values of the two intra-prediction modes on the template, two integer fusion weight matrices are derived. Then, the prediction blocks under these two intra-prediction modes are obtained respectively. Finally, the final predicted value of the current block is obtained by weighted fusion using the weight matrices.
[0102] In some block vector-based prediction modes such as SGPM and R-SGPM, the current block uses the block vector information of the reconstructed reference block to participate in the prediction. However, the uncertainty of the meaning of the block vector information is not fully considered. Under certain circumstances, this can lead to inaccurate information obtained when the block vector participates in the prediction and the final prediction value, which has an adverse effect on coding efficiency.
[0103] Based on this, embodiments of this application provide an encoding / decoding method, encoder, decoder, and storage medium. The block vector of the current block is determined using the block vector information of the reference block, improving the accuracy of prediction patterns based on block vectors and thus enhancing encoding efficiency. To facilitate understanding of the technical solutions of the embodiments of this application, the technical solutions of this application are described in detail below through specific embodiments. The above-mentioned related technologies are optional solutions and can be arbitrarily combined with the technical solutions of the embodiments of this application, all of which fall within the protection scope of the embodiments of this application. Embodiments of this application include at least some of the following contents.
[0104] In one embodiment of this application, see Figure 4, which shows a flowchart of a decoding method provided in this embodiment.
[0105] As shown in Figure 4, the method may include:
[0106] S401: Obtain the block vector information of the reference block of the current block. The block vector information includes the block vector and / or block vector related information.
[0107] It should be noted that the current block may include a first color component, a second color component, and a third color component. If the current block includes the first color component and the first color component is the luminance component, then the current block may also be called a luminance block. Alternatively, if the current block includes the second color component and the second color component is the chrominance component, then the current block may also be called a chrominance block. The chrominance component includes the chrominance U component and the chrominance V component.
[0108] The reference block for the current block includes the reconstructed neighboring blocks. Specifically, neighboring blocks can include spatial neighboring blocks and / or temporal neighboring blocks, which can further include adjacent blocks and / or non-adjacent blocks. Assuming the current block includes a first color component, and the first color component is a luma component, the reference block for the current block includes a reference luma block. Assuming the current block includes a second color component, and the second color component is a chroma component, the reference block for the current block includes a reference chroma block and / or a reference luma block.
[0109] In one example, when the prediction mode of the reference block includes a block vector-based prediction mode, the block vector information of the reference block for the current block is obtained. In another example, when the prediction information of the reference block includes block vector information, the block vector information of the reference block for the current block is obtained.
[0110] S402: Determine the block vector of the current block based on the block vector information of the reference block;
[0111] In some embodiments, one or more block vectors of the current block are determined based on the block vector information of the reference block; and the predicted value of the current block is determined based on the one or more block vectors.
[0112] In some embodiments, determining the block vector of the current block based on the block vector information of a reference block includes: determining candidate block vectors of the current block based on the block vector information of the reference block; correspondingly, the method further includes: constructing a candidate list for the current block based on the candidate block vectors of the current block; determining the prediction mode of the current block based on the candidate list of the current block; and obtaining the block vector corresponding to the prediction mode of the current block as the block vector used by the current block. That is, one or more block vectors of the current block can be directly determined based on the block vector information of the reference block; alternatively, one or more candidate block vectors (or available block vectors) of the current block can be determined first based on the block vector information of the reference block, and then a candidate list can be constructed based on the one or more candidate block vectors of the current block, and the block vector used by the current block can be determined based on the candidate list.
[0113] In one example, the block vector of the current block is determined based on the block vector information of the reference block. This includes determining the block vector of the current block based on the block vector information of the reference block and the current block information. The current block information is used to adjust the block vector information of the reference block to obtain a block vector (or candidate block vector) that fits the current block.
[0114] For example, determining the block vector of the current block based on the block vector information of the reference block and the current block information includes: adjusting the block vector of the reference block based on the block vector related information of the reference block, the reference block information, and the current block information to obtain the block vector of the current block.
[0115] For example, determining the block vector of the current block based on the block vector information of the reference block and the current block information includes: adjusting the block vector of the reference block based on the block vector related information of the reference block, the reference block information, and the current block information to obtain the adjusted block vector; and scaling the adjusted block vector based on the color sampling format when the current block includes a first color component and the reference block includes a second color component to obtain the block vector of the current block.
[0116] For example, determining the block vector of the current block based on the block vector information of the reference block and the current block information includes: scaling the block vector of the reference block based on the color sampling format when the current block includes a first color component and the reference block includes a second color component, to obtain a scaled block vector; and adjusting the scaled block vector based on the block vector-related information of the reference block, the reference block information, and the current block information to obtain the block vector of the current block.
[0117] In other words, when the current block is a first color component block, and the reference block of the current block includes a second color component block, and the sampling formats of the first and second color component blocks are different, the BV of the second color component block can be adjusted first and then scaled to obtain the BV of the first color component block, or the BV of the second color component block can be scaled first and then adjusted to obtain the BV of the first color component block. For example, if the current CU is a chromaticity CU and the BV information of the current block comes from the luminance CU of the reconstructed region, BV scaling can be performed first, and then the obtained BV of the reconstructed CU can be adjusted (e.g., flip-aware adjustment) based on the BV information of the reconstructed CU and the current block information (e.g., current block size, coordinates, etc.). Alternatively, the obtained BV of the reconstructed CU can be adjusted (e.g., flip-aware adjustment) based on the BV information of the reconstructed CU and the current block information (e.g., current block size, coordinates, etc.), and then BV scaling can be performed.
[0118] The current block information and reference block information are used to adjust the block vector information of the reference block to obtain a block vector adapted to the current block. For example, the current block information may include the size and position information of the current block, and the reference block information, which is a block vector, may include the size and position information of the reference block.
[0119] In some embodiments, the method further includes: performing a refinement search on the block vector of the current block within a first range to obtain a refined block vector; determining the template cost of the refined block vector based on the current block template; and using the block vector corresponding to the minimum template cost as the refined block vector of the current block. Here, the block vector of the current block is used as the search reference point, and then the first range of the refinement search is determined. The first range of the refinement search can be of a fixed size or related to the search area. Further, the final BV is obtained through template matching search. The template cost includes, but is not limited to, one of the following: sum of absolute errors (SAD), sum of transformed absolute errors (SATD), sum of squared differences (SSE), mean absolute difference (MAD), mean absolute error (MAE), mean squared error (MSE), etc.
[0120] One example of BV refinement is as follows: Starting from the current BV, search the surrounding area and use the SAD between the reference template and the current template to determine the refined BV.
[0121] For example, based on the block vector information of the reference block, candidate block vectors for the current block are determined; the candidate block vectors for the current block are refined, and the refined block vectors are added to the candidate list. Another example is, based on the candidate list, the block vectors used by the current block are determined; the block vectors used by the current block are refined to obtain refined block vectors.
[0122] In some embodiments, the method further includes: determining block vector related information for the current block based on block vector related information of a reference block. The block vector related information of the current block can be used to determine the predicted value of the current block or the current block template, and to determine the block value (BV) of subsequent blocks, thereby improving the accuracy of BV-based predictions for subsequent blocks.
[0123] For example, the block vector information of the reference block is used as the block vector information of the current block. For example, the block vector of the reference block is adjusted based on the block vector information of the reference block, as well as the current block information and / or the reference block information, to obtain the block vector information of the current block.
[0124] In some embodiments, the method further includes: adjusting the block vector of the current block based on block vector-related information of the current block to obtain the block vector of the current block template. For example, the block vector of the current block is adjusted based on block vector-related information of the current block, current block information, and current block template information to obtain the block vector of the current block template.
[0125] In some embodiments, the method further includes: determining block vector related information of the current block template based on block vector related information of the current block.
[0126] For example, the block vector information of the current block is used as the block vector information of the current block template. For example, the block vector of the current block is adjusted based on the block vector information of the current block, as well as the current block information and / or the current block template information, to obtain the block vector information of the current block.
[0127] It should be noted that when the current block template needs to be used, the BV of the current block template can be determined based on the BV information of the current block, and the BV-related information corresponding to the BV of the current block template can also be determined for the prediction of the current block template.
[0128] In this embodiment, the block vector related information includes one or more pieces of information related to the block vector. In one example, the block vector of a reference block is adjusted based on the block vector related information. In another example, the current block is predicted based on the block vector related information and the block vector. In yet another example, the block vector of the current block is adjusted based on the block vector related information. In yet another example, the current block template is predicted based on the block vector related information and the block vector.
[0129] For example, block vector-related information includes, but is not limited to, a flip identifier. A flip typically refers to a 180-degree rotation of the current block or image along an axis, the angle between which is made with a reference axis (such as the X-axis) including, but not limited to, 0 degrees and 90 degrees, and the axis may also include 30 degrees, 45 degrees, 120 degrees, and 135 degrees, etc.
[0130] For example, the flip symbol is used to indicate no flip, horizontal flip, or vertical flip. A horizontal flip can be understood as a 180-degree rotation along the axis corresponding to 90 degrees, and a vertical flip can be understood as a 180-degree rotation along the axis corresponding to 0 degrees.
[0131] For example, block vector adjustment can include: when the flip flag is set to the first value, using the block vector to be processed as the adjusted block vector. It should be noted that the block vector to be processed includes any block vector that has been adjusted based on block vector related information. For example, if the block vector to be processed is the block vector of the reference block of the current block, the adjusted block vector can be the block vector of the current block. Alternatively, if the block vector to be processed is the block vector of the current block, the adjusted block vector can be the block vector of the current block template.
[0132] Let the BV information obtained from the reconstructed CU be: BV value (let's say...). ) and the flip flag (set to rribcFlipType) nbr ); Let the final BV information used for the current block be: BV value (let's say...). ) and the flip flag (set to rribcFlipType) cur ).
[0133] rribcFlipType nbr When no flipping is required, no adjustment is needed; the BV information for the current block can be used as follows: rribcFlipType cur =rribcFlipType nbr =0
[0134] For example, the block vector includes a horizontal component, and the block vector adjustment may include: adjusting the horizontal component of the block vector to be processed when the value of the flip identifier is a second value, to obtain the adjusted horizontal component.
[0135] For example, adjusting the horizontal component of the block vector to be processed to obtain the adjusted horizontal component includes at least one of the following: determining a first distance value in the horizontal direction between the center position of the current block and the center position of the reference block; adding twice the first distance value to the horizontal component of the block vector of the reference block to obtain the horizontal component of the block vector of the current block; determining a second distance value in the horizontal direction between the center position of the first template of the current block and the center position of the current block; adding twice the second distance value to the horizontal component of the block vector of the current block to obtain the horizontal component of the block vector of the first template of the current block; and using the horizontal component of the block vector of the current block as the horizontal component of the second template of the current block. The first template may include the left template of the current block, and the second template may include the top template of the current block. The first template may also include the top template of the current block, and the second template may also include the left template of the current block.
[0136] The first distance value can be determined by the difference between the x-coordinate of the current block's center position and the x-coordinate of the reference block's center position, or by the width and top-left corner coordinates of the current block and the reference block. The second distance value can be determined by the difference between the x-coordinate of the current block template's center position and the x-coordinate of the current block's center position, or by the width and top-left corner coordinates of the current block template and the current block.
[0137] For example, the block vector also includes a vertical component, and the block vector adjustment further includes: when the value of the flip identifier is a second value, taking the vertical component of the block vector to be processed as the adjusted vertical component.
[0138] rribcFlipType nbr When instructing a horizontal flip, BV needs to be adjusted. nbr After performing a horizontal flip-aware adjustment, the BV information for the current block can be: rribcFlipType cur =rribcFlipType nbr =1
[0139] Where, xnbr xc represents the X-coordinate of the center position of the reconstructed CU, and xcur represents the X-coordinate of the center position of the current block. BV nbr Figure 5 shows a schematic diagram of the horizontal flip perception adjustment.
[0140] For example, the block vector includes a vertical component, and the block vector adjustment includes: when the value of the flip identifier is a third value, adjusting the vertical component of the block vector to be processed to obtain the adjusted vertical component.
[0141] For example, adjusting the vertical component of the block vector to be processed to obtain the adjusted vertical component includes at least one of the following: determining a third distance value in the vertical direction between the center position of the current block and the center position of the reference block; adding twice the third distance value to the vertical component of the block vector of the reference block to obtain the vertical component of the block vector of the current block; determining a fourth distance value in the vertical direction between the center position of the second template of the current block and the center position of the current block; adding twice the fourth distance value to the vertical component of the block vector of the current block to obtain the vertical component of the block vector of the second template of the current block; and using the vertical component of the block vector of the current block as the vertical component of the first template of the current block. The first template may include the left template of the current block, and the second template may include the top template of the current block. Alternatively, the first template may include the top template of the current block, and the second template may include the left template of the current block.
[0142] The third distance value can be determined by the difference between the ordinate of the current block's center position and the ordinate of the reference block's center position, or by the height and top-left corner coordinates of the current block and the reference block. The second distance value can be determined by the difference between the ordinate of the current block template's center position and the ordinate of the current block's center position, or by the height and top-left corner coordinates of the current block template and the current block.
[0143] For example, the block vector also includes a horizontal component, and the block vector adjustment further includes: when the value of the flip identifier is a third value, using the horizontal component of the block vector to be processed as the adjusted horizontal component.
[0144] rribcFlipType nbr When indicating a vertical flip, BV needs to be adjusted. nbr After performing vertical flip-aware adjustments, the BV information for the current block can be obtained as follows: rribcFlipType cur =rribcFlipType nbr =2
[0145] Among them, y nbr The Y-coordinate of the center position of the reference block, y cur This is the Y-coordinate of the center position of the current block. (BV)nbr Figure 6 shows a schematic diagram of the vertical flip perception adjustment.
[0146] When it is necessary to utilize the current block template, an example is given to illustrate the method for determining the current block template (BV).
[0147] Let the BV information used for the current block be: BV value (let's say...). ) and the flip flag (set to rribcFlipType) cur );
[0148] Let the BV information used for the template be: BV value (let's say tBV = (tBV)). h ,tBV v )) and the flip flag (set to trribcFlipType);
[0149] Let the BV information used for the left template be: BV value (let's say lBV = (lBV)). h ,lBVv)) and the flip flag (set to lrribcFlipType).
[0150] rribcFlipType cur When no flipping is required, no adjustment is needed. The BV information that can be used for the upper and left templates is as follows: trribcFlipType = ribcFlipType cur =0 lrribcFlipType=ribcFlipType cur =0
[0151] A schematic diagram of tBV and lBV is shown in Figure 7.
[0152] rribcFlipType cur When instructing a horizontal flip, BV needs to be adjusted. cur After adjusting the horizontal flip perception, the BV information that can be used for the top and left templates is as follows: trribcFlipType = ribcFlipType cur =1 lrribcFlipType=ribcFlipType cur =1
[0153] Where, x cur The x-coordinate of the center position of the current block. left This is the X-coordinate of the center position of the left template region of the current block. A schematic diagram of the horizontally flipped, sensor-adjusted tBV and lBV is shown in Figure 8.
[0154] rribcFlipType curIndicates vertical flip, requires BV. cur After adjusting the vertical flip perception, the BV information that can be used for the top and left templates is as follows: trribcFlipType = ribcFlipType cur =2 lrribcFlipType=ribcFlipType cur =2
[0155] Among them, y cur The y-coordinate of the center position of the current block. top This is the Y-coordinate of the center position of the template region on the current block. A schematic diagram of the vertically flipped, sensor-adjusted tBV and lBV is shown in Figure 9.
[0156] In some embodiments, the method further includes: determining a reference region pointed to by the block vector of the current block; determining prediction mode-related information of the current block based on the reference region pointed to by the block vector; determining a prediction mode of the current block based on the prediction mode information of the current block; the prediction mode information includes at least one of the following: block vector, prediction mode, prediction model parameters, prediction mode-related data, and prediction mode-related information.
[0157] In other words, the reference region pointed to by the block vector can be determined based on the block vector (or candidate block vector) of the current block determined in the embodiments of this application, thereby determining the prediction mode information of the current block, and then performing subsequent prediction steps based on the determined prediction mode information.
[0158] In some embodiments, constructing a candidate list for the current block based on the candidate block vector of the current block includes: constructing a first candidate list and a second candidate list for the current block based on the candidate block vector of the current block.
[0159] For example, a first candidate list is constructed based on the first candidate block vector of the current block; a second candidate list is constructed based on the second candidate block vector of the current block. The first candidate block vector is determined based on the block vector information of the first reference block of the current block, and the second candidate block vector is determined based on the block vector information of the second reference block of the current block. The first reference block and the second reference block are either the same reference block or different reference blocks.
[0160] For example, the method further includes: determining a first partition (or first sub-block) and a second partition (or second sub-block) of the current block based on the partitioning pattern of the current block; determining a first reference block of the current block based on the position and shape of the first partition; and determining a second reference block of the current block based on the position and shape of the second partition. That is, if the current block adopts a geometric partitioning pattern or a sub-block prediction pattern, a corresponding reference block is selected for different partitions or sub-blocks based on the characteristics of different partitions or sub-blocks.
[0161] The candidate list contains or may contain block vector-based prediction modes. For example, the candidate list can be a BVmerge list or a list of intra-frame prediction modes.
[0162] In some embodiments, constructing a candidate list for the current block based on the candidate block vectors of the current block includes: constructing a first list for the current block based on the candidate block vectors of the current block; sorting the first list based on the current block template to obtain a second list; and adding the second list to the candidate list of the current block. The first list may be an initial block vector list, and the first list includes one or more candidate lists for the current block. The second list is a sorted list of block vectors.
[0163] For example, sorting the first list based on the current block template to obtain the second list includes: traversing the first list to obtain the block vector information of the current block; determining the block vector of the current block template based on the block vector information of the current block; determining the predicted value of the current block template based on the block vector of the current block template; calculating the cost based on the predicted value and the reconstructed value of the current block template to determine the first-generation value; and sorting the first list based on the first-generation value to obtain the second list.
[0164] First-generation values include, but are not limited to, one of the following: sum of absolute errors (SAD), sum of transformed absolute errors (SATD), sum of squared differences (SSE), mean absolute difference (MAD), mean absolute error (MAE), mean squared error (MSE), etc.
[0165] In some embodiments, the block vector information of the current block includes candidate block vectors and block vector-related information of the current block. Determining the block vector of the current block template based on the block vector information of the current block includes: adjusting the block vector of the current block based on the block vector-related information of the current block and the current block template information to obtain the block vector of the current block template. The block vector adjustment method will be described in detail later.
[0166] Accordingly, the method further includes: determining the block vector related information corresponding to the candidate block vector of the current block based on the block vector related information of the reference block of the current block; and constructing a first list of the current block based on the candidate block vector of the current block, including: constructing a first list of the current block based on the candidate block vector of the current block and its block vector related information.
[0167] In some embodiments, determining the predicted value of the current block template based on the block vector of the current block template includes: determining the reference block of the current block template based on the block vector of the current block template; and determining the predicted value of the current block template based on the reference block of the current block template and the relevant information of the block vector of the current block template.
[0168] For example, the block vector related information includes a flip identifier; determining the predicted value of the current block template based on the reference block of the current block template and the block vector related information of the current block template includes: if the flip identifier is a first value, using the reference value of the current block template as the predicted value of the current block template. Specifically, the reference value of the current block template refers to the reconstructed value of the sample point in the reference block pointed to by the block vector of the current block template.
[0169] For example, the block vector related information includes a flip identifier; determining the predicted value of the current block template based on the reference block of the current block template and the block vector related information of the current block template includes: when the flip identifier is a second value, horizontally flipping the coordinates of the sample points of the current block template based on the width of the current block template; and determining the predicted value of the sample points of the current block template based on the flipped coordinates of the sample points of the current block template and the corresponding reference block.
[0170] For example, the block vector related information includes a flip identifier; when the flip identifier is a third value, the coordinates of the sample points of the current block template are vertically flipped based on the height of the current block template; and the predicted value of the sample points of the current block template is determined based on the flipped coordinates of the sample points of the current block template and the corresponding reference block.
[0171] In some embodiments, determining the prediction mode of the current block based on the candidate list of the current block includes: constructing a candidate list of the current block based on the candidate block vectors of the current block, provided that a first condition is met; the first condition includes at least one of the following: all reference templates of the reference regions pointed to by the candidate block vectors of the current block have been reconstructed; all or part of the reference regions pointed to by the candidate block vectors of the current block have been reconstructed; the reference regions pointed to by the candidate block vectors of the current block do not exceed the image boundary; the reference regions pointed to by the candidate block vectors of the current block do not include the current block; the reference regions pointed to by the candidate block vectors of the current block do not exceed the available area; the candidate block vectors of the current block have not been added to the candidate list of the current block.
[0172] In some embodiments, the method further includes: obtaining one or more preset patterns based on a first order, wherein the preset patterns do not include block vector information; constructing a third list of the current block based on the one or more preset patterns; sorting the third list based on the current block template to obtain a fourth list; and adding the fourth list to the candidate list of the current block.
[0173] One or more preset modes include, but are not limited to: horizontal TIMD mode, vertical TIMD mode, angle prediction mode parallel to the dividing line, intra-frame prediction mode derived in a DIMD-like manner, angle prediction modes at five adjacent positions, angle mode perpendicular to the first candidate in the list, and Planar mode. For example, the fourth candidate list precedes the second list.
[0174] In some embodiments, determining the prediction mode of the current block based on the candidate list of the current block includes: determining the candidate combination mode of the current block based on the candidate list of the current block, wherein the candidate combination mode includes a first prediction mode and a second prediction mode; sorting the candidate combination modes based on the current block template to obtain a third candidate list of the current block; and determining the combination mode used by the current block based on the third candidate list of the current block.
[0175] For example, determining the candidate combination mode for the current block based on the candidate list includes: obtaining a first prediction mode and a second prediction mode from the candidate list to obtain a candidate combination mode. That is, any two prediction modes in the candidate list are combined to obtain a candidate combination mode, and the candidate combination modes are sorted using a template to obtain the combination mode used by the current block. For example, the candidate combination mode can be two intra-frame prediction modes, and the combination of intra-frame prediction modes includes, but is not limited to: traditional intra-frame prediction mode M0 + traditional intra-frame prediction mode M1, and traditional intra-frame prediction mode M0 + BV-based prediction mode. Or based on BV prediction model +Based on BV prediction model
[0176] For example, determining a candidate combination pattern for the current block based on the candidate list of the current block includes: obtaining a first prediction pattern from a first candidate list, obtaining a second prediction pattern from a second candidate list, and obtaining a candidate combination pattern.
[0177] In some embodiments, a candidate list for the current block is constructed based on the candidate block vector of the current block, including: constructing a candidate list for the current block under each partitioning mode based on the candidate block vector of the current block and one or more partitioning modes of the current block.
[0178] Accordingly, based on the candidate list of the current block, the candidate combination mode of the current block is determined, including: based on the candidate list of the current block and one or more partitioning modes of the current block, the candidate combination mode also includes partitioning modes.
[0179] For example, a first candidate list and a second candidate list are constructed for each partitioning mode; under each partitioning mode, a first prediction mode is obtained from the first candidate list and a second prediction mode is obtained from the second candidate list, thereby obtaining a candidate combination mode. At this time, the candidate combination mode includes: partitioning mode, first prediction mode and second prediction mode.
[0180] For example, a candidate list is constructed for each partitioning mode; under each partitioning mode, a first prediction mode and a second prediction mode are obtained from the corresponding candidate list to obtain a candidate combination mode.
[0181] For example, a candidate list is constructed corresponding to all partitioning modes; under each partitioning mode, a first prediction mode and a second prediction mode are obtained from the candidate list to obtain a candidate combination mode.
[0182] In some embodiments, the process of sorting candidate combination patterns based on the current block template to obtain a third candidate list for the current block includes: determining a first predicted value and a second predicted value for the current block template based on a first predicted pattern and a second predicted pattern of the candidate combination patterns; performing a weighted fusion of the first predicted value and the second predicted value of the current block template to obtain a final predicted value for the current block template; calculating a cost based on the final predicted value and the reconstructed value of the current block template to determine a second-generation value; and sorting the candidate combination patterns based on the second-generation value to obtain a third candidate list for the current block.
[0183] Second-generation values include, but are not limited to, one of the following: sum of absolute errors (SAD), sum of transformed absolute errors (SATD), sum of squared differences (SSE), mean absolute difference (MAD), mean absolute error (MAE), mean squared error (MSE), etc.
[0184] In some embodiments, determining the combination pattern used by the current block based on the third candidate list of the current block includes: taking the combination pattern ranked first in the third candidate list as the combination pattern used by the current block.
[0185] In some embodiments, the method further includes: parsing the pattern index of the current block; and determining the combined pattern used by the current block based on the pattern index of the current block and a third candidate list of the current block. For example, the position of the combined pattern used by the current block in the third candidate list is determined according to the pattern index, thereby determining the first prediction pattern and the second prediction pattern included in the combined pattern.
[0186] In some embodiments, the candidate combination pattern further includes a partitioning pattern; the method further includes: determining the fusion weights of the current block template based on the partitioning pattern of the current block; the fusion weights of the current block template are used to perform weighted fusion of the first predicted value and the second predicted value of the current block template. That is, the weight matrices W0 and W1 corresponding to the two predicted blocks of the current block template can be determined according to the partitioning pattern, the current block size, and the current block template size, and the weight matrices include the fusion weights of one or more sample points. For example, the fusion weights of the sample points of the current block can be determined according to the direction and position of the partitioning line and the coordinates of the sample points of the current block template.
[0187] In some embodiments, the method further includes: determining a fusion weight for the current block template based on a first predicted value, a second predicted value, and a reconstructed value; the fusion weight of the current block template is used to perform a weighted fusion of the first predicted value and the second predicted value of the current block template. That is, assuming a candidate combination mode includes a first predicted mode as Mode0 and a second predicted mode as Mode1, the predicted values Pred0 and Pred1 of Mode0 and Mode1 on the template are first obtained respectively, then the fusion weight is derived based on the predicted value and the reconstructed value on the template, and the two predicted values on the template are weighted and fused according to the fusion weight.
[0188] For example, the fusion weight of the current block template is determined based on the partitioning pattern of the current block and the size of the current block template; or, the fusion weight of the current block template is determined based on the first and second predicted values of the current block template, as well as the current block template and the reconstructed value.
[0189] S403: Determine the predicted value of the current block based on the block vector of the current block.
[0190] In some embodiments, determining the predicted value of the current block based on the block vector of the current block includes: determining a reference block of the current block based on the block vector of the current block; and determining the predicted value of the current block based on the reference block of the current block and the block vector related information of the current block.
[0191] For example, the block vector related information includes a flip identifier; determining the predicted value of the current block based on the reference block of the current block and the block vector related information of the current block includes: if the flip identifier is a first value, using the reference value of the current block as the predicted value of the current block. Specifically, the reference value of the current block refers to the reconstructed value of the sample point in the reference block pointed to by the block vector of the current block.
[0192] For example, the block vector related information includes a flip identifier; determining the predicted value of the current block based on the reference block of the current block and the block vector related information of the current block includes: when the value of the flip identifier is a second value, horizontally flipping the coordinates of the sample points of the current block based on the width of the current block; and determining the predicted value of the sample points of the current block based on the flipped coordinates of the sample points of the current block and the corresponding reference block.
[0193] For example, the block vector related information includes a flip identifier; when the flip identifier is a third value, the coordinates of the sample points of the current block are vertically flipped based on the height of the current block; and the predicted value of the sample points of the current block is determined based on the flipped coordinates of the sample points of the current block and the corresponding reference block.
[0194] Block copy prediction based on BV refers to obtaining the predicted block of the current block through block copying based on the current BV information. The specific prediction process is as follows: first, block copy prediction is performed using the current BV to obtain the predicted block Pred based on BV for the current CU. bv Then, post-processing is performed based on the information corresponding to the current BV (e.g., the flip identifier rribcFlipType) to determine the final prediction block Pred.
[0195] a) Determine the prediction block based on the current block BV.
[0196] The prediction block Pred is obtained by copying its block vector. bv The specific prediction process is shown in Figure 10:
[0197] b) Adjust the prediction block based on BV additional information
[0198] Let the current CU's width be w, the current CU's height be h, and p bv (x,y) is the predicted value of the current block at position (x,y) before flipping, and p(x,y) is the final predicted value of the current block at position (x,y).
[0199] The specific details are as follows:
[0200] For the case where rribcFlipType = 0, no flipping is required, as shown in Figure 11. That is, the value at each position in the final predicted block Pred is: p(x,y) = p bv (x,y)
[0201] For the case where rribcFlipType=1, horizontal flipping is required, as shown in Figure 12. That is, the value at each position in the final predicted block Pred is: p(x,y)=p bv (w-1-x,y)
[0202] For the case where rribcFlipType=2, vertical flipping is required, as shown in Figure 13. That is, the value at each position in the final predicted block Pred is: p(x,y)=p bv (x, h-1-y)
[0203] For cases requiring template prediction, the template prediction process will be described:
[0204] a) Determine the template prediction block based on the current block template BV.
[0205] Based on the current block template block vector, the prediction value P of the prediction block is obtained by block copying. top and P left .
[0206] b) Adjust the template prediction block based on the template BV supplementary information
[0207] Let w top h is the width of the upper template. top w is the height of the upper template left h is the width of the left template. left p is the height of the left template. top (x,y) is the reference value of the (x,y) position of the upper template before the flip-sensor adjustment, p′ top (x,y) represents the final template prediction value at position (x,y) of the upper template, p left (x,y) is the reference value of the left template before the flip-sensor adjustment of the (x,y) position, p′ left (x, y) represents the final template prediction value at position (x, y) of the left template. The specific flip-aware adjustment prediction process is explained based on the flip flag corresponding to the current BV:
[0208] For the case where rribcFlipType = 0, no flipping is required; that is, the predicted value at each position in the final template prediction block is: p′ top (x,y)=p top (x,y) p′ left (x,y)=p left (x,y)
[0209] For the case where rribcFlipType=1, horizontal flipping is required, meaning the predicted value for each position in the final template prediction block is: p′ top (x,y)=ptop(w top -1-x,y) p′ left (x,y)=p left (w left -1-x,y)
[0210] For the case where rribcFlipType=2, vertical flipping is required, meaning the predicted value at each position in the final template prediction block is: p′ top (x,y)=p top (x,h top -1-y) p′ left (x,y)=p left (x,h left -1-y)
[0211] In some embodiments, the method further includes: determining a first prediction mode and a second prediction mode for the current block based on the combination mode used by the current block; determining a first prediction value and a second prediction value for the current block based on the first prediction mode and the second prediction mode; and performing a weighted fusion of the first prediction value and the second prediction value for the current block to obtain the final prediction value for the current block.
[0212] If the first prediction mode of the current block includes a block vector, the first prediction value of the current block is determined based on the block vector corresponding to the first prediction mode; if the first prediction mode of the current block does not include a block vector, the first prediction value of the current block is determined based on the first prediction mode.
[0213] If the second prediction mode of the current block includes a block vector, the second prediction value of the current block is determined based on the block vector corresponding to the second prediction mode; if the second prediction mode of the current block does not include a block vector, the second prediction value of the current block is determined based on the second prediction mode.
[0214] In some embodiments, the candidate combination mode further includes a partitioning mode; the method further includes: determining the fusion weight of the current block or the fusion weight of the current block template based on the partitioning mode of the current block; the fusion weight of the current block is used to perform weighted fusion of the first predicted value and the second predicted value of the current block, and the fusion weight of the current block template is used to perform weighted fusion of the first predicted value and the second predicted value of the current block template. That is, the weight matrices W0 and W1 corresponding to the two predicted blocks of the current block can be determined according to the partitioning mode and the current block size. The weight matrices W0 and W1 corresponding to the two predicted blocks of the current block template can be determined according to the partitioning mode, the current block size, and the current block template size. The weight matrix includes the fusion weights of one or more sample points. For example, the fusion weights of the sample points of the current block are determined according to the direction and position of the partitioning line and the coordinates of the sample points of the current block template.
[0215] In some embodiments, the method further includes: determining a fusion weight for the current block based on a first predicted value, a second predicted value, and a reconstructed value of the current block template; the fusion weight of the current block is used to perform a weighted fusion of the first predicted value and the second predicted value of the current block. That is, assuming a candidate combination mode includes a first predicted mode as Mode0 and a second predicted mode as Mode1, the predicted values Pred0 and Pred1 of Mode0 and Mode1 on the template are first obtained respectively, then the fusion weight is derived based on the predicted value and the reconstructed value on the template, and the two predicted values on the template are weighted and fused according to the fusion weight.
[0216] For example, the fusion weight of the current block template is determined based on the partitioning pattern of the current block and the size of the current block template; or, the fusion weight of the current block template is determined based on the first and second predicted values of the current block template, as well as the current block template and the reconstructed value.
[0217] To further improve luminance coding performance, a Spatial Geometric Partitioning Mode (SGPM) is proposed in related technologies. In SGPM, the coded block is divided into two geometric partitions using partition lines, and these two partitions are obtained using different intra-prediction modes. Specifically, two prediction blocks are obtained using the two intra-prediction modes respectively, and then weighted and fused to obtain the final prediction value. The weighting weights are typically determined based on the direction and position of the partition lines to reflect the partitioning.
[0218] Furthermore, related technologies also propose allowing SGPM partitions to use block vector (BV) based prediction modes. Specifically, the intra-prediction mode combination for two SGPM partitions can be: traditional intra-prediction mode M0 + traditional intra-prediction mode M1, or traditional intra-prediction mode M0 + BV-based prediction mode. Or based on BV prediction model +Based on BV prediction model
[0219] Furthermore, taking SGPM as an example, the prediction process at the decoding end is further illustrated in Figure 14. The specific prediction process of SGPM includes:
[0220] The process involves determining available partitioning modes, identifying corresponding candidate intra-prediction modes for each partitioning mode, determining the SGPM combined intra-prediction mode, and obtaining the predicted values of the combined intra-prediction mode. The flowchart of this process is shown in Figure 14, and will be described in detail below:
[0221] S1401: Determine the available partitioning modes for the current block;
[0222] To enable fine-grained encoding of content-rich units, SGPM supports multiple partitioning modes. An example of a partitioning mode available to SGPM is shown in Figure 15. In this example, SGPM selects 26 partitions as a candidate set of partitioning modes, as shown by the bold lines in Figure 15.
[0223] S1402: Determine the first candidate list and the second candidate list corresponding to each partitioning pattern;
[0224] For example, the SGPM mode selects intra-prediction modes for prediction in two partitions. To reduce mode information overhead, an Intra Prediction Mode (IPM) list is established for each partition, namely a first candidate list and a second candidate list, for partition intra-prediction mode selection. The list length does not exceed L (e.g., L=9), including L1 (e.g., L1=3) traditional intra-prediction modes and no more than L2 (e.g., L2=6) BV-based prediction modes. One method for obtaining the partition IPM list construction is as follows:
[0225] (1) Based on the information corresponding to the following modes, add L1 traditional intra-frame prediction modes to construct a third list;
[0226] An example of adding a traditional intra-frame prediction mode is as follows:
[0227] Add traditional intra-frame prediction modes in the following order without repetition, until L1 traditional intra-frame prediction modes are added.
[0228] 1. Horizontal TIMD mode
[0229] 2. Vertical TIMD mode
[0230] 3. Angle prediction mode parallel to the dividing line
[0231] 4. Intra-prediction mode derived using a DIMD-like approach
[0232] 5. Angle prediction model for five adjacent positions
[0233] 6. Angle pattern perpendicular to the first candidate in the list
[0234] 7. Planar Mode
[0235] Another example of adding traditional intra-frame prediction mode is:
[0236] a. Constructing a list of traditional intra-frame prediction modes for SGPM
[0237] Add the following modes to the list of traditional intra-frame prediction modes for SGPM.
[0238] 1. Horizontal TIMD mode
[0239] 2. Vertical TIMD mode
[0240] 3. Angle prediction mode parallel to the dividing line
[0241] 4. Intra-prediction mode derived using a DIMD-like approach
[0242] 5. Angle prediction model for five adjacent positions
[0243] 6. Angle pattern perpendicular to the first candidate in the list
[0244] 7. Planar Mode
[0245] b. Sort the list of traditional intra-frame prediction modes according to the template to obtain the fourth list.
[0246] Using the reconstructed regions adjacent to the current CU as templates (e.g., the row above and column to the left of the current CU as templates), each mode in the traditional intra-frame prediction mode list is traversed, the prediction value of the current block template is obtained for each mode, and the prediction cost (e.g., SAD) of the template reconstruction value and the prediction value is calculated. The templates are then sorted in ascending order. The specific template prediction process is shown in the figure below.
[0247] c. Add the traditional intra-frame prediction mode to the IPM list.
[0248] Based on the traditional intra-frame prediction mode list sorted by template, the top L1 modes in the list are added to the partition candidate prediction mode list.
[0249] (2) Based on the following steps, add no more than L2 BV-based prediction patterns.
[0250] a. Construct the BV Merge list of SGPM, i.e., the first list.
[0251] Obtain multiple neighboring CUs of the current block. If the prediction mode of a neighboring CU is Intra TMP mode or IBC mode, obtain its block vector (set as...). Then, it is determined whether the neighboring CUs carry auxiliary information (e.g., flip information, more specifically, such as RRIBC mode, or flip information carried in the mode described in this patent). For example, whether the flip identifier rribcFlipType of the neighboring block is greater than 0. If rribcFlipType is greater than 0, then the block vector needs to be flip-aware adjusted. Let the adjusted block vector be BV. cur The specific details are as follows:
[0252] No flipping is needed; that is, for the case where rribcFlipType = 0, directly determine BV. nbr To determine if the current block is available (or valid), if available, set BV. nbr and its flip information rribcFlipType=0 combination (BV nbr ,0) is added to the BV candidate list.
[0253] An example of a method to check whether a block value (BV) is valid for the current block is as follows:
[0254] Specifically, the following conditions are considered; if all conditions are met, the BV is usable:
[0255] The entire reference template area has been rebuilt.
[0256] The entire reference area has been reconstructed.
[0257] The obtained offset position does not exceed the image boundary.
[0258] The reference region corresponding to the obtained offset position does not cover the current block: xCb+width+BVChor<=xCb or yCb+height+BVCver<=yCb
[0259] The obtained offset position does not exceed the available area.
[0260] The current BV is not duplicated with the BV in the existing BV Merge list.
[0261] Without flipping, the reference template area corresponding to the template area of the current block is shown in Figure 7.
[0262] Horizontal flipping, that is, for the case where rribcFlipType=1, first, for BV... nbr Perform horizontal flip perception adjustment, which obtains BV through horizontal flip perception adjustment. cur The calculation formula is as follows:
[0263] Where, x nbr The x-coordinate of the center position of the neighboring block, x cur This represents the X-coordinate of the center position of the current block. (BV) nbr The schematic diagram of the horizontal flip perception adjustment is shown in Figure 5.
[0264] Secondly, determine BV cur To determine if the current block is available, if so, set the BV. cur and its flip information rribcFlipType=1 combination (BV cur 1) Add to the BV candidate list. The reference template region corresponding to the template region of the current block in the case of horizontal flipping is shown in Figure 8.
[0265] Vertical flipping, i.e., for the case where rribcFlipType=2, first, for BV... nbr Vertical flip perception adjustment is performed, which obtains BV through horizontal flip perception adjustment. cur The calculation formula is as follows:
[0266] Among them, y nbr The Y-coordinate of the center position of the neighboring block, y cur This is the Y-coordinate of the center position of the current block. (BV) nbrThe schematic diagram of the vertical flip perception adjustment is shown in Figure 6.
[0267] Secondly, determine BV cur To determine if the current block is available, if so, set the BV. cur and its flip information rribcFlipType=2 combination (BV cur 2) Add to the BV candidate list. In the case of vertical flipping, the reference template region corresponding to the template region of the current block is shown in Figure 9.
[0268] b. Sort the BV Merge list according to the template to obtain the second list.
[0269] Using the reconstructed regions adjacent to the current CU as templates (e.g., the row above and column to the left of the current CU as templates), traverse each BV in the BV Merge list, obtain the predicted value of the current block template under each BV mode, and calculate the prediction cost (e.g., SAD) of the template reconstruction value and the predicted value. Sort them in ascending order accordingly. The specific template prediction process is explained according to the flip flag corresponding to the current BV.
[0270] No flipping is required; that is, for the case where rribcFlipType = 0, the corresponding template prediction value P is obtained for the upper and left template regions based on their current block vector BV. top and P left That is, tBV = lBV = BV. The process of obtaining the template prediction value based on tBV and lBV without flipping is shown in Figure 7.
[0271] Horizontal flipping, i.e., for the case where rribcFlipType=1, yields the corresponding template prediction value P for the upper and left template regions based on their block vectors tBV and lBV, respectively. top and P left The formulas for calculating tBV and lBV are as follows: tBV = BV lBV = (BV...) h +2×(x cur -x left ),BV v )
[0272] Where, x cur The x-coordinate of the center position of the current block. left This represents the X-coordinate of the center position of the left template region of the current block. Figure 8 illustrates the process of obtaining the template prediction value based on tBV and lBV in the case of horizontal flipping.
[0273] Subsequently, P top and P left The final template prediction value P′ is obtained by performing a horizontal flip. top and P′ leftSpecifically, the calculation formula for each sample point is as follows: p′ top (x,y)=p top (w top -1-x,y) p′ left (x,y)=p left (w left -1-x,y)
[0274] Among them, w top w is the width of the template above. left p is the width of the left template. top (x,y) is the reference value of the (x,y) position of the upper template before flipping, p′ top (x,y) is the final template prediction value at position (x,y) of the upper template.
[0275] Vertical flipping, i.e., for the case where rribcFlipType=2, yields the corresponding template prediction value P for the upper and left template regions based on their block vectors tBV and lBV, respectively. top and P lef The formulas for calculating tBV and lBV are as follows: tBV = (BV) / lBV h BV v +2×(y cur -y top )) lBV=BV
[0276] Among them, y cur The y-coordinate of the center position of the current block. top This represents the Y-coordinate of the center position of the template region on the current block. Figure 9 illustrates the process of obtaining the template prediction value based on tBV and lBV in the case of vertical flipping.
[0277] Subsequently, P top and P left The final template prediction value P′ is obtained by performing a vertical flip. top and P′ left Specifically, the calculation formula for each sample point is as follows: p′ top (x,y)=p top (x,h top -1-y) p′ left (x,y)=p left (x,h left -1-y)
[0278] Among them, h top h is the width of the upper template. left p is the width of the left template. top (x,y) is the reference value of the (x,y) position of the upper template before flipping, p′ top(x,y) is the final template prediction value at position (x,y) of the upper template.
[0279] c. Add a BV-based prediction model to obtain the final IPM list.
[0280] Based on the BV Merge list sorted by template, the first Q (Q = min(L2,P)) BVs in the list (where P is the number of elements in the BV Merge list) are added to the first and second candidate lists corresponding to each partition.
[0281] S1403: Determine the SGPM composition mode of the current block.
[0282] To reduce pattern overhead and complexity, SGPM technology uses template derivation to find the top N most likely candidate pattern combinations and selects one as the final prediction pattern. The index of this pattern among the N candidates is transmitted in the bitstream. Each candidate pattern combination includes a partitioning pattern, a partition 0 prediction pattern, and a partition 1 prediction pattern. Specifically, the template-based SGPM candidate pattern combination operation involves extending the partition lines of the coded block to the template region, as shown in Figure 16. For each possible combination of partitioning and partition prediction patterns, a template prediction value is generated on the template, and the prediction cost (e.g., SAD) between the template and the predicted value and the reconstructed value is calculated and sorted in ascending order.
[0283] As shown in Figure 17, the specific implementation mainly consists of the following four steps:
[0284] S1701: Get the current block template;
[0285] Take the neighboring reconstructed areas of the current CU as the template (e.g., the row above and column to the left of the current CU as the template).
[0286] S1702: Obtain the weighted prediction value of the current block template under different candidate combinations;
[0287] Weighted predictions are performed on all candidate combinations using the template. Specifically, let P be the partitioning mode of a candidate combination pattern, Mode0 be the prediction mode for partition 0, and Mode1 be the prediction mode for partition 1. First, the predicted values tPred0 and tPred1 for Mode0 and Mode1 on the template are obtained respectively. Then, the fusion matrix is obtained, and the weighted fusion of tPred0 and tPred1 is used to calculate the template prediction value. The specific prediction process is explained based on the flip flag corresponding to the current BV:
[0288] a. Obtain the predicted values of Mode0 and Mode1 on the template.
[0289] Weighted predictions are performed on all candidate combinations on the template. Specifically, let P be the partitioning mode of a candidate combination pattern, Mode0 be the prediction mode of partition 0, and Mode1 be the prediction mode of partition 1. First, the prediction values tPred0 and tPred1 of Mode0 and Mode1 on the template are obtained respectively. Then, the fusion matrix is obtained. Based on the fusion matrix, the template prediction value after weighted fusion of tPred0 and tPred1 is calculated. The specific prediction process is explained according to the flip flag corresponding to the current BV:
[0290] When flipping is not required, for the case where rribcFlipType=0, the corresponding template prediction value P is obtained for the upper and left template regions based on their current block vector BV. top and P left That is, tBV = lBV = BV. The process of obtaining the template prediction value based on tBV and lBV without flipping is shown in Figure 7.
[0291] When flipping horizontally, for the case where rribcFlipType=1, the corresponding template prediction value P is obtained for the upper and left template regions based on their block vectors tBV and lBV, respectively. top and P left The formulas for calculating tBV and lBV are as follows: tBV = BV lBV = (BV...) h +2×(x cur -x left ),BV v )
[0292] Where, x cur x is the X-coordinate of the center position of the current block, and xleft is the X-coordinate of the center position of the left template region of the current block. Figure 8 shows a schematic diagram of the process of obtaining the template prediction value based on tBV and lBV in the case of horizontal flipping.
[0293] Subsequently, P top and P left The final template prediction value P′ is obtained by performing a horizontal flip. top and P′ left Specifically, the calculation formula for each sample point is as follows: p′ top (x,y)=p top (w top -1-x,y) p′ left (x,y)=p left (w left -1-x,y)
[0294] Among them, w top w is the width of the template above. left p is the width of the left template. top(x,y) is the reference value of the (x,y) position of the upper template before flipping, p′ top (x,y) is the final template prediction value at position (x,y) of the upper template.
[0295] Vertical flipping, i.e., for the case where rribcFlipType=2, yields the corresponding template prediction value P for the upper and left template regions based on their block vectors tBV and lBV, respectively. top and P left The formulas for calculating tBV and lBV are as follows: tBV = (BV) / lBV h BV v +2×(y cur -y top )) lBV=BV
[0296] Among them, y cur The y-coordinate of the center position of the current block. top This represents the Y-coordinate of the center position of the template region on the current block. Figure 9 illustrates the process of obtaining the template prediction value based on tBV and lBV in the case of vertical flipping.
[0297] Subsequently, P top and P left The final template prediction value P′ is obtained by performing a vertical flip. top and P′ left Specifically, the calculation formula for each sample point is as follows: p′ top (x,y)=p top (x,h top -1-y) p′ left (x,y)=p left (x,h lef t-1-y)
[0298] Among them, h top h is the width of the upper template. left p is the width of the left template. top (x,y) is the reference value of the (x,y) position of the upper template before flipping, p′ top (x,y) is the final template prediction value at position (x,y) of the upper template.
[0299] b. Determine the template fusion matrix
[0300] The fusion matrix on the template is determined based on the partitioning pattern, block size, and template area size.
[0301] c. Calculate the template prediction value after weighted fusion.
[0302] Based on the template prediction values and template fusion matrix corresponding to Mode0 and Mode1, the final template prediction value is generated by weighted fusion.
[0303] S1703: Sort candidate combination patterns;
[0304] The template distortion of each candidate combination is calculated according to the cost criterion (e.g., SAD), and the candidate combination patterns are sorted in ascending order according to the distortion to obtain a reordered candidate combination pattern list modeCandList. The first N (e.g., N=16) candidate combination patterns in the list are retained.
[0305] S1704: Determine the SGPM combination mode of the current block based on the SGPM combination mode index of the current block.
[0306] By using the SGPM combination mode index obtained from the decoder and the candidate combination mode list after template sorting obtained in step S1703, the combination mode used by the SGPM mode of the current block can be determined as the SGPM Idx item in the candidate combination mode list after template sorting, and the corresponding partitioning mode and partitioning mode can be determined.
[0307] For example, the method further includes: if the current block allows the use of SGPM mode, parsing the mode index (sgpm_cand_idx) of the current block; determining the partition mode index (partition_mode_idx), the first prediction mode index (intra_pre_mode0_idx), and the second prediction mode index (intra_pre_mode1_idx) of the current block based on the mode index; determining the partition mode of the current block based on the partition mode index, determining the first prediction mode of the current block based on the first prediction mode index, and determining the second prediction mode of the current block based on the second prediction mode index.
[0308] S1404: Determine the predicted value of the current block.
[0309] Based on the final determined combination mode, a weighted prediction value for the current combination mode is generated according to its corresponding partitioning mode, partition 0 prediction mode Mode0, and partition 1 prediction mode Mode1. This process includes three parts: obtaining the prediction value of the current block under Mode0 and Mode1 respectively, determining the fusion matrix according to the partitioning mode, and generating the weighted prediction value.
[0310] (1) Obtain the prediction blocks Pred0 and Pred1 of the current block in Mode 0 and Mode 1 respectively.
[0311] Two prediction blocks, Pred0 and Pred1, are obtained for the current CU based on Mode0 and Mode1, respectively. Specifically, taking Mode0 as an example, if Mode0 is the traditional intra-frame prediction mode, the prediction value of each sample point of the current CU in Mode0 mode is calculated based on the neighboring reference samples of the current block to obtain Pred0; if Mode0 is the BV-based prediction mode, the prediction block Pred0 is obtained by copying the block vector. The specific prediction process is shown in Figure 10.
[0312] After obtaining the current CU's BV-based prediction block Pred0 via block copy, determine whether post-processing of the prediction values is required based on its flip flag:
[0313] Let Pred′ be the final predicted block based on BV for the post-processed current block.
[0314] If the flip flag corresponding to the current BV indicates that it does not need to be flipped (rribcFlipType=0), then Pred′=Pred, that is, no flipping is required for the prediction block;
[0315] If the flip flag corresponding to the current BV indicates that it needs to be horizontally flipped (rribcFlipType=1), then Pred′ is equal to the prediction block after horizontally flipping Pred.
[0316] Specifically, the calculation formula for each sample point is as follows: p′(x,y)=p(w-1-x,y)
[0317] Where w is the width of the current CU, p(x,y) is the predicted value of the current block at position (x,y) before flipping, and p′(x,y) is the final predicted value of the current block at position (x,y).
[0318] If the flip flag corresponding to the current BV indicates that it needs to be vertically flipped (rribcFlipType=2), then Pred′ is equal to the prediction block after vertically flipping Pred.
[0319] Specifically, the calculation formula for each sample point is as follows: p′(x,y)=p(x,h-1-y)
[0320] Where h is the current height of the CU, p(x,y) is the predicted value of the current block's (x,y) position before flipping, and p′(x,y) is the final predicted value of the current block's (x,y) position.
[0321] (2) Determine the fusion matrix
[0322] The weight matrices W0 and W1 corresponding to the two prediction blocks are determined based on the partitioning pattern and block size.
[0323] (3) Generate weighted predicted values
[0324] Based on Pred0 and Pred1, and their corresponding weight matrices W0 and W1, a weighted fusion is performed to generate the final predicted value. An example is shown below:
[0325] Here, +16 means adding 0.5 times the total weight value (32) to the weighted value in the horizontal direction, and >>5 means dividing the weighted value by the total weight value 32 to obtain the final predicted value. This operation is to round the weighted value.
[0326] If the SGPM mode is selected in the encoding decision, the mode index sgpm_cand_idx of the selected combination mode in the candidate list after template sorting needs to be encoded to indicate the position of the combination mode corresponding to the SGPM mode in the candidate list after template sorting, thereby determining its partition mode index (partition_mode_idx), first prediction mode index (intra_pre_mode0_idx), and second prediction mode index (intra_pre_mode1_idx), as shown in Figure 18.
[0327] In SGPM mode, when some predicted values are derived from BV-based prediction modes, the BV of the reference block and its related information (such as flip indicators) are comprehensively considered. The BV information obtained from the reference block is corrected based on the related information (flip indicators) (flip-aware adjustment). The corrected BV and corresponding additional information (flip indicators) are combined and added to the candidate list of BV-based prediction modes. When selecting a BV-based prediction mode, the final predicted value is obtained based on the BV and the additional information (flip information). A specific implementation example is provided.
[0328] Furthermore, the application of the method provided in this application embodiment in the regression-based SGPM prediction process is illustrated with an example. The regression-based SGPM mode (R-SGPM) is an intra-frame prediction mode that includes two intra-frame prediction modes and adaptively derives fusion weights. Similar to the SGPM mode, R-SGPM also requires first determining a list of candidate intra-frame prediction modes (e.g., traditional intra-frame prediction mode and BV-based prediction mode). Then, a list of candidate combined intra-frame prediction modes is constructed based on the candidate intra-frame prediction mode list, and sorted using template cost. If the current block selects a combined intra-frame prediction mode of R-SGPM, two prediction blocks are obtained based on its corresponding two intra-frame prediction modes, and the weight matrix is derived based on the template to determine the final prediction value after weighted fusion. Specifically, the prediction process is as follows: First, based on the prediction values and reconstructed values of the two intra-frame prediction modes on the template, two integer fusion weight matrices are derived. Then, the prediction blocks under the two intra-frame prediction modes are obtained respectively. Finally, the final prediction value of the current block is obtained by weighted fusion based on the weight matrix.
[0329] When R-SGPM uses the BV information of neighboring blocks to participate in the prediction of the current block, it comprehensively considers the BV of the neighboring blocks from which the BV originates and its additional information (such as flip identifiers). Based on the additional information (flip identifiers), the BV information obtained from neighboring blocks is corrected (flip-aware adjustment) before being applied to the current block / current block template region. After obtaining the reference value of the current block or current block template region through block copying, it is corrected and adjusted (horizontal or vertical flip) to obtain the final prediction value of the current block / prediction value of the current block template region based on the BV prediction mode.
[0330] Using the method provided in the embodiments of this application, Class F and Class TGM sequences were tested on ECM14.0 at 48 intervals under ALL Intra conditions, and BD-rate changes of -0.10%, -0.24%, and -0.04% (i.e. average bitrate changes under the same psnr) were obtained on the Y, Cb, and Cr components, respectively.
[0331] In another embodiment of this application, referring to FIG19, a flowchart of an encoding method provided by an embodiment of this application is shown. As shown in FIG19, the method may include:
[0332] S1901: Obtain the block vector information of the reference block of the current block. The block vector information includes the block vector and / or block vector related information.
[0333] S1902: Determine the block vector of the current block based on the block vector information of the reference block;
[0334] S1903: Determine the predicted value of the current block based on the block vector of the current block.
[0335] In some embodiments, determining the block vector of the current block based on the block vector information of the reference block includes: determining the candidate block vector of the current block based on the block vector information of the reference block; correspondingly, the method further includes: constructing a candidate list of the current block based on the candidate block vector of the current block; determining the prediction mode of the current block based on the candidate list of the current block; and obtaining the block vector corresponding to the prediction mode of the current block as the block vector used by the current block.
[0336] In some embodiments, determining the prediction mode of the current block based on the candidate list of the current block includes: determining the candidate combination mode of the current block based on the candidate list of the current block, wherein the candidate combination mode includes a first prediction mode and a second prediction mode; sorting the candidate combination modes based on the current block template to obtain a third candidate list of the current block; and determining the combination mode used by the current block based on the third candidate list of the current block.
[0337] In some embodiments, constructing a candidate list for the current block based on the candidate block vector of the current block includes: constructing a first candidate list and a second candidate list for the current block based on the candidate block vector of the current block. In some embodiments, constructing a first candidate list and a second candidate list for the current block based on the candidate block vector of the current block includes: constructing a first candidate list based on the first candidate block vector of the current block; and constructing a second candidate list based on the second candidate block vector of the current block.
[0338] In some embodiments, determining a candidate combination pattern for the current block based on a candidate list for the current block includes: determining a first prediction pattern for the candidate combination pattern from a first candidate list; and determining a second prediction pattern for the candidate combination pattern from a second candidate list.
[0339] In some embodiments, a candidate list for the current block is constructed based on the candidate block vector of the current block, including: constructing a candidate list for the current block under each partitioning mode based on the candidate block vector of the current block and one or more partitioning modes of the current block.
[0340] In some embodiments, the process of sorting candidate combination patterns based on the current block template to obtain a third candidate list for the current block includes: determining a first predicted value and a second predicted value for the current block template based on a first predicted pattern and a second predicted pattern of the candidate combination patterns; performing a weighted fusion of the first predicted value and the second predicted value of the current block template to obtain a final predicted value for the current block template; calculating a cost based on the final predicted value and the reconstructed value of the current block template to determine a second-generation value; and sorting the candidate combination patterns based on the second-generation value to obtain a third candidate list for the current block.
[0341] In some embodiments, the method further includes: determining a first prediction mode and a second prediction mode for the current block based on the combination mode used by the current block; determining a first prediction value and a second prediction value for the current block based on the first prediction mode and the second prediction mode; and performing a weighted fusion of the first prediction value and the second prediction value for the current block to obtain the final prediction value for the current block.
[0342] In some embodiments, the candidate combination pattern further includes a partitioning pattern; the method further includes: determining the fusion weight of the current block or the fusion weight of the current block template based on the partitioning pattern of the current block; the fusion weight of the current block is used to perform weighted fusion of the first predicted value and the second predicted value of the current block, and the fusion weight of the current block template is used to perform weighted fusion of the first predicted value and the second predicted value of the current block template.
[0343] In some embodiments, the method further includes: determining the fusion weight of the current block or the fusion weight of the current block template based on the first predicted value, the second predicted value, and the reconstructed value of the current block template; the fusion weight of the current block is used to perform weighted fusion of the first predicted value and the second predicted value of the current block, and the fusion weight of the current block template is used to perform weighted fusion of the first predicted value and the second predicted value of the current block template.
[0344] In some embodiments, determining the combination mode used by the current block based on the third candidate list of the current block includes: traversing the third candidate list of the current block to determine candidate combination modes of the current block; determining the predicted value of the current block based on the candidate combination modes; determining the reconstructed value of the current block based on the predicted value of the current block; calculating the cost based on the reconstructed value and the original value of the current block to determine the third-generation value; and determining the combination mode used by the current block based on the third-generation value. The method further includes: encoding the mode index of the combination mode used by the current block and writing the obtained encoded bits into the bitstream. The third-generation value includes, but is not limited to, rate-distortion cost (RDO).
[0345] In some embodiments, the method further includes: constructing a candidate list for the current block based on the candidate block vectors of the current block, provided that a first condition is met; the first condition includes at least one of the following: all reference templates of the reference regions pointed to by the candidate block vectors of the current block have been reconstructed; all or part of the reference regions pointed to by the candidate block vectors of the current block have been reconstructed; the reference regions pointed to by the candidate block vectors of the current block do not exceed the image boundary; the reference regions pointed to by the candidate block vectors of the current block do not include the current block; the reference regions pointed to by the candidate block vectors of the current block do not exceed the available area; the candidate block vectors of the current block have not been added to the candidate list of the current block.
[0346] In some embodiments, constructing a candidate list for the current block based on the candidate block vector of the current block includes: constructing a first list for the current block based on the candidate block vector of the current block; sorting the first list based on the current block template to obtain a second list; and adding the second list to the candidate list of the current block.
[0347] In some embodiments, sorting the first list based on the current block template to obtain a second list includes: traversing the first list to obtain the block vector information of the current block; determining the block vector of the current block template based on the block vector information of the current block; determining the predicted value of the current block template based on the block vector of the current block template; calculating the cost based on the predicted value and the reconstructed value of the current block template to determine the first generation value; and sorting the first list based on the first generation value to obtain the second list.
[0348] In some embodiments, the block vector information of the current block includes candidate block vectors and block vector related information of the current block. Determining the block vector of the current block template based on the block vector information of the current block includes: adjusting the block vector of the current block based on the block vector related information of the current block and the current block template information to obtain the block vector of the current block template.
[0349] In some embodiments, the method further includes: determining the block vector related information corresponding to the candidate block vector of the current block based on the block vector related information of the reference block of the current block; and constructing a first list of the current block based on the candidate block vector of the current block, including: constructing a first list of the current block based on the candidate block vector of the current block and its block vector related information.
[0350] In some embodiments, the method further includes: determining the block vector information of the current block template based on the block vector information of the current block.
[0351] In some embodiments, determining the predicted value of the current block template based on the block vector of the current block template includes: determining the reference block of the current block template based on the block vector of the current block template; and determining the predicted value of the current block template based on the reference block of the current block template and the relevant information of the block vector of the current block template.
[0352] In some embodiments, the method further includes: obtaining one or more preset patterns based on a first order, wherein the preset patterns do not include block vector information; constructing a third list of the current block based on the one or more preset patterns; sorting the third list based on the current block template to obtain a fourth list; and adding the fourth list to the candidate list of the current block.
[0353] In some embodiments, determining the block vector of the current block based on the block vector information of the reference block includes: determining the block vector of the current block based on the block vector information of the reference block and the current block information.
[0354] In some embodiments, determining the block vector of the current block based on the block vector information of the reference block and the current block information includes: adjusting the block vector of the reference block based on the block vector related information of the reference block, the reference block information, and the current block information to obtain the block vector of the current block.
[0355] In some embodiments, block vector-related information includes a flip identifier.
[0356] In some embodiments, block vector adjustment includes: when the value of the flip identifier is a first value, using the block vector to be processed as the adjusted block vector.
[0357] In some embodiments, the block vector includes a horizontal component, and the block vector adjustment includes: adjusting the horizontal component of the block vector to be processed when the flip identifier is a second value, to obtain the adjusted horizontal component.
[0358] In some embodiments, adjusting the horizontal component of the block vector to be processed to obtain an adjusted horizontal component includes at least one of the following: determining a first distance value in the horizontal direction between the current block center position and the reference block center position; adding twice the first distance value to the horizontal component of the reference block's block vector to obtain the horizontal component of the current block's block vector; determining a second distance value in the horizontal direction between the current block's first template center position and the current block center position; adding twice the second distance value to the horizontal component of the current block's block vector to obtain the horizontal component of the current block's first template's block vector; and using the horizontal component of the current block's block vector as the horizontal component of the current block's second template.
[0359] In some embodiments, the block vector further includes a vertical component, and the block vector adjustment further includes: when the value of the flip identifier is a second value, using the vertical component of the block vector to be processed as the adjusted vertical component.
[0360] In some embodiments, the block vector includes a vertical component, and the block vector adjustment includes: setting the value of the flip identifier to a third value, adjusting the vertical component of the block vector to be processed, and obtaining the adjusted vertical component.
[0361] In some embodiments, adjusting the vertical component of the block vector to be processed to obtain the adjusted vertical component includes at least one of the following: determining a third distance value in the vertical direction between the current block center position and the reference block center position; adding twice the third distance value to the vertical component of the reference block's block vector to obtain the vertical component of the current block's block vector; determining a fourth distance value in the vertical direction between the current block's second template center position and the current block center position; adding twice the fourth distance value to the vertical component of the current block's block vector to obtain the vertical component of the current block's second template's block vector; and using the vertical component of the current block's block vector as the vertical component of the current block's first template.
[0362] In some embodiments, the block vector further includes a horizontal component, and the block vector adjustment further includes: when the value of the flip identifier is a third value, using the horizontal component of the block vector to be processed as the adjusted horizontal component.
[0363] In some embodiments, the method further includes: searching the block vector of the current block within a first range to obtain a refined block vector; determining the template cost of the refined block vector based on the current block template; and using the block vector corresponding to the minimum template cost as the refined block vector of the current block.
[0364] In some embodiments, determining the predicted value of the current block based on the block vector of the current block includes: determining a reference block of the current block based on the block vector of the current block; and determining the predicted value of the current block based on the reference block of the current block and the block vector related information of the current block.
[0365] In some embodiments, the block vector related information includes a flip identifier; the value of the flip identifier is a first value, and the reference value of the current block or the current block template is used as the predicted value of the current block or the current block template.
[0366] In some embodiments, the block vector related information includes a flip identifier; the flip identifier is a second value, and the coordinates of the sample points of the current block or the current block template are horizontally flipped based on the width of the current block or the current block template; the predicted value of the sample points of the current block or the current block template is determined based on the flipped coordinates of the sample points of the current block or the current block template and the corresponding reference block.
[0367] In some embodiments, the block vector related information includes a flip identifier; the flip identifier is a third value, and the coordinates of the sample points of the current block or the current block template are vertically flipped based on the height of the current block or the current block template; the predicted value of the sample points of the current block or the current block template is determined based on the flipped coordinates of the sample points of the current block or the current block template and the corresponding reference block.
[0368] In some embodiments, the method further includes: performing a block vector search within a second range based on the current block template to obtain candidate block vectors for the current block.
[0369] In some embodiments, performing a block vector search within a second range based on the current block template to obtain the block vector of the current block candidate includes: performing a block vector search within a second range based on the current block template and the flipped current block template to obtain the block vector of the current block candidate; determining the block vector of the current block candidate and its flip identifier; and determining the block vector of the current block based on the block vector of the current block candidate, including: determining the block vector of the current block based on the block vector of the current block candidate and its flip identifier.
[0370] Furthermore, taking SGPM as an example, the prediction process at the encoding end is further illustrated as shown in Figure 20. The specific prediction process of SGPM includes:
[0371] S2001: Determine the available partitioning modes for the current block;
[0372] In some embodiments, this is consistent with the decoding process S1401, which determines the available partitioning mode.
[0373] S2002: Determine the first and second candidate lists corresponding to each partitioning pattern;
[0374] In some embodiments, this is consistent with the process S1402 of the decoding end determining the first candidate list and the second candidate list corresponding to each partitioning mode.
[0375] S2003: Determine the SGPM composition mode of the current block;
[0376] As shown in Figure 21, the specific implementation mainly consists of the following four steps:
[0377] S2101: Get the current block template;
[0378] S2102: Obtain the weighted prediction value of the current block template under different candidate combinations;
[0379] S2103: Sort the candidate combination patterns;
[0380] In some embodiments, the current block template is obtained in the same way as the decoder S1701, the weighted prediction value of the current block template under different candidate combinations is obtained in the same way as the decoder S1702, and the candidate combination mode sorting is the same as the decoder S1703.
[0381] S2104: Determine the SGPM composition mode of the current block.
[0382] For the N candidate combination patterns derived from the template, they are sorted at the encoding end according to a certain cost criterion, and one is determined as the final combination pattern. The pattern index of this combination pattern among the N candidate combination patterns is transmitted in the bit stream.
[0383] S2004: Determine the predicted value of the current block.
[0384] Based on the final combination mode determined in step S2104, the weighted prediction value of the current combination mode is generated according to its corresponding partitioning mode, partition 0 prediction mode Mode0, and partition 1 prediction mode Mode1.
[0385] The encoding method provided in this application embodiment can be a prediction method. In a mode that requires the use of reference block BV information for prediction, the relevant information corresponding to the reference block BV is comprehensively considered. Based on the BV-related information and the current block information, the BV and its corresponding relevant information for the current block are determined. When participating in prediction based on the obtained BV, the relevant information of the prediction result or prediction mode is adjusted based on the relevant information corresponding to the BV of the current block, which helps to improve prediction accuracy and thus improve encoding efficiency.
[0386] It should be noted that the application scope of the encoding and decoding method provided in this application embodiment includes, but is not limited to, the prediction process of SGPM and R-SGPM, and can also be applied to other block vector-based prediction modes, such as IBC mode, Intra TMP mode, DIMD mode, TIMD mode, etc.
[0387] In another embodiment of this application, based on the same inventive concept as the foregoing embodiments, referring to FIG22, a schematic diagram of the composition structure of an encoder provided in an embodiment of this application is shown. As shown in FIG22, the encoder 220 may include: a first acquisition unit 2201, a first determination unit 2202, and a first prediction unit 2203; wherein:
[0388] The first acquisition unit is configured to acquire the block vector information of the reference block of the current block, wherein the block vector information includes the block vector and / or block vector related information;
[0389] The first determining unit is configured to determine the block vector of the current block based on the block vector information of the reference block;
[0390] The first prediction unit is configured to determine the predicted value of the current block based on the block vector of the current block.
[0391] Understandably, each functional unit of the encoder also performs the encoding method of any of the foregoing embodiments.
[0392] Understandably, in the embodiments of this application, 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 one. Furthermore, the components in this embodiment can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit described above can be implemented in hardware or as a software functional module.
[0393] 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, in essence, or the part 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 to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the method of this embodiment. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0394] Therefore, embodiments of this application provide a computer-readable storage medium applied to an encoder 220, the computer-readable storage medium storing a computer program that, when executed by a first processor, implements the method of any of the foregoing embodiments.
[0395] This application provides a computer-readable storage medium that stores a bitstream generated by an encoding method such as described above.
[0396] Based on the composition of encoder 220 and the computer-readable storage medium, see Figure 23, which illustrates a schematic diagram of the specific hardware structure of encoder 220 provided in this embodiment. As shown in Figure 23, encoder 220 may include: a first communication interface 2261, a first memory 2262, and a first processor 2263; the various components are coupled together through a first bus system 2264. It is understood that the first bus system 2264 is used to realize the connection and communication between these components. In addition to a data bus, the first bus system 2264 also includes a power bus, a control bus, and a status signal bus. However, for clarity, all buses are labeled as the first bus system 2264 in Figure 23.
[0397] The first communication interface 2261 is used for receiving and sending signals during the process of sending and receiving information with other external network elements;
[0398] The first memory 2262 is used to store computer programs that can run on the first processor 2263;
[0399] The first processor 2263 is used to execute the following when running computer programs:
[0400] Obtain the block vector information of the reference block of the current block. The block vector information includes the block vector and / or block vector related information.
[0401] Determine the block vector of the current block based on the block vector information of the reference block;
[0402] Determine the predicted value of the current block based on the block vector of the current block.
[0403] It is understood that the first memory 2262 in the embodiments of this application can be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced Synchronous DRAM (ESDRAM), Synchlink DRAM (SLDRAM), and Direct Rambus RAM (DRRAM). The first memory 2262 of the system and method described in this application is intended to include, but is not limited to, these and any other suitable types of memory.
[0404] The first processor 2263 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of the first processor 2263 or by instructions in software form. The first processor 2263 may 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. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules may reside in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. The storage medium is located in the first memory 2262. The first processor 2263 reads the information in the first memory 2262 and completes the steps of the above method in conjunction with its hardware.
[0405] It is understood that the embodiments described in this application can be implemented using hardware, software, firmware, middleware, microcode, or a combination thereof. For hardware implementation, the processing unit can be implemented in one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), general-purpose processors, controllers, microcontrollers, microprocessors, other electronic units for performing the functions of this application, or combinations thereof. For software implementation, the technology of this application can be implemented through modules (e.g., procedures, functions, etc.) that perform the functions of this application. Software code can be stored in memory and executed by a processor. The memory can be implemented in the processor or external to the processor.
[0406] Alternatively, as another embodiment, the first processor 2263 is also configured to execute any of the methods in the foregoing embodiments when running a computer program.
[0407] This embodiment provides an encoder in which, in a mode that requires the use of reference block BV information for prediction, the encoder comprehensively considers the relevant information corresponding to the reference block BV, determines the BV and its corresponding relevant information for the current block based on the BV-related information and the current block information, and adjusts the relevant information of the prediction result or prediction mode based on the relevant information corresponding to the BV of the current block when participating in prediction based on the obtained BV, which helps to improve prediction accuracy and thus improve coding efficiency.
[0408] In another embodiment of this application, based on the same inventive concept as the foregoing embodiments, referring to FIG24, a schematic diagram of the composition structure of a decoder 240 provided in an embodiment of this application is shown. As shown in FIG24, the decoder 240 may include: a second acquisition unit, a second determination unit, and a second prediction unit; wherein:
[0409] The second acquisition unit is configured to acquire the block vector information of the reference block of the current block, wherein the block vector information includes the block vector and / or block vector related information;
[0410] The second determining unit is configured to determine the block vector of the current block based on the block vector information of the reference block;
[0411] The second prediction unit is configured to determine the predicted value of the current block based on the block vector of the current block.
[0412] Understandably, each functional unit of the decoder also performs the decoding method of any of the aforementioned embodiments.
[0413] Based on the composition of the decoder 240 and the computer-readable storage medium, Figure 25 illustrates a schematic diagram of the specific hardware structure of the decoder 240 provided in this embodiment. As shown in Figure 25, the decoder 240 may include: a second communication interface 2501, a second memory 2502, and a second processor 2503; the various components are coupled together through a second bus system 2504. It is understood that the second bus system 2504 is used to realize the connection and communication between these components. In addition to a data bus, the second bus system 2504 also includes a power bus, a control bus, and a status signal bus. However, for clarity, all buses are labeled as the second bus system 2504 in Figure 25.
[0414] The second communication interface 2501 is used for receiving and sending signals during the process of sending and receiving information with other external network elements;
[0415] The second memory 2502 is used to store computer programs that can run on the second processor 2503;
[0416] The second processor 2503 is used to execute the following when running computer programs:
[0417] Obtain the block vector information of the reference block of the current block. The block vector information includes the block vector and / or block vector related information.
[0418] Determine the block vector of the current block based on the block vector information of the reference block;
[0419] Determine the predicted value of the current block based on the block vector of the current block.
[0420] Optionally, as another embodiment, the second processor 2503 is also configured to execute the method of any of the foregoing embodiments when running a computer program. It is understood that the second memory 2502 has similar hardware functions to the first memory 2262, and the second processor 2503 has similar hardware functions to the first processor 2263; these will not be described in detail here.
[0421] This embodiment provides a decoder in which, in a mode that requires the use of reference block BV information for prediction, the decoder comprehensively considers the relevant information corresponding to the reference block BV, determines the BV and its corresponding relevant information for the current block based on the BV-related information and the current block information, and adjusts the relevant information of the prediction result or prediction mode based on the relevant information corresponding to the BV of the current block when participating in prediction based on the obtained BV, which helps to improve prediction accuracy and thus improve decoding efficiency.
[0422] In another embodiment of this application, referring to FIG26, a schematic diagram of the composition structure of an encoding / decoding system provided in an embodiment of this application is shown. As shown in FIG26, the encoding / decoding system 260 may include an encoder 2601 and a decoder 2602. In this embodiment of the application, the encoder 2601 may be the encoder described in any of the foregoing embodiments, and the decoder 2602 may be the decoder described in any of the foregoing embodiments.
[0423] It should be noted that, in this application, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0424] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0425] The methods disclosed in the several method embodiments provided in this application can be arbitrarily combined to obtain new method embodiments without conflict. The features disclosed in the several product embodiments provided in this application can be arbitrarily combined to obtain new product embodiments without conflict. The features disclosed in the several method or device embodiments provided in this application can be arbitrarily combined to obtain new method embodiments or device embodiments without conflict.
[0426] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims. Industrial applicability
[0427] This application provides an encoding / decoding method, encoder, decoder, and storage medium. Whether at the encoding or decoding end, the block vector information of a reference block for the current block is obtained. The block vector information includes block vectors and / or block vector-related information. The block vector of the current block is determined using the block vector information of the reference block, thereby improving the accuracy of the prediction mode based on the block vector and thus enhancing encoding efficiency.
Claims
1. A decoding method applied to a decoder, the method comprising: Obtain the block vector information of the reference block of the current block, wherein the block vector information includes the block vector and / or block vector related information; Based on the block vector information of the reference block, determine the block vector of the current block; The predicted value of the current block is determined based on the block vector of the current block.
2. The method according to claim 1, wherein, Determining the block vector of the current block based on the block vector information of the reference block includes: determining the candidate block vector of the current block based on the block vector information of the reference block; The method further includes: Based on the candidate block vector of the current block, construct a candidate list for the current block; Based on the candidate list of the current block, determine the prediction mode of the current block; Obtain the block vector corresponding to the prediction mode of the current block as the block vector of the current block.
3. The method according to claim 2, wherein, Determining the prediction mode of the current block based on the candidate list of the current block includes: Based on the candidate list of the current block, a candidate combination mode for the current block is determined, wherein the candidate combination mode includes a first prediction mode and a second prediction mode; The candidate combination patterns are sorted based on the current block template to obtain the third candidate list of the current block; Based on the third candidate list of the current block, the combination mode used by the current block is determined.
4. The method according to claim 3, wherein, The step of constructing a candidate list for the current block based on the candidate block vector of the current block includes: Based on the candidate block vector of the current block, construct a first candidate list and a second candidate list for the current block.
5. The method according to claim 4, wherein, The step of constructing a first candidate list and a second candidate list for the current block based on the candidate block vector of the current block includes: Based on the first candidate block vector of the current block, construct a first candidate list; A second candidate list is constructed based on the second candidate block vector of the current block.
6. The method according to claim 4, wherein, Determining the candidate combination pattern of the current block based on the candidate list of the current block includes: From the first candidate list, determine the first prediction pattern of the candidate combination pattern; From the second candidate list, a second prediction pattern of the candidate combination pattern is determined.
7. The method according to any one of claims 3-5, wherein, The step of constructing a candidate list for the current block based on the candidate block vector of the current block includes: Based on the candidate block vector of the current block and one or more partitioning modes of the current block, construct a candidate list of the current block under each partitioning mode.
8. The method according to any one of claims 3-7, wherein, The step of sorting the candidate combination patterns based on the current block template to obtain the third candidate list of the current block includes: Based on the first and second prediction modes of the candidate combination patterns, determine the first and second prediction values of the current block template; The first and second predicted values of the current block template are weighted and fused to obtain the final predicted value of the current block template. The cost is calculated based on the final predicted and reconstructed values of the current block template to determine the second-generation value; The candidate combination patterns are sorted based on the second-generation value to obtain the third candidate list of the current block.
9. The method according to any one of claims 3-7, wherein, The method further includes: Based on the combination pattern used by the current block, determine the first prediction pattern and the second prediction pattern of the current block; Based on the first prediction mode and the second prediction mode of the current block, determine the first prediction value and the second prediction value of the current block; The first and second predicted values of the current block are weighted and fused to obtain the final predicted value of the current block.
10. The method according to claim 8 or 9, wherein, The candidate combination pattern further includes a partitioning pattern; the method further includes: Based on the partitioning pattern of the current block, determine the fusion weight of the current block or the fusion weight of the current block template; The fusion weight of the current block is used to perform weighted fusion of the first predicted value and the second predicted value of the current block, and the fusion weight of the current block template is used to perform weighted fusion of the first predicted value and the second predicted value of the current block template.
11. The method according to claim 8 or 9, wherein, The method further includes: Based on the first predicted value, the second predicted value, and the reconstructed value of the current block template, determine the fusion weight of the current block or the fusion weight of the current block template; The fusion weight of the current block is used to perform weighted fusion of the first predicted value and the second predicted value of the current block, and the fusion weight of the current block template is used to perform weighted fusion of the first predicted value and the second predicted value of the current block template.
12. The method according to claim 3, wherein, The method further includes: Parse the pattern index of the current block; Based on the pattern index of the current block and the third candidate list of the current block, the combined pattern used by the current block is determined.
13. The method according to claim 2, wherein, The method further includes: If the first condition is met, a candidate list for the current block is constructed based on the candidate block vector of the current block; The first condition includes at least one of the following: The reference templates of the reference regions pointed to by the candidate block vectors of the current block have all been reconstructed; The reference region pointed to by the candidate block vector of the current block is fully or partially reconstructed; The reference region pointed to by the candidate block vector of the current block does not exceed the image boundary; The reference region pointed to by the candidate block vector of the current block does not include the current block; The reference region pointed to by the candidate block vector of the current block does not exceed the available region; The candidate block vector of the current block is not added to the candidate list of the current block.
14. The method according to claim 2, wherein, The step of constructing a candidate list for the current block based on the candidate block vector of the current block includes: Based on the candidate block vectors of the current block, construct a first list of the current block; The first list is sorted based on the current block template to obtain the second list; Add the second list to the candidate list of the current block.
15. The method according to claim 14, wherein, The process of sorting the first list based on the current block template to obtain the second list includes: Traverse the first list to obtain the block vector information of the current block; Based on the block vector information of the current block, determine the block vector of the current block template; Based on the block vector of the current block template, determine the predicted value of the current block template; The cost is calculated based on the predicted and reconstructed values of the current block template to determine the first-generation value; The first list is sorted based on the first generation value to obtain the second list.
16. The method according to claim 15, wherein, The block vector information of the current block includes candidate block vectors and block vector-related information of the current block. Determining the block vector of the current block template based on the block vector information of the current block includes: Based on the block vector information of the current block and the current block template information, the block vector of the current block is adjusted to obtain the block vector of the current block template.
17. The method according to claim 16, wherein, The method further includes: Based on the block vector related information of the reference block of the current block, determine the block vector related information corresponding to the candidate block vector of the current block; The process of constructing a first list of the current block based on the candidate block vector of the current block includes: Based on the candidate block vectors of the current block and their related block vector information, a first list of the current block is constructed.
18. The method according to claim 16, wherein, The method further includes: Based on the block vector information of the current block, determine the block vector information of the current block template.
19. The method according to claim 15, wherein, Determining the predicted value of the current block template based on the block vector of the current block template includes: Based on the block vector of the current block template, determine the reference block of the current block template; Based on the reference block of the current block template and the block vector related information of the current block template, the predicted value of the current block template is determined.
20. The method of claim 14, wherein, The method further includes: Based on the first order, one or more preset modes are obtained, wherein the preset modes do not include block vector information; Based on the one or more preset patterns, construct a third list for the current block; The third list is sorted based on the current block template to obtain the fourth list; Add the fourth list to the candidate list of the current block.
21. The method according to any one of claims 1-20, wherein, Determining the block vector of the current block based on the block vector information of the reference block includes: The block vector of the current block is determined based on the block vector information of the reference block and the current block information.
22. The method according to claim 21, wherein, Determining the block vector of the current block based on the block vector information of the reference block and the current block information includes: Based on the block vector related information of the reference block, the reference block information, and the current block information, the block vector of the reference block is adjusted to obtain the block vector of the current block.
23. The method according to claim 16 or 22, wherein, The block vector related information includes a flip identifier.
24. The method according to claim 23, wherein, The block vector adjustment includes: when the value of the flip identifier is the first value, the block vector to be processed is taken as the adjusted block vector.
25. The method according to claim 23, wherein, The block vector includes a horizontal component, and the block vector adjustment includes: When the flip identifier takes the second value, the horizontal component of the block vector to be processed is adjusted to obtain the adjusted horizontal component.
26. The method according to claim 25, wherein, The horizontal component of the block vector to be processed is adjusted to obtain the adjusted horizontal component, which includes at least one of the following: Determine a first horizontal distance between the current block center position and the reference block center position; add twice the first distance value to the horizontal component of the block vector of the reference block to obtain the horizontal component of the block vector of the current block; Determine the center position of the current block's first template and the second distance value of the current block's center position in the horizontal direction; add twice the second distance value to the horizontal component of the current block's block vector to obtain the horizontal component of the current block's first template's block vector; The horizontal component of the block vector of the current block is used as the horizontal component of the second template of the current block.
27. The method according to claim 25, wherein, The block vector also includes a vertical component, and the block vector adjustment further includes: When the flip identifier takes the second value, the vertical component of the block vector to be processed is taken as the adjusted vertical component.
28. The method according to claim 23, wherein, The block vector includes a vertical component, and the block vector adjustment includes: The value of the flip identifier is the third value, which is used to adjust the vertical component of the block vector to be processed, resulting in the adjusted vertical component.
29. The method according to claim 28, wherein, The vertical component of the vector to be processed is adjusted to obtain the adjusted vertical component, which includes at least one of the following: Determine the third distance value in the vertical direction between the current block center position and the reference block center position; add twice the third distance value to the vertical component of the block vector of the reference block to obtain the vertical component of the block vector of the current block; Determine the center position of the second template of the current block and the fourth distance value of the center position of the current block in the vertical direction; add twice the fourth distance value to the vertical component of the block vector of the current block to obtain the vertical component of the block vector of the second template of the current block; The vertical component of the block vector of the current block is used as the vertical component of the first template of the current block.
30. The method according to claim 28, wherein, The block vector also includes a horizontal component, and the block vector adjustment further includes: When the value of the flip identifier is the third value, the horizontal component of the block vector to be processed is taken as the adjusted horizontal component.
31. The method according to claim 21, wherein, The method further includes: The block vector of the current block is searched within a first range to obtain a refined block vector; Based on the current block template, determine the template value of the refined block vector; The block vector corresponding to the minimum template cost is used as the refined block vector of the current block.
32. The method according to claim 1, wherein, Determining the predicted value of the current block based on the block vector of the current block includes: Based on the block vector of the current block, determine the reference block of the current block; The predicted value of the current block is determined based on the reference block of the current block and the block vector related information of the current block.
33. The method according to claim 19 or 32, wherein, The block vector related information includes a flip identifier; the value of the flip identifier is a first value, and the reference value of the current block or the current block template is used as the predicted value of the current block or the current block template.
34. The method according to claim 19 or 32, wherein, The block vector related information includes a flip identifier; The value of the flip identifier is a second value, and the coordinates of the sample points of the current block or the current block template are horizontally flipped based on the width of the current block or the current block template. Based on the flipped coordinates of the sample points of the current block or current block template and the corresponding reference block, the predicted value of the sample points of the current block or current block template is determined.
35. The method according to claim 19 or 32, wherein, The block vector related information includes a flip identifier; The value of the flip identifier is a third value, which is used to vertically flip the coordinates of the sample points of the current block or the current block template based on the height of the current block or the current block template. Based on the flipped coordinates of the sample points of the current block or current block template and the corresponding reference block, the predicted value of the sample points of the current block or current block template is determined.
36. The method according to claim 2, wherein, The method further includes: Based on the current block template, a block vector search is performed in the second range to obtain the candidate block vector of the current block.
37. The method of claim 36, wherein, The step of performing a block vector search within a second range based on the current block template to obtain the block vector of the current block candidate includes: Based on the current block template and the flipped current block template, a block vector search is performed in the second range to obtain the block vector of the current block candidate; Determine the block vector and its flip identifier for the current block candidate; Determining the block vector of the current block based on the block vectors of the current block candidates includes: The block vector of the current block is determined based on the block vector of the current block candidate and its flip identifier.
38. An encoding method applied to an encoder, the method comprising: Obtain the block vector information of the reference block of the current block, wherein the block vector information includes the block vector and / or block vector related information; Based on the block vector information of the reference block, determine the block vector of the current block; The predicted value of the current block is determined based on the block vector of the current block.
39. The method according to claim 38, wherein, Determining the block vector of the current block based on the block vector information of the reference block includes: determining the candidate block vector of the current block based on the block vector information of the reference block; The method further includes: Based on the candidate block vector of the current block, construct a candidate list for the current block; Based on the candidate list of the current block, determine the prediction mode of the current block; Obtain the block vector corresponding to the prediction mode of the current block as the block vector used by the current block.
40. The method according to claim 39, wherein, Determining the prediction mode of the current block based on the candidate list of the current block includes: Based on the candidate list of the current block, a candidate combination mode for the current block is determined, wherein the candidate combination mode includes a first prediction mode and a second prediction mode; The candidate combination patterns are sorted based on the current block template to obtain the third candidate list of the current block; Based on the third candidate list of the current block, the combination mode used by the current block is determined.
41. The method according to claim 40, wherein, The step of constructing a candidate list for the current block based on the candidate block vector of the current block includes: Based on the candidate block vector of the current block, construct a first candidate list and a second candidate list for the current block.
42. The method according to claim 41, wherein, The step of constructing a first candidate list and a second candidate list for the current block based on the candidate block vector of the current block includes: Based on the first candidate block vector of the current block, construct a first candidate list; A second candidate list is constructed based on the second candidate block vector of the current block.
43. The method according to claim 41, wherein, Determining the candidate combination pattern of the current block based on the candidate list of the current block includes: From the first candidate list, determine the first prediction pattern of the candidate combination pattern; From the second candidate list, a second prediction pattern of the candidate combination pattern is determined.
44. The method according to any one of claims 40-43, wherein, The step of constructing a candidate list for the current block based on the candidate block vector of the current block includes: Based on the candidate block vector of the current block and one or more partitioning modes of the current block, construct a candidate list of the current block under each partitioning mode.
45. The method according to any one of claims 40-43, wherein, The step of sorting the candidate combination patterns based on the current block template to obtain the third candidate list of the current block includes: Based on the first and second prediction modes of the candidate combination patterns, determine the first and second prediction values of the current block template; The first and second predicted values of the current block template are weighted and fused to obtain the final predicted value of the current block template. The cost is calculated based on the final predicted and reconstructed values of the current block template to determine the second-generation value; The candidate combination patterns are sorted based on the second-generation value to obtain the third candidate list of the current block.
46. The method according to any one of claims 40-45, wherein, The method further includes: Based on the combination pattern used by the current block, determine the first prediction pattern and the second prediction pattern of the current block; Based on the first prediction mode and the second prediction mode of the current block, determine the first prediction value and the second prediction value of the current block; The first and second predicted values of the current block are weighted and fused to obtain the final predicted value of the current block.
47. The method according to claim 45 or 46, wherein, The candidate combination pattern also includes a partitioning pattern; the method further includes: determining the fusion weight of the current block or the fusion weight of the current block template based on the partitioning pattern of the current block; The fusion weight of the current block is used to perform weighted fusion of the first predicted value and the second predicted value of the current block, and the fusion weight of the current block template is used to perform weighted fusion of the first predicted value and the second predicted value of the current block template.
48. The method according to claim 45 or 46, wherein, The method further includes: Based on the first predicted value, the second predicted value, and the reconstructed value of the current block template, determine the fusion weight of the current block or the fusion weight of the current block template; The fusion weight of the current block is used to perform weighted fusion of the first predicted value and the second predicted value of the current block, and the fusion weight of the current block template is used to perform weighted fusion of the first predicted value and the second predicted value of the current block template.
49. The method according to claim 40, wherein, The step of determining the combination pattern used by the current block based on the third candidate list of the current block includes: Traverse the third candidate list of the current block to determine the candidate combination pattern of the current block; Based on the candidate combination pattern, determine the predicted value of the current block; Based on the predicted value of the current block, determine the reconstructed value of the current block; The cost is calculated based on the reconstructed value and the original value of the current block to determine the third-generation value; Based on the third-generation value, the combination pattern used by the current block is determined; The method further includes: encoding the pattern index of the combination mode used by the current block, and writing the obtained encoded bits into the code stream.
50. The method according to claim 39, wherein, The method further includes: If the first condition is met, a candidate list for the current block is constructed based on the candidate block vector of the current block; The first condition includes at least one of the following: The reference templates of the reference regions pointed to by the candidate block vectors of the current block have all been reconstructed; The reference region pointed to by the candidate block vector of the current block is fully or partially reconstructed; The reference region pointed to by the candidate block vector of the current block does not exceed the image boundary; The reference region pointed to by the candidate block vector of the current block does not include the current block; The reference region pointed to by the candidate block vector of the current block does not exceed the available region; The candidate block vector of the current block is not added to the candidate list of the current block.
51. The method according to claim 39, wherein, The step of constructing a candidate list for the current block based on the candidate block vector of the current block includes: Based on the candidate block vectors of the current block, construct a first list of the current block; The first list is sorted based on the current block template to obtain the second list; Add the second list to the candidate list of the current block.
52. The method according to claim 51, wherein, The process of sorting the first list based on the current block template to obtain the second list includes: Traverse the first list to obtain the block vector information of the current block; Based on the block vector information of the current block, determine the block vector of the current block template; Based on the block vector of the current block template, determine the predicted value of the current block template; The cost is calculated based on the predicted and reconstructed values of the current block template to determine the first-generation value; The first list is sorted based on the first generation value to obtain the second list.
53. The method according to claim 52, wherein, The block vector information of the current block includes candidate block vectors and block vector-related information of the current block. Determining the block vector of the current block template based on the block vector information of the current block includes: Based on the block vector information of the current block and the current block template information, the block vector of the current block is adjusted to obtain the block vector of the current block template.
54. The method according to claim 53, wherein, The method further includes: Based on the block vector related information of the reference block of the current block, determine the block vector related information corresponding to the candidate block vector of the current block; The process of constructing a first list of the current block based on the candidate block vector of the current block includes: Based on the candidate block vectors of the current block and their related block vector information, a first list of the current block is constructed.
55. The method according to claim 53, wherein, The method further includes: Based on the block vector information of the current block, determine the block vector information of the current block template.
56. The method according to claim 52, wherein, Determining the predicted value of the current block template based on the block vector of the current block template includes: Based on the block vector of the current block template, determine the reference block of the current block template; Based on the reference block of the current block template and the block vector related information of the current block template, the predicted value of the current block template is determined.
57. The method according to claim 51, wherein, The method further includes: Based on the first order, one or more preset modes are obtained, wherein the preset modes do not include block vector information; Based on the one or more preset patterns, construct a third list for the current block; The third list is sorted based on the current block template to obtain the fourth list; Add the fourth list to the candidate list of the current block.
58. The method according to any one of claims 38-57, wherein, Determining the block vector of the current block based on the block vector information of the reference block includes: The block vector of the current block is determined based on the block vector information of the reference block and the current block information.
59. The method according to claim 58, wherein, Determining the block vector of the current block based on the block vector information of the reference block and the current block information includes: Based on the block vector related information of the reference block, the reference block information, and the current block information, the block vector of the reference block is adjusted to obtain the block vector of the current block.
60. The method according to claim 53 or 59, wherein, The block vector related information includes a flip identifier.
61. The method according to claim 60, wherein, The block vector adjustment includes: when the value of the flip identifier is the first value, the block vector to be processed is taken as the adjusted block vector.
62. The method according to claim 60, wherein, The block vector includes a horizontal component, and the block vector adjustment includes: When the flip identifier takes the second value, the horizontal component of the block vector to be processed is adjusted to obtain the adjusted horizontal component.
63. The method according to claim 62, wherein, The horizontal component of the block vector to be processed is adjusted to obtain the adjusted horizontal component, which includes at least one of the following: Determine a first horizontal distance between the current block center position and the reference block center position; add twice the first distance value to the horizontal component of the block vector of the reference block to obtain the horizontal component of the block vector of the current block; Determine the center position of the current block's first template and the second distance value of the current block's center position in the horizontal direction; add twice the second distance value to the horizontal component of the current block's block vector to obtain the horizontal component of the current block's first template's block vector; The horizontal component of the block vector of the current block is used as the horizontal component of the second template of the current block.
64. The method according to claim 62, wherein, The block vector also includes a vertical component, and the block vector adjustment further includes: When the flip identifier takes the second value, the vertical component of the block vector to be processed is taken as the adjusted vertical component.
65. The method according to claim 60, wherein, The block vector includes a vertical component, and the block vector adjustment includes: The value of the flip identifier is the third value, which is used to adjust the vertical component of the block vector to be processed, resulting in the adjusted vertical component.
66. The method according to claim 65, wherein, The vertical component of the vector to be processed is adjusted to obtain the adjusted vertical component, which includes at least one of the following: Determine the third distance value in the vertical direction between the current block center position and the reference block center position; add twice the third distance value to the vertical component of the block vector of the reference block to obtain the vertical component of the block vector of the current block; Determine the center position of the second template of the current block and the fourth distance value of the center position of the current block in the vertical direction; add twice the fourth distance value to the vertical component of the block vector of the current block to obtain the vertical component of the block vector of the second template of the current block; The vertical component of the block vector of the current block is used as the vertical component of the first template of the current block.
67. The method according to claim 65, wherein, The block vector also includes a horizontal component, and the block vector adjustment further includes: When the value of the flip identifier is the third value, the horizontal component of the block vector to be processed is taken as the adjusted horizontal component.
68. The method according to claim 58, wherein, The method further includes: The block vector of the current block is searched within a first range to obtain a refined block vector; Based on the current block template, determine the template value of the refined block vector; The block vector corresponding to the minimum template cost is used as the refined block vector of the current block.
69. The method according to claim 38, wherein, Determining the predicted value of the current block based on the block vector of the current block includes: determining the reference block of the current block based on the block vector of the current block; The predicted value of the current block is determined based on the reference block of the current block and the block vector related information of the current block.
70. The method according to claim 56 or 69, wherein, The block vector related information includes a flip identifier; the value of the flip identifier is a first value, and the reference value of the current block or the current block template is used as the predicted value of the current block or the current block template.
71. The method according to claim 56 or 69, wherein, The block vector related information includes a flip identifier; The value of the flip identifier is a second value, and the coordinates of the sample points of the current block or the current block template are horizontally flipped based on the width of the current block or the current block template. Based on the flipped coordinates of the sample points of the current block or current block template and the corresponding reference block, the predicted value of the sample points of the current block or current block template is determined.
72. The method according to claim 56 or 69, wherein, The block vector related information includes a flip identifier; The value of the flip identifier is a third value, which is used to vertically flip the coordinates of the sample points of the current block or the current block template based on the height of the current block or the current block template. Based on the flipped coordinates of the sample points of the current block or current block template and the corresponding reference block, the predicted value of the sample points of the current block or current block template is determined.
73. The method according to claim 39, wherein, The method further includes: Based on the current block template, a block vector search is performed in the second range to obtain the candidate block vector of the current block.
74. The method according to claim 73, wherein, The step of performing a block vector search within a second range based on the current block template to obtain the block vector of the current block candidate includes: Based on the current block template and the flipped current block template, a block vector search is performed in the second range to obtain the block vector of the current block candidate; Determine the block vector and its flip identifier for the current block candidate; Determining the block vector of the current block based on the block vectors of the current block candidates includes: The block vector of the current block is determined based on the block vector of the current block candidate and its flip identifier.
75. An encoder, comprising a first acquisition unit, a first determination unit, and a first prediction unit; wherein: The first acquisition unit is configured to acquire block vector information of a reference block of the current block, wherein the block vector information includes block vector and / or block vector related information; The first determining unit is configured to determine the block vector of the current block based on the block vector information of the reference block; The first prediction unit is configured to determine the predicted value of the current block based on the block vector of the current block.
76. An encoder, comprising a first memory and a first processor; wherein: The first memory is used to store computer programs that can run on the first processor; The first processor is configured to perform the method as described in any one of claims 38 to 74 when running the computer program.
77. A decoder, comprising a second acquisition unit, a second determination unit, and a second prediction unit; wherein: The second acquisition unit is configured to acquire block vector information of a reference block of the current block, wherein the block vector information includes block vector and / or block vector related information; The second determining unit is configured to determine the block vector of the current block based on the block vector information of the reference block; The second prediction unit is configured to determine the predicted value of the current block based on the block vector of the current block.
78. A decoder, comprising a second memory and a second processor; wherein: The second memory is used to store computer programs that can run on the second processor; The second processor is configured to perform the method as described in any one of claims 1 to 37 when running the computer program.
79. A computer-readable storage medium, wherein, The computer-readable storage medium stores the bitstream generated by the encoding method as described in any one of claims 38 to 74.
80. A computer-readable storage medium, wherein, The computer-readable storage medium stores a computer program that, when executed, implements the method as described in any one of claims 1 to 37, or the method as described in any one of claims 38 to 74.