Encoding / Decoding Method, Bitstream, Encoder, Decoder, and Storage Medium
The method addresses inaccurate chrominance prediction in VVC by determining target block vector parameters and symmetry relationships, improving chroma prediction accuracy and efficiency in video coding.
Patent Information
- Application Number
- JP2025533000
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2022-12-09
- Publication Date
- 2025-11-28
AI Technical Summary
In video coding standards like H.266/Versatile Video Coding (VVC), inappropriate setting of chrominance prediction modes in Intra Block Copy (IBC) leads to inaccurate chrominance prediction, reducing coding efficiency.
An encoding/decoding method that determines a target block vector parameter and symmetry relationship for chrominance prediction, dividing blocks into sub-regions for adaptive prediction, and utilizing reconstructed luma information to improve chroma prediction accuracy and efficiency.
Improves coding efficiency by accurately predicting chroma components, saving bitrate and enhancing encoding/decoding performance through detailed symmetry-based processing and adaptive sub-region prediction.
Smart Images

Figure 2025538746000001_ABST
Abstract
Description
[Technical Field]
[0001] The present application relates to the technical field of video codecs, and in particular to encoding and decoding methods, bitstreams, encoders, decoders and storage media. [Background technology]
[0002] As people's demands for video display quality increase, new video applications such as high-definition video and ultra-high-definition video are emerging. The Joint Video Exploration Team (JVET) of the international standardization organizations ISO / IEC and ITU-T has established the video coding standard H.266 / Versatile Video Coding (VVC). Intra block copy (IBC) is one of the block-level coding modes provided by VVC for video sequences of screen content type.
[0003] In the related art, in the case of a direct mode (DM), if the chrominance prediction mode is set inappropriately when the IBC mode is used for a luminance block, the chrominance prediction of the current block becomes inaccurate, resulting in a decrease in coding efficiency. Summary of the Invention
[0004] The present application provides an encoding / decoding method, a bitstream, an encoder, a decoder, and a storage medium that can save bitrate, improve encoding and decoding efficiency, and further improve encoding and decoding performance.
[0005] The technical solution of the present application can be realized as follows:
[0006] In a first aspect, an embodiment of the present application provides a decoding method applied to a decoder, the method comprising: determining a first color component block of the current block; If the prediction mode of the first color component block satisfies a first condition, determine a target block vector parameter of the current block, and determine a target symmetry relationship according to the target block vector parameter of the current block; Performing a prediction process on the second color component of the current block based on the target block vector parameters to determine a predicted value of the second color component of the current block; determining a reconstructed value of the second color component of the current block based on the predicted value of the second color component of the current block and the target symmetry relationship.
[0007] In a second aspect, embodiments of the present application provide a decoding method applied to a decoder, the method comprising: determining a first co-location region corresponding to the current block; Dividing the first co-located region to obtain at least one first color component sub-block; determining at least one second color component sub-block and prediction information for the at least one second color component sub-block based on the at least one first color component sub-block; determining a predicted value of the second color component of the current block based on the prediction information of the at least one second color component sub-block.
[0008] In a third aspect, embodiments of the present application provide an encoding method applied to an encoder, the method comprising: determining a first color component block of the current block; If the prediction mode of the first color component block satisfies a first condition, determine a target block vector parameter of the current block, and determine a target symmetry relationship according to the target block vector parameter of the current block; Performing a prediction process on the second color component of the current block based on the target block vector parameters to determine a predicted value of the second color component of the current block; determining a residual value of the second color component of the current block based on the predicted value of the second color component of the current block and the target symmetry relationship.
[0009] In a fourth aspect, embodiments of the present application provide an encoding method applied to an encoder, the method comprising: determining a first co-location region corresponding to the current block; Dividing the first co-located region to obtain at least one first color component sub-block; determining at least one second color component sub-block and prediction information for the at least one second color component sub-block based on the at least one first color component sub-block; determining a predicted value of the second color component of the current block based on the prediction information of the at least one second color component sub-block.
[0010] In a fifth aspect, an embodiment of the present application provides a bitstream generated by performing bit encoding based on encoding target information, the encoding target information being: The residual value includes at least one of the residual value of the second color component of the current block, the residual value of the second color component sub-block, the target block vector parameter of the current block, the target symmetry relationship, and the value of the first syntax element identification information.
[0011] In a sixth aspect, an embodiment of the present application provides an encoder, the encoder comprising: a first determination unit; and a first prediction unit; the first determination unit is configured to determine a first color component block of a current block; if a prediction mode of the first color component block satisfies a first condition, determine a target block vector parameter of the current block; and determine a target symmetry relationship based on the target block vector parameter of the current block; The first prediction unit is configured to perform a prediction process on a second color component of the current block based on the target block vector parameters to determine a predicted value of the second color component of the current block; The first determining unit is further configured to determine a residual value of a second color component of the current block based on the predicted value of the second color component of the current block and the target symmetry relationship.
[0012] In a seventh aspect, an embodiment of the present application provides an encoder, the encoder comprising: a first determination unit; and a first prediction unit; the first determining unit is configured to determine a first co-location region corresponding to a current block; divide the first co-location region to obtain at least one first color component sub-block; and determine at least one second color component sub-block and prediction information of the at least one second color component sub-block based on the at least one first color component sub-block; The first prediction unit is configured to determine a predicted value of a second color component of the current block based on prediction information of the at least one second color component sub-block.
[0013] In an eighth aspect, embodiments of the present application provide an encoder, the encoder comprising: a first memory; and a first processor; the first memory is configured to store a computer program executable by the first processor; The first processor is configured to perform the method according to the third or fourth aspect when executing the computer program.
[0014] In a ninth aspect, an embodiment of the present application provides a decoder, the decoder comprising: a second determination unit; and a second prediction unit; the second determination unit is configured to determine a first color component block of a current block; if a prediction mode of the first color component block satisfies a first condition, determine a target block vector parameter of the current block; and determine a target symmetry relationship based on the target block vector parameter of the current block; The second prediction unit is configured to perform a prediction process on a second color component of the current block based on the target block vector parameters to determine a predicted value of the second color component of the current block; The second determining unit is further configured to determine a reconstructed value of a second color component of the current block based on the predicted value of the second color component of the current block and the target symmetry relationship.
[0015] In a tenth aspect, an embodiment of the present application provides a decoder, the decoder comprising: a second determination unit; and a second prediction unit; the second determining unit is configured to determine a first co-location region corresponding to the current block, divide the first co-location region to obtain at least one first color component sub-block, and determine at least one second color component sub-block and prediction information of the at least one second color component sub-block based on the at least one first color component sub-block; The second prediction unit is configured to determine a predicted value of a second color component of the current block based on prediction information of the at least one second color component sub-block.
[0016] In an eleventh aspect, embodiments of the present application provide a decoder, the decoder comprising: a second memory; and a second processor; the second memory is configured to store a computer program executable by the second processor; The second processor is configured to perform the method according to the first or second aspect when executing the computer program.
[0017] In a twelfth aspect, an embodiment of the present application provides a computer-readable storage medium having stored thereon a computer program, the computer program being configured, when executed, to implement the method according to the first aspect, or the method according to the second aspect, or the method according to the third aspect, or the method according to the fourth aspect.
[0018] The present invention provides an encoding / decoding method, a bitstream, an encoder, a decoder, and a storage medium. In either the encoding side or the decoding side, a first color component block of a current block is first determined. If the prediction mode of the first color component block satisfies a first condition, a target block vector parameter of the current block is determined. A target symmetry relationship is determined based on the target block vector parameter of the current block. Then, a prediction process is performed on the second color component of the current block based on the target block vector parameter to determine a predicted value of the second color component of the current block. In this way, the encoding side can determine a residual value of the second color component of the current block based on the predicted value of the second color component of the current block and the target symmetry relationship. Meanwhile, the decoding side determines a reconstructed value of the second color component of the current block based on the predicted value of the second color component of the current block and the target symmetry relationship. That is, in the present application, by fully considering available information such as reconstructed luma and block vectors and predicting chroma based on this information, the unity of chroma prediction is improved, and by processing the predicted value in more detail by considering symmetry relationships, the accuracy of chroma prediction is improved, bit rate is saved, and encoding and decoding performance is improved, thereby effectively improving coding efficiency. Furthermore, at either the encoding side or the decoding side, a first co-location region corresponding to the current block is determined, the first co-location region is divided to obtain at least one first color component sub-block, at least one second color component sub-block and prediction information for the at least one second color component sub-block are determined based on the at least one first color component sub-block, and a predicted value of the second color component of the current block is determined based on the prediction information for the at least one second color component sub-block. In this way, by dividing the current block into sub-regions for prediction, various options are adaptively provided according to different content and luma prediction information, making DBV prediction more effective and further improving coding efficiency. [Brief explanation of the drawings]
[0019] [Figure 1] 10 is a flowchart for obtaining reconstruction samples based on the IBC mode. [Figure 2] FIG. 10 is a schematic diagram illustrating the position distribution of adjacent blocks according to an embodiment of the present application. [Figure 3] FIG. 2 is a schematic diagram illustrating the positional relationship between a luminance block and a chromaticity block according to an embodiment of the present application. [Figure 4A] FIG. 1 is a block diagram illustrating a configuration of an encoder according to an embodiment of the present invention. [Figure 4B] FIG. 2 is a block diagram showing the configuration of a decoder according to an embodiment of the present application; [Figure 5] FIG. 5 is a schematic diagram illustrating a network architecture configuration of a codec system according to an embodiment of the present invention. [Figure 6] 1 is a flowchart of a decoding method according to an embodiment of the present application; [Figure 7] FIG. 10 is a schematic diagram illustrating another positional relationship between the luminance block and the chrominance block according to an embodiment of the present application. [Figure 8] FIG. 10 is a schematic diagram illustrating yet another positional relationship between the luminance block and the chrominance block according to an embodiment of the present application. [Figure 9] FIG. 10 is a schematic diagram illustrating yet another positional relationship between the luminance block and the chrominance block according to an embodiment of the present application. [Figure 10] FIG. 10 is a schematic diagram illustrating whether an offset position does not cover a current block according to an embodiment of the present application; [Figure 11] FIG. 10 is a schematic diagram illustrating whether an offset position exceeds an available area according to an embodiment of the present application. [Figure 12] FIG. 1 is a schematic diagram for determining optimal chromaticity BV parameters according to an embodiment of the present application. [Figure 13] 10 is a schematic diagram illustrating the position of a luminance region at the same position corresponding to a current chrominance block according to an embodiment of the present application; FIG. [Figure 14] FIG. 10 is a schematic diagram illustrating the position of a reference chromaticity block at an offset position corresponding to a chromaticity BV according to an embodiment of the present application. [Figure 15A] FIG. 1 is a schematic diagram illustrating asymmetry within a block according to an embodiment of the present application. [Figure 15B]FIG. 1 is a schematic diagram illustrating horizontal symmetry of samples within a block according to an embodiment of the present application. [Figure 15C] FIG. 1 is a schematic diagram illustrating vertical symmetry of samples within a block according to an embodiment of the present application. [Figure 16] 1 is a schematic diagram illustrating templates of a current chromaticity block and a reference chromaticity block according to an embodiment of the present application; [Figure 17] FIG. 1 is a schematic diagram illustrating block copy based on DBV mode according to an embodiment of the present application; [Figure 18] 1 is a flowchart of an encoding method according to an embodiment of the present application; [Figure 19] 1 is a detailed flowchart of an encoding method according to an embodiment of the present application; [Figure 20] 4 is a detailed flowchart of another encoding method according to an embodiment of the present application; [Figure 21] 2 is a detailed flowchart of a decoding method according to an embodiment of the present application; [Figure 22] 4 is a detailed flowchart of another decoding method according to an embodiment of the present application; [Figure 23] 1 is a flowchart of another decoding method according to an embodiment of the present application; [Figure 24] 1 is a flowchart of another encoding method according to an embodiment of the present application; [Figure 25] 10 is a detailed flowchart of yet another encoding / decoding method according to an embodiment of the present application; [Figure 26] 10 is a detailed flowchart of yet another encoding / decoding method according to an embodiment of the present application; [Figure 27] 10 is a detailed flowchart of yet another encoding / decoding method according to an embodiment of the present application; [Figure 28] FIG. 10 is a schematic diagram illustrating whether the offset position does not cover the current chromaticity sub-region according to an embodiment of the present application. [Figure 29] 10 is a detailed flowchart of yet another encoding / decoding method according to an embodiment of the present application; [Figure 30] FIG. 1 is a schematic diagram illustrating a configuration of an encoder according to an embodiment of the present application. [Figure 31] FIG. 2 is a schematic diagram illustrating a specific hardware configuration of an encoder according to an embodiment of the present application. [Figure 32] FIG. 2 is a schematic diagram illustrating the configuration of a decoder according to an embodiment of the present application. [Figure 33] FIG. 2 is a schematic diagram illustrating a specific hardware configuration of a decoder according to an embodiment of the present application. [Figure 34] 1 is a schematic diagram illustrating the configuration of a codec system according to an embodiment of the present application; DETAILED DESCRIPTION OF THE INVENTION
[0020] In order to understand the features and technical contents of the embodiments of the present application in more detail, the implementation of the embodiments of the present application will be described in detail below with reference to the drawings, and the accompanying drawings are for reference purposes only and are not intended to limit the embodiments of the present application.
[0021] Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art. The terms used herein are used only to describe the embodiments of the present application and are not intended to limit the present application.
[0022] In the following, the reference to "some embodiments" describes a subset of all possible embodiments, but it should be understood that "some embodiments" may be the same or a different subset of all possible embodiments and may be combined with each other without contradiction. It should also be understood that the terms "first / second / third" and the like in the embodiments herein do not limit a particular order but distinguish between similar objects. It should be understood that "first / second / third" can be used to interchange a particular order or order where appropriate, so that the embodiments described herein may be performed in an order other than that shown or described herein.
[0023] Before describing the embodiments of the present application in more detail, the nouns and terms used in the embodiments of the present application will be explained. The explanation of the nouns and terms used in the embodiments of the present application is as follows.
[0024] Coding Block (CB), Intra block copy (IBC), Screen Content Coding (SCC), Block Matching (BM), Coding Unit (CU), Coding Tree Unit (CTU), Block Vector (BV), Motion Vector (MV), Direct Block Vector (DBV), Advanced Motion Vector Prediction (AMVP: IBC Advanced Motion Vector Prediction), Cross-Component Linear Model prediction (CCLM), Merge Mode, Planar Mode, Discrete Cosine Transform (DCT), Low-Frequency Non-Separable Transform (LFNST), Enhanced Compression Model (ECM), H.266 / Versatile Video Coding (VVC), VVC Reference Software Test Platform (VTM: VVC Test Model).
[0025] It can be understood that in a video image, a first color component, a second color component, and a third color component are usually employed to represent a coding block, where the three color components are a luma component, a blue chroma component, and a red chroma component, respectively, and 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, the video image can be represented in a YCbCr format or a YUV format.
[0026] It can also be understood that IBC is an enhanced tool for encoding screen content type video sequences in VVC, and significantly improves the encoding efficiency of screen content sequences. Specifically, IBC is a block-level encoding mode, and similar to inter prediction technology, IBC performs motion search on the encoding side. Specifically, an optimal block vector (also called a motion vector) is found for each encoding block through block matching. Here, the block vector is a vector that points from the current block to a reference block. Unlike inter prediction technology, the optimal block vector of IBC is obtained by searching from the reconstruction region of the frame where the current encoding block is located (i.e., the current encoding frame), while the motion vector of inter prediction is obtained by searching from an adjacent reference frame in the temporal domain of the current encoding frame.
[0027] In H.266 / VVC, a specific process for obtaining reconstructed pixels of a current block in IBC mode may include deriving a block vector, deriving a predicted sample using the block vector, deriving a residual sample, and deriving a reconstructed sample using the predicted sample and the residual sample.
[0028] In one specific implementation, the process of obtaining reconstruction samples in IBC mode is as shown in FIG. 1 and may include the following steps:
[0029] In step S101, a block vector is derived.
[0030] For the luma component, the inputs include a luma position (xCb, yCb) specifying the position of the top-left corner sample of the current block relative to the top-left corner luma sample of the current image, one variable cbWidth specifying the width of the current block in luma samples, and one variable cbHeight specifying the height of the current block in luma samples. The outputs include a luma block vector (bvL: Block Vector Luma). For clarification, the current block containing luma samples is also called the "luma block."
[0031] Here, IBC mode is divided into IBC MERGE mode and IBC AMVP mode, and when deriving bvL, both modes require the establishment of a candidate list of IBC block vectors, bvCandList. The following describes in detail the list establishment process in IBC MERGE. Here, the list establishment process in IBC AMVP is the same as the IBC MERGE list, but the maximum number of candidates in the two modes is different.
[0032] In step 1, if IsGt4by4 is equal to TRUE (the variable IsGt4by4 is TRUE when the product of the width and height of the luminance block is greater than 16), the luminance block position (xCb, yCb), the luminance block width cbWidth, and the luminance block height cbHeight are used as inputs, and the process of deriving spatial block vector candidates from neighboring coding units, as specified in the decoding specification, is invoked. The output is the available flags availableFlagA1 and availableFlagB1, and the block vectors bvA1 and bvB1. Here, the relative positions of the neighboring blocks where A1 and B1 are located and the current block are as shown in Figure 2.
[0033] In step 2, if IsGt4by4 is equal to TRUE, the pseudocode for constructing the candidate list bvCandList of block vectors is as follows:
[0034] i=0 if(availableFlagA1) bvCandList[i++]=bvA1 if(availableFlagB1) bvCandList[i++]=bvB1 In step 3, the process of deriving the variable numCurrCand (the number of candidates obtained up to now) is as follows.
[0035] If IsGt4by4 is equal to TRUE, then numCurrCand is set equal to the number of candidates in bvCandList; otherwise, numCurrCand is set to 0.
[0036] In step 4, if numCurrCand is smaller than MaxNumIbcMergeCand (the maximum number of candidates in MERGE mode) and NumHmvpIbcCand (the maximum number of candidates for the past optimal block vector Hmvp in IBC mode) is greater than 0, the process for deriving past-based IBC block vector candidates specified in the decoding specification is called, with bvCandList and numCurrCand as inputs and the modified bvCandList and numCurrCand as outputs.
[0037] In step 5, if numCurrCand is less than MaxNumIbcMergeCand, apply the following until numCurrCand is equal to MaxNumIbcMergeCand:
[0038] Set bvCandList[numCurrCand][0] equal to 0 (horizontal component of BV), Set bvCandList[numCurrCand][1] equal to 0 (vertical component of BV), Increment numCurrCand by 1.
[0039] In this way, the establishment of the block vector candidate list bvCandList is completed, and the candidate index bvIdx is derived as follows, and general_merge_flag indicates whether the IBC MERGE mode is selected.
[0040] bvIdx=general_merge_flag[xCb][yCb]?merge_idx[xCb][yCb]:mvp_l0_flag[xCb][yCb] In this way, a specific bvL can be obtained based on the index bvIdx and the candidate list bvCandList of block vectors.
[0041] bvL[0]=bvCandList[bvIdx][0], bvL[1]=bvCandList[bvIdx][1].
[0042] In IBC AMVP mode, the predicted bvL is obtained as a specific bvL by the index bvIdx and the block vector candidate list bvCandList. Meanwhile, the actual bvL needs to add the block vector difference (BVD), and the specific process is as follows:
[0043] In step 1, obtain the horizontal and vertical components of BVD, where MvdL0 is the forward motion vector differential, the horizontal component of BVD is represented by bvd[0], and the vertical component of BVD is represented by bvd[1], as follows:
[0044] bvd[0]=MvdL0[xCb][yCb][0], bvd[1] = MvdL0[xCb][yCb][1].
[0045] In step 2, the prediction bvL obtained above is rounded. Here, right-shifting the parameter AmvrShift is used to perform rounding, and left-shifting the parameter AmvrShift is used to improve resolution. Specifically, it is as follows:
[0046] Offset=(AmvrShift==0)?0:((1<<(AmvrShift-1))-1), bvL[0]=Sign(bvL[0])×(((Abs(bvL[0])+offset)>>AmvrShift)< <AmvrShift)、 bvL[1]=Sign(bvL[1],)×(((Abs(bvL[1])+offset)>>AmvrShift)< <AmvrShift)。
[0047] In step 3, for the fruit bvL, the range is -2 17 From 2 17 It is necessary to control between -1, and the specific derivation process is as follows:
[0048] u[0]=(bvL[0]+bvd[0]+2 18 )%2 18 , bvL[0]=(u[0]>=2 17 )?(u[0]-2 18 ):u[0], u[1]=(bvL[1]+bvd[1]+2 18 )%2 18 , bvL[1]=(u[1]>=2 17 )?(u[1]-2 18 ):u[1].
[0049] For the chrominance components, in the case of dual tree division, the chrominance components do not undergo IBC mode, and in the case of single tree division, the BV of the chrominance components needs to be derived.
[0050] Here, the input includes the luminance BVL (1 / 16 pixel accuracy), and the output includes the chromaticity block vector (bvC: Block Vector Chroma) (1 / 32 pixel accuracy). The specific derivation process is as follows:
[0051] bvC[0]=((bvL[0]>>(3+SubWidthC))×32), bvC[1]=((bvL[1]>>(3+SubHeightC))×32).
[0052] In step S102, a prediction sample is derived using the block vector.
[0053] Here, the inputs include a luma location (xCb, yCb) specifying the location of the top-left corner sample of the current block relative to the top-left corner luma sample of the current image, one variable cbWidth specifying the width of the current block in luma samples, one variable cbHeight specifying the height of the current block in luma samples, a block vector BV, and one variable cIdx specifying the color component index of the current block. The output includes an array of prediction samples, predSamples.
[0054] For the prediction sample, the specific derivation process is as follows:
[0055] If cIdx is equal to 0, i.e., the luminance component, then x=xCb...xCb+cbWidth-1, y=yCb...yCb+cbHeight-1, xVb=(x+(bv[0]>>4))&(IbcBufWidthY-1), yVb=(y+(bv[1]>>4))&(CtbSizeY-1), predSamples[x][y]=ibcVirBuf[0][xVb][yVb].
[0056] where IbcBufWidthY is the width of the luminance pixels of the reconstructed buffer unit (Buffer) stored in the IBC, CtbSizeY is the size of the CTU, and ibcVirBuf is the reconstructed pixels stored in the IBC.
[0057] If cIdx is not equal to 0, i.e., it is a chromaticity component, then x=xCb / SubWidthC…xCb / SubWidthC+cbWidth / SubWidthC-1, y=yCb / SubHeightC…yCb / SubHeightC+cbHeight / SubHeightC-1, xVb=(x+(bv[0]>>5))&(IbcBufWidthC-1), yVb=(y+(bv[1]>>5))&((CtbSizeY / subHeightC)-1), predSamples[x][y]=ibcVirBuf[cIdx][xVb][yVb].
[0058] Here, the variables SubWidthC and SubHeightC specifically depend on the chromaticity sampling format specified by sps_chroma_format_idc, and the specific correspondence is as shown in Table 1.
[0059] [Table 1] In step S103, residual samples are derived.
[0060] The residual samples can be subjected to a residual decoding process as specified in the decoding specification.
[0061] In step S104, the predicted samples and the residual samples are used to derive reconstructed samples.
[0062] On the reconstructed samples (ie, reconstructed pixel values), an image reconstruction process for a specified color component as defined in the decoding specification can be invoked.
[0063] In another specific implementation, for a chrominance prediction mode derivation process in H.266 / VVC, the inputs include a luma position (xCb, yCb) specifying the position of the top-left corner sample of the current block relative to the top-left corner luma sample of the current image, one variable cbWidth specifying the width of the current block in luma samples, one variable cbHeight specifying the height of the current block in luma samples, and a variable treeType specifying whether to use single-tree or dual-tree partitioning. The outputs include a chrominance intra prediction mode IntraPredModeC[xCb][yCb] and a MIP chrominance direct mode flag MipChromaDirectFlag[xCb][yCb].
[0064] If treeType is equal to SINGLE_TREE, i.e., single-tree partitioning, sps_chroma_format_idc is equal to 3, i.e., 4:4:4 format, intra_chroma_pred_mode is equal to 4, and IntraMipFlag[xCb][yCb] is equal to 1, i.e., the prediction mode of the corresponding co-located luminance center block is MIP mode. In this case, (1) Set the MIP chrominance direct mode flag MipChromaDirectFlag[xCb][yCb] equal to 1, i.e., MIP mode of luma for chrominance is used.
[0065] (2) Set the chrominance intra-prediction mode IntraPredModeC[xCb][yCb] equal to IntraPredModeY[xCb][yCb].
[0066] If not, (1) Set the MIP chromaticity direct mode flag MipChromaDirectFlag[xCb][yCb] equal to 0.
[0067] (2) The corresponding luma intra prediction mode lumaIntraPredMode is derived as follows:
[0068] If IntraMipFlag[xCb+cbWidth / 2][yCb+cbHeight / 2] is equal to 1, set lumaIntraPredMode equal to INTRA_PLANAR.
[0069] If IntraMipFlag[xCb+cbWidth / 2][yCb+cbHeight / 2] is not equal to 1 and CuPredMode[0][xCb+cbWidth / 2][yCb+cbHeight / 2] is equal to MODE_IBC or MODE_PLT, set lumaIntraPredMode equal to INTRA_DC.
[0070] Note that the IntraTmp mode is newly introduced in ECM, and if CuPredMode[0][xCb+cbWidth / 2][yCb+cbHeight / 2] is equal to MODE_INTRA and in IntraTmp mode, set lumaIntraPredMode equal to INTRA_PLANAR.
[0071] Otherwise, set lumaIntraPredMode equal to IntraPredModeY[xCb+cbWidth / 2][yCb+cbHeight / 2].
[0072] (3) The chrominance intra prediction mode IntraPredModeC[xCb][yCb] is derived as follows.
[0073] If cu_act_enabled_flag[xCb][yCb] is equal to 1, set the chrominance intra prediction mode IntraPredModeC[xCb][yCb] equal to lumaIntraPredMode.
[0074] If not, If BdpcmFlag[xCb][yCb][1] is equal to 1, set IntraPredModeC[xCb][yCb] equal to BdpcmDir[xCb][yCb][1]?INTRA_ANGULAR50:INTRA_ANGULAR18.
[0075] Otherwise, if cu_act_enabled_flag[xCb][yCb] is equal to 0 and BdpcmFlag[xCb][yCb][1] is equal to 0, the chrominance intra prediction mode IntraPredModeC[xCb][yCb] uses cclm_mode_flag, cclm_mode_idx, intra_chroma_pred_mode, and lumaIntraPredMode specified in Table 2.
[0076] [Table 2]
[0077] When sps_chroma_format_idc is equal to 2, chrominance intra prediction mode X in Table 2 can be used to derive chrominance intra prediction mode Y, specifically, refer to the mode X to mode Y mapping process specification in Table 3. Then, chrominance intra prediction mode X is set equal to chrominance intra prediction mode Y.
[0078] [Table 3]
[0079] In yet another specific implementation, for the DM mode, the DM mode refers to directly using the luminance prediction mode information of the corresponding position.
[0080] When dual tree partitioning is used for an I frame, independent block partitioning structures, such as the dual tree mode in H.266 / VVC, are permitted for the luma and chroma components. In this case, the luma component at a position corresponding to a chroma coding block may contain multiple luma coding blocks. As shown in Figure 3, in H.266 / VVC, if the value of intra_chroma_pred_mode is equal to 4, it indicates that the current chroma block is decoded using DM mode.
[0081] The intra prediction mode of the chrominance block is determined based on the intra prediction mode of the luma block at the center of the co-located luma region corresponding to the chrominance block, and may be determined directly using the intra prediction mode of the luma block or by further derivation.
[0082] In practical application, the central position coordinates of the luma region at the same position as the corresponding chroma block are used as a reference point, and the intra prediction mode of the chroma block can be determined based on the intra prediction mode of the luma block including the reference point. The determination method can be either the intra prediction mode of the luma block directly or the intra prediction mode obtained by further derivation.
[0083] A specific description of the coding block positions obtained in DM mode is as follows.
[0084] Obtain the position of the current chroma block, i.e., the position of the top-left corner chroma sample of the current chroma block relative to the top-left corner chroma sample of the current image, chromaPos=(x,y), and scale chromaPos based on the chroma sampling format to obtain the luma region position lumaPos=(xCb,yCb) of the same position corresponding to the current chroma block. Here, Table 4 shows an example of scaling chromaPos based on the chroma sampling format.
[0085] [Table 4]
[0086] The luminance position (xCb, yCb) specifies the top left luminance sample of the luminance region corresponding to the current chrominance block relative to the top left luminance sample of the current image, one variable cbWidth specifies the width of the current coding block in luminance samples, and one variable cbHeight specifies the height of the current coding block in luminance samples.
[0087] The positional relationship between the current chroma block and the corresponding luma region is as shown in Figure 3. The central luma pixel position of the luma region corresponding to the current chroma block is explained as follows: where xCenter represents the horizontal coordinate position, yCenter represents the vertical coordinate position, and the coding block containing this pixel position is the block at the center position of the luma block corresponding to the chroma block.
[0088] xCenter=xCb+cbWidth>>1, yCenter=yCb+cbHeight>>1.
[0089] Furthermore, it should be noted that in the embodiments of the present application, unless otherwise specified, the blocks described in this specification may be one CU, one sub-block, one transform block, etc., and are not particularly limited thereto.
[0090] In yet another specific implementation, for a bitstream configuration method for chrominance prediction in H.266 / VVC, the associated syntax elements are as shown in Table 5. Furthermore, for the value of the syntax element Value of intra_chroma_pred_mode, the corresponding binarization mapping table is as shown in Table 6. For different syntax elements (e.g., cclm_mode_flag, cclm_mode_idx, and intra_chroma_pred_mode, etc.), the coding schemes adopted for each coding bit are specifically as shown in Table 7.
[0091] [Table 5]
[0092] [Table 6]
[0093] [Table 7]
[0094] Here, binIdx represents the number of bits, and when binIdx=0, it represents the 0th bit, and when binIdx=1, it represents the 1st bit. Also, bypass represents the bypass mode, and na represents no processing.
[0095] In the related art, in dual-tree partitioning, if the corresponding luma block is in IBC mode in DM mode, the obtained chroma prediction mode will be DC mode, which will result in reduced coding efficiency.On the other hand, in the original DBV prediction process, the chroma IBC prediction step simply identifies the reference chroma block and performs block copying, which fails to provide a good prediction, resulting in inaccurate chroma prediction of the current block and reduced coding efficiency.
[0096] Based on this, an embodiment of the present application further provides an encoding / decoding method capable of effectively and accurately predicting chroma blocks. Here, on the one hand, by fully considering available information such as reconstructed luma and block vectors and predicting chroma based on this information, the unity of chroma prediction is improved, and by processing predicted values in more detail taking into account symmetry relationships, the accuracy of chroma prediction is improved, saving bitrate and improving encoding and decoding performance, thereby effectively improving coding efficiency. On the other hand, by predicting the current block by dividing it into subregions, various options are adaptively provided according to different content and luma prediction information, making DBV prediction more effective and further improving coding efficiency.
[0097] Hereinafter, each embodiment of the present invention will be described in detail with reference to the drawings.
[0098] 4A, which is a block diagram showing the configuration of an encoder according to an embodiment of the present application. As shown in FIG. 4A, an encoder (specifically, a "video encoder") 100 may include a transform and quantization unit 101, an intra estimation unit 102, an intra prediction unit 103, a motion compensation unit 104, a motion estimation unit 105, an inverse transform and inverse quantization unit 106, a filter control analysis unit 107, a filtering unit 108, an encoding unit 109, and a decoded image buffer unit 110, etc., where the filtering unit 108 can realize deblock filtering and sample adaptive offset (SAO) filtering, and the encoding unit 109 can realize header information coding and context-based adaptive binary arithmetic coding (CABAC). For an input original video signal, one video coding block is obtained by dividing a coding tree unit (CTU), and then the video coding block is transformed by a transform and quantization unit 101 with respect to residual pixel information obtained through intra prediction or inter prediction. The transform includes converting the residual information from the pixel domain to a transform domain and quantizing the resulting transform coefficients to further reduce the bit rate. The intra estimation unit 102 and the intra prediction unit 103 are configured to perform intra prediction on the video coding block, and explicitly, the intra estimation unit 102 and the intra prediction unit 103 are configured to determine an intra prediction mode to be used to encode the video coding block.The motion compensation unit 104 and the motion estimation unit 105 are configured to perform inter-prediction coding of the received video coding block relative to one or more blocks in one or more reference frames to provide temporal prediction information, and the motion estimation performed by the motion estimation unit 105 is a process of generating a motion vector, which can estimate the motion of the video coding block, and then the motion compensation unit 104 performs motion compensation based on the motion vector determined by the motion estimation unit 105, and after determining the intra prediction mode, the intra prediction unit 103 is further configured to provide the selected intra prediction data to the encoding unit 109, and the motion estimation unit 105 also sends the motion vector data determined by calculation to the encoding unit 109. The inverse transform and inverse quantization unit 106 is for reconstructing the video coding block and is configured to reconstruct a residual block in the pixel domain. The reconstructed residual block is then filtered to remove blocking effect artifacts by the filter control analysis unit 107 and the filtering unit 108. The reconstructed residual block is then added to one prediction block in the frame of the decoded picture buffer unit 110 to generate a reconstructed video coding block. The encoding unit 109 is configured to encode various coding parameters and quantized transform coefficients. In a CABAC-based encoding algorithm, context content may be based on neighboring coding blocks and may be used to encode information indicating a determined intra-prediction mode and output a bitstream of the video signal. The decoded picture buffer unit 110 is configured to store the reconstructed video coding block for prediction reference. As the video image encoding progresses, new reconstructed video coding blocks are continuously generated and stored in the decoded picture buffer unit 110.
[0099] Referring to Figure 4B, Figure 4B is a block diagram showing the configuration of a decoder according to an embodiment of the present application. As shown in Figure 4B, a decoder (specifically, a "video decoder") 200 includes a decoding unit 201, an inverse transform and inverse quantization unit 202, an intra prediction unit 203, a motion compensation unit 204, a filtering unit 205, and a decoded image buffer unit 206, etc., where the decoding unit 201 can realize header information decoding and CABAC decoding, and the filtering unit 205 can realize deblock filtering and SAO filtering. After an input video signal undergoes the encoding process of Figure 4A, a bitstream of the video signal is output. This bitstream is input to decoder 200, first passing through decoding unit 201 to obtain decoded transform coefficients, which are processed by inverse transform and inverse quantization unit 202 to generate residual blocks in the pixel domain; intra prediction unit 203 may be configured to generate prediction data for a current video decoding block based on a determined intra prediction mode and data of a previously decoded block from the current frame or picture; motion compensation unit 204 determines prediction information for the video decoding block by analyzing motion vectors and other related syntax elements, and uses this prediction information to generate a predictive block for the video decoding block being decoded. A decoded video block is formed by summing the residual block from inverse transform and inverse quantization unit 202 with the corresponding predictive block generated by intra prediction unit 203 or motion compensation unit 204; and this decoded video signal passes through filtering unit 205 to remove blocking effect artifacts, which can improve video quality. The decoded video blocks are then stored in a decoded image buffer unit 206, which is configured to store reference images for subsequent intra-prediction or motion compensation and to output a video signal, i.e., a restored original video signal is obtained.
[0100] Furthermore, the present embodiment further provides a network architecture of a codec system including an encoder and a decoder. FIG. 5 is a schematic diagram illustrating the network architecture configuration of a codec system according to the present embodiment. As shown in FIG. 5, the network architecture includes one or more electronic devices 13-1N and a communication network 01, where the electronic devices 13-1N can perform video interaction via the communication network 01. In the implementation process, the electronic device may be a device having video encoding and decoding functions. For example, the electronic device may include a smartphone, a tablet computer, a personal computer, a personal digital assistant, a navigator, a digital telephone, a videophone, a television, a sensor device, a server, etc., and the present embodiment is not limited to these. Here, the decoder or encoder described in the present embodiment may be the above-mentioned electronic device.
[0101] It should be noted that the method of the embodiment of the present application is mainly applied to the intra prediction unit 103 shown in Fig. 4A and the intra prediction unit 203 shown in Fig. 4B. That is, the embodiment of the present application may be applied to an encoder, a decoder, or even simultaneously to an encoder and a decoder, but the embodiment of the present application is not particularly limited.
[0102] It should be further explained that when applied to intra prediction unit 103, the "current block" specifically refers to the coded block currently being intra predicted, and when applied to intra prediction unit 203, the "current block" specifically refers to the decoded block currently being intra predicted.
[0103] In one embodiment of the present application, please refer to Figure 6, which is a flowchart of a decoding method according to an embodiment of the present application. As shown in Figure 6, the method may include the following steps:
[0104] In step S601, the first color component block of the current block is determined.
[0105] It should be noted that the decoding method of the present embodiment is applied to a decoder. In addition, the decoding method may specifically refer to an intra prediction method, more specifically a prediction method using DBV mode. Here, a video image is divided into multiple decoding blocks, and each decoding block may include a first color component, a second color component, and a third color component. In the present embodiment, the current block refers to a decoding block to be currently intra-predicted in the video image.
[0106] Here, when a first color component needs to be predicted, the component to be predicted is the first color component, when a second color component needs to be predicted, the component to be predicted is the second color component, and when a third color component needs to be predicted, the component to be predicted is the third color component. Furthermore, if a first color component is predicted for a current block and the first color component is a luma component, i.e., the component to be predicted is a luma component, the current block may also be called a luma block. Alternatively, if a second color component is predicted for a current block and the second color component is a chroma component, i.e., the component to be predicted is a chroma component, the current block may also be called a chroma block.
[0107] Furthermore, it should be noted that in dual-tree partitioning, in DM mode, if the prediction mode of the co-located luminance block satisfies the first condition, the embodiments of the present application can derive the block vector parameters applied to chrominance based on the block vector parameters of the co-located luminance block, thereby improving coding efficiency.
[0108] In some embodiments, determining the first color component block of the current block may include determining a first co-location area corresponding to the current block, and determining the first color component block of the current block in a plurality of blocks divided from the first co-location area.
[0109] It should be noted that in the present embodiment, the first co-location region may refer to a first color component region that is co-located with the current block. For example, if the current block is a chrominance component, the first co-location region may refer to a luminance region that is co-located with the current block. The current block may be divided into blocks in the first co-location region using, for example, a binary tree structure, a ternary tree structure, or a quadtree structure to obtain multiple blocks. Each block may be considered as one CU, one sub-block, or one transform block. Next, the first color component block of the current block is determined from these multiple blocks.
[0110] 3, the shaded area represents the luminance area at the same position corresponding to the chrominance component. The luminance area at the same position may be divided into a plurality of blocks, and the central block may be selected as the luminance block corresponding to the current block. For example, the black shaded block in FIG. 3 is the luminance block corresponding to the current block.
[0111] Further, in some embodiments, determining a first color component block of a current block among a plurality of blocks divided from the first co-location region may include selecting a target block from the plurality of blocks divided from the first co-location region, and setting the target block as the first color component block of the current block.
[0112] Here, the target block may be a block at any position. In one specific embodiment, a block at the center position within the first color component region is selected as the target block, or a block at the upper left corner position within the first color component region is selected as the target block, or a block at the lower right corner position within the first color component region is selected as the target block.
[0113] Furthermore, in some embodiments, determining the first color component block of the current block may include determining position information of the current block, performing a scaling process on the position information of the current block based on a predetermined sampling format to obtain position information of a co-location area corresponding to the current block, determining target position information based on the position information of the co-location area, and setting the target block including the target position information as the first color component block of the current block.
[0114] Furthermore, in some embodiments, determining the target position information based on the position information of the identical position area may include performing a center position calculation based on the position information of the identical position area and setting the obtained center position information as the target position information, or performing a top left corner position calculation based on the position information of the identical position area and setting the obtained top left position information as the target position information, or performing a bottom right corner position calculation based on the position information of the identical position area and setting the obtained bottom left position information as the target position information.
[0115] In an embodiment of the present application, the predetermined sampling format may be a chrominance sampling format (also called a color sampling format). For example, the mapping relationship between the position (x, y) of the current block and the position (xCb, yCb) of the same location region is as shown in Table 8.
[0116] [Table 8]
[0117] In one possible implementation, the position of the current chroma block, i.e., the position of the top-left corner chroma sample of the current chroma block relative to the top-left corner chroma sample of the current image, is obtained as chromaPos=(x,y), and chromaPos is scaled based on the chroma sampling format shown in Table 8 to obtain the luma domain position lumaPos=(xCb,yCb) of the same position corresponding to the current chroma block.
[0118] Here, assuming that the position of the luminance pixel at the same position corresponding to the upper left corner of the current chroma block relative to the luminance pixel at the upper left corner of the image is (xCb, yCb), and the width and height of the luminance area at the same position corresponding to the current chroma block (i.e., the entire area shaded with diagonal lines in the luminance component in Figure 3) are cbWidth and cbHeight, respectively, the block at the center position (the block at the center of the luminance area) is a luminance block with center position information (xCb+cbWidth>>1, yCb+cbHeight>>1), which is the block shaded with black in Figure 3.
[0119] In another possible implementation, the position of the current chroma block, i.e., the position of the top-left corner chroma sample of the current chroma block relative to the top-left corner chroma sample of the current image, is taken as chromaPos=(x,y), and chromaPos is scaled based on the chroma sampling format shown in Table 8 to obtain the luma domain position lumaPos=(xCb,yCb) of the same position corresponding to the current chroma block.
[0120] Here, assuming that the position of the luminance pixel at the same position corresponding to the upper left corner of the current chroma block relative to the luminance pixel at the upper left corner of the image is (xCb, yCb), and the width and height of the luminance area at the same position corresponding to the current chroma block (i.e., the entire area shaded with diagonal lines in the luminance component in Figure 7) are cbWidth and cbHeight, respectively, the block at the upper left corner (the block at the upper left corner of the luminance area) is a luminance block with position coordinates (xCb, yCb), which is the block shaded with black in Figure 7.
[0121] In yet another possible implementation, the position of the current chroma block's location, i.e., the position of the top-left corner chroma sample of the current chroma block relative to the top-left corner chroma sample of the current image, is taken as chromaPos=(x,y), and chromaPos is scaled based on the chroma sampling format shown in Table 8 to obtain the luma domain position of the same location corresponding to the current chroma block, lumaPos=(xCb,yCb).
[0122] Here, assuming that the position of the luminance pixel at the same position corresponding to the upper left corner of the current chroma block relative to the luminance pixel at the upper left corner of the image is (xCb, yCb), and the width and height of the luminance area at the same position corresponding to the current chroma block (i.e., the entire area shaded with diagonal lines in the luminance component in Figure 8) are cbWidth and cbHeight, respectively, the block at the lower right corner (the block at the lower right corner of the luminance area) is a luminance block with position coordinates (xCb+cbWidth-1, yCb+cbHeight-1), which is the block shaded with black in Figure 8.
[0123] That is, in the embodiment of the present application, the target block as the first color component block may be a block at any position among the multiple blocks shown in Fig. 3. For example, it may be a block (block filled with black) at the center of the luminance region at the same position shown in Fig. 3, a block (block filled with black) at the upper left corner of the luminance region at the same position shown in Fig. 7, or a block (block filled with black) at the lower right corner of the luminance region at the same position shown in Fig. 8, or even a block at the upper right corner or lower left corner of the luminance region at the same position, or even a block at the center of the upper left region, and there are no specific limitations here.
[0124] Furthermore, in some embodiments, determining a first color component block of a current block among a plurality of blocks divided from the first co-location region may include determining at least one candidate block located at a predetermined position among a plurality of blocks divided from the first co-location region; determining a target candidate block from the at least one candidate block that satisfies a predetermined judgment condition; and setting the target candidate block as the first color component block of the current block.
[0125] In one specific embodiment, determining whether a candidate block satisfies a predetermined judgment condition may include sequentially obtaining at least one candidate block according to a predetermined order and performing mode judgment, and if the judgment results in a candidate block whose prediction mode first satisfies a first condition, setting the candidate block that first satisfies the first condition as the first color component block of the current block.
[0126] In another specific embodiment, determining whether a candidate block satisfies the predetermined judgment condition may include: when the judgment results in a candidate block whose prediction mode first satisfies the first condition, determining a first block vector parameter of the candidate block that first satisfies the first condition; determining whether the first block vector parameter of the candidate block that first satisfies the first condition satisfies an availability condition; if the first block vector parameter of the candidate block that first satisfies the first condition satisfies the availability condition, setting the candidate block that first satisfies the first condition as the first color component block of the current block; if the first block vector parameter of the candidate block that first satisfies the first condition does not satisfy the availability condition, continuing to judge the mode of the next candidate block until a target candidate block whose prediction mode satisfies the first condition and whose corresponding first block vector parameter satisfies the availability condition is determined and obtained, and setting the target candidate block as the first color component block of the current block.
[0127] In an embodiment of the present application, the first color component block may be determined by performing a mode determination on at least one candidate block at a predetermined position. For example, as shown in FIG. 9, five luminance pixel positions CU are included, specifically, C, TL, TR, BL, and BR. However, the embodiment of the present application is not limited to the five positions, and may be multiple different positions, and is not limited to the five positions shown in FIG. 9, and is not specifically limited thereto.
[0128] In yet another possible implementation, taking the block including five luminance pixel positions shown in Figure 9 as an example, they can be sequentially acquired according to a predetermined order, and continue until it is determined that the block is a block that is predictively coded in a mode with BV information, that is, until a block with the first luminance pixel position that is predictively coded in a mode with BV information is found. The predetermined order of sequential acquisition includes, but is not limited to, C->TL->TR->BL->BR.
[0129] In the process of deriving the detailed positions of C, TL, TR, BL, and BR, obtain the position of the current chroma block, i.e., the position of the chroma sample at the top left corner of the current chroma block relative to the chroma sample at the top left corner of the current image, chromaPos=(x,y). Then, scale chromaPos according to the chroma sampling format shown in Table 8 to obtain the luma region position at the same position corresponding to the current chroma block, lumaPos=(xCb,yCb).
[0130] Here, it is assumed that the position of the luminance pixel at the same position corresponding to the upper left corner of the current chroma block relative to the luminance pixel at the upper left corner of the image (i.e., the position of the luminance pixel TL) is (xCb, yCb), and the width and height of the luminance region at the same position corresponding to the current chroma coding block (i.e., the entire region shaded with diagonal lines in the luminance component in Figure 9) are cbWidth and cbHeight, respectively.
[0131] The coordinates of the position of luminance pixel C are (xCb+cbWidth / 2, yCb+cbHeight / 2), The coordinates of the position of the luminance pixel TL are (xCb, yCb), The coordinates of the position of the luminance pixel TR are (xCb+cbWidth-1, yCb), The coordinates of the position of the luminance pixel BL are (xCb, yCb+cbHeight-1), The coordinates of the position of the luminance pixel BR are (xCb+cbWidth-1, yCb+cbHeight-1).
[0132] In this way, for the current block, the corresponding first color component block needs to be determined first. For example, if the first color component is a luminance component, the corresponding luminance block of the current block needs to be determined.
[0133] In step S602, if the prediction mode of the first color component block satisfies a first condition, a target block vector parameter of the current block is determined, and a target symmetry relationship is determined according to the target block vector parameter of the current block.
[0134] In an embodiment of the present application, determining that the prediction mode of the first color component block satisfies the first condition may include determining that the prediction mode of the first color component block is a first prediction mode having BV information.
[0135] In the present embodiment, the first prediction mode includes at least one of an IBC mode and an IntraTMP mode, where BV information is required for predictive coding, regardless of whether the mode is an IBC mode or an IntraTMP mode.
[0136] In some embodiments, the decoding method may further include not performing the step of decoding the bitstream to determine the target prediction mode of the current block if the prediction mode of the first color component block does not satisfy the first condition.
[0137] In an embodiment of the present application, determining that the prediction mode of the first color component block does not satisfy the first condition includes determining that the prediction mode of the first color component block is a second prediction mode without BV information.
[0138] In the present embodiment, the second prediction mode does not include the IBC mode or the IntraTMP mode, that is, the second prediction mode may be a mode other than the IBC mode or the IntraTMP mode, such as the PLANAR mode, the DM mode, or the DC mode.
[0139] In this way, after obtaining the corresponding luminance block, determine whether the corresponding luminance block is coded in a mode with BV information, where the mode with BV information includes but is not limited to IBC mode or IntraTMP mode. If the corresponding luminance block is coded in a mode with BV information, continue to obtain the BV information of the corresponding luminance block; otherwise, there is no need to parse the syntax element of the prediction mode.
[0140] It can be understood that if the prediction mode of the first color component block satisfies the first condition, the step of determining the target block vector parameters of the current block may include: determining the first block vector parameters of the first color component block; and adjusting the first block vector parameters of the first color component block to determine the target block vector parameters of the current block.
[0141] In an embodiment of the present application, if the prediction mode of the first color component block satisfies a first condition, a first block vector parameter of the first color component block can be obtained, where the first block vector parameter represents a vector pointing from the current block to a reference block, and the reference block is obtained by searching from a reconstruction region of the frame (i.e., the current image) in which the current block is located.
[0142] It should be further noted that in some embodiments of the present application, when there are multiple first color component blocks, the first block vector parameters are obtained by averaging the BV information of the multiple first color component blocks. Therefore, in some embodiments, determining the first color component block of the current block from the multiple blocks divided from the first color component region may include determining at least one candidate block at a predetermined position from the multiple blocks divided from the first color component region, and determining the at least one candidate block as the first color component block of the current block.
[0143] In one possible implementation, determining the first block vector parameters of the first color component block may include determining at least one target block from at least one candidate block whose prediction mode satisfies a first condition, determining the first block vector parameters of each of the at least one target block, and performing an average value calculation based on the first block vector parameters of each of the at least one target block, and setting the calculation result as the first block vector parameters of the first color component block.
[0144] Here, in the embodiment of the present application, the first color component block of the current block is not limited to one block, but may be composed of multiple blocks. Here, if composed of multiple blocks, all of the prediction modes of these multiple blocks satisfy the first condition. For example, first, multiple luminance blocks in the luminance region at the same position are obtained, and then the average value of the first block vector parameters is calculated as the finally obtained first block vector parameter.
[0145] In another possible implementation, the first block vector parameters finally obtained may also be determined by selecting optimal block vector parameters using a template matching method. Thus, in some embodiments, when the prediction mode of the first color component block satisfies the first condition, determining the first block vector parameters of the first color component block may further include determining at least one target block using an IBC mode from at least one candidate block, searching the at least one target block based on the template matching method to determine optimal block vector parameters, and setting the optimal block vector parameters as the first block vector parameters of the first color component block.
[0146] 9 as an example, for luminance blocks at five positions C, TL, TR, BL, and BR, if the prediction modes of these five luminance blocks all satisfy the first condition, multiple luminance blocks in the luminance region at the same position are obtained, and then optimal block vector parameters are selected using a template matching method to become the finally obtained first block vector parameters. Here, the positions of these multiple luminance blocks are not limited to the five positions C, TL, TR, BL, and BR, and may be other positions, and the embodiments of the present application do not specifically limit these.
[0147] It can be further understood that after determining the first block vector parameters of the first color component block, block vector parameters to be applied to the chrominance components, i.e., target block vector parameters of the current block, can be determined based on the first block vector parameters of the first color component block, where the target block vector parameters of the current block can be obtained by adjusting the first block vector parameters of the first color component block, and the adjustment manner includes, but is not limited to, the following:
[0148] In one possible implementation, adjusting the first block vector parameters of the first color component block and determining the target block vector parameters of the current block may include performing a scaling operation on the first block vector parameters of the first color component block based on a predetermined sampling format and determining the target block vector parameters of the current block.
[0149] In another possible implementation, adjusting the first block vector parameters of the first color component block and determining the target block vector parameters of the current block may include performing a scaling operation on the first block vector parameters of the first color component block based on a predetermined sampling format to obtain initial block vector parameters of the current block, and performing a correction operation on the initial block vector parameters of the current block to determine the target block vector parameters of the current block.
[0150] In an embodiment of the present application, assuming that the first color component is a luma component and the second color component is a chroma component, after obtaining the first block vector parameter (i.e., luma BV parameter), the luma BV parameter can be adjusted to obtain the target block vector parameter (i.e., chroma BV parameter) applied to the chroma component. Assuming that the luma BV parameters are (BVLhor, BVLver) and the chroma BV parameters are (BVChor, BVCver), BVLhor represents the horizontal block vector of the luma BV parameters, BVLver represents the vertical block vector of the luma BV parameters, BVChor represents the horizontal block vector of the chroma BV parameters, and BVCver represents the vertical block vector of the chroma BV parameters.
[0151] In this way, the luminance BV parameters are scaled based on the predetermined sampling format, and the mapping relationship between the luminance BV parameters and the scaled chromaticity BV parameters is as shown in Table 9.
[0152] [Table 9]
[0153] Here, the syntax element sps_chroma_format_idc is used to indicate the type of color sampling format, which specifically refers to the chroma sampling format, where different types of chroma sampling formats have different corresponding scaling operations.
[0154] In this way, in the embodiment of the present application, after obtaining the scaled chroma BV parameters based on the chroma sampling format, the chroma BV parameters may be used directly or may be further corrected, including but not limited to the following: The correction is performed using the IntraTMP mode, that is, after obtaining the chroma BV parameters, the offset position is found using the position information of the current block and the obtained chroma BV parameters, and then a template matching method is used to perform a fine search near the offset position to determine the optimal chroma BV parameters, and the optimal chroma BV parameters are used as the finally obtained chroma BV parameters, i.e., the target block vector parameters of the current block.
[0155] It can be further understood that after obtaining the target block vector parameters of the current block, it is necessary to determine whether the target block vector parameters are available, i.e., whether the target block vector parameters satisfy an availability condition. In some embodiments, the decoding method may further include: after determining the target block vector parameters of the current block, determining whether the target block vector parameters satisfy an availability condition; and if the target block vector parameters satisfy the availability condition, performing a step of determining a target symmetry relationship of the current block based on the target block vector parameters of the current block.
[0156] Furthermore, in some embodiments, the target block vector parameters satisfy the availability condition if at least: the offset position indicated by the position information of the current block and the target block vector parameter does not exceed the image boundary; The offset position indicated by the position information of the current block and the target block vector parameter does not cover the current block; The offset position indicated by the position information of the current block and the target block vector parameter does not exceed a predetermined available area; It may include that the position information of the current block and the offset position indicated by the target block vector parameter have been reconstructed.
[0157] It should be understood that in the embodiment of the present application, only when all the above conditions are met can it be determined that the target block vector parameters satisfy the availability condition, i.e., the target block vector parameters are available. For example, FIG. 10 is a schematic diagram showing whether an offset position does not cover a current block according to an embodiment of the present application. As shown in FIG. 10, the black-filled block represents the current block, the shaded area represents the available area, and the unfilled area represents the unavailable area. If the offset position occupied by the target block vector parameters for the current block is in the unavailable area, the offset position will cover the current block.
[0158] 11 is a schematic diagram showing whether an offset position according to an embodiment of the present application exceeds the available area of an IBC. As shown in FIG. 11, the black-filled block represents the current block, the shaded area represents the available area, and the reference blocks within the available area have been reconstructed. In this embodiment of the present application, taking into account the storage capacity of the buffer, under normal circumstances, the reference blocks adjacent to the current block (m, n), specifically, reference block (m-2, n-2), reference block (m-1, n-2), reference block (m, n-2), reference block (m+1, n-2), reference block (m-2, n-1), reference block (m-1, n-1), reference block (m, n-1), reference block (m+1, n-1), reference block (m-2, n), reference block (m-1, n), etc., can be used as the available area in DBV mode.
[0159] It should be further understood that in the embodiment of the present application, after performing a scaling process on the first block vector parameters of the first color component block according to the predetermined sampling format, the obtained initial block vector parameters need to be further corrected, where before the correction process, the decoding method may further include: determining whether the initial block vector parameters satisfy an availability condition; if the initial block vector parameters satisfy the availability condition, performing a correction process on the initial block vector parameters of the current block to determine target block vector parameters of the current block; or if the initial block vector parameters do not satisfy the availability condition, performing an adjustment process on the initial block vector parameters of the current block until the adjusted block vector parameters satisfy the availability condition, and then performing a correction process on the adjusted block vector parameters to determine target block vector parameters of the current block.
[0160] For example, after obtaining chrominance BV parameters scaled based on a predetermined sampling format, if the chrominance BV parameters satisfy the availability condition, correction is performed using a template search. That is, after obtaining the corrected chrominance BV parameters, an offset position is found using the position of the current block and the corrected chrominance BV parameters, and then a fine search is performed near the offset position using a template matching method to obtain optimal chrominance BV parameters. A chrominance predicted block for the current block is obtained by copying the reference block at the optimal offset position obtained after the fine search. As shown in FIG. 12, the shaded area represents a chrominance reconstruction area. For the current block, an optimal matching template and a corresponding optimal BV are found using a template matching method, and the chrominance predicted value of the current block can be determined by copying the reference block at the optimal offset position obtained based on the optimal BV.
[0161] It can be further understood that in the embodiments of the present application, a symmetrical relationship needs to be determined. In one possible implementation, determining a target symmetrical relationship based on a target block vector parameter of a current block may include: determining a first coincidence area corresponding to the current block; determining a reference block based on the target block vector parameter and determining a second coincidence area corresponding to the reference block; performing error calculation of at least one symmetrical relationship based on the first coincidence area and the second coincidence area to obtain an error value of the at least one symmetrical relationship; and determining a target symmetrical relationship from the at least one symmetrical relationship based on the error value of the at least one symmetrical relationship.
[0162] Furthermore, in some embodiments, performing an error calculation of at least one symmetric relationship based on the first coincidence area and the second coincidence area to obtain an error value of the at least one symmetric relationship may include: performing a transformation process of the first symmetric relationship on the second coincidence area to determine a transformed second coincidence area; and calculating a symmetric error between the transformed second coincidence area and the first coincidence area based on a predetermined error criterion to determine an error value of the first symmetric relationship, where the first symmetric relationship is any one of the at least one symmetric relationship.
[0163] In another possible implementation form, determining a target symmetry relationship based on the target block vector parameters of the current block may include determining a first adjacent region corresponding to the current block, determining a reference block based on the target block vector parameters and determining a second adjacent region corresponding to the reference block, performing an error calculation for at least one symmetry relationship based on the first adjacent region and the second adjacent region to obtain an error value of the at least one symmetry relationship, and determining a target symmetry relationship from the at least one symmetry relationship based on the error value of the at least one symmetry relationship.
[0164] Further, in some embodiments, performing an error calculation of at least one symmetric relation based on the first adjacent region and the second adjacent region to obtain an error value of the at least one symmetric relation may include: performing a transformation process of the first symmetric relation on the second adjacent region to determine a transformed second adjacent region; and calculating a symmetric error between the transformed second adjacent region and the first adjacent region based on a predetermined error criterion to determine an error value of the first symmetric relation, where the first symmetric relation is any one of the at least one symmetric relation.
[0165] It should be understood that in the present embodiment, the at least one symmetrical relationship includes at least one of: no symmetrical relationship, a vertical symmetrical relationship, and a horizontal symmetrical relationship.
[0166] It should be understood that in the present embodiment, the predetermined error criterion includes at least one of the sum of absolute errors (SAD), sum of absolute transformed errors (SATD), residual sum of squares (SSE), mean absolute difference (MAD), mean absolute error (MAE), mean squared error (MSE), and rate distortion optimization (RDO).
[0167] It should be further understood that in embodiments of the present application, determining a target symmetric relationship from the at least one symmetric relationship based on an error value of the at least one symmetric relationship may include selecting a minimum error value from the error values of the at least one symmetric relationship, and determining the symmetric relationship corresponding to the minimum error value as the target symmetric relationship.
[0168] In another embodiment of the present application, the decoding method may further include storing the target symmetry relationship in a predetermined buffer area, so that the target symmetry relationship can be directly obtained later without needing to be derived again. Therefore, in yet another possible implementation, determining the target symmetry relationship based on the target block vector parameters of the current block may include obtaining the target symmetry relationship of the first color component block from the predetermined buffer area to determine the target symmetry relationship, where the target symmetry relationship is used to indicate the symmetry relationship between the first co-location region in which the first color component block is located and the second co-location region indicated by the target block vector parameters.
[0169] It should be noted that the following provides a detailed description of the symmetry relationship in conjunction with three specific examples.
[0170] In one specific embodiment, the chrominance block is derived based on the luma region at the same position as the current chrominance block.
[0171] (1) Obtain the luminance area at the same position corresponding to the current chrominance block.
[0172] As shown in Figure 13, the position of the current chroma block, chromaPos=(xCb, yCb), is obtained, and chromaPos is scaled based on the chroma sampling format to obtain the luma region position, lumaPos=(xCb_Y, yCb_Y), of the same position corresponding to the current chroma block. Here, Table 10 shows an example of scaling chromaPos based on the chroma sampling format.
[0173] [Table 10]
[0174] The size of the current chroma block, chromaSize=(cbWidth, cbHeight), is obtained, and the chromaSize is scaled based on the chroma sampling format to obtain the size of the luma region at the same position corresponding to the current chroma block, lumaSize=(cbWidth_Y, cbHeight_Y). Here, Table 11 shows an example of scaling chromaPos based on the chroma sampling format.
[0175] [Table 11]
[0176] (2) Obtain a reference chromaticity block at an offset position corresponding to the chromaticity BV.
[0177] As shown in Figure 14, the position (xCb, yCb) of the current chromaticity block is obtained, and the chromaticity BV=(BVC hor ,BVC ver ) and obtain the corresponding offset position (xCb+BVC hor ,yCb+BVC ver ) to find the
[0178] (3) Obtain the luminance region at the same position corresponding to the reference chromaticity block in (2).
[0179] According to the method (1), the luminance region corresponding to the reference chrominance block is obtained at the same position.
[0180] (4) Derive symmetry relations.
[0181] In the present embodiment, the predefined symmetry relationships include, but are not limited to, no symmetry required, horizontal symmetry, vertical symmetry, etc. The following figures use corresponding positions of four-pointed stars to represent the symmetry relationships of samples within different blocks: 15A is a schematic diagram showing asymmetry within a block, 15B is a schematic diagram showing horizontal symmetry of samples within a block, and 15C is a schematic diagram showing vertical symmetry of samples within a block.
[0182] A predefined symmetric relationship error is calculated between the co-located luma region corresponding to the current chroma block obtained in (1) and the co-located luma region corresponding to the reference chroma block obtained in (3). The error evaluation criteria include, but are not limited to, SAD and MSE, and a symmetric relationship is derived based on the calculated error. Specifically, a predefined symmetric type transformation is performed on the co-located luma region corresponding to the reference chroma block, and an error is calculated for the co-located luma region corresponding to the current chroma block. The derived symmetric relationship is stored and used in subsequent processes of the embodiment of the present application.
[0183] Assuming that the size of the luma region is lumaSize=(cbWidth_Y, cbHeight_Y), the luma reconstruction samples of the luma region at the same position corresponding to the current chroma block are CurLumaSamples[x][y], x=0...cbWidth_Y-1, y=0...cbHeight_Y-1, and the luma reconstruction samples of the luma region at the same position corresponding to the reference chroma block are RefLumaSamples[x][y], x=0...cbWidth_Y-1, y=0...cbHeight_Y-1. Taking the error evaluation criterion of SAD as an example, taking the horizontal symmetry relationship as an example, the error calculation method shown in the following formula can be given.
[0184]
number
[0185]
number
[0186] The symmetrical relationship of the luminance block at the position, i.e., the luminance block area and the luminance BV=(BVL hor ,BVL ver ) to obtain a symmetric relationship with the reference luminance region corresponding to the symmetric relationship. The symmetric relationship has already been stored in advance in a process such as the RDO strategy for the luminance component. That is, in the embodiment of the present application, the symmetric relationship does not need to be derived again at this stage, but can be obtained directly. This symmetric relationship is used in subsequent processes of the embodiment of the present application.
[0187] In yet another specific embodiment, the derivation is based on the current chromatic block template (ie, the neighboring region).
[0188] (1) Obtain a reference chromaticity block at an offset position corresponding to the chromaticity BV.
[0189] Get the current chromaticity block position (xCb, yCb) and set the chromaticity BV = (BVC hor ,BVC ver ) and obtain the corresponding offset position (xCb+BVC hor ,yCb+BVC ver ) to find the
[0190] (2) Obtain the template.
[0191] Obtain templates for the current chrominance block and the reference chrominance block, including but not limited to the template positions shown in Figure 16, such as the upper template adjacent to the top and the left template adjacent to the left.
[0192] (3) Derive symmetry relations.
[0193] The error of a predefined symmetric relationship is calculated between the current chrominance block template obtained in (2) and the reference chrominance block template. The error evaluation criteria include, but are not limited to, SAD and MSE, and a symmetric relationship is derived based on the calculated error. Specifically, a predefined symmetric transformation is performed on the template region corresponding to the reference chrominance block, and the error between the result and the template region corresponding to the current chrominance block is calculated. The derived symmetric relationship is stored and used in subsequent processes of the main technical solution.
[0194] Assuming that the chromaticity size of the upper template region corresponding to the current block is TemplateSize=(tmpWidth, tmpHeight), the chromaticity samples of the upper template region corresponding to the current block are CurTemplateSamples[x][y], x=0...tmpWidth-1, y=0...tmpHeight-1, and the chromaticity samples of the template region corresponding to the reference block are RefTemplateSamples[x][y], x=0...tmpWidth-1, y=0...tmpHeight-1. Taking the error evaluation criterion of SAD as an example, taking the horizontal symmetry relationship as an example, the error calculation method shown in the following formula can be given.
[0195]
number
[0196] It should be noted that in the present embodiment, the DBV mode can refer to a prediction mode newly introduced in the present embodiment, represented as DBV, in which a prediction value of the second color component of the current block is determined by performing a prediction process on the second color component of the current block based on the determined target block vector parameter.
[0197] In some embodiments, performing a prediction process on the second color component of the current block based on the target block vector parameters and determining a predicted value of the second color component of the current block may include determining an offset position of the current block based on the target block vector parameters and position information of the current block, performing a block copy process based on the offset position of the current block to obtain a first predicted block, and determining a predicted value of the second color component of the current block based on the first predicted block.
[0198] In some embodiments, determining a predicted value of the second color component of the current block based on the first predicted block may include performing a correction operation on the first predicted block to determine a predicted value of the second color component of the current block.
[0199] It should be noted that in the embodiment of the present application, the correction operation may include, but is not limited to, a clip operation, a filtering operation, a weighting operation with a prediction value obtained in another prediction mode, etc.
[0200] It should be further noted that in the present embodiment, the BV-based chromaticity prediction includes, but is not limited to, the following methods:
[0201] In one possible implementation, as specifically shown in FIG. 17, obtain the position (xCb, yCb) of the current block, obtain the chromaticity BV=(BVChor, BVCver), find the corresponding offset position (xCb+BVChor, yCb+BVCver), and perform block copy to determine the reference block.
[0202] Here, the variable cbWidth specifies the width of the current block in chroma samples, the variable cbHeight specifies the height of the current coding block in chroma samples, and the variable cIdx specifies the color component index of the current block.
[0203] If x=xCb…xCb+cbWidth-1, y=yCb…yCb+cbHeight-1, xVb=(x+BVChor)&(BufWidthC-1) yVb=(y+BVCver)&(CtbSizeC-1) predSamples[cIdx][x][y]=function(VirChromaBuf[cIdx][xVb][yVb]) where BufWidthC is the width of the chroma pixels in the stored reconstruction buffer, CtbSizeC is the size of the chroma pixels in the CTU, and VirChromaBuf is the stored reconstruction chroma pixels. function() is a processing function for pixel values, which may be a direct copy, a shift operation to ensure calculation accuracy, a filtering operation, etc.
[0204] Another possible implementation is to get the current chroma block position (xCb, yCb), get the chroma BV=(BVChor, BVCver), find the corresponding offset position (xCb+BVChor, yCb+BVCver), perform a block copy, and apply corrections to the copied values to get the final predicted values, including but not limited to weighting with predicted values obtained in CCLM-type mode or other modes.
[0205] In step S604, a reconstructed value of the second color component of the current block is determined based on the predicted value of the second color component of the current block and the target symmetry relationship.
[0206] In an embodiment of the present application, regarding the determination of a reconstructed value, in one possible implementation form, determining a reconstructed value of the second color component of the current block based on a predicted value of the second color component of the current block and a target symmetry relationship may include: decoding a bitstream to determine a residual value of the second color component of the current block; determining an initial reconstructed value of the second color component of the current block based on the predicted value of the second color component of the current block and the residual value of the second color component of the current block; and performing a conversion process on the initial reconstructed value based on the target symmetry relationship to determine a reconstructed value of the second color component of the current block.
[0207] It should be noted that the predicted transform value of the second color component of the current block is obtained by analyzing the bitstream, and determining an initial reconstructed value of the second color component of the current block based on the predicted value of the second color component of the current block and the residual value of the second color component of the current block may include performing an addition operation based on the predicted value of the second color component of the current block and the residual value of the second color component of the current block to determine the initial reconstructed value of the second color component of the current block.
[0208] For example, by using the predicted value (i.e., predicted sample) and the residual value (i.e., residual sample) obtained above, the two are added to obtain an initial reconstructed value (i.e., reconstructed sample), and then the reconstructed sample is processed according to the target symmetry relationship to obtain an actual reconstructed sample. Specific processing methods include, but are not limited to, the following:
[0209] In Scheme 1, the residual data in the bitstream is after the symmetry operation, and the symmetry operation needs to be performed on the reconstructed pixels in the reconstruction process.
[0210] If the target symmetry relation is symmetry-free, The inputs are a chromaticity position (xCb, yCb) that specifies the position of the top-left corner sample of the current block relative to the top-left corner chromaticity sample of the current image, one variable cbWidth that specifies the width of the current block in chromaticity samples, one variable cbHeight that specifies the height of the current block in chromaticity samples, one variable cIdx that specifies the color component index of the current block, one array predSamples that specifies the current block predicted samples, and one array resiSamples that specifies the current block predicted residual samples.
[0211] The output is the current block reconstruction sample array recChromaBuf.
[0212] The derivation process is as follows:
[0213] If x=xCb…xCb+cbWidth-1, y=yCb…yCb+cbHeight-1, xVb=x&(recBufWidthC-1) yVb=y&(recBufHeightC-1) recChromaBuf[cIdx][xVb][yVb]=funcAdd(predSamples[cIdx][x][y],resiSamples[x][y]) recChromaBuf is the stored reconstructed chroma pixel, recBufWidthC is the width of the chroma pixel in the stored reconstructed pixel buffer, i.e., the width of recChromaBuf, and recBufHeightC is the height of the chroma pixel in the stored reconstructed pixel buffer, i.e., the height of recChromaBuf. To handle special situations such as luma mapping with chroma scaling (LMCS), the funcAdd() function can perform direct addition, process the data within it before adding, or perform further processing after the addition is complete.
[0214] If the target symmetry relationship is horizontally symmetric, The inputs are a chroma position (xCb, yCb) that specifies the position of the top-left corner sample of the current block relative to the top-left corner chroma sample of the current image, one variable cbWidth that specifies the width of the current block in chroma samples, one variable cbHeight that specifies the height of the current block in chroma samples, one variable cIdx that specifies the color component index of the current block, one array predSamples that specifies the reconstructed prediction samples of the current block, and one array resiSamples that specifies the prediction residual samples of the current block.
[0215] The output is the current block reconstruction sample array recChromaBuf.
[0216] The derivation process is as follows:
[0217] If x=xCb...xCb+cbWidth-1, y=yCb...yCb+cbHeight-1, and xTemp=xCb+cbWidth-1...xCb, xVb=xTemp&(recBufWidthC-1) yVb=y&(recBufHeightC-1) recChromaBuf[cIdx][xVb][yVb]=funcAdd(predSamples[cIdx][x][y],resiSamples[x][y]) recChromaBuf is the stored reconstructed chroma pixel, recBufWidthC is the width of the chroma pixel in the stored reconstructed pixel buffer, i.e., the width of recChromaBuf, and recBufHeightC is the height of the chroma pixel in the stored reconstructed pixel buffer, i.e., the height of recChromaBuf. The funcAdd() function can perform direct addition, or it can process the data within it before adding, or it can perform further processing after the addition is complete.
[0218] If the target symmetry relationship is vertical symmetry, The inputs are a chroma position (xCb, yCb) that specifies the position of the top-left corner sample of the current block relative to the top-left corner chroma sample of the current image, one variable cbWidth that specifies the width of the current block in chroma samples, one variable cbHeight that specifies the height of the current block in chroma samples, one variable cIdx that specifies the color component index of the current block, one array predSamples that specifies the reconstructed prediction samples of the current block, and one array resiSamples that specifies the prediction residual samples of the current block.
[0219] The output is the current block reconstructed sample array recChromaBuf.
[0220] The derivation process is as follows:
[0221] If x=xCb…xCb+cbWidth-1, y=yCb…yCb+cbHeight-1, and yTemp=yCb+cbHeight-1…yCb, xVb=x&(recBufWidthC-1) yVb=yTemp&(recBufHeightC-1) recChromaBuf[cIdx][xVb][yVb]=funcAdd(predSamples[cIdx][x][y],resiSamples[x][y]) recChromaBuf is the stored reconstructed chroma pixel, recBufWidthC is the width of the chroma pixel in the stored reconstructed pixel buffer, i.e., the width of recChromaBuf, and recBufHeightC is the height of the chroma pixel in the stored reconstructed pixel buffer, i.e., the height of recChromaBuf. The funcAdd() function can perform direct addition, or it can process the data within it before adding, or it can perform further processing after the addition is complete.
[0222] In Method 2, the reconstruction process requires a symmetry operation on the reconstructed values, which can be divided into two steps.
[0223] Here, a two-step transformation is required: store the symmetric reconstructed samples of the current block in one temporary buffer, and then write this temporary buffer to the reconstructed buffer.
[0224] In the first step, a temporary buffer is stored.
[0225] If the target symmetry relation is symmetry-free, The inputs are a chroma position (xCb, yCb) that specifies the position of the top-left corner sample of the current block relative to the top-left corner chroma sample of the current image, one variable cbWidth that specifies the width of the current block in chroma samples, one variable cbHeight that specifies the height of the current block in chroma samples, one variable cIdx that specifies the color component index of the current block, one array predSamples that specifies the reconstructed prediction samples of the current block, and one array resiSamples that specifies the prediction residual samples of the current block.
[0226] The output is a temporary buffer tempBuf of reconstructed chrominance pixels.
[0227] The derivation process is as follows:
[0228] If x=xCb…xCb+cbWidth-1, y=yCb…yCb+cbHeight-1, xVb=x&(tempBufWidthC-1) yVb=y&(tempBufHeightC-1) tempBuf[cIdx][xVb][yVb]=funcAdd(predSamples[cIdx][x][y],resiSamples[x][y]) tempBuf is a temporary buffer established to store the reconstructed chrominance pixels of the current block, tempBufWidthC is the width of tempBuf, and tempBufHeightC is the height of tempBuf. The funcAdd() function can be a direct addition, or it can process the data in it before adding, or it can perform further processing after the addition is complete.
[0229] If the target symmetry relationship is horizontally symmetric, The inputs are a chroma position (xCb, yCb) that specifies the position of the top-left corner sample of the current block relative to the top-left corner chroma sample of the current image, one variable cbWidth that specifies the width of the current block in chroma samples, one variable cbHeight that specifies the height of the current block in chroma samples, one variable cIdx that specifies the color component index of the current block, one array predSamples that specifies the reconstructed prediction samples of the current block, and one array resiSamples that specifies the prediction residual samples of the current block.
[0230] The output is a temporary buffer tempBuf of reconstructed chrominance pixels.
[0231] The derivation process is as follows:
[0232] For x=xCb...xCb+cbWidth-1, y=yCb...yCb+cbHeight-1, and xTemp=xCb+cbWidth-1...xCb, xVb=xTemp&(tempBufWidthC-1) yVb=y&(tempBufHeightC-1) tempBuf[cIdx][xVb][yVb]=funcAdd(predSamples[cIdx][x][y],resiSamples[x][y]) tempBuf is a temporary buffer established to store the reconstructed chrominance pixels of the current block, tempBufWidthC is the width of tempBuf, and tempBufHeightC is the height of tempBuf. The funcAdd() function can be a direct addition, or it can process the data in it before adding, or it can perform further processing after the addition is complete.
[0233] If the target symmetry relationship is vertical symmetry, The inputs are a chroma position (xCb, yCb) that specifies the position of the top-left corner sample of the current block relative to the top-left corner chroma sample of the current image, one variable cbWidth that specifies the width of the current block in chroma samples, one variable cbHeight that specifies the height of the current block in chroma samples, one variable cIdx that specifies the color component index of the current block, one array predSamples that specifies the reconstructed prediction samples of the current block, and one array resiSamples that specifies the prediction residual samples of the current block.
[0234] The output is a temporary buffer tempBuf of reconstructed chrominance pixels.
[0235] The derivation process is as follows:
[0236] If x=xCb…xCb+cbWidth-1, y=yCb…yCb+cbHeight-1, and yTemp=yCb+cbHeight-1…yCb, xVb=x&(tempBufWidthC-1) yVb=yTemp&(tempBufHeightC-1) tempBuf[cIdx][xVb][yVb]=func(predSamples[cIdx][x][y],resiSamples[x][y]) tempBuf is a temporary buffer established to store the reconstructed chrominance pixels of the current block, tempBufWidthC is the width of tempBuf, and tempBufHeightC is the height of tempBuf. The funcAdd() function can be a direct addition, or it can process the data in it before adding, or it can perform further processing after the addition is complete.
[0237] In the second step, the reconstruction buffer is written.
[0238] The inputs are one variable picWidth that specifies the width of the current image in chroma samples, one variable picHeight that specifies the height of the current image in chroma samples, one variable cIdx that specifies the color component index of the current block, and a temporary buffer tempBuf for reconstructed chroma pixels.
[0239] The output is the reconstructed sample array recPicChromaBuf.
[0240] For x=0...picWidth-1, y=0...picHeight-1, xVb=x&(recBufWidthC-1) yVb=y&(recBufHeightC-1) recPicChromaBuf[cIdx][xVb][yVb]=tempBuf[cIdx][x][y] recPicChromaBuf is the stored reconstructed chroma pixels, recBufWidthC is the width of the chroma pixels in the stored reconstructed pixel buffer, i.e., the width of recPicChromaBuf, and recBufHeightC is the height of the chroma pixels in the stored reconstructed pixel buffer, i.e., the height of recPicChromaBuf.
[0241] In an embodiment of the present application, in another possible implementation form of determining a reconstructed value, determining a reconstructed value of the second color component of the current block based on a predicted value of the second color component of the current block and a target symmetry relationship may include performing a conversion process on the predicted value of the second color component of the current block based on the target symmetry relationship to determine a predicted conversion value of the second color component of the current block; decoding the bitstream to determine a residual value of the second color component of the current block; and determining a reconstructed value of the second color component of the current block based on the predicted conversion value of the second color component of the current block and the residual value of the second color component of the current block.
[0242] It should be noted that the predicted transform value of the second color component of the current block is obtained by analyzing the bitstream. Determining a reconstructed value of the second color component of the current block based on the predicted transform value of the second color component of the current block and the residual value of the second color component of the current block may include: performing an addition operation based on the predicted transform value of the second color component of the current block and the residual value of the second color component of the current block to determine a reconstructed value of the second color component of the current block.
[0243] Illustratively, the predicted samples are transformed based on the target symmetry relationship and summed with the residual samples to obtain reconstructed samples.
[0244] In Scheme 1, we first obtain the predicted samples after the symmetry operation, and then obtain the reconstructed samples.
[0245] (1) Obtaining predicted samples after transformation Obtaining the transformed predicted samples based on the target symmetry relationship and the obtained predicted samples includes, but is not limited to, the following ways:
[0246] If the target symmetry relation is symmetry-free, The inputs are a chroma position (xCb, yCb) that specifies the position of the top left corner sample of the current block relative to the top left corner chroma sample of the current image, one variable cbWidth that specifies the width of the current block in chroma samples, one variable cbHeight that specifies the height of the current block in chroma samples, one variable cIdx that specifies the color component index of the current block, and an array predSamples of current block predicted samples.
[0247] The output is an array of transformed current block predicted samples, predTrsSamples.
[0248] The derivation process is as follows:
[0249] If x=xCb…xCb+cbWidth-1, y=yCb…yCb+cbHeight-1, xVb=x&(predSamplesWidthC-1) yVb=y&(predSamplesHeightC-1) predTrsSamples[cIdx][x][y]=predSamples[cIdx][xVb][yVb] predSamples are the stored predicted chrominance pixels, predSamplesWidthC is the width of predSamples, and predSamplesHeightC is the height of predSamples.
[0250] If the target symmetry relationship is horizontally symmetric, The inputs are a chroma position (xCb, yCb) that specifies the position of the top left corner sample of the current block relative to the top left corner chroma sample of the current image, one variable cbWidth that specifies the width of the current block in chroma samples, one variable cbHeight that specifies the height of the current block in chroma samples, one variable cIdx that specifies the color component index of the current block, and an array predSamples of current block predicted samples.
[0251] The output is an array of transformed current block predicted samples, predTrsSamples.
[0252] The derivation process is as follows:
[0253] If x=xCb...xCb+cbWidth-1, y=yCb...yCb+cbHeight-1, and xTemp=xCb+cbWidth-1...xCb, xVb=xTemp&(predSamplesWidthC-1) yVb=y&(predSamplesHeightC-1) predTrsSamples[cIdx][x][y]=predSamples[cIdx][xVb][yVb] predSamples are the stored predicted chrominance pixels, predSamplesWidthC is the width of predSamples, and predSamplesHeightC is the height of predSamples.
[0254] If the target symmetry relationship is vertical symmetry, The inputs are a chroma position (xCb, yCb) that specifies the position of the top left corner sample of the current block relative to the top left corner chroma sample of the current image, one variable cbWidth that specifies the width of the current block in chroma samples, one variable cbHeight that specifies the height of the current block in chroma samples, one variable cIdx that specifies the color component index of the current block, and an array predSamples of current block predicted samples.
[0255] The output is an array of transformed current block predicted samples, predTrsSamples.
[0256] The derivation process is as follows:
[0257] If x=xCb…xCb+cbWidth-1, y=yCb…yCb+cbHeight-1, and yTemp=yCb+cbHeight-1…yCb, xVb=x&(predSamplesWidthC-1) yVb=yTemp&(predSamplesHeightC-1) predTrsSamples[cIdx][x][y]=predSamples[cIdx][xVb][yVb] predSamples are the stored predicted chrominance pixels, predSamplesWidthC is the width of predSamples, and predSamplesHeightC is the height of predSamples.
[0258] (2) Obtaining reconstructed samples Using the transformed predicted samples and the residual samples obtained above, we add the two together to obtain the reconstructed samples recSamples, thereby obtaining the actual reconstructed samples recChromaBuf.
[0259] The inputs are a chroma position (xCb, yCb) that specifies the position of the top-left corner sample of the current block relative to the top-left corner chroma sample of the current image, one variable cbWidth that specifies the width of the current block in chroma samples, one variable cbHeight that specifies the height of the current block in chroma samples, one variable cIdx that specifies the color component index of the current block, one array predSamples that specifies the reconstructed prediction samples of the current block, and one array resiSamples that specifies the prediction residual samples of the current block.
[0260] The output is the current block reconstructed sample array recChromaBuf.
[0261] The derivation process is as follows:
[0262] If x=xCb…xCb+cbWidth-1, y=yCb…yCb+cbHeight-1, xVb=x&(recBufWidthC-1) yVb=y&(recBufHeightC-1) recChromaBuf[cIdx][xVb][yVb]=funcAdd(predSamples[cIdx][x][y],resiSamples[x][y]) recChromaBuf is the stored reconstructed chroma pixel, recBufWidthC is the width of the chroma pixel in the stored reconstructed pixel buffer, i.e., the width of recChromaBuf, and recBufHeightC is the height of the chroma pixel in the stored reconstructed pixel buffer, i.e., the height of recChromaBuf. The funcAdd() function can perform direct addition, or it can process the data within it before adding, or it can perform further processing after the addition is complete.
[0263] In Scheme 2, we obtain direct prediction samples and then obtain reconstructed samples after symmetry operations.
[0264] (1) Obtain a prediction sample.
[0265] (2) Obtain a reconstruction sample.
[0266] If the target symmetry relation is symmetry-free, The inputs are a chroma position (xCb, yCb) that specifies the position of the top-left corner sample of the current block relative to the top-left corner chroma sample of the current image, one variable cbWidth that specifies the width of the current block in chroma samples, one variable cbHeight that specifies the height of the current block in chroma samples, one variable cIdx that specifies the color component index of the current block, one array predSamples that specifies the reconstructed prediction samples of the current block, and one array resiSamples that specifies the prediction residual samples of the current block.
[0267] The output is the current block reconstructed sample array recChromaBuf.
[0268] The derivation process is as follows:
[0269] If x=xCb…xCb+cbWidth-1, y=yCb…yCb+cbHeight-1, xVb=x&(recBufWidthC-1) yVb=y&(recBufHeightC-1) recChromaBuf[cIdx][xVb][yVb]=funcAdd(predSamples[cIdx][x][y],resiSamples[x][y]) recChromaBuf is the stored reconstructed chroma pixel, recBufWidthC is the width of the chroma pixel in the stored reconstructed pixel buffer, i.e., the width of recChromaBuf, and recBufHeightC is the height of the chroma pixel in the stored reconstructed pixel buffer, i.e., the height of recChromaBuf. The funcAdd() function can perform direct addition, or it can process the data within it before adding, or it can perform further processing after the addition is complete.
[0270] If the target symmetry relationship is horizontally symmetric, The inputs are a chroma position (xCb, yCb) that specifies the position of the top-left corner sample of the current block relative to the top-left corner chroma sample of the current image, one variable cbWidth that specifies the width of the current block in chroma samples, one variable cbHeight that specifies the height of the current block in chroma samples, one variable cIdx that specifies the color component index of the current block, one array predSamples that specifies the reconstructed prediction samples of the current block, and one array resiSamples that specifies the prediction residual samples of the current block.
[0271] The output is the current block reconstructed sample array recChromaBuf.
[0272] The derivation process is as follows:
[0273] If x=xCb...xCb+cbWidth-1, y=yCb...yCb+cbHeight-1, and xTemp=xCb+cbWidth-1...xCb, xVb=x&(recBufWidthC-1) yVb=y&(recBufHeightC-1) recChromaBuf[cIdx][xVb][yVb]=funcAdd(predSamples[cIdx][xTemp][y],resiSamples[x][y]) recChromaBuf is the stored reconstructed chroma pixel, recBufWidthC is the width of the chroma pixel in the stored reconstructed pixel buffer, i.e., the width of recChromaBuf, and recBufHeightC is the height of the chroma pixel in the stored reconstructed pixel buffer, i.e., the height of recChromaBuf. The funcAdd() function can perform direct addition, or it can process the data within it before adding, or it can perform further processing after the addition is complete.
[0274] If the target symmetry relationship is vertical symmetry, The inputs are a chroma position (xCb, yCb) that specifies the position of the top-left corner sample of the current block relative to the top-left corner chroma sample of the current image, one variable cbWidth that specifies the width of the current block in chroma samples, one variable cbHeight that specifies the height of the current block in chroma samples, one variable cIdx that specifies the color component index of the current block, one array predSamples that specifies the reconstructed prediction samples of the current block, and one array resiSamples that specifies the prediction residual samples of the current block.
[0275] The output is the current block reconstructed sample array recChromaBuf.
[0276] The derivation process is as follows:
[0277] If x=xCb…xCb+cbWidth-1, y=yCb…yCb+cbHeight-1, and yTemp=yCb+cbHeight-1…yCb, xVb=x&(recBufWidthC-1) yVb=y&(recBufHeightC-1) recChromaBuf[cIdx][xVb][yVb]=funcAdd(predSamples[cIdx][x][yTemp],resiSamples[x][y]) recChromaBuf is the stored reconstructed chroma pixel, recBufWidthC is the width of the chroma pixel in the stored reconstructed pixel buffer, i.e., the width of recChromaBuf, and recBufHeightC is the height of the chroma pixel in the stored reconstructed pixel buffer, i.e., the height of recChromaBuf. The funcAdd() function can perform direct addition, or it can process the data within it before adding, or it can perform further processing after the addition is complete.
[0278] It can be further understood that in an embodiment of the present application, the decoding method may further include: decoding the bitstream to determine a target prediction mode of the current block; and if the target prediction mode indicates that DBV mode is allowed to be used for the second color component of the current block, determining target block vector parameters of the current block, i.e., performing step S602 of FIG. 6 .
[0279] In some embodiments, decoding the bitstream to determine a target prediction mode of the current block may include decoding the bitstream to determine a value of a first syntax element identification information, and determining that the target prediction mode of the current block is DBV mode if the value of the first syntax element identification information is a first value, and determining that the target prediction mode of the current block is a prediction mode other than DBV mode if the value of the first syntax element identification information is a second value.
[0280] In the present embodiment, the first syntax element identification information may be intra_dbv_flag. In addition, in dual tree partitioning, if the corresponding luma region has BV information in DM mode, the current chroma block will be predicted in DBV mode. For example, If CuPredMode[0][xCb+cbWidth / 2][yCb+cbHeight / 2] is equal to MODE_IBC and intra_dbv_flag=1 is set, the chrominance intra prediction mode IntraPredModeC[xCb][yCb] uses DBV mode.
[0281] If CuPredMode[0][xCb+cbWidth / 2][yCb+cbHeight / 2] is equal to MODE_INTRA, IntraTmpFlag[xCb+cbWidth / 2][yCb+cbHeight / 2] is equal to 1, and intra_dbv_flag=1 is set, the chrominance intra prediction mode IntraPredModeC[xCb][yCb] uses DBV mode.
[0282] Furthermore, in the present embodiment, the chromaticity prediction mode is derived as follows:
[0283] The chrominance intra prediction mode IntraPredModeC[xCb][yCb] uses cclm_mode_flag, cclm_mode_idx, intra_chroma_pred_mode, lumaIntraPredMode, and lumaTempPredMode specified in the following table. The filled items other than these DBV modes are illustrative of corresponding values and do not necessarily have to be filled with these values. Here, Table 12 shows an example of deriving the chrominance prediction mode. In Table 12, 0 represents Planar mode, 1 represents DC mode, 18 represents horizontal prediction mode, 50 represents vertical prediction mode, and 81 to 83 represent CCLM prediction modes.
[0284] [Table 12]
[0285] As can be seen from Table 12, in DM mode, if intra_ibc_flag==1, i.e., if the information obtained at the central position block of the luminance region at the same position includes BV, the chrominance intra prediction mode IntraPredModeC[xCb][yCb] uses DBV mode.
[0286] In some embodiments, the decoding method may further include determining a first co-location region corresponding to the current block, and determining that if any position within the first co-location region has BV information, the use of DBV mode is allowed for the second color component of the current block.
[0287] In the embodiment of the present application, the judgment condition of the DM method may be that any position in the entire corresponding luminance region has BV information, which is explained as follows:
[0288] In DM mode, if the corresponding luma prediction information includes BV information, the current chroma block is coded using DBV mode. For example, If there is any pair (x, y) where x=xCb...xCb+cbWidth-1, y=yCb...yCb+cbHeight-1 such that CuPredMode[0][x][y] is equal to MODE_IBC, Intra_DBV_flag is set to 1, and the chrominance intra prediction mode IntraPredModeC[xCb][yCb] uses DBV mode.
[0289] If there is any pair (x, y) where x=xCb...xCb+cbWidth-1 and y=yCb...yCb+cbHeight-1 such that CuPredMode[0][x][y] is equal to MODE_INTRA and IntraTmpFlag[x][y] is equal to 1, Intra_DBV_flag is set to 1, and in this case, the chrominance intra prediction mode IntraPredModeC[xCb][yCb] uses the DBV mode. Here, the flag IntraTmpFlag is used to indicate whether to use the IntraTmp mode.
[0290] In some embodiments, determining the target block vector parameters of the current block may include decoding the bitstream to determine the target block vector parameters of the current block, i.e., the target block vector parameters (such as chroma BV) of the current block may also be written into the bitstream by the encoding side, so that the decoding side can parse the bitstream to obtain the target block vector parameters of the current block.
[0291] In some embodiments, determining the target symmetry relations may include decoding the bitstream to determine the target symmetry relations, i.e., the determined target symmetry relations may also be written into the bitstream by the encoding side, so that the decoding side can parse the bitstream to obtain the target symmetry relations.
[0292] In some embodiments, the decoding method may further include performing sub-block division on the current block to obtain at least one sub-block, and using the sub-block as the current block, performing the steps of the decoding method shown in Figure 6 to determine a reconstructed value of the second color component of the sub-block.
[0293] It should be noted that in the present embodiment, even if processing is performed in units of sub-blocks of the current block, processing can be performed according to the symmetry relationship in the present embodiment, provided that all decisions and processing in the steps are performed in units of sub-blocks.
[0294] It should be further noted that in the embodiment of the present application, for a current block for which chrominance prediction is performed in DBV mode, the transform and inverse transform of its corresponding residual may include, but are not limited to, the following methods: Only one transform may be performed (for example, only DCT transform without LFNST), or two transforms may be performed (primary transform and secondary transform, for example, the encoding side performs DCT transform and then LFNST transform). Here, the decoding side maintains the consistency of the reverse order of the forward transform method performed on the encoding side.
[0295] An embodiment of the present application provides a decoding method, which includes determining a first color component block of a current block, determining a target block vector parameter of the current block if the prediction mode of the first color component block satisfies a first condition, determining a target symmetry relationship based on the target block vector parameter of the current block, performing a prediction process on a second color component of the current block based on the target block vector parameter, determining a predicted value of the second color component of the current block, and determining a reconstructed value of the second color component of the current block based on the predicted value of the second color component of the current block and the target symmetry relationship. That is, the present application fully considers available information such as reconstructed luma and block vectors and predicts chrominance based on this information to improve the unity of chrominance prediction, and more precisely processes the predicted value taking into account the symmetry relationship to improve the accuracy of chrominance prediction, thereby saving bit rate and improving encoding and decoding performance, thereby effectively improving coding efficiency.
[0296] In another embodiment of the present application, please refer to Figure 18, which is a flowchart of an encoding method according to an embodiment of the present application. As shown in Figure 18, the method may include the following steps:
[0297] In step S1801, the first color component block of the current block is determined.
[0298] It should be noted that the encoding method of the present embodiment is applied to an encoder. Furthermore, the encoding method may specifically refer to an intra prediction method, more specifically a prediction method using DBV mode. Here, a video image is divided into a plurality of coding blocks, and the plurality of coding blocks may include a first color component, a second color component, and a third color component. The current block in the present embodiment refers to a coding block to be currently intra-predicted in the video image.
[0299] It should be further noted that in the embodiment of the present application, in dual tree partitioning, in DM mode, if the prediction mode of the co-located luminance block satisfies the first condition, the embodiment of the present application can derive the block vector parameters applied to chrominance based on the block vector parameters of the co-located luminance block, thereby improving coding efficiency.
[0300] In step S1802, if the prediction mode of the first color component block satisfies the first condition, determine the target block vector parameters of the current block, and determine the target symmetry relationship according to the target block vector parameters of the current block.
[0301] In an embodiment of the present application, determining that the prediction mode of the first color component block satisfies the first condition may include determining that the prediction mode of the first color component block is a first prediction mode having BV information.
[0302] In an embodiment of the present application, the first prediction mode includes at least one of an IBC mode and an IntraTMP mode.
[0303] In some embodiments, the encoding method may further include not performing an encoding process on the target prediction mode of the current block if the prediction mode of the first color component block does not satisfy a first condition.
[0304] In an embodiment of the present application, the failure of the prediction mode of the first color component block to satisfy the first condition may include determining that the prediction mode of the first color component block is a second prediction mode without BV information, where the second prediction mode does not include the IBC mode and the IntraTMP mode, i.e., the second prediction mode is a mode other than the IBC mode and the IntraTMP mode, such as the PLANAR mode, the DM mode, or the DC mode.
[0305] In some embodiments, determining the first color component block of the current block may include determining a first co-location area corresponding to the current block, and determining the first color component block of the current block in a plurality of blocks divided from the first co-location area.
[0306] In some embodiments, determining the first color component block of the current block may include selecting a target block from a plurality of blocks divided from the first co-located region, and setting the target block as the first color component block of the current block.
[0307] In some embodiments, determining the first color component block of the current block may include determining position information of the current block, performing a scaling process on the position information of the current block based on a predetermined sampling format to obtain position information of a co-location area corresponding to the current block, determining target position information based on the position information of the co-location area, and setting the target block including the target position information as the first color component block of the current block.
[0308] In some embodiments, determining the target position information based on the position information of the same location area may include performing a center position calculation based on the position information of the same location area and setting the obtained center position information as the target position information, or performing a top left corner position calculation based on the position information of the same location area and setting the obtained top left position information as the target position information, or performing a bottom right corner position calculation based on the position information of the same location area and setting the obtained bottom left position information as the target position information.
[0309] In the present embodiment, the target block as the first color component block may be a block at any position within the first same-position region. For example, it may be a block (filled in black) at the center of the same-position luminance region shown in Fig. 3, a block (filled in black) at the upper left corner of the same-position luminance region shown in Fig. 7, or a block (filled in black) at the lower right corner of the same-position luminance region shown in Fig. 8, or even a block at the upper right corner or lower left corner of the same-position luminance region, or even a block at the center of the upper left region, and the present invention is not limited to this.
[0310] In some embodiments, determining the first color component block of the current block may include determining at least one candidate block located at a predetermined position among multiple blocks divided from the first co-location region; determining a target candidate block from the at least one candidate block that satisfies a predetermined judgment condition; and setting the target candidate block as the first color component block of the current block.
[0311] In some embodiments, determining the target block vector parameters of the current block may include determining first block vector parameters of a first color component block, and adjusting the first block vector parameters of the first color component block to determine the target block vector parameters of the current block.
[0312] In some embodiments, adjusting the first block vector parameters of the first color component block and determining the target block vector parameters of the current block may include performing a scaling operation on the first block vector parameters of the first color component block based on a predetermined sampling format and determining the target block vector parameters of the current block.
[0313] In some embodiments, adjusting the first block vector parameters of the first color component block and determining the target block vector parameters of the current block may include performing a scaling operation on the first block vector parameters of the first color component block based on a predetermined sampling format to obtain initial block vector parameters of the current block, and performing a correction operation on the initial block vector parameters of the current block to determine the target block vector parameters of the current block.
[0314] In some embodiments, the encoding method may further include: after determining the target block vector parameters of the current block, determining whether the target block vector parameters satisfy an availability condition; and if the target block vector parameters satisfy the availability condition, performing a step of determining a target symmetry relationship of the current block based on the target block vector parameters of the current block.
[0315] In some embodiments, the target block vector parameters satisfy the availability condition if at least: the offset position indicated by the position information of the current block and the target block vector parameter does not exceed the image boundary; The offset position indicated by the position information of the current block and the target block vector parameter does not cover the current block; The offset position indicated by the position information of the current block and the target block vector parameter does not exceed a predetermined available area; It may include that the position information of the current block and the offset position indicated by the target block vector parameter have been reconstructed.
[0316] In one possible implementation, determining a target symmetry relationship based on target block vector parameters of the current block may include determining a first coincidence area corresponding to the current block, determining a reference block based on the target block vector parameters and determining a second coincidence area corresponding to the reference block, performing error calculation of at least one symmetry relationship based on the first coincidence area and the second coincidence area to obtain an error value of the at least one symmetry relationship, and determining a target symmetry relationship from the at least one symmetry relationship based on the error value of the at least one symmetry relationship.
[0317] In some embodiments, performing an error calculation of at least one symmetric relationship based on the first coincident position area and the second coincident position area to obtain an error value of the at least one symmetric relationship may include: performing a transformation process of the first symmetric relationship on the second coincident position area to determine a transformed second coincident position area; and calculating a symmetric error between the transformed second coincident position area and the first coincident position area based on a predetermined error criterion to determine an error value of the first symmetric relationship, where the first symmetric relationship is any one of the at least one symmetric relationship.
[0318] In another possible implementation form, determining a target symmetry relationship based on the target block vector parameters of the current block may include determining a first adjacent region corresponding to the current block, determining a reference block based on the target block vector parameters and determining a second adjacent region corresponding to the reference block, performing an error calculation for at least one symmetry relationship based on the first adjacent region and the second adjacent region to obtain an error value of the at least one symmetry relationship, and determining a target symmetry relationship from the at least one symmetry relationship based on the error value of the at least one symmetry relationship.
[0319] In some embodiments, performing an error calculation of at least one symmetric relation based on the first adjacent region and the second adjacent region and obtaining an error value of the at least one symmetric relation may include: performing a transformation process of the first symmetric relation on the second adjacent region to determine a transformed second adjacent region; and calculating a symmetric error between the transformed second adjacent region and the first adjacent region based on a predetermined error criterion to determine an error value of the first symmetric relation, where the first symmetric relation is any one of the at least one symmetric relation.
[0320] In some embodiments, the at least one symmetry relationship may include at least one of: no symmetry relationship, a vertical symmetry relationship, and a horizontal symmetry relationship. Furthermore, in some embodiments, the predetermined error criterion may include at least one of: sum of absolute errors (SAD), sum of absolute transformed errors (SATD), residual sum of squares (SSE), mean absolute difference (MAD), mean absolute error (MAE), mean squared error (MSE), and rate-distortion optimization (RDO).
[0321] In some examples, determining the target symmetric relation from the at least one symmetric relation based on the error value of the at least one symmetric relation may include selecting a minimum error value from the error values of the at least one symmetric relation, and determining the symmetric relation corresponding to the minimum error value as the target symmetric relation.
[0322] It should be noted that in an embodiment of the present application, after determining the target symmetry relationship, the encoding method may further include storing the target symmetry relationship in a predetermined buffer area, so that the target symmetry relationship can be directly obtained subsequently without deriving the symmetry relationship again.
[0323] In yet another possible implementation, determining the target symmetry relationship based on the target block vector parameters of the current block may include obtaining the target symmetry relationship of the first color component block from a predetermined buffer area to determine the target symmetry relationship, wherein the target symmetry relationship is used to indicate the symmetry relationship between the first co-location area in which the first color component block is located and the second co-location area indicated by the target block vector parameters.
[0324] It should be mentioned that in the embodiment of the present application, the specific determination process of the target block vector parameters and the target symmetry relationship is similar between the encoding side and the decoding side, and will not be described in detail here.
[0325] In step S1803, a prediction process is performed on the second color component of the current block based on the target block vector parameters to determine a predicted value of the second color component of the current block.
[0326] It should be noted that in the present embodiment, the DBV mode can refer to a prediction mode newly introduced in the present embodiment, represented as DBV, in which a prediction value of the second color component of the current block is determined by performing a prediction process on the second color component of the current block based on the determined target block vector parameter.
[0327] In some embodiments, performing a prediction process on the second color component of the current block based on the target block vector parameters and determining a predicted value of the second color component of the current block may include determining an offset position of the current block based on the target block vector parameters and position information of the current block, performing a block copy process based on the offset position of the current block to obtain a first predicted block, and determining a predicted value of the second color component of the current block based on the first predicted block.
[0328] Further, in some embodiments, determining a predicted value of the second color component of the current block based on the first predicted block may include performing a correction operation on the first predicted block to determine a predicted value of the second color component of the current block.
[0329] That is, in the embodiment of the present application, the position (xCb, yCb) of the current chroma block is obtained, the chroma BV=(BVChor, BVCver) is obtained, and the corresponding offset position (xCb+BVChor, yCb+BVCve r) and then directly perform block copy to determine the predicted value. Alternatively, after performing block copy, the copied value needs to be further corrected to obtain the final predicted value, including but not limited to weighting with the predicted value obtained in CCLM mode or other modes.
[0330] In step S1804, a residual value of the second color component of the current block is determined based on the predicted value of the second color component of the current block and the target symmetry relationship.
[0331] In an embodiment of the present application, regarding the determination of the residual value, in one possible implementation form, determining the residual value of the second color component of the current block based on the predicted value of the second color component of the current block and the target symmetry relationship may include: determining the original value of the second color component of the current block; performing a transformation process on the original value of the second color component of the current block based on the target symmetry relationship to determine an initial value of the second color component of the current block; and determining the residual value of the second color component of the current block based on the initial value of the second color component of the current block and the predicted value of the second color component of the current block.
[0332] It should be noted that determining a residual value of the second color component of the current block based on the initial value of the second color component of the current block and the predicted value of the second color component of the current block may include performing a subtraction operation based on the initial value of the second color component of the current block and the predicted value of the second color component of the current block to determine a residual value of the second color component of the current block.
[0333] Furthermore, in some embodiments, the encoding method may further include encoding a residual value of the second color component of the current block and writing the resulting coded bits into a bitstream. In this way, after the encoding side writes the residual value into the bitstream, the decoding side can subsequently obtain the residual value by analyzing the bitstream.
[0334] Illustratively, determining the residual value (ie, the residual sample) may specifically include:
[0335] (1) Obtain the original sample.
[0336] Obtaining original samples based on the target symmetry relationship includes, but is not limited to, the following ways:
[0337] In Method 1, original samples are manipulated at the block level based on symmetry relationships. Here, three symmetry relationships are taken as examples.
[0338] If the target symmetry relationship does not require symmetry, copying is performed as is.
[0339] The inputs are a chromaticity position (xCb, yCb) that specifies the position of the top left corner sample of the current block relative to the top left corner chromaticity sample of the current image, one variable cbWidth that specifies the width of the current block in chromaticity samples, one variable cbHeight that specifies the height of the current block in chromaticity samples, and one variable cIdx that specifies the color component index of the current block.
[0340] The output is an array of the current block's original samples, orgSamples.
[0341] The derivation process is as follows:
[0342] If x=xCb…xCb+cbWidth-1, y=yCb…yCb+cbHeight-1, xVb=x&(orgBufWidthC-1) yVb=y&(orgBufHeightC-1) orgSamples[cIdx][x][y]=orgChromaBuf[cIdx][xVb][yVb] orgChromaBuf is the stored original chroma pixel, orgBufWidthC is the width of the chroma pixel in the stored original pixel buffer, i.e., the width of orgChromaBuf, and orgBufHeightC is the height of the chroma pixel in the stored original pixel buffer, i.e., the height of orgChromaBuf.
[0343] If the target symmetry relationship is horizontally symmetric, The inputs are a chromaticity position (xCb, yCb) that specifies the position of the top left corner sample of the current block relative to the top left corner chromaticity sample of the current image, one variable cbWidth that specifies the width of the current block in chromaticity samples, one variable cbHeight that specifies the height of the current block in chromaticity samples, and one variable cIdx that specifies the color component index of the current block.
[0344] The output is an array of the current block's original samples, orgSamples.
[0345] The derivation process is as follows:
[0346] If x=xCb...xCb+cbWidth-1, y=yCb...yCb+cbHeight-1, and xTemp=xCb+cbWidth-1...xCb, xVb=xTemp&(orgBufWidthC-1) yVb=y&(orgBufHeightC-1) orgSamples[cIdx][x][y]=orgChromaBuf[cIdx][xVb][yVb] orgChromaBuf is the stored original chroma pixel, orgBufWidthC is the width of the chroma pixel in the stored original pixel buffer, i.e., the width of orgChromaBuf, and orgBufHeightC is the height of the chroma pixel in the stored original pixel buffer, i.e., the height of orgChromaBuf.
[0347] If the target symmetry relationship is vertical symmetry, The inputs are a chromaticity position (xCb, yCb) that specifies the position of the top left corner sample of the current block relative to the top left corner chromaticity sample of the current image, one variable cbWidth that specifies the width of the current block in chromaticity samples, one variable cbHeight that specifies the height of the current block in chromaticity samples, and one variable cIdx that specifies the color component index of the current block.
[0348] The output is an array of the current block's original samples, orgSamples.
[0349] The derivation process is as follows:
[0350] If x=xCb…xCb+cbWidth-1, y=yCb…yCb+cbHeight-1, and yTemp=yCb+cbHeight-1…yCb, xVb=x&(orgBufWidthC-1) yVb=yTemp&(orgBufHeightC-1) orgSamples[cIdx][x][y]=orgChromaBuf[cIdx][xVb][yVb] orgChromaBuf is the stored original chroma pixel, orgBufWidthC is the width of the chroma pixel in the stored original pixel buffer, i.e., the width of orgChromaBuf, and orgBufHeightC is the height of the chroma pixel in the stored original pixel buffer, i.e., the height of orgChromaBuf.
[0351] In method 2, In the first step, all symmetry-related transformations are performed on the original samples at the image level based on predefined symmetry relations, including but not limited to no symmetry, horizontal symmetry, vertical symmetry, etc. Here, three types of symmetry relations are taken as examples.
[0352] First, no symmetric transformation is performed on the original sample array.
[0353] The inputs are one variable picWidth that specifies the width of the current image in chroma samples, one variable picHeight that specifies the height of the current image in chroma samples, and one variable cIdx that specifies the color component index of the current block.
[0354] The output is an array of the original samples without symmetry transformation, orgPicSamples.
[0355] For x=0...picWidth-1, y=0...picHeight-1, xVb=x&(orgBufWidthC-1) yVb=y&(orgBufHeightC-1) orgPicSamples[cIdx][x][y]=orgChromaBuf[cIdx][xVb][yVb] orgChromaBuf is the stored original chroma pixel, orgBufWidthC is the width of the chroma pixel in the stored original pixel buffer, i.e., the width of orgChromaBuf, and orgBufHeightC is the height of the chroma pixel in the stored original pixel buffer, i.e., the height of orgChromaBuf.
[0356] Note that this type of operation is a simple copy operation and can be omitted. If omitted, orgPicSamples (described below) corresponds to orgChromaBuf.
[0357] The second type is to perform horizontal symmetry on the original sample array.
[0358] The inputs are one variable picWidth that specifies the width of the current image in chroma samples, one variable picHeight that specifies the height of the current image in chroma samples, and one variable cIdx that specifies the color component index of the current block.
[0359] The output is an array of horizontally symmetric original samples, orgHorPicSamples.
[0360] For x=0...picWidth-1, y=0...picHeight-1, and xTemp=picWidth-1...0, xVb=xTemp&(orgBufWidthC-1) yVb=y&(orgBufHeightC-1) orgHorPicSamples[cIdx][x][y]=orgChromaBuf[cIdx][xVb][yVb] orgChromaBuf is the stored original chroma pixel, orgBufWidthC is the width of the chroma pixel in the stored original pixel buffer, i.e., the width of orgChromaBuf, and orgBufHeightC is the height of the chroma pixel in the stored original pixel buffer, i.e., the height of orgChromaBuf.
[0361] The third type is to perform vertical symmetry with respect to the original sample array.
[0362] The inputs are one variable picWidth that specifies the width of the current image in chroma samples, one variable picHeight that specifies the height of the current image in chroma samples, and one variable cIdx that specifies the color component index of the current block.
[0363] The output is an array of original samples, orgVerPicSamples.
[0364] If x=0...picWidth-1, y=0...picHeight-1, and yTemp=picHeight-1...0, xVb=x&(orgBufWidthC-1) yVb=yTemp&(orgBufHeightC-1) orgVerPicSamples[cIdx][x][y]=orgChromaBuf[cIdx][xVb][yVb] orgChromaBuf is the stored original chroma pixel, orgBufWidthC is the width of the chroma pixel in the stored original pixel buffer, i.e., the width of orgChromaBuf, and orgBufHeightC is the height of the chroma pixel in the stored original pixel buffer, i.e., the height of orgChromaBuf.
[0365] In the second step, the original sample sequence of the current block is obtained based on the target symmetry relationship.
[0366] If the target symmetry relation is symmetry-free, The inputs are a chromaticity position (xCb, yCb) that specifies the position of the top left corner sample of the current block relative to the top left corner chromaticity sample of the current image, one variable cbWidth that specifies the width of the current block in chromaticity samples, one variable cbHeight that specifies the height of the current block in chromaticity samples, and one variable cIdx that specifies the color component index of the current block.
[0367] The output is an array of the current block's original samples, orgSamples.
[0368] The derivation process is as follows:
[0369] If x=xCb…xCb+cbWidth-1, y=yCb…yCb+cbHeight-1, xVb=x&(orgPicBufWidthC-1) yVb=y&(orgPicBufHeightC-1) orgSamples[cIdx][x][y]=orgPicSamples[cIdx][xVb][yVb] What is stored in orgPicSamples are the chroma pixels that are not subjected to symmetric transformation in the first step of transformation, orgPicBufWidthC is the width of the chroma pixels in the stored transformed pixel buffer, i.e., the width of orgPicSamples, and orgPicBufHeightC is the height of the chroma pixels in the stored transformed pixel buffer, i.e., the height of orgPicSamples.
[0370] If the target symmetry relationship is horizontally symmetric, The inputs are a chromaticity position (xCb, yCb) specifying the position of the top left corner sample of the current block relative to the top left corner chromaticity sample of the current image, one variable cbWidth specifying the width of the current block in chromaticity samples, one variable cbHeight specifying the height of the current block in chromaticity samples, one variable picWidth specifying the width of the current image in chromaticity samples, one variable picHeight specifying the height of the current image in chromaticity samples, and one variable cIdx specifying the color component index of the current block.
[0371] The output is an array of the current block's original samples, orgSamples.
[0372] The derivation process is as follows:
[0373] If x=xCb…xCb+cbWidth-1, y=yCb…yCb+cbHeight-1, and xTemp=picWidth-xCb-cbWidth…picWidth-xCb-1, xVb=xTemp&(orgHorPicBufWidthC-1) yVb=y&(orgHorPicBufHeightC-1) orgSamples[cIdx][x][y]=orgHorPicSamples[cIdx][xVb][yVb] What is stored in orgHorPicSamples are the chromatic pixels after the first step of horizontal symmetric transformation, orgHorPicBufWidthC is the width of the chromatic pixels in the stored transformed pixel buffer, i.e., the width of orgHorPicSamples, and orgHorPicBufHeightC is the height of the chromatic pixels in the stored transformed pixel buffer, i.e., the height of orgHorPicSamples.
[0374] If the target symmetry relationship is vertical symmetry, The inputs are a chromaticity position (xCb, yCb) specifying the position of the top left corner sample of the current block relative to the top left corner chromaticity sample of the current image, one variable cbWidth specifying the width of the current block in chromaticity samples, one variable cbHeight specifying the height of the current block in chromaticity samples, one variable picWidth specifying the width of the current image in chromaticity samples, one variable picHeight specifying the height of the current image in chromaticity samples, and one variable cIdx specifying the color component index of the current block.
[0375] The output is an array of the current block's original samples, orgSamples.
[0376] The derivation process is as follows:
[0377] If x=xCb…xCb+cbWidth-1, y=yCb…yCb+cbHeight-1, and yTemp=picHeight-yCb-cbHeight…picHeight-yCb-1, xVb=x&(orgVerPicBufWidthC-1) yVb=yTemp&(orgVerPicBufHeightC-1) orgSamples[cIdx][x][y]=orgVerPicSamples[cIdx][xVb][yVb] What is stored in orgVerPicSamples is the chrominance pixels after the first step of vertical symmetric transformation, orgVerPicBufWidthC is the width of the chrominance pixels in the stored transformed pixel buffer, i.e., the width of orgVerPicSamples, and orgVerPicBufHeightC is the height of the chrominance pixels in the stored transformed pixel buffer, i.e., the height of orgVerPicSamples.
[0378] (2) Obtain the residual sample.
[0379] Derive residual samples based on the predicted samples obtained above and the original samples obtained in (1).
[0380] The inputs are a chromaticity position (xCb, yCb) specifying the position of the top left corner sample of the current block relative to the top left corner chromaticity sample of the current image, one variable cbWidth specifying the width of the current block in chromaticity samples, one variable cbHeight specifying the height of the current block in chromaticity samples, one variable cIdx specifying the color component index of the current block, the original samples orgSamples obtained in step S7, and the predicted samples predSamples obtained in step S6.
[0381] The output is the array resiSamples of the current block residual samples.
[0382] The derivation process is as follows:
[0383] If x=xCb…xCb+cbWidth-1, y=yCb…yCb+cbHeight-1, resiSamples[cIdx][x][y]=FuncSub(orgSamples[cIdx][x][y],predSamples[cIdx][x][y]) Here, the FuncSub() function may directly subtract two parameters, or may perform further operations such as conversion processing after subtracting two parameters.
[0384] In another possible implementation, the predicted samples can be subjected to a symmetric transformation based on a standard symmetry relationship and subtracted from the original samples to obtain residual samples.
[0385] Illustratively, determining the residual value (ie, the residual sample) may further include:
[0386] In Method 1, we directly perform a symmetry operation on the predicted samples, then obtain the original samples and obtain the residual.
[0387] (1) Obtain the transformed predicted samples.
[0388] Obtaining the transformed predicted samples based on the target symmetry relationship and the predicted samples obtained above includes, but is not limited to, the following ways:
[0389] If the target symmetry relation is symmetry-free, The inputs are a chroma position (xCb, yCb) that specifies the position of the top left corner sample of the current block relative to the top left corner chroma sample of the current image, one variable cbWidth that specifies the width of the current block in chroma samples, one variable cbHeight that specifies the height of the current block in chroma samples, one variable cIdx that specifies the color component index of the current block, and an array predSamples of current block predicted samples.
[0390] The output is an array of transformed current block predicted samples, predTrsSamples.
[0391] The derivation process is as follows:
[0392] If x=xCb…xCb+cbWidth-1, y=yCb…yCb+cbHeight-1, xVb=x&(predSamplesWidthC-1) yVb=y&(predSamplesHeightC-1) predTrsSamples[cIdx][x][y]=predSamples[cIdx][xVb][yVb] predSamples are the stored predicted chrominance pixels, predSamplesWidthC is the width of predSamples, and predSamplesHeightC is the height of predSamples.
[0393] If the target symmetry relationship is horizontally symmetric, The inputs are a chroma position (xCb, yCb) that specifies the position of the top left corner sample of the current block relative to the top left corner chroma sample of the current image, one variable cbWidth that specifies the width of the current block in chroma samples, one variable cbHeight that specifies the height of the current block in chroma samples, one variable cIdx that specifies the color component index of the current block, and an array predSamples of current block predicted samples.
[0394] The output is an array of transformed current block predicted samples, predTrsSamples.
[0395] The derivation process is as follows:
[0396] If x=xCb...xCb+cbWidth-1, y=yCb...yCb+cbHeight-1, and xTemp=xCb+cbWidth-1...xCb, xVb=xTemp&(predSamplesWidthC-1) yVb=y&(predSamplesHeightC-1) predTrsSamples[cIdx][x][y]=predSamples[cIdx][xVb][yVb] predSamples are the stored predicted chrominance pixels, predSamplesWidthC is the width of predSamples, and predSamplesHeightC is the height of predSamples.
[0397] If the target symmetry relationship is vertical symmetry, The inputs are a chroma position (xCb, yCb) that specifies the position of the top left corner sample of the current block relative to the top left corner chroma sample of the current image, one variable cbWidth that specifies the width of the current block in chroma samples, one variable cbHeight that specifies the height of the current block in chroma samples, one variable cIdx that specifies the color component index of the current block, and an array predSamples of current block predicted samples.
[0398] The output is an array of transformed current block predicted samples, predTrsSamples.
[0399] The derivation process is as follows:
[0400] If x=xCb…xCb+cbWidth-1, y=yCb…yCb+cbHeight-1, and yTemp=yCb+cbHeight-1…yCb, xVb=x&(predSamplesWidthC-1) yVb=yTemp&(predSamplesHeightC-1) predTrsSamples[cIdx][x][y]=predSamples[cIdx][xVb][yVb] predSamples are the stored predicted chrominance pixels, predSamplesWidthC is the width of predSamples, and predSamplesHeightC is the height of predSamples.
[0401] (2) Obtain the original sample.
[0402] The inputs are a chromaticity position (xCb, yCb) that specifies the position of the top left corner sample of the current block relative to the top left corner chromaticity sample of the current image, one variable cbWidth that specifies the width of the current block in chromaticity samples, one variable cbHeight that specifies the height of the current block in chromaticity samples, and one variable cIdx that specifies the color component index of the current block.
[0403] The output is an array of the current block's original samples, orgSamples.
[0404] The derivation process is as follows:
[0405] If x=xCb…xCb+cbWidth-1, y=yCb…yCb+cbHeight-1, xVb=x&(orgBufWidthC-1) yVb=y&(orgBufHeightC-1) orgSamples[cIdx][x][y]=orgChromaBuf[cIdx][xVb][yVb] orgChromaBuf is the stored original chroma pixel, orgBufWidthC is the width of the chroma pixel in the stored original pixel buffer, i.e., the width of orgChromaBuf, and orgBufHeightC is the height of the chroma pixel in the stored original pixel buffer, i.e., the height of orgChromaBuf.
[0406] (3) Obtain the residual sample.
[0407] Residual samples are derived based on the predicted samples obtained in (1) and the original samples obtained in (2).
[0408] The inputs are a chromaticity position (xCb, yCb) specifying the position of the top-left corner sample of the current block relative to the top-left corner chromaticity sample of the current image, one variable cbWidth specifying the width of the current block in chromaticity samples, one variable cbHeight specifying the height of the current block in chromaticity samples, one variable cIdx specifying the color component index of the current block, the original samples orgSamples obtained in step S7(2), and the predicted samples predTrsSamples obtained in step S7(1).
[0409] The output is an array of current block residual samples, resiSamples.
[0410] The derivation process is as follows:
[0411] If x=xCb…xCb+cbWidth-1, y=yCb…yCb+cbHeight-1, resiSamples[cIdx][x][y]=funcSub(orgSamples[cIdx][x][y],predTrsSamples[cIdx][x][y]) Here, the FuncSub() function may directly subtract two parameters, or may perform further operations such as conversion processing after subtracting two parameters.
[0412] In method 2, Residual samples are derived based on the predicted samples obtained by the above prediction and the original samples.
[0413] Obtain the original sample directly.
[0414] If x=xCb…xCb+cbWidth-1, y=yCb…yCb+cbHeight-1, xVb=x&(orgVerPicBufWidthC-1) yVb=y&(orgVerPicBufHeightC-1) orgSamples[cIdx][xVb][yVb]=orgChromaBuf[cIdx][x][y] If the target symmetry relation is symmetry-free, The inputs are a chromaticity position (xCb, yCb) specifying the position of the top left corner sample of the current block relative to the top left corner chromaticity sample of the current image, one variable cbWidth specifying the width of the current block in chromaticity samples, one variable cbHeight specifying the height of the current block in chromaticity samples, one variable cIdx specifying the color component index of the current block, the original samples orgSamples obtained in step S7, and the predicted samples predSamples obtained in step S6.
[0415] The output is an array of current block residual samples, resiSamples.
[0416] The derivation process is as follows:
[0417] If x=xCb…xCb+cbWidth-1, y=yCb…yCb+cbHeight-1, resiSamples[cIdx][x][y]=funcSub(orgSamples[cIdx][x][y],predSamples[cIdx][x][y]) Here, the FuncSub() function may directly subtract two parameters, or may perform further operations such as conversion processing after subtracting two parameters.
[0418] If the target symmetry relationship is horizontally symmetric, The inputs are a chromaticity position (xCb, yCb) specifying the position of the top left corner sample of the current block relative to the top left corner chromaticity sample of the current image, one variable cbWidth specifying the width of the current block in chromaticity samples, one variable cbHeight specifying the height of the current block in chromaticity samples, one variable cIdx specifying the color component index of the current block, the original samples orgSamples obtained in step S7, and the predicted samples predSamples obtained in step S6.
[0419] The output is an array of current block residual samples, resiSamples.
[0420] The derivation process is as follows:
[0421] If x=xCb...xCb+cbWidth-1, y=yCb...yCb+cbHeight-1, and xTemp=xCb+cbWidth-1...xCb, resiSamples[cIdx][x][y]=funcSub(orgSamples[cIdx][x][y],predSamples[cIdx][xTemp][y]) Here, the FuncSub() function may directly subtract two parameters, or may perform further operations such as conversion processing after subtracting two parameters.
[0422] If the target symmetry relationship is vertical symmetry, The inputs are a chromaticity position (xCb, yCb) specifying the position of the top left corner sample of the current block relative to the top left corner chromaticity sample of the current image, one variable cbWidth specifying the width of the current block in chromaticity samples, one variable cbHeight specifying the height of the current block in chromaticity samples, one variable cIdx specifying the color component index of the current block, the original samples orgSamples obtained in step S7, and the predicted samples predSamples obtained in step S6.
[0423] The output is an array of current block residual samples, resiSamples.
[0424] The derivation process is as follows:
[0425] If x=xCb…xCb+cbWidth-1, y=yCb…yCb+cbHeight-1, and yTemp=yCb+cbHeight-1…yCb, resiSamples[cIdx][x][y]=funcSub(orgSamples[cIdx][x][y],predSamples[cIdx][x][yTemp]) Here, the FuncSub() function may directly subtract two parameters, or may perform further operations such as conversion processing after subtracting two parameters.
[0426] Furthermore, in some embodiments, the encoding method may further include determining a target prediction mode for the current block, and if the target prediction mode indicates that DBV mode is allowed for the second color component of the current block, encoding the target prediction mode for the current block and writing the resulting encoding bits to the bitstream.
[0427] Furthermore, in some embodiments, the encoding method may further include determining a value of a first syntax element identification information, encoding the value of the first syntax element identification information, and writing the resulting encoded bits into the bitstream.
[0428] Further, in some embodiments, the encoding method may include determining a first co-location region corresponding to the current block, and determining that if any position within the first co-location region has BV information, the use of DBV mode is allowed for the second color component of the current block.
[0429] It should be further explained that in an embodiment of the present application, determining the value of the first syntax element identification information may include determining that the value of the first syntax element identification information is a first value when the target prediction mode of the current block is DBV mode, and determining that the value of the first syntax element identification information is a second value when the target prediction mode of the current block is a prediction mode other than DBV mode.
[0430] In the embodiment of the present application, for different syntax element identification information (e.g., first syntax element identification information), the corresponding first value and second value may be the same or different, and this is not specifically limited. Also, in the embodiment of the present application, the first value and the second value may be in a parameter format or a numeric format. Specifically, each syntax element identification information may be a parameter written in a profile or a single flag / identifier value, and this is not specifically limited.
[0431] Exemplarily, the first value may be set to 1 and the second value may be set to 0, or the first value may be set to 0 and the second value may be set to 1, or the first value may be set to true and the second value may be set to false, or the first value may be set to false and the second value may be set to true. Here, in an embodiment of the present application, the first value may be set to 1 and the second value may be set to 0, but this is not specifically limited herein.
[0432] Furthermore, in order to accelerate the processing speed of the decoding side, the encoding side may write the target block vector parameters directly into the bitstream. Therefore, in some embodiments, the encoding method may further include encoding the target block vector parameters of the current block and writing the resulting coded bits into the bitstream.
[0433] Furthermore, in order to accelerate the processing speed on the decoding side, the encoding side can also directly write the target symmetry relation into the bitstream. Thus, in some embodiments, the encoding method may further include encoding the target symmetry relation and writing the resulting coded bits into the bitstream.
[0434] Furthermore, in some embodiments, the encoding method may further include: performing sub-block division on the current block to obtain at least one sub-block; and using the sub-block as the current block, performing the steps of the encoding method shown in FIG. 18 to determine a residual value of a second color component of the sub-block.
[0435] It should be noted that in the present embodiment, even if processing is performed in units of sub-blocks of the current block, processing can be performed according to the symmetry relationship of the present embodiment, provided that all decisions and processing in the steps are performed in units of sub-blocks.
[0436] It should be further noted that in the embodiment of the present application, for a current block for which chrominance prediction is performed in DBV mode, the corresponding residual may be transformed and inversely transformed in a manner including, but not limited to, the following: Only one transform (e.g., only DCT transform without LFNST) or two transforms (primary transform and secondary transform, e.g., DCT transform performed on the encoding side and then LFNST transform), where the decoding side maintains the reverse order of the forward transform method performed on the encoding side.
[0437] An embodiment of the present application provides an encoding method, which includes determining a first color component block of a current block, determining a target block vector parameter of the current block if the prediction mode of the first color component block satisfies a first condition, determining a target symmetry relationship based on the target block vector parameter of the current block, performing a prediction process on a second color component of the current block based on the target block vector parameter, determining a predicted value of the second color component of the current block, and determining a residual value of the second color component of the current block based on the predicted value of the second color component of the current block and the target symmetry relationship. That is, the present application fully considers available information such as reconstructed luma and block vectors and predicts chrominance based on this information to improve the unity of chrominance prediction, and more precisely processes the predicted value taking into account the symmetry relationship to improve the accuracy of chrominance prediction, thereby saving bitrate and improving encoding and decoding performance, thereby effectively improving coding efficiency.
[0438] In another embodiment of the present application, based on the encoding method described in the above embodiment, the embodiment of the present application adds a new prediction mode DBV (i.e., Scheme 1). In the process of Scheme 1, a corresponding luminance block is obtained, and it is determined whether the corresponding luminance block is encoded in a mode having BV information, and then the following processing manner can be adopted:
[0439] If the corresponding luminance block is not coded in a mode with BV information, then the syntax element for that mode is not transmitted in the bitstream.
[0440] If the corresponding luma block is coded in a mode with BV information, the BV of the corresponding luma block is obtained, and the BV is adjusted to apply to chroma, and it is determined whether the adjusted BV is available. If it is available, the symmetrical relationship is directly derived, and chroma prediction and residual sample derivation are performed. If it is not available, the BV is adjusted until it is available, and the symmetrical relationship is derived, and chroma prediction and residual sample derivation are performed, or prediction is performed using the PLANAR mode or other chroma prediction modes. When the BV is not available, different processing processes are as shown in Figures 19 and 20.
[0441] Please refer to Figure 19, which is a detailed flowchart of an encoding method according to an embodiment of the present application. As shown in Figure 19, the detailed process may include the following steps:
[0442] In step S1901, the corresponding luminance block is obtained.
[0443] In step S1902, it is determined whether the prediction mode of the corresponding luminance block is a mode having BV information.
[0444] In step S1903, no DBV mode syntax elements are transmitted in the bitstream.
[0445] In step S1904, the first BV parameter of the corresponding luminance block is obtained.
[0446] In step S1905, the first BV parameter is adjusted to determine the second BV parameter to be applied to the chromaticity.
[0447] In step S1906, it is determined whether the second BV parameter is available.
[0448] In step S1907, if the second BV parameter is unavailable, the second BV parameter is adjusted until the second BV parameter is available.
[0449] In step S1908, if the second BV parameters are available, symmetry relations are derived.
[0450] In step S1909, chromaticity prediction is performed based on the second BV parameters to determine predicted samples.
[0451] In step S1910, residual samples are determined.
[0452] 20, which is a detailed flowchart of another encoding method according to an embodiment of the present application. As shown in FIG. 20, the detailed process may include the following steps:
[0453] In step S2001, the corresponding luminance block is obtained.
[0454] In step S2002, it is determined whether the prediction mode of the corresponding luminance block is a mode having BV information.
[0455] In step S2003, no syntax elements of DBV mode are transmitted in the bitstream.
[0456] In step S2004, the first BV parameter of the corresponding luminance block is obtained.
[0457] In step S2005, the first BV parameter is adjusted to determine the second BV parameter to be applied to the chromaticity.
[0458] In step S2006, it is determined whether the second BV parameter is available.
[0459] In step S2007, if the second BV parameters are not available, a predetermined prediction mode is used to perform chromaticity prediction.
[0460] In step S2008, if the second BV parameters are available, symmetry relations are derived.
[0461] In step S2009, chromaticity prediction is performed based on the second BV parameters to determine predicted samples.
[0462] In step S2010, the residual samples are determined.
[0463] In one specific embodiment, the exemplary encoding method of the present application may specifically include the following steps:
[0464] In step S1, the corresponding luminance block is obtained.
[0465] The acquired block location may be any location, including but not limited to the following locations:
[0466] (1) As shown in FIG. 3, the central block of the luminance region at the same position is obtained.
[0467] (2) As shown in FIG. 7, the block in the upper left corner of the luminance area at the same position is obtained.
[0468] (3) As shown in FIG. 8, the block at the bottom right corner of the luminance region at the same position is obtained.
[0469] (4) Sequentially obtain blocks containing the five luminance pixel positions shown in Figure 9 (including, but not limited to, five positions, and may be multiple different positions) until it is determined that the obtained blocks are coded in a mode with BV information, i.e., until a block with the first luminance pixel position coded in a mode with BV information is found. The sequential obtaining order may include, but is not limited to, C -> TL -> TR -> BL -> BR.
[0470] In step S2, it is determined whether the corresponding luminance block is coded in a mode that has BV information.
[0471] Obtain a block at a corresponding position, and determine whether the corresponding luminance block is coded in a mode with BV information, where the mode with BV information includes but is not limited to IBC mode or IntraTMP mode. If the corresponding luminance block is coded in a mode with BV information, obtain the BV of the corresponding luminance block; otherwise, do not transmit the syntax element of the mode in the bitstream.
[0472] In step S3, the BV is adjusted to accommodate the chromaticity.
[0473] After obtaining the BV of the corresponding luma block, adjust the BV to apply to the chromaticity, luma BV = (BVL hor ,BVL ver ), chromaticity BV=(BVC hor ,BVC ver ) Adjustment methods include, but are not limited to, the following, scaling based on the chromaticity sampling format shown in Table 9.
[0474] In step S4, it is determined whether the BV is available.
[0475] Get the current chromaticity block position (xCb, yCb) and set the chromaticity BVC = (BVC hor ,BVC ver ) and obtain the corresponding offset position (xCb+BVChor ,yCb+BVC ver ) and determine the following conditions. If all of them are met, the chromaticity BV is available, that is, the conditions are: Whether the obtained offset position exceeds the Picture boundary or not As shown in FIG. 10, whether the obtained offset position does not cover the current block or not, As shown in FIG. 11, whether the obtained offset position is within the available area or not, If all the conditions are met, such as whether the obtained offset position has been reconstructed or not, it is determined that the chromaticity BV is usable.
[0476] If BV is available, proceed to step S5 to derive the symmetry relationship. If BV is not available, adjust it until it is available, then proceed to step S5 to derive the symmetry relationship. Adjustment methods include, but are not limited to, clipping, scaling, etc. If BV is not available, modes including, but not limited to, planar mode, CCLM mode, or other angle prediction modes can be adopted to obtain reference pixels and mode parameters to perform chromaticity mode prediction.
[0477] In step S5, the symmetry relations are derived.
[0478] In short, from the viewpoint of data manipulation, the data may be directly used without flipping, or may be flipped. Here, flipping can be divided into two types: horizontal flipping and vertical flipping. In the process of deriving the intra prediction mode for chrominance, if an intra prediction mode based on BV parameters is used for the corresponding luma block, the decoding side may further determine whether luma information has been flipped. There are two embodiments of flipping:
[0479] Embodiment 1: If the original block is flipped in the encoding process, then in the decoding process, the reconstructed block of the current block is flipped to get the final reconstructed block.
[0480] Embodiment 2: If the reference block is flipped in the encoding process, then in the decoding process, the reference block is flipped to obtain the next reconstructed block.
[0481] In the second embodiment, in the BV search process on the decoding side and the template matching process of the BV parameters, the reference block needs to be flipped once for each detection target point, which introduces additional complexity. In practical applications, the following symmetric operations can be considered:
[0482] Symmetric operation 1: Use one independent buffer to store the data after symmetric processing, i.e., aRef[x]=aOrg[N-1-x], where N is the number of data.
[0483] Symmetry operation 2: Based on the symmetry operation being used, an operation is performed on the position coordinates when reading the data.
[0484] In the first embodiment, residual[x]=input[N-1-x]-ref[x] on the encoding side, and recon[N-1-x]=residual[x]+ref[x] on the decoding side.
[0485] In the case of embodiment 2, on the encoding side, residual[x]=input[x]-ref[N-1-x], and on the decoding side, recon[x]=residual[x]+ref[N-1-x], where recon is the reconstructed block.
[0486] Here, the derivation of the symmetry relationship can be referred to the contents of the above embodiment, and is not limited here in any way.
[0487] In step S6, chromaticity prediction is performed based on BV.
[0488] This includes, but is not limited to, the following methods:
[0489] In method 1, As shown in Figure 17, the position (xCb, yCb) of the current chromaticity block is obtained, and the chromaticity BV=(BVC hor ,BVC ver ) and obtain the corresponding offset position (xCb+BVC hor ,yCb+BVC ver ) and perform a block copy.
[0490] The variable cbWidth specifies the width of the currently coded block in chroma samples, the variable cbHeight specifies the height of the currently coded block in chroma samples, and the variable cIdx specifies the color component index of the current block.
[0491] If x=xCb…xCb+cbWidth-1, y=yCb…yCb+cbHeight-1, xVb=(x+BVC hor )&(BufWidthC-1) yVb=(y+BVC ver )&(CtbSizeC-1) predSamples[cIdx][x][y]=function(VirChromaBuf[cIdx][xVb][yVb]) BufWidthC is the width of the chroma pixel in the stored reconstruction buffer, CtbSizeC is the size of the chroma pixel in the CTU, and VirChromaBuf is the stored reconstruction chroma pixel. function() is a processing function for pixel values, which may be a direct copy, a shift operation to ensure calculation accuracy, a filtering operation, etc.
[0492] In method 2, Get the current chromaticity block position (xCb, yCb) and set the chromaticity BV = (BVC hor ,BVC ver ) and obtain the corresponding offset position (xCb+BVChor ,yCb+BVC ver ), perform a block copy, and then perform a correction on the copy to obtain the final prediction, including but not limited to weighting it with the prediction obtained in CCLM-type mode or other modes.
[0493] In step S7, residual samples are derived.
[0494] (1) Obtain the original sample.
[0495] Obtaining the original samples based on the symmetrical relationship derived in step S5 includes, but is not limited to, the following ways:
[0496] In Method 1, original samples are manipulated at the block level based on symmetry relationships. Here, three symmetry relationships are taken as examples.
[0497] If the symmetrical relationship derived in step S5 is asymmetrical, copying is performed as is.
[0498] The inputs are a chromaticity position (xCb, yCb) that specifies the position of the top left corner sample of the current coding block relative to the top left corner chromaticity sample of the current image, one variable cbWidth that specifies the width of the current coding block in chromaticity samples, one variable cbHeight that specifies the height of the current coding block in chromaticity samples, and one variable cIdx that specifies the color component index of the current block.
[0499] The output is an array of original samples of the current coding block, orgSamples.
[0500] The derivation process is as follows:
[0501] If x=xCb…xCb+cbWidth-1, y=yCb…yCb+cbHeight-1, xVb=x&(orgBufWidthC-1) yVb=y&(orgBufHeightC-1) orgSamples[cIdx][x][y]=orgChromaBuf[cIdx][xVb][yVb] orgChromaBuf is the stored original chroma pixel, orgBufWidthC is the width of the chroma pixel in the stored original pixel buffer, i.e., the width of orgChromaBuf, and orgBufHeightC is the height of the chroma pixel in the stored original pixel buffer, i.e., the height of orgChromaBuf.
[0502] If the symmetry relationship derived in step S5 is horizontally symmetric, The inputs are a chromaticity position (xCb, yCb) that specifies the position of the top left corner sample of the current coding block relative to the top left corner chromaticity sample of the current image, one variable cbWidth that specifies the width of the current coding block in chromaticity samples, one variable cbHeight that specifies the height of the current coding block in chromaticity samples, and one variable cIdx that specifies the color component index of the current block.
[0503] The output is an array of original samples of the current coding block, orgSamples.
[0504] The derivation process is as follows:
[0505] If x=xCb...xCb+cbWidth-1, y=yCb...yCb+cbHeight-1, and xTemp=xCb+cbWidth-1...xCb, xVb=xTemp&(orgBufWidthC-1) yVb=y&(orgBufHeightC-1) orgSamples[cIdx][x][y]=orgChromaBuf[cIdx][xVb][yVb] orgChromaBuf is the stored original chroma pixel, orgBufWidthC is the width of the chroma pixel in the stored original pixel buffer, i.e., the width of orgChromaBuf, and orgBufHeightC is the height of the chroma pixel in the stored original pixel buffer, i.e., the height of orgChromaBuf.
[0506] If the symmetry relationship derived in step S5 is vertical symmetry, The inputs are a chromaticity position (xCb, yCb) that specifies the position of the top left corner sample of the current coding block relative to the top left corner chromaticity sample of the current image, one variable cbWidth that specifies the width of the current coding block in chromaticity samples, one variable cbHeight that specifies the height of the current coding block in chromaticity samples, and one variable cIdx that specifies the color component index of the current block.
[0507] The output is an array of original samples of the current coding block, orgSamples.
[0508] The derivation process is as follows:
[0509] If x=xCb…xCb+cbWidth-1, y=yCb…yCb+cbHeight-1, and yTemp=yCb+cbHeight-1…yCb, xVb=x&(orgBufWidthC-1) yVb=yTemp&(orgBufHeightC-1) orgSamples[cIdx][x][y]=orgChromaBuf[cIdx][xVb][yVb] orgChromaBuf is the stored original chroma pixel, orgBufWidthC is the width of the chroma pixel in the stored original pixel buffer, i.e., the width of orgChromaBuf, and orgBufHeightC is the height of the chroma pixel in the stored original pixel buffer, i.e., the height of orgChromaBuf.
[0510] In method 2, In the first step, all symmetry-related transformations are performed on the original samples at the image level based on predefined symmetry relations, including but not limited to no symmetry, horizontal symmetry, vertical symmetry, etc. Here, three types of symmetry relations are taken as examples.
[0511] First, no symmetric transformation is performed on the original sample array.
[0512] The inputs are one variable picWidth that specifies the width of the current image in chroma samples, one variable picHeight that specifies the height of the current image in chroma samples, and one variable cIdx that specifies the color component index of the current block.
[0513] The output is an array of the original samples without symmetry transformation, orgPicSamples.
[0514] For x=0...picWidth-1, y=0...picHeight-1, xVb=x&(orgBufWidthC-1) yVb=y&(orgBufHeightC-1) orgPicSamples[cIdx][x][y]=orgChromaBuf[cIdx][xVb][yVb] orgChromaBuf is the stored original chroma pixel, orgBufWidthC is the width of the chroma pixel in the stored original pixel buffer, i.e., the width of orgChromaBuf, and orgBufHeightC is the height of the chroma pixel in the stored original pixel buffer, i.e., the height of orgChromaBuf.
[0515] Note that this group of operations is a simple copy operation and can be omitted. If omitted, orgPicSamples (described below) corresponds to orgChromaBuf.
[0516] The second type is to perform horizontal symmetry on the original sample array.
[0517] The inputs are one variable picWidth that specifies the width of the current image in chroma samples, one variable picHeight that specifies the height of the current image in chroma samples, and one variable cIdx that specifies the color component index of the current block.
[0518] The output is an array of horizontally symmetric original samples, orgHorPicSamples.
[0519] For x=0...picWidth-1, y=0...picHeight-1, and xTemp=picWidth-1...0, xVb=xTemp&(orgBufWidthC-1) yVb=y&(orgBufHeightC-1) orgHorPicSamples[cIdx][x][y]=orgChromaBuf[cIdx][xVb][yVb] orgChromaBuf is the stored original chroma pixel, orgBufWidthC is the width of the chroma pixel in the stored original pixel buffer, i.e., the width of orgChromaBuf, and orgBufHeightC is the height of the chroma pixel in the stored original pixel buffer, i.e., the height of orgChromaBuf.
[0520] The third type is to perform vertical symmetry with respect to the original sample array.
[0521] The inputs are one variable picWidth that specifies the width of the current image in chroma samples, one variable picHeight that specifies the height of the current image in chroma samples, and one variable cIdx that specifies the color component index of the current block.
[0522] The output is an array of original samples, orgVerPicSamples.
[0523] If x=0...picWidth-1, y=0...picHeight-1, and yTemp=picHeight-1...0, xVb=x&(orgBufWidthC-1) yVb=yTemp&(orgBufHeightC-1) orgVerPicSamples[cIdx][x][y]=orgChromaBuf[cIdx][xVb][yVb] orgChromaBuf is the stored original chroma pixel, orgBufWidthC is the width of the chroma pixel in the stored original pixel buffer, i.e., the width of orgChromaBuf, and orgBufHeightC is the height of the chroma pixel in the stored original pixel buffer, i.e., the height of orgChromaBuf.
[0524] In the second step, the original sample sequence of the current coding block is obtained based on the symmetry relationship derived in step S5.
[0525] If the symmetry relation derived in step S5 is symmetry-free, The inputs are a chromaticity position (xCb, yCb) that specifies the position of the top left corner sample of the current coding block relative to the top left corner chromaticity sample of the current image, one variable cbWidth that specifies the width of the current coding block in chromaticity samples, one variable cbHeight that specifies the height of the current coding block in chromaticity samples, and one variable cIdx that specifies the color component index of the current block.
[0526] The output is an array of original samples of the current coding block, orgSamples.
[0527] The derivation process is as follows:
[0528] If x=xCb…xCb+cbWidth-1, y=yCb…yCb+cbHeight-1, xVb=x&(orgPicBufWidthC-1) yVb=y&(orgPicBufHeightC-1) orgSamples[cIdx][x][y]=orgPicSamples[cIdx][xVb][yVb] What is stored in orgPicSamples are the chroma pixels that are not subjected to symmetric transformation in the first step of transformation, orgPicBufWidthC is the width of the chroma pixels in the stored transformed pixel buffer, i.e., the width of orgPicSamples, and orgPicBufHeightC is the height of the chroma pixels in the stored transformed pixel buffer, i.e., the height of orgPicSamples.
[0529] If the symmetry relationship derived in step S5 is horizontally symmetric, The inputs are a chromaticity position (xCb, yCb) specifying the position of the top left corner sample of the current coding block relative to the top left corner chromaticity sample of the current image, one variable cbWidth specifying the width of the current coding block in chromaticity samples, one variable cbHeight specifying the height of the current coding block in chromaticity samples, one variable picWidth specifying the width of the current image in chromaticity samples, one variable picHeight specifying the height of the current image in chromaticity samples, and one variable cIdx specifying the color component index of the current block.
[0530] The output is an array of original samples of the current coding block, orgSamples.
[0531] The derivation process is as follows:
[0532] If x=xCb…xCb+cbWidth-1, y=yCb…yCb+cbHeight-1, and xTemp=picWidth-xCb-cbWidth…picWidth-xCb-1, xVb=xTemp&(orgHorPicBufWidthC-1) yVb=y&(orgHorPicBufHeightC-1) orgSamples[cIdx][x][y]=orgHorPicSamples[cIdx][xVb][yVb] What is stored in orgHorPicSamples are the chrominance pixels after the first step of horizontal symmetric transformation, orgHorPicBufWidthC is the width of the chrominance pixels in the stored transformed pixel buffer, i.e., the width of orgHorPicSamples, and orgHorPicBufHeightC is the height of the chrominance pixels in the stored transformed pixel buffer, i.e., the height of orgHorPicSamples.
[0533] If the symmetry relationship derived in step S5 is vertical symmetry, The inputs are a chromaticity position (xCb, yCb) specifying the position of the top left corner sample of the current coding block relative to the top left corner chromaticity sample of the current image, one variable cbWidth specifying the width of the current coding block in chromaticity samples, one variable cbHeight specifying the height of the current coding block in chromaticity samples, one variable picWidth specifying the width of the current image in chromaticity samples, one variable picHeight specifying the height of the current image in chromaticity samples, and one variable cIdx specifying the color component index of the current block.
[0534] The output is an array of original samples of the current coding block, orgSamples.
[0535] The derivation process is as follows:
[0536] If x=xCb…xCb+cbWidth-1, y=yCb…yCb+cbHeight-1, and yTemp=picHeight-yCb-cbHeight…picHeight-yCb-1, xVb=x&(orgVerPicBufWidthC-1) yVb=yTemp&(orgVerPicBufHeightC-1) orgSamples[cIdx][x][y]=orgVerPicSamples[cIdx][xVb][yVb] What is stored in orgVerPicSamples is the chrominance pixels after the first step of vertical symmetric transformation, orgVerPicBufWidthC is the width of the chrominance pixels in the stored transformed pixel buffer, i.e., the width of orgVerPicSamples, and orgVerPicBufHeightC is the height of the chrominance pixels in the stored transformed pixel buffer, i.e., the height of orgVerPicSamples.
[0537] (2) Obtain the residual sample.
[0538] Residual samples are derived from the predicted samples derived in step S6 and the original samples obtained in step S7(1).
[0539] The inputs are a chromaticity position (xCb, yCb) specifying the position of the top left corner sample of the current coding block relative to the top left corner chromaticity sample of the current image, one variable cbWidth specifying the width of the current coding block in chromaticity samples, one variable cbHeight specifying the height of the current coding block in chromaticity samples, one variable cIdx specifying the color component index of the current block, the original samples orgSamples obtained in step S7, and the predicted samples predSamples obtained in step S6.
[0540] The output is an array of currently coded block residual samples, resiSamples.
[0541] The derivation process is as follows:
[0542] If x=xCb…xCb+cbWidth-1, y=yCb…yCb+cbHeight-1, resiSamples[cIdx][x][y]=FuncSub(orgSamples[cIdx][x][y],predSamples[cIdx][x][y]) Here, the FuncSub() function may directly subtract two parameters, or may perform further operations such as conversion processing after subtracting two parameters.
[0543] In step S8, if there are other situations, the corresponding processing is carried out.
[0544] If the mode is PLANAR mode, CCLM type mode, or other angle mode, the reference pixels and mode parameters are obtained to perform chromaticity mode prediction.
[0545] In another embodiment, an improvement to the DM mode change (i.e., Scheme 2) is provided. In dual-tree partitioning, in DM mode, if the corresponding luma domain has BV information, the current chroma block is predicted in DBV mode. For example, If CuPredMode[0][xCb+cbWidth / 2][yCb+cbHeight / 2] is equal to MODE_IBC and intra_dbv_flag=1, the chrominance intra prediction mode IntraPredModeC[xCb][yCb] uses DBV.
[0546] If CuPredMode[0][xCb+cbWidth / 2][yCb+cbHeight / 2] is equal to MODE_INTRA, IntraTmpFlag[xCb+cbWidth / 2][yCb+cbHeight / 2] is equal to 1, and intra_dbv_flag=1 is set, then the chrominance intra prediction mode IntraPredModeC[xCb][yCb] uses DBV.
[0547] For details on how the chrominance prediction mode is derived, see Table 12. In DM mode, if intra_ibc_flag==1, that is, if the information acquired by the central block of the luminance region at the same position includes BV, the chrominance intra prediction mode IntraPredModeC[xCb][yCb] uses DBV.
[0548] Here, the improved DBV mode process in the above embodiment is adopted to perform prediction and residual acquisition, and the steps are the same as steps S1, S2, S3, S4, S5, S6, and S7 in the above embodiment. In step S1, the block at the center position of the luminance region at the same position is acquired. In step S2, the BV of the corresponding luminance block is directly acquired. In step S8, if the chrominance BV is unavailable, the corresponding luminance prediction mode is acquired.
[0549] Based on the decoding method described in the above embodiment, the embodiment of the present application adds a new prediction mode (DBV mode). In this process, obtain the corresponding luminance block, determine whether the corresponding luminance block is coded in a mode with BV information, and then adopt the following processing scheme:
[0550] If the corresponding luminance block is not coded in a mode with BV information, then the syntax element for that mode is not parsed.
[0551] If the corresponding luma block is coded in a mode with BV information, the BV of the corresponding luma block is obtained and adjusted to apply to chroma, and then it is determined whether the adjusted BV is available. If it is available, the symmetrical relationship is directly derived, and chroma prediction, residual sample derivation, and reconstructed sample derivation are performed. If it is not available, the BV is adjusted until it is available, and then the symmetrical relationship is derived, and chroma prediction, residual sample derivation, and reconstructed sample derivation are performed, or prediction is performed using the planar mode or other chroma prediction modes. When the BV is not available, different processing processes are as shown in Figures 21 and 22.
[0552] Referring to Figure 21, Figure 21 is a detailed flowchart of a decoding method according to an embodiment of the present application. As shown in Figure 21, the detailed process may include the following steps:
[0553] In step S2101, the corresponding luminance block is obtained.
[0554] In step S2102, it is determined whether the prediction mode of the corresponding luminance block is a mode having BV information.
[0555] In step S2103, the syntax elements of the DBV information are not analyzed.
[0556] In step S2104, the first BV parameter of the corresponding luminance block is obtained.
[0557] In step S2105, the first BV parameter is adjusted to determine the second BV parameter to be applied to the chromaticity.
[0558] In step S2106, it is determined whether the second BV parameter is available.
[0559] In step S2107, if the second BV parameter is unavailable, the second BV parameter is adjusted until the second BV parameter is available.
[0560] In step S2108, if the second BV parameters are available, derive the symmetry relations.
[0561] In step S2109, chromaticity prediction is performed based on the second BV parameters to determine predicted samples.
[0562] In step S2110, the residual samples are determined.
[0563] In step S2111, a reconstructed sample is determined based on the predicted sample and the residual sample.
[0564] 22, which is a detailed flowchart of another decoding method according to an embodiment of the present application. As shown in FIG. 22, the detailed process may include the following steps:
[0565] In step S2201, the corresponding luminance block is obtained.
[0566] In step S2202, it is determined whether the prediction mode of the corresponding luminance block is a mode having BV information.
[0567] In step S2203, the syntax elements of the DBV information are not analyzed.
[0568] In step S2204, the first BV parameter of the corresponding luminance block is obtained.
[0569] In step S2205, the first BV parameter is adjusted to determine the second BV parameter to be applied to the chromaticity.
[0570] In step S2206, it is determined whether the second BV parameter is available.
[0571] In step S2207, if the second BV parameters are not available, a predetermined prediction mode is used to perform chromaticity prediction.
[0572] In step S2208, if the second BV parameters are available, symmetry relations are derived.
[0573] In step S2209, chromaticity prediction is performed based on the second BV parameters to determine predicted samples.
[0574] In step S2210, the residual samples are determined.
[0575] In step S2211, a reconstructed sample is determined based on the predicted sample and the residual sample.
[0576] In the embodiment of the present application, step S1 obtains the corresponding luma block, step S2 determines whether it is an available mode, step S3 adjusts BV to apply to chroma, step S4 determines whether BV is available, step S5 derives the symmetrical relationship, and step S6 performs chroma prediction based on BV. The processes on the decoding side and the encoding side are the same, and will not be described in detail here.
[0577] In step S7, residual samples are derived.
[0578] The bitstream is analyzed to obtain residual coefficient samples, and these residual coefficient samples are subjected to inverse quantization, inverse transform, etc. to obtain actual residual samples.
[0579] In step S8, the predicted samples and the residual samples are used to derive reconstructed samples.
[0580] Using the predicted sample obtained in step S6 and the residual sample obtained in step S7, the two are added together to obtain a reconstructed sample, and the reconstructed sample is processed according to the symmetric relationship derived in step S5 to obtain an actual reconstructed sample. Specific processing methods include, but are not limited to, the following:
[0581] In Scheme 1, the residual data in the bitstream is after the symmetry operation, and the symmetry operation needs to be performed on the reconstructed pixels in the reconstruction process.
[0582] If the symmetry relation derived in step S5 is symmetry-free, The inputs are a chromaticity position (xCb, yCb) specifying the position of the top left corner sample of the currently coded block relative to the top left corner chromaticity sample of the current image, one variable cbWidth specifying the width of the currently coded block in chromaticity samples, one variable cbHeight specifying the height of the currently coded block in chromaticity samples, one variable cIdx specifying the color component index of the current block, one array predSamples specifying the currently coded block predicted samples, and one array resiSamples specifying the currently coded block predicted residual samples.
[0583] The output is the currently coded block reconstructed sample array recChromaBuf.
[0584] The derivation process is as follows:
[0585] If x=xCb…xCb+cbWidth-1, y=yCb…yCb+cbHeight-1, xVb=x&(recBufWidthC-1) yVb=y&(recBufHeightC-1) recChromaBuf[cIdx][xVb][yVb]=funcAdd(predSamples[cIdx][x][y],resiSamples[x][y]) recChromaBuf is the stored reconstructed chroma pixel, recBufWidthC is the width of the chroma pixel in the stored reconstructed pixel buffer, i.e., the width of recChromaBuf, and recBufHeightC is the height of the chroma pixel in the stored reconstructed pixel buffer, i.e., the height of recChromaBuf. To handle special situations such as luma mapping with chroma scaling (LMCS), the funcAdd() function can perform direct addition, process the data within it before adding, or perform further processing after the addition is complete.
[0586] If the symmetry relationship derived in step S5 is horizontally symmetric, The inputs are a chromaticity position (xCb, yCb) that specifies the position of the top left corner sample of the currently coded block relative to the top left corner chromaticity sample of the current image, one variable cbWidth that specifies the width of the currently coded block in chromaticity samples, one variable cbHeight that specifies the height of the currently coded block in chromaticity samples, one variable cIdx that specifies the color component index of the current block, one array predSamples that specifies the reconstructed prediction samples of the currently coded block, and one array resiSamples that specifies the prediction residual samples of the currently coded block.
[0587] The output is the currently coded block reconstructed sample array recChromaBuf.
[0588] The derivation process is as follows:
[0589] If x=xCb...xCb+cbWidth-1, y=yCb...yCb+cbHeight-1, and xTemp=xCb+cbWidth-1...xCb, xVb=xTemp&(recBufWidthC-1) yVb=y&(recBufHeightC-1) recChromaBuf[cIdx][xVb][yVb]=funcAdd(predSamples[cIdx][x][y],resiSamples[x][y]) recChromaBuf is the stored reconstructed chroma pixel, recBufWidthC is the width of the chroma pixel in the stored reconstructed pixel buffer, i.e., the width of recChromaBuf, and recBufHeightC is the height of the chroma pixel in the stored reconstructed pixel buffer, i.e., the height of recChromaBuf. The funcAdd() function can perform direct addition, or it can process the data within it before adding, or it can perform further processing after the addition is complete.
[0590] If the symmetry relationship derived in step S5 is vertical symmetry, The inputs are a chromaticity position (xCb, yCb) that specifies the position of the top left corner sample of the currently coded block relative to the top left corner chromaticity sample of the current image, one variable cbWidth that specifies the width of the currently coded block in chromaticity samples, one variable cbHeight that specifies the height of the currently coded block in chromaticity samples, one variable cIdx that specifies the color component index of the current block, one array predSamples that specifies the reconstructed prediction samples of the currently coded block, and one array resiSamples that specifies the prediction residual samples of the currently coded block.
[0591] The output is the currently coded block reconstructed sample array recChromaBuf.
[0592] The derivation process is as follows:
[0593] If x=xCb…xCb+cbWidth-1, y=yCb…yCb+cbHeight-1, and yTemp=yCb+cbHeight-1…yCb, xVb=x&(recBufWidthC-1) yVb=yTemp&(recBufHeightC-1) recChromaBuf[cIdx][xVb][yVb]=funcAdd(predSamples[cIdx][x][y],resiSamples[x][y]) recChromaBuf is the stored reconstructed chroma pixel, recBufWidthC is the width of the chroma pixel in the stored reconstructed pixel buffer, i.e., the width of recChromaBuf, and recBufHeightC is the height of the chroma pixel in the stored reconstructed pixel buffer, i.e., the height of recChromaBuf. The funcAdd() function can perform direct addition, or it can process the data within it before adding, or it can perform further processing after the addition is complete.
[0594] In Method 2, the reconstruction process requires a symmetry operation on the reconstructed values, which can be divided into two steps.
[0595] A two-step transformation is required: store the symmetric reconstructed samples of the current block in one temporary buffer, and then write this temporary buffer to the reconstructed buffer.
[0596] In the first step, a temporary buffer is stored.
[0597] If the symmetry relation derived in step S5 is symmetry-free, The inputs are a chromaticity position (xCb, yCb) that specifies the position of the top left corner sample of the currently coded block relative to the top left corner chromaticity sample of the current image, one variable cbWidth that specifies the width of the currently coded block in chromaticity samples, one variable cbHeight that specifies the height of the currently coded block in chromaticity samples, one variable cIdx that specifies the color component index of the current block, one array predSamples that specifies the reconstructed prediction samples of the currently coded block, and one array resiSamples that specifies the prediction residual samples of the currently coded block.
[0598] The output is a temporary buffer tempBuf of reconstructed chrominance pixels.
[0599] The derivation process is as follows:
[0600] If x=xCb…xCb+cbWidth-1, y=yCb…yCb+cbHeight-1, xVb=x&(tempBufWidthC-1) yVb=y&(tempBufHeightC-1) tempBuf[cIdx][xVb][yVb]=funcAdd(predSamples[cIdx][x][y],resiSamples[x][y]) tempBuf is a temporary buffer established to store the reconstructed chrominance pixels of the current coding block, tempBufWidthC is the width of tempBuf, and tempBufHeightC is the height of tempBuf. The funcAdd() function can be a direct addition, or it can process the data in it before adding, or it can perform further processing after the addition is complete.
[0601] If the symmetry relationship derived in step S5 is horizontally symmetric, The inputs are a chromaticity position (xCb, yCb) that specifies the position of the top left corner sample of the currently coded block relative to the top left corner chromaticity sample of the current image, one variable cbWidth that specifies the width of the currently coded block in chromaticity samples, one variable cbHeight that specifies the height of the currently coded block in chromaticity samples, one variable cIdx that specifies the color component index of the current block, one array predSamples that specifies the reconstructed prediction samples of the currently coded block, and one array resiSamples that specifies the prediction residual samples of the currently coded block.
[0602] The output is a temporary buffer tempBuf of reconstructed chrominance pixels.
[0603] The derivation process is as follows:
[0604] If x=xCb...xCb+cbWidth-1, y=yCb...yCb+cbHeight-1, and xTemp=xCb+cbWidth-1...xCb, xVb=xTemp&(tempBufWidthC-1) yVb=y&(tempBufHeightC-1) tempBuf[cIdx][xVb][yVb]=funcAdd(predSamples[cIdx][x][y],resiSamples[x][y]) tempBuf is a temporary buffer established to store the reconstructed chrominance pixels of the current coding block, tempBufWidthC is the width of tempBuf, and tempBufHeightC is the height of tempBuf. The funcAdd() function can be a direct addition, or it can process the data in it before adding, or it can perform further processing after the addition is complete.
[0605] If the symmetry relationship derived in step S5 is vertical symmetry, The inputs are a chromaticity position (xCb, yCb) that specifies the position of the top left corner sample of the currently coded block relative to the top left corner chromaticity sample of the current image, one variable cbWidth that specifies the width of the currently coded block in chromaticity samples, one variable cbHeight that specifies the height of the currently coded block in chromaticity samples, one variable cIdx that specifies the color component index of the current block, one array predSamples that specifies the reconstructed prediction samples of the currently coded block, and one array resiSamples that specifies the prediction residual samples of the currently coded block.
[0606] The output is a temporary buffer tempBuf of reconstructed chrominance pixels.
[0607] The derivation process is as follows:
[0608] If x=xCb…xCb+cbWidth-1, y=yCb…yCb+cbHeight-1, and yTemp=yCb+cbHeight-1…yCb, xVb=x&(tempBufWidthC-1) yVb=yTemp&(tempBufHeightC-1) tempBuf[cIdx][xVb][yVb]=func(predSamples[cIdx][x][y],resiSamples[x][y]) tempBuf is a temporary buffer established to store the reconstructed chrominance pixels of the current coding block, tempBufWidthC is the width of tempBuf, and tempBufHeightC is the height of tempBuf. The funcAdd() function can be a direct addition, or it can process the data in it before adding, or it can perform further processing after the addition is complete.
[0609] In the second step, the reconstruction buffer is written.
[0610] The inputs are one variable picWidth that specifies the width of the current image in chroma samples, one variable picHeight that specifies the height of the current image in chroma samples, one variable cIdx that specifies the color component index of the current block, and a temporary buffer tempBuf for reconstructed chroma pixels.
[0611] The output is the reconstructed sample array recPicChromaBuf.
[0612] For x=0...picWidth-1, y=0...picHeight-1, xVb=x&(recBufWidthC-1) yVb=y&(recBufHeightC-1) recPicChromaBuf[cIdx][xVb][yVb]=tempBuf[cIdx][x][y] recPicChromaBuf is the stored reconstructed chroma pixels, recBufWidthC is the width of the chroma pixels in the stored reconstructed pixel buffer, i.e., the width of recPicChromaBuf, and recBufHeightC is the height of the chroma pixels in the stored reconstructed pixel buffer, i.e., the height of recPicChromaBuf.
[0613] In step S9, if there are other situations, the corresponding processing is carried out.
[0614] If the mode is PLANAR mode, CCLM type mode, or other angle mode, the reference pixels and mode parameters are obtained to perform chromaticity mode prediction.
[0615] In another embodiment, for a bitstream, the role of the encoding side is to generate the bitstream, and the role of the decoding side is to analyze the bitstream. Plan 1: In method 1, it is encoded inside MODE_INTRA.
[0616] For the sake of explanation, only one bitstream parsing position is illustrated here.
[0617] The syntax element is added before intra_chroma_pred_mode, and the specific syntax element description is as shown in Table 13.
[0618] [Table 13] If sps_ibc_enabled_flag is equal to 0 and sps_intratmp_enabled_flag is equal to 0, then DbvEnabled is equal to 0. Otherwise, set the variable ModeIncludeBv, and if the corresponding luma block is not coded in a mode with BV information, ModeIncludeBv is equal to 0, otherwise ModeIncludeBv is equal to 1.
[0619] If the following conditions are all true: ModeIncludeBv is equal to 1, sh_slice_type equals I, CtbLog2SizeC is less than or equal to MaxChromaIbcSize (MaxChromaIbcSize can be determined based on the size of the chromaticity CTU or a predetermined value); If all of the following conditions are true (including but not limited to the above conditions), then DbvEnabled is equal to 1.
[0620] Otherwise, DbvEnabled is equal to 0.
[0621] If DbvEnabled is equal to 0, dbv_flag is inferred to be FALSE.
[0622] If dbv_flag is TRUE, it indicates that the current chromaticity prediction mode is DBV. The binarization method may include, but is not limited to, encoding using a context model or a bypass model. Examples are as shown in Table 14, Table 15, and Table 16. Here, FL represents a fixed length.
[0623] [Table 14]
[0624] [Table 15]
[0625] [Table 16]
[0626] In method 2, it is coded as MODE_IBC. The specific syntax elements are described in Table 17.
[0627] [Table 17]
[0628] If sps_ibc_enabled_flag is equal to 0 and sps_intratmp_enabled_flag is equal to 0, then DbvEnabled is equal to 0. Otherwise, set the variable ModeIncludeBv, and if the corresponding luma block is not coded in a mode with BV information, ModeIncludeBv is equal to 0, otherwise ModeIncludeBv is equal to 1.
[0629] If the following conditions are all true: ModeIncludeBv is equal to 1, sh_slice_type equals I, CtbLog2SizeC is less than or equal to MaxChromaIbcSize (MaxChromaIbcSize can be determined based on the size of the chromaticity CTU or a predetermined value); If all of the following conditions are true (including but not limited to the above conditions), then DbvEnabled is equal to 1.
[0630] Otherwise, DbvEnabled is equal to 0.
[0631] If treeType==DUAL_TREE_CHROMA and DbvEnabled is equal to 0, pred_mode_ibc_flag is inferred to be FALSE.
[0632] If treeType==DUAL_TREE_CHROMA and pred_mode_ibc_flag is TRUE, it indicates that the current chromaticity prediction mode is DBV, as shown in Table 18 and Table 19 for example.
[0633] [Table 18]
[0634] [Table 19]
[0635] In Scheme 2, the DM mode is changed, and the specific syntax elements are described as shown in Table 20. In addition, the binarization method may include, but is not limited to, encoding using a context model or a bypass model, as shown in Tables 21 and 22 for example.
[0636] [Table 20]
[0637] [Table 21]
[0638] [Table 22]
[0639] The 0th bin of intra_chroma_pred_mode represents DM mode, and the encoding method is the same as VVC.
[0640] The derivation process of DbvEnabled is as follows:
[0641] If condition 1 holds, that is, sps_ibc_enabled_flag is equal to 0 and sps_intratmp_enabled_flag is equal to 0, then DbvEnabled is equal to 0.
[0642] If the above condition 1 is not met, then the following condition 2 is met: sh_slice_type equals I, CtbLog2SizeC is less than or equal to MaxChromaIbcSize (MaxChromaIbcSize can be determined based on the size of the chromaticity CTU or a predetermined value); If all of the following conditions are true (including but not limited to the above conditions), then DbvEnabled is equal to 1.
[0643] If DbvEnabled is equal to 1, If intra_chroma_pred_mode is equal to 0, 1, 2 or 3, these four chrominance prediction modes are maintained; if intra_chroma_pred_mode is equal to 4, Scheme 2 is implemented.
[0644] Otherwise, the chromaticity prediction process in the H.266 standard is unchanged.
[0645] Furthermore, in some embodiments, the residual data in the bitstream does not need to be flipped, but rather a symmetric flipping operation is performed on the reference pixels in the reconstruction process, specifically, a complementary scheme for deriving the residual samples in step S7 on the encoding side and the reconstruction samples in step S8 on the decoding side.
[0646] In one implementation, in step S7 on the encoding side, the predicted samples are subjected to a symmetric transformation based on the symmetric relationship in step S5, and are subtracted from the original samples to obtain residual samples.
[0647] In Method 1, the modification starts from step S5, and performs a direct symmetry operation on the predicted samples, then obtains the original samples, and obtains the residual.
[0648] (1) Obtain the transformed predicted samples.
[0649] Obtaining the transformed predicted sample based on the symmetric relationship derived in step S5 and the predicted sample obtained in step S6 includes, but is not limited to, the following ways:
[0650] If the symmetry relation derived in step S5 is symmetry-free, The inputs are a chromaticity position (xCb, yCb) that specifies the position of the top left corner sample of the currently coded block relative to the top left corner chromaticity sample of the current image, one variable cbWidth that specifies the width of the currently coded block in chromaticity samples, one variable cbHeight that specifies the height of the currently coded block in chromaticity samples, one variable cIdx that specifies the color component index of the current block, and an array predSamples of predicted samples of the currently coded block.
[0651] The output is an array predTrsSamples of predicted samples of the current coding block after transformation.
[0652] The derivation process is as follows:
[0653] If x=xCb…xCb+cbWidth-1, y=yCb…yCb+cbHeight-1, xVb=x&(predSamplesWidthC-1) yVb=y&(predSamplesHeightC-1) predTrsSamples[cIdx][x][y]=predSamples[cIdx][xVb][yVb] predSamples are the stored predicted chrominance pixels, predSamplesWidthC is the width of predSamples, and predSamplesHeightC is the height of predSamples.
[0654] If the symmetry relationship derived in step S5 is horizontally symmetric, The inputs are a chromaticity position (xCb, yCb) that specifies the position of the top left corner sample of the currently coded block relative to the top left corner chromaticity sample of the current image, one variable cbWidth that specifies the width of the currently coded block in chromaticity samples, one variable cbHeight that specifies the height of the currently coded block in chromaticity samples, one variable cIdx that specifies the color component index of the current block, and an array predSamples of predicted samples of the currently coded block.
[0655] The output is an array predTrsSamples of predicted samples of the current coding block after transformation.
[0656] The derivation process is as follows:
[0657] If x=xCb...xCb+cbWidth-1, y=yCb...yCb+cbHeight-1, and xTemp=xCb+cbWidth-1...xCb, xVb=xTemp&(predSamplesWidthC-1) yVb=y&(predSamplesHeightC-1) predTrsSamples[cIdx][x][y]=predSamples[cIdx][xVb][yVb] predSamples are the stored predicted chrominance pixels, predSamplesWidthC is the width of predSamples, and predSamplesHeightC is the height of predSamples.
[0658] If the symmetry relationship derived in step S5 is vertical symmetry, The inputs are a chromaticity position (xCb, yCb) that specifies the position of the top left corner sample of the currently coded block relative to the top left corner chromaticity sample of the current image, one variable cbWidth that specifies the width of the currently coded block in chromaticity samples, one variable cbHeight that specifies the height of the currently coded block in chromaticity samples, one variable cIdx that specifies the color component index of the current block, and an array predSamples of predicted samples of the currently coded block.
[0659] The output is an array predTrsSamples of predicted samples of the current coding block after transformation.
[0660] The derivation process is as follows:
[0661] If x=xCb…xCb+cbWidth-1, y=yCb…yCb+cbHeight-1, and yTemp=yCb+cbHeight-1…yCb, xVb=x&(predSamplesWidthC-1) yVb=yTemp&(predSamplesHeightC-1) predTrsSamples[cIdx][x][y]=predSamples[cIdx][xVb][yVb] predSamples are the stored predicted chrominance pixels, predSamplesWidthC is the width of predSamples, and predSamplesHeightC is the height of predSamples.
[0662] (2) Obtain the original sample.
[0663] The inputs are a chromaticity position (xCb, yCb) that specifies the position of the top left corner sample of the current coding block relative to the top left corner chromaticity sample of the current image, one variable cbWidth that specifies the width of the current coding block in chromaticity samples, one variable cbHeight that specifies the height of the current coding block in chromaticity samples, and one variable cIdx that specifies the color component index of the current block.
[0664] The output is an array of original samples of the current coding block, orgSamples.
[0665] The derivation process is as follows:
[0666] If x=xCb…xCb+cbWidth-1, y=yCb…yCb+cbHeight-1, xVb=x&(orgBufWidthC-1) yVb=y&(orgBufHeightC-1) orgSamples[cIdx][x][y]=orgChromaBuf[cIdx][xVb][yVb] orgChromaBuf is the stored original chroma pixel, orgBufWidthC is the width of the chroma pixel in the stored original pixel buffer, i.e., the width of orgChromaBuf, and orgBufHeightC is the height of the chroma pixel in the stored original pixel buffer, i.e., the height of orgChromaBuf.
[0667] (3) Obtain the residual sample.
[0668] Residual samples are derived based on the predicted samples obtained in (1) and the original samples obtained in (2).
[0669] The inputs are a chromaticity position (xCb, yCb) that specifies the position of the top left corner sample of the current coding block relative to the top left corner chromaticity sample of the current image, one variable cbWidth that specifies the width of the current coding block in chromaticity samples, one variable cbHeight that specifies the height of the current coding block in chromaticity samples, one variable cIdx that specifies the color component index of the current block, the original samples orgSamples obtained in step S7(2), and the predicted samples predTrsSamples obtained in step S7(1).
[0670] The output is an array of currently coded block residual samples, resiSamples.
[0671] The derivation process is as follows:
[0672] If x=xCb…xCb+cbWidth-1, y=yCb…yCb+cbHeight-1, resiSamples[cIdx][x][y]=funcSub(orgSamples[cIdx][x][y],predTrsSamples[cIdx][x][y]) Here, the FuncSub() function may directly subtract two parameters, or may perform further operations such as conversion processing after subtracting two parameters.
[0673] In method 2, Similar to steps S5 and S6 in the above embodiment, residual samples are derived based on the predicted samples derived in step S6 and the original samples.
[0674] Obtain the original sample directly.
[0675] If x=xCb…xCb+cbWidth-1, y=yCb…yCb+cbHeight-1, xVb=x&(orgVerPicBufWidthC-1) yVb=y&(orgVerPicBufHeightC-1) orgSamples[cIdx][xVb][yVb]=orgChromaBuf[cIdx][x][y] If the symmetry relation derived in step S5 is symmetry-free, The inputs are a chromaticity position (xCb, yCb) specifying the position of the top left corner sample of the current coding block relative to the top left corner chromaticity sample of the current image, one variable cbWidth specifying the width of the current coding block in chromaticity samples, one variable cbHeight specifying the height of the current coding block in chromaticity samples, one variable cIdx specifying the color component index of the current block, the original samples orgSamples obtained in step S7, and the predicted samples predSamples obtained in step S6.
[0676] The output is an array of currently coded block residual samples, resiSamples.
[0677] The derivation process is as follows:
[0678] If x=xCb…xCb+cbWidth-1, y=yCb…yCb+cbHeight-1, resiSamples[cIdx][x][y]=funcSub(orgSamples[cIdx][x][y],predSamples[cIdx][x][y]) Here, the FuncSub() function may directly subtract two parameters, or may perform further operations such as conversion processing after subtracting two parameters.
[0679] If the symmetry relationship derived in step S5 is horizontally symmetric, The inputs are a chromaticity position (xCb, yCb) that specifies the position of the top left corner sample of the current coding block relative to the top left corner chromaticity sample of the current image, one variable cbWidth that specifies the width of the current coding block in chromaticity samples, one variable cbHeight that specifies the height of the current coding block in chromaticity samples, one variable cIdx that specifies the color component index of the current block, the original samples orgSamples obtained in step S7, and the predicted samples predSamples obtained in step S6.
[0680] The output is an array of currently coded block residual samples, resiSamples.
[0681] The derivation process is as follows:
[0682] If x=xCb...xCb+cbWidth-1, y=yCb...yCb+cbHeight-1, and xTemp=xCb+cbWidth-1...xCb, resiSamples[cIdx][x][y]=funcSub(orgSamples[cIdx][x][y],predSamples[cIdx][xTemp][y]) Here, the FuncSub() function may directly subtract two parameters, or may perform further operations such as conversion processing after subtracting two parameters.
[0683] If the symmetry relationship derived in step S5 is vertical symmetry, The inputs are a chromaticity position (xCb, yCb) specifying the position of the top left corner sample of the current coding block relative to the top left corner chromaticity sample of the current image, one variable cbWidth specifying the width of the current coding block in chromaticity samples, one variable cbHeight specifying the height of the current coding block in chromaticity samples, one variable cIdx specifying the color component index of the current block, the original samples orgSamples obtained in step S7, and the predicted samples predSamples obtained in step S6.
[0684] The output is an array of currently coded block residual samples, resiSamples.
[0685] The derivation process is as follows:
[0686] If x=xCb…xCb+cbWidth-1, y=yCb…yCb+cbHeight-1, and yTemp=yCb+cbHeight-1…yCb, resiSamples[cIdx][x][y]=funcSub(orgSamples[cIdx][x][y],predSamples[cIdx][x][yTemp]) Here, the FuncSub() function may directly subtract two parameters, or may perform further operations such as conversion processing after subtracting two parameters.
[0687] In another implementation, in step S8 on the decoding side, the predicted samples are transformed based on the target symmetry relation in step S5 and summed with the residual samples to obtain reconstructed samples.
[0688] In Scheme 1, we first obtain the predicted samples after the symmetry operation, and then obtain the reconstructed samples.
[0689] (1) Obtain the transformed predicted samples.
[0690] (2) Obtain a reconstruction sample.
[0691] Using the transformed predicted samples and the residual samples obtained in step S7, the two are summed to obtain reconstructed samples recSamples, and then the actual reconstructed samples recChromaBuf are obtained.
[0692] The inputs are a chromaticity position (xCb, yCb) that specifies the position of the top left corner sample of the currently coded block relative to the top left corner chromaticity sample of the current image, one variable cbWidth that specifies the width of the currently coded block in chromaticity samples, one variable cbHeight that specifies the height of the currently coded block in chromaticity samples, one variable cIdx that specifies the color component index of the current block, one array predSamples that specifies the reconstructed prediction samples of the currently coded block, and one array resiSamples that specifies the prediction residual samples of the currently coded block.
[0693] The output is the currently coded block reconstructed sample array recChromaBuf.
[0694] The derivation process is as follows:
[0695] If x=xCb…xCb+cbWidth-1, y=yCb…yCb+cbHeight-1, xVb=x&(recBufWidthC-1) yVb=y&(recBufHeightC-1) recChromaBuf[cIdx][xVb][yVb]=funcAdd(predSamples[cIdx][x][y],resiSamples[x][y]) recChromaBuf is the stored reconstructed chroma pixel, recBufWidthC is the width of the chroma pixel in the stored reconstructed pixel buffer, i.e., the width of recChromaBuf, and recBufHeightC is the height of the chroma pixel in the stored reconstructed pixel buffer, i.e., the height of recChromaBuf. The funcAdd() function can perform direct addition, or it can process the data within it before adding, or it can perform further processing after the addition is complete.
[0696] In Scheme 2, we obtain direct prediction samples and then obtain reconstructed samples after symmetry operations.
[0697] (1) Obtain a prediction sample.
[0698] (2) Obtain a reconstruction sample If the symmetry relation derived in step S5 is symmetry-free, The inputs are a chromaticity position (xCb, yCb) that specifies the position of the top left corner sample of the currently coded block relative to the top left corner chromaticity sample of the current image, one variable cbWidth that specifies the width of the currently coded block in chromaticity samples, one variable cbHeight that specifies the height of the currently coded block in chromaticity samples, one variable cIdx that specifies the color component index of the current block, one array predSamples that specifies the reconstructed prediction samples of the currently coded block, and one array resiSamples that specifies the prediction residual samples of the currently coded block.
[0699] The output is the currently coded block reconstructed sample array recChromaBuf.
[0700] The derivation process is as follows:
[0701] If x=xCb…xCb+cbWidth-1, y=yCb…yCb+cbHeight-1, xVb=x&(recBufWidthC-1) yVb=y&(recBufHeightC-1) recChromaBuf[cIdx][xVb][yVb]=funcAdd(predSamples[cIdx][x][y],resiSamples[x][y]) recChromaBuf is the stored reconstructed chroma pixel, recBufWidthC is the width of the chroma pixel in the stored reconstructed pixel buffer, i.e., the width of recChromaBuf, and recBufHeightC is the height of the chroma pixel in the stored reconstructed pixel buffer, i.e., the height of recChromaBuf. The funcAdd() function can perform direct addition, or it can process the data within it before adding, or it can perform further processing after the addition is complete.
[0702] If the symmetry relationship derived in step S5 is horizontally symmetric, The inputs are a chromaticity position (xCb, yCb) that specifies the position of the top left corner sample of the currently coded block relative to the top left corner chromaticity sample of the current image, one variable cbWidth that specifies the width of the currently coded block in chromaticity samples, one variable cbHeight that specifies the height of the currently coded block in chromaticity samples, one variable cIdx that specifies the color component index of the current block, one array predSamples that specifies the reconstructed prediction samples of the currently coded block, and one array resiSamples that specifies the prediction residual samples of the currently coded block.
[0703] The output is the currently coded block reconstructed sample array recChromaBuf.
[0704] The derivation process is as follows:
[0705] If x=xCb...xCb+cbWidth-1, y=yCb...yCb+cbHeight-1, and xTemp=xCb+cbWidth-1...xCb, xVb=x&(recBufWidthC-1) yVb=y&(recBufHeightC-1) recChromaBuf[cIdx][xVb][yVb]=funcAdd(predSamples[cIdx][xTemp][y],resiSamples[x][y]) recChromaBuf is the stored reconstructed chroma pixel, recBufWidthC is the width of the chroma pixel in the stored reconstructed pixel buffer, i.e., the width of recChromaBuf, and recBufHeightC is the height of the chroma pixel in the stored reconstructed pixel buffer, i.e., the height of recChromaBuf. The funcAdd() function can perform direct addition, or it can process the data within it before adding, or it can perform further processing after the addition is complete.
[0706] If the symmetry relationship derived in step S5 is vertical symmetry, The inputs are a chromaticity position (xCb, yCb) that specifies the position of the top left corner sample of the currently coded block relative to the top left corner chromaticity sample of the current image, one variable cbWidth that specifies the width of the currently coded block in chromaticity samples, one variable cbHeight that specifies the height of the currently coded block in chromaticity samples, one variable cIdx that specifies the color component index of the current block, one array predSamples that specifies the reconstructed prediction samples of the currently coded block, and one array resiSamples that specifies the prediction residual samples of the currently coded block.
[0707] The output is the currently coded block reconstructed sample array recChromaBuf.
[0708] The derivation process is as follows:
[0709] If x=xCb…xCb+cbWidth-1, y=yCb…yCb+cbHeight-1, and yTemp=yCb+cbHeight-1…yCb, xVb=x&(recBufWidthC-1) yVb=y&(recBufHeightC-1) recChromaBuf[cIdx][xVb][yVb]=funcAdd(predSamples[cIdx][x][yTemp],resiSamples[x][y]) recChromaBuf is the stored reconstructed chroma pixel, recBufWidthC is the width of the chroma pixel in the stored reconstructed pixel buffer, i.e., the width of recChromaBuf, and recBufHeightC is the height of the chroma pixel in the stored reconstructed pixel buffer, i.e., the height of recChromaBuf. The funcAdd() function can perform direct addition, or it can process the data within it before adding, or it can perform further processing after the addition is complete.
[0710] Additionally, in some embodiments, the BV is adjusted to be applied to the chromaticity expansion, where the chromaticity BV is corrected to obtain a corrected usable BV.
[0711] After obtaining the scaled chromaticity BV based on the chromaticity sampling format, further correction is performed. Before correction, it is first necessary to determine whether the BV is available, and if it is available, correction is performed; if it is not available, adjustment is performed until it is available, and then correction is performed.
[0712] The judgment method is as follows:
[0713] Get the current chromaticity block position (xCb, yCb) and set the chromaticity BVC = (BVC hor ,BVC ver ) and obtain the corresponding offset position (xCb+BVC hor ,yCb+BVC ver ) and determine the following conditions. If all of them are met, the chromaticity BV is available, that is, the conditions are: Whether the obtained offset position exceeds the Picture boundary or not As shown in FIG. 10, whether the obtained offset position does not cover the current block or not, As shown in FIG. 11, whether the obtained offset position is within the available area or not, If all the conditions are met, that is, whether the obtained offset position has been reconstructed or not, the chromaticity BV is available.
[0714] Here, the correction method includes, but is not limited to, the following methods: The correction is performed by using a template search, that is, after obtaining the chrominance BV, the offset position is found using the position information of the chrominance block and the obtained chrominance BV, and then a fine search is performed near the offset position using a template, and the fine search range must fill the available area defined as shown in Figure 11. Finally, the optimal chrominance BV is obtained, and the reference block at the optimal offset position obtained after the fine search is copied, thereby obtaining the predicted pixel shown in Figure 12.
[0715] In this way, after obtaining an available BV, step S4 can be skipped and the process can proceed directly to step S5.
[0716] Furthermore, in some embodiments, the judgment condition of the DM method may be that any position in the entire corresponding luminance region has BV information, which is described as follows:
[0717] In DM mode, if the corresponding luma prediction information includes BV information, the current chroma block is coded using DBV mode. For example, If there is any pair (x, y) where x=xCb...xCb+cbWidth-1, y=yCb...yCb+cbHeight-1 such that CuPredMode[0][x][y] is equal to MODE_IBC, Intra_DBV_flag is set to 1, and the chrominance intra prediction mode IntraPredModeC[xCb][yCb] uses DBV mode.
[0718] If there is any pair (x, y) where x=xCb...xCb+cbWidth-1, y=yCb...yCb+cbHeight-1 such that CuPredMode[0][x][y] is equal to MODE_INTRA and IntraTmpFlag[x][y] is equal to 1, Intra_DBV_flag is set to 1, and in this case the chrominance intra prediction mode IntraPredModeC[xCb][yCb] uses DBV mode (the flag IntraTmpFlag is used to indicate whether to use IntraTmp mode).
[0719] Further, in some embodiments, a luminance block including the five luminance pixel locations shown in Figure 9 (including but not limited to five locations, and may be multiple different locations) is sequentially acquired, including but not limited to an order of C -> TL -> TR -> BL -> BR.
[0720] First, it is determined whether the luminance blocks at the five acquired positions are coded in a mode with BV information. If the luminance blocks at the five acquired positions are not coded in a mode with BV information, the luminance blocks are not acquired, and the DBV mode identifier is not transmitted in the bitstream. If there are one or more luminance blocks coded in a mode with BV information at the five positions, these five positions are sequentially re-acquired until the first luminance block that satisfies the following condition is found: whether the luminance blocks are coded in a mode with BV information is determined, and whether the BV is available is determined in step S3 and then in step S4.
[0721] If available, this luma block is selected as the luma block from which the BV is ultimately obtained.
[0722] If it is unavailable, the luma block may not be obtained, including but not limited to predicting it using a planar mode, a CCLM-type mode, or other angular prediction mode, or the first luma block coded in a mode with BV information may be found, adjusted until a BV is available, and this luma block may be selected as the luma block from which the BV is finally obtained.
[0723] Furthermore, in some embodiments, for chroma blocks where chroma prediction is performed in DBV mode, the corresponding residuals may be transformed and inversely transformed in a manner including, but not limited to, the following: Only one transform (e.g., only DCT transform without LFNST) or two transforms (primary transform and secondary transform, e.g., DCT transform performed on the encoding side followed by LFNST transform). The decoding side maintains the reverse order of the forward transform method performed on the encoding side.
[0724] It can be understood that in the original DBV prediction process, the chrominance IBC prediction step simply identifies a reference chrominance block and performs block copying. Therefore, if a symmetric relationship exists between the reference chrominance block and the current predicted block in the video of the screen content, the processing of this part cannot effectively utilize existing information such as BV and reconstructed luma, resulting in poor prediction. Furthermore, the processing only determines whether the luma CU is in IBC mode, and does not fully utilize the BV information of conventional technologies such as Intra TMP for prediction, resulting in reduced coding efficiency. Based on this, the present embodiment proposes a new chrominance prediction method. On the one hand, it fully utilizes the advantages of existing technologies to improve the uniformity of chrominance prediction and fully utilize information from the co-located luma region, thereby effectively improving the accuracy of chrominance prediction. On the other hand, it fully takes into account available information such as reconstructed luma and BV, and based on this information, performs a more detailed manipulation process regarding the symmetry relationship for the predicted value, thereby improving the accuracy of the predicted value.
[0725] According to the encoding and decoding methods shown in the embodiments of the present application, the test data is shown in Table 23. The test data shows that the main technical solutions can improve the encoding performance.
[0726] [Table 23]
[0727] In summary, this embodiment provides a detailed description of the specific implementation of the above embodiment, and it can be seen that this embodiment can effectively and accurately predict chrominance blocks. This solution fully considers available information such as reconstructed luminance and BV, and predicts chrominance based on this information, thereby improving the uniformity of chrominance prediction and processing the predicted value in more detail by taking into account symmetry relationships. By fully utilizing existing technology and information on the co-located luminance region, coding efficiency is effectively improved.
[0728] In yet another embodiment of the present application, please refer to Figure 23, which is a flowchart of another decoding method according to an embodiment of the present application. As shown in Figure 23, the method may include the following steps:
[0729] In step S2301, a first co-location area corresponding to the current block is determined.
[0730] It should be noted that the decoding method of the present embodiment is applied to a decoder. The decoding method may specifically refer to an intra prediction method, more specifically, a method that performs prediction using DBV mode and is applied to subblocks. Here, a video image is divided into multiple decoding blocks, each of which may include a first color component, a second color component, and a third color component. The current block in the present embodiment refers to a decoding block currently being intra-predicted in the video image. Here, the current block may be divided into at least one subblock, and then DBV mode prediction processing is performed on a subblock-by-subblock basis.
[0731] It should be further noted that in the embodiment of the present application, if the at least one is only one, the technical solution is the same as the above embodiment. Even if the first color component is a luminance component and the second color component is a chrominance component, the embodiment of the present application determines the BV parameter applied to the chrominance based on the luminance BV.
[0732] In some embodiments, determining the first co-location area corresponding to the current block may include: determining position information of the current block and size information of the current block; performing a scaling process on the position information of the current block based on a predetermined sampling format to obtain position information of the co-location area corresponding to the current block; performing a scaling process on the size information of the current block based on the predetermined sampling format to obtain size information of the co-location area corresponding to the current block; and determining the first co-location area corresponding to the current block based on the position information of the co-location area corresponding to the current block and the size information of the co-location area.
[0733] It should be noted that in the present embodiment, the first co-location region may refer to a first color component region at the same location as the current block. For example, if the current block is a chrominance component, the first co-location region may refer to a luminance region at the same location as the current block. The current block may be divided into blocks in the first co-location region, for example, using a binary tree structure, a ternary tree structure, a quadtree structure, etc., to obtain multiple blocks. Each block may be one CU, one sub-block, or one transform block, and at least one first color component sub-block may be obtained.
[0734] It should be further noted that in the embodiment of the present application, the predetermined sampling format here may be as shown in the above Table 8 or Table 9. For example, the position chromaPos=(xCb, yCb) of the current chroma block is obtained, and chromaPos is scaled according to the chroma sampling format shown in Table 8 to obtain the position lumaPos=(xCb_Y, yCb_Y) of the co-located luma region corresponding to the current chroma block, and the size chromaSize=(cbWidth, cbHeight) of the current chroma block is obtained, and chromaSize is scaled according to the chroma sampling format shown in Table 9 to obtain the size lumaSize=(cbWidth_Y, cbHeight_Y) of the co-located luma region corresponding to the current chroma block, thereby determining the first co-located region corresponding to the current block.
[0735] In step S2302, the first co-located region is divided to obtain at least one first color component sub-block.
[0736] It should be noted that in the embodiment of the present application, the block division here may be performed by performing region division on the first co-located region to obtain at least one first color component sub-region. For example, dividing the co-located luminance region corresponding to the current block into luminance sub-regions is specifically as follows:
[0737] The inputs are the luminance position (xCb, yCb) that specifies the position of the top left luminance sample in the luminance region corresponding to the current chromaticity block at the same position as the top left luminance sample in the current image, a variable cbWidth that specifies the width of the current coding block in luminance samples, a variable cbHeight that specifies the height of the current coding block in luminance samples, a variable SbWidth that specifies the width of the luminance sub-region, and a variable SbHeight that specifies the height of the luminance sub-region.
[0738] The output is the luminance subdomain The number of luminance coding sub-blocks in the horizontal direction, numSbX, and the number of luminance coding sub-blocks in the vertical direction, numSbY, are derived as follows.
[0739] numSbX=cbWidth / SbWidth numSbY=cbHeight / SbHeight When xSbIdx=0...numSbX-1, ySbIdx=0...numSbY-1, xCbY=xCb+xSbIdx×SbWidth yCbY=yCb+ySbIdx×SbHeight A luma subregion is a luma region with position (xCbY, yCbY) and size (SbWidth, SbHeight).
[0740] In step S2303, at least one second color component sub-block and prediction information of at least one second color component sub-block are determined based on the at least one first color component sub-block.
[0741] In an embodiment of the present application, determining at least one second color component sub-block based on at least one first color component sub-block may include determining a horizontal sampling factor and a vertical sampling factor based on a predetermined sampling format, and adjusting position information of the first color component sub-block based on the horizontal sampling factor and the vertical sampling factor to determine the second color component sub-block.
[0742] In some embodiments, adjusting the position information of the first color component sub-block based on the horizontal sampling factor and the vertical sampling factor to determine the second color component sub-block may include adjusting the horizontal coordinate of the first color component sub-block based on the horizontal sampling factor to obtain the horizontal coordinate of the second color component sub-block, adjusting the vertical coordinate of the first color component sub-block based on the vertical sampling factor to obtain the vertical coordinate of the second color component sub-block, and determining the second color component sub-block based on the horizontal coordinate of the second color component sub-block and the vertical coordinate of the second color component sub-block.
[0743] For example, prediction information for the chrominance sub-region is derived from the luma sub-region, and the chrominance sub-region is derived as follows.
[0744] The variable SubWidthC specifies the horizontal sampling ratio of chroma, and the variable SubHeightC specifies the vertical sampling ratio of chroma, where the derivation process of SubWidthC and SubHeightC is as shown in Table 24.
[0745] [Table 24]
[0746] The luminance position (xCb, yCb) specifies the position of the top left luminance sample of the luminance region at the same position corresponding to the current chromaticity block relative to the top left luminance sample of the current image, numSbX specifies the number of luminance coding sub-blocks in the horizontal direction, numSbY specifies the number of luminance coding sub-blocks in the vertical direction, the variable SbWidth specifies the width of the luminance sub-region, and the variable SbHeight specifies the height of the luminance sub-region.
[0747] Chromaticity position: When xSbIdx=0...numSbX-1, ySbIdx=0...numSbY-1, xCbC=xCb / SubWidthC+xSbIdx×(SbWidth / SubWidthC) yCbC=yCb / SubHeightC+ySbIdx×(SbHeight / SubHeightC) A chromaticity subregion is a chromaticity region with location (xCbC, yCbC) and size ((SbWidth / SubWidthC), (SbHeight / SubHeightC)).
[0748] In some embodiments, determining prediction information for the at least one second color component sub-block may include determining prediction information for the at least one first color component sub-block, and determining prediction information for the at least one second color component sub-block based on the prediction information for the at least one first color component sub-block.
[0749] In some embodiments, the decoding method may further include, when the prediction information of the first color component sub-block includes BV information, determining first block vector parameters of the first color component sub-block, adjusting the first block vector parameters of the first color component sub-block to determine second block vector parameters of the second color component sub-block, and determining prediction information of the second color component sub-block based on the second block vector parameters of the second color component sub-block.
[0750] In some embodiments, the decoding method may further include: if the prediction information of the first color component sub-block does not include BV information, obtaining a predetermined prediction mode and determining the predetermined prediction mode as the prediction information of the second color component sub-block; or if the prediction information of the first color component sub-block does not include BV information, determining candidate information of the second color component sub-block and determining the prediction information of the second color component sub-block based on the candidate information.
[0751] In some embodiments, the decoding method may further include adjusting first block vector parameters of the first color component sub-block to determine second block vector parameters of the second color component sub-block, and this operation may include performing a scaling operation on the first block vector parameters of the first color component sub-block based on a predetermined sampling format to determine second block vector parameters of the second color component sub-block.
[0752] In some embodiments, adjusting the first block vector parameters of the first color component sub-block to determine the second block vector parameters of the second color component sub-block may include performing a scaling operation on the first block vector parameters of the first color component sub-block based on a predetermined sampling format to obtain initial block vector parameters of the second color component sub-block, and performing a correction operation on the initial block vector parameters of the second color component sub-block to determine the second block vector parameters of the second color component sub-block.
[0753] In some embodiments, the decoding method may further include: after determining the second block vector parameters of the second color component sub-block, determining whether the second block vector parameters satisfy an availability condition; and, if the second block vector parameters satisfy the availability condition, determining the second block vector parameters as prediction information of the second color component sub-block.
[0754] In some embodiments, whether the second block vector parameters satisfy the availability condition depends on at least: the offset position indicated by the position information of the current block and the second block vector parameter does not exceed the image boundary; The offset position indicated by the position information of the current block and the second block vector parameter does not cover the current block; The offset position indicated by the position information of the current block and the second block vector parameter does not exceed a predetermined available area; It may include that the position information of the current block and the offset position indicated by the second block vector parameter have been reconstructed.
[0755] In some embodiments, whether the second block vector parameters satisfy the availability condition depends on at least: the offset position indicated by the position information of the second color component sub-block and the second block vector parameter does not exceed the image boundary; the offset position indicated by the position information of the second color component sub-block and the second block vector parameter does not cover the current block; the offset position indicated by the position information of the second color component sub-block and the second block vector parameter does not exceed a predetermined available area; The position information of the second color component sub-block and the offset position indicated by the second block vector parameter may be reconstructed.
[0756] It should be noted that in the embodiment of the present application, whether the second block vector parameters are available may be determined based on the position of the current block and the second block vector parameters, or may be determined based on the position of the current chromaticity sub-region and the second block vector parameters, and the embodiment of the present application is not particularly limited thereto.
[0757] In some embodiments, the decoding method may further include: determining candidate information for the second color component sub-block when the second block vector parameters do not satisfy the availability condition; and determining prediction information for the second color component sub-block based on the candidate information.
[0758] In some embodiments, the decoding method may further include, after determining the candidate information of the second color component sub-block, determining whether the candidate information is a block vector parameter, and if the candidate information is a block vector parameter, determining the block vector parameter as prediction information of the second color component sub-block.
[0759] In some embodiments, the decoding method may further include, if the candidate information is not a block vector parameter, obtaining a predetermined prediction mode and determining the predetermined prediction mode as prediction information for the second color component sub-block.
[0760] In some embodiments, determining candidate information for the second color component sub-block may include: determining a first color component block of the current block; if a prediction mode of the first color component block satisfies a first condition, determining a first block vector parameter of the first color component block; adjusting the first block vector parameter of the first color component block and determining a second block vector parameter of the second color component sub-block; and determining candidate information for the second color component sub-block based on the second block vector parameter.
[0761] In some embodiments, the decoding method may further include: after determining the second block vector parameters of the second color component sub-block, determining whether the second block vector parameters satisfy an availability condition; and, if the second block vector parameters satisfy the availability condition, determining the second block vector parameters as candidate information of the second color component sub-block.
[0762] In some embodiments, the decoding method may further include storing candidate information for the second color component sub-block.
[0763] It should be noted that the candidate information of the second color component sub-block can refer to the basic candidate chromaticity BV, and in this embodiment, the determining method thereof is similar to the determining method of the second block vector parameters in the above embodiment, and will not be described in detail here.
[0764] Furthermore, it should be noted that in the embodiment of the present application, if the prediction mode of the first color component block does not satisfy the first condition, a predetermined prediction mode, for example, a non-IntraTMP intra prediction mode, can be obtained, and then chromaticity prediction can be performed based on the predetermined prediction mode.
[0765] In some embodiments, the decoding method may further include not performing the step of decoding the bitstream to determine the target prediction mode of the current block if the prediction mode of the first color component block does not satisfy the first condition.
[0766] In step S2304, a predicted value of the second color component of the current block is determined based on the prediction information of at least one second color component sub-block.
[0767] In some embodiments, determining a predicted value of the second color component of the current block based on prediction information of at least one second color component sub-block may include: performing a prediction process on at least one second color component sub-block based on the prediction information of the at least one second color component sub-block, respectively, to determine a predicted value of the at least one second color component sub-block; and determining a predicted value of the second color component of the current block based on the predicted value of the at least one second color component sub-block.
[0768] In some embodiments, performing a prediction process on at least one second color component sub-block based on prediction information of the at least one second color component sub-block and determining a prediction value of the at least one second color component sub-block may include: determining second block vector parameters of the second color component sub-block based on the prediction information of the second color component sub-block; determining an offset position of the second color component sub-block based on the second block vector parameters and position information of the second color component sub-block; performing a block copy process based on the offset position of the second color component sub-block to obtain a first prediction sub-block; and determining a prediction value of the second color component sub-block based on the first prediction sub-block.
[0769] In some embodiments, the decoding method may include performing a correction operation on the first prediction sub-block to determine a prediction of the second color component sub-block.
[0770] It should be noted that in the embodiment of the present application, for each second color component sub-block, prediction information of the corresponding second color component sub-block is determined based on the prediction information of the first color component sub-block, and then a prediction process is performed on this second color component sub-block based on the determined prediction information to obtain a predicted value of this second color component sub-block; after obtaining the predicted value of each second color component sub-block, a predicted value of the second color component of the current block can be determined.
[0771] It should be further noted that in the embodiment of the present application, the correction operation includes, but is not limited to, a clip operation, a filtering operation, a weighting operation with a prediction value obtained in another prediction mode, and the like.
[0772] Furthermore, it should be noted that in the embodiment of the present application, after determining the predicted value of the second color component of the current block, the reconstructed value of the second color component of the current block can also be determined based on the predicted value of the second color component of the current block.
[0773] In one possible implementation, for determining the reconstruction value, the decoding method may further include: analyzing the bitstream to determine a residual value of at least one second color component sub-block; and determining the reconstruction value of at least one second color component sub-block based on the predicted value of the at least one second color component sub-block and the residual value of the at least one second color component sub-block.
[0774] In another possible implementation, for determining the reconstructed value, the decoding method may further include determining a target symmetry relationship, determining an initial reconstructed value of the second color component sub-block based on the predicted value of the second color component sub-block and the residual value of the second color component sub-block, and performing a transformation process on the initial reconstructed value based on the target symmetry relationship to determine the reconstructed value of the second color component sub-block.
[0775] In yet another possible implementation form, for determining the reconstruction value, the decoding method may further include determining a target symmetry relationship, performing a transformation process on the predicted value of the second color component sub-block based on the target symmetry relationship to determine a predicted transformation value of the second color component sub-block, and determining a reconstruction value of the second color component sub-block based on the predicted transformation value of the second color component sub-block and the residual value of the second color component sub-block.
[0776] It should be noted that in the present embodiment, the target symmetry relationship may be obtained by analyzing the bitstream, or by deriving the symmetry relationship as described in the above embodiment.
[0777] It should be further noted that in the embodiment of the present application, the above-mentioned decoding method is applied to prediction processing in sub-block units, and the decoding method shown in Fig. 6 can also be applied to sub-blocks. Similarly, the decoding method shown in Fig. 23 can also determine a symmetry relationship and perform prediction processing based on the symmetry relationship, and is not particularly limited here.
[0778] This embodiment provides a decoding method, which includes determining a first co-location region corresponding to a current block, dividing the first co-location region to obtain at least one first-color component sub-block, determining at least one second-color component sub-block and prediction information for the at least one second-color component sub-block based on the at least one first-color component sub-block, and determining a predicted value of the second-color component of the current block based on the prediction information for the at least one second-color component sub-block. In this way, by dividing the current block into sub-regions for prediction, various options are adaptively provided according to different content and luminance prediction information, making DBV prediction more effective and further improving coding efficiency.
[0779] In yet another embodiment of the present application, reference is made to Figure 24, which is a flowchart of another encoding method according to an embodiment of the present application. As shown in Figure 24, the method may include the following steps:
[0780] In step S2401, a first co-location area corresponding to the current block is determined.
[0781] It should be noted that the encoding method of the present embodiment is applied to an encoder. The encoding method may specifically refer to an intra prediction method, more specifically, a method that performs prediction using DBV mode and is applied to subblocks. Here, a video image is divided into multiple coding blocks, and the multiple coding blocks may include a first color component, a second color component, and a third color component. The current block in the present embodiment refers to a coding block currently targeted for intra prediction in the video image. Here, the current block may be divided into at least one subblock, and then DBV mode prediction processing is performed on a subblock-by-subblock basis.
[0782] In some embodiments, determining the first co-location area corresponding to the current block may include: determining position information of the current block and size information of the current block; performing a scaling process on the position information of the current block based on a predetermined sampling format to obtain position information of the co-location area corresponding to the current block; performing a scaling process on the size information of the current block based on the predetermined sampling format to obtain size information of the co-location area corresponding to the current block; and determining the first co-location area corresponding to the current block based on the position information of the co-location area corresponding to the current block and the size information of the co-location area.
[0783] In step S2402, the first co-located region is divided to obtain at least one first color component sub-block.
[0784] In step S2403, at least one second color component sub-block and prediction information of at least one second color component sub-block are determined based on the at least one first color component sub-block.
[0785] It should be noted that in the embodiment of the present application, the first co-location region needs to be divided to obtain at least one first color component sub-block, which may also be referred to as at least one first color component sub-region, and then at least one second color component sub-block and prediction information of the at least one second color component sub-block are derived based on the at least one first color component sub-region.
[0786] In some embodiments, determining at least one second color component sub-block based on at least one first color component sub-block may include determining a horizontal sampling factor and a vertical sampling factor based on a predetermined sampling format, and adjusting position information of the first color component sub-block based on the horizontal sampling factor and the vertical sampling factor to determine the second color component sub-block.
[0787] In some embodiments, adjusting the position information of the first color component sub-block based on the horizontal sampling factor and the vertical sampling factor to determine the second color component sub-block may include adjusting the horizontal coordinate of the first color component sub-block based on the horizontal sampling factor to obtain the horizontal coordinate of the second color component sub-block, adjusting the vertical coordinate of the first color component sub-block based on the vertical sampling factor to obtain the vertical coordinate of the second color component sub-block, and determining the second color component sub-block based on the horizontal coordinate of the second color component sub-block and the vertical coordinate of the second color component sub-block.
[0788] In some embodiments, determining prediction information for the at least one second color component sub-block may include determining prediction information for the at least one first color component sub-block, and determining prediction information for the at least one second color component sub-block based on the prediction information for the at least one first color component sub-block.
[0789] In some embodiments, the encoding method may further include, when the prediction information of the first color component sub-block includes BV information, determining first block vector parameters of the first color component sub-block, adjusting the first block vector parameters of the first color component sub-block to determine second block vector parameters of the second color component sub-block, and determining prediction information of the second color component sub-block based on the second block vector parameters of the second color component sub-block.
[0790] In some embodiments, the encoding method may further include: if the prediction information of the first color component sub-block does not include BV information, obtaining a predetermined prediction mode and determining the predetermined prediction mode as the prediction information of the second color component sub-block; or if the prediction information of the first color component sub-block does not include BV information, determining candidate information of the second color component sub-block and determining the prediction information of the second color component sub-block based on the candidate information.
[0791] In some embodiments, adjusting the first block vector parameters of the first color component sub-block to determine the second block vector parameters of the second color component sub-block includes performing a scaling operation on the first block vector parameters of the first color component sub-block based on a predetermined sampling format to determine the second block vector parameters of the second color component sub-block.
[0792] In some embodiments, adjusting the first block vector parameters of the first color component sub-block to determine the second block vector parameters of the second color component sub-block may include performing a scaling operation on the first block vector parameters of the first color component sub-block based on a predetermined sampling format to obtain initial block vector parameters of the second color component sub-block, and performing a correction operation on the initial block vector parameters of the second color component sub-block to determine the second block vector parameters of the second color component sub-block.
[0793] In some embodiments, the encoding method may further include: after determining the second block vector parameters of the second color component sub-block, determining whether the second block vector parameters satisfy an availability condition; and, if the second block vector parameters satisfy the availability condition, determining the second block vector parameters as prediction information of the second color component sub-block.
[0794] In some embodiments, whether the second block vector parameters satisfy the availability condition depends on at least: the offset position indicated by the position information of the current block and the second block vector parameter does not exceed the image boundary; The offset position indicated by the position information of the current block and the second block vector parameter does not cover the current block; The offset position indicated by the position information of the current block and the second block vector parameter does not exceed a predetermined available area; It may include that the position information of the current block and the offset position indicated by the second block vector parameter have been reconstructed.
[0795] In some embodiments, whether the second block vector parameters satisfy the availability condition depends on at least: the offset position indicated by the position information of the second color component sub-block and the second block vector parameter does not exceed the image boundary; the offset position indicated by the position information of the second color component sub-block and the second block vector parameter does not cover the current block; the offset position indicated by the position information of the second color component sub-block and the second block vector parameter does not exceed a predetermined available area; The position information of the second color component sub-block and the offset position indicated by the second block vector parameter may be reconstructed.
[0796] In some embodiments, the encoding method may further include: determining candidate information for the second color component sub-block if the second block vector parameters do not satisfy the availability condition; and determining prediction information for the second color component sub-block based on the candidate information.
[0797] In some embodiments, the encoding method may further include, after determining the candidate information of the second color component sub-block, determining whether the candidate information is a block vector parameter, and if the candidate information is a block vector parameter, determining the block vector parameter as prediction information of the second color component sub-block.
[0798] In some embodiments, the encoding method may further include, if the candidate information is not a block vector parameter, obtaining a predetermined prediction mode and determining the predetermined prediction mode as prediction information for the second color component sub-block.
[0799] In some embodiments, determining candidate information for the second color component sub-block may include: determining a first color component block of the current block; if a prediction mode of the first color component block satisfies a first condition, determining a first block vector parameter of the first color component block; adjusting the first block vector parameter of the first color component block and determining a second block vector parameter of the second color component sub-block; and determining candidate information for the second color component sub-block based on the second block vector parameter.
[0800] In some embodiments, the encoding method may further include: after determining the second block vector parameters of the second color component sub-block, determining whether the second block vector parameters satisfy an availability condition; and, if the second block vector parameters satisfy the availability condition, determining the second block vector parameters as candidate information of the second color component sub-block.
[0801] In some embodiments, the encoding method may further include storing candidate information for the second color component sub-block.
[0802] In some embodiments, the encoding method may further include not performing an encoding process on the target prediction mode of the current block if the prediction mode of the first color component block does not satisfy a first condition.
[0803] In step S2404, a predicted value of the second color component of the current block is determined based on the prediction information of at least one second color component sub-block.
[0804] In step S2405, a residual value of the second color component of the current block is determined based on the predicted value of the second color component of the current block.
[0805] It should be noted that in an embodiment of the present application, determining a predicted value of the second color component of the current block based on prediction information of at least one second color component sub-block may include: performing a prediction process on at least one second color component sub-block based on the prediction information of the at least one second color component sub-block, and determining a predicted value of the at least one second color component sub-block; and determining a predicted value of the second color component of the current block based on the predicted value of the at least one second color component sub-block.
[0806] In some embodiments, performing a prediction process on at least one second color component sub-block based on prediction information of the at least one second color component sub-block and determining a prediction value of the at least one second color component sub-block may include: determining second block vector parameters of the second color component sub-block based on the prediction information of the second color component sub-block; determining an offset position of the second color component sub-block based on the second block vector parameters and position information of the second color component sub-block; performing a block copy process based on the offset position of the second color component sub-block to obtain a first prediction sub-block; and determining a prediction value of the second color component sub-block based on the first prediction sub-block.
[0807] In some embodiments, the encoding method may include performing a correction operation on the first prediction sub-block to determine a prediction of the second color component sub-block.
[0808] It should be further explained that in an embodiment of the present application, determining a residual value of the second color component of the current block based on a predicted value of the second color component of the current block may include determining an original value of the second color component sub-block, and determining a residual value of the second color component sub-block based on the original value of the second color component sub-block and the predicted value of the second color component sub-block.
[0809] Furthermore, in some embodiments, determining a residual value of the second color component sub-block based on the original value of the second color component sub-block and the predicted value of the second color component sub-block may include determining a target symmetry relationship; performing a transformation process on the original value of the second color component sub-block based on the target symmetry relationship to determine an initial value of the second color component sub-block; and determining a residual value of the second color component sub-block based on the initial value of the second color component sub-block and the predicted value of the second color component sub-block.
[0810] Further, in some embodiments, determining a residual value of the second color component sub-block based on an original value of the second color component sub-block and a predicted value of the second color component sub-block may include determining a target symmetry relationship, performing a transformation process on the predicted value of the second color component sub-block based on the target symmetry relationship to determine a predicted transformation value of the second color component sub-block, and determining a residual value of the second color component sub-block based on the original value of the second color component sub-block and the predicted transformation value of the second color component sub-block.
[0811] Additionally, in some embodiments, the encoding method may further include encoding the residual values of the second color component sub-block and writing the resulting coded bits into a bitstream.
[0812] It should be further noted that in the embodiment of the present application, the encoding method is applied to prediction processing in units of sub-blocks, and the encoding method shown in Fig. 18 can also be applied to sub-blocks. Similarly, the encoding method shown in Fig. 24 can also determine a symmetry relationship and perform prediction processing based on the symmetry relationship, and is not particularly limited here.
[0813] This embodiment provides a coding method, which determines a first co-location region corresponding to a current block, divides the first co-location region to obtain at least one first-color component sub-block, determines at least one second-color component sub-block and prediction information for the at least one second-color component sub-block based on the at least one first-color component sub-block, and determines a predicted value of the second-color component of the current block based on the prediction information for the at least one second-color component sub-block. In this way, by dividing the current block into sub-regions for prediction, various options are adaptively provided according to different content and luminance prediction information, making DBV prediction more effective and further improving coding efficiency.
[0814] In another embodiment of the present application, based on the encoding and decoding methods described in the above embodiments, a new prediction mode DBV (i.e., Scheme 3) is also added in the embodiment of the present application. In the process of Scheme 3, the luma region at the same position corresponding to the current chroma block is obtained, the luma subregions are divided, prediction information for each luma subregion is then obtained, and prediction information for each chroma subregion is further obtained, and finally chroma prediction is performed.
[0815] 25, which is a detailed flowchart of yet another encoding / decoding method according to an embodiment of the present application. As shown in FIG. 25, the detailed process may include the following steps:
[0816] In step S2501, a luminance area corresponding to the current chrominance block at the same position is obtained.
[0817] In step S2502, the luminance sub-regions are divided.
[0818] In step S2503, prediction information for each luminance sub-region is obtained.
[0819] In step S2504, prediction information for each chromaticity sub-region is obtained.
[0820] In step S2505, chromaticity prediction is performed.
[0821] Furthermore, for obtaining prediction information for each luminance sub-region, specifically, as shown in FIG. 26, the detailed process may include the following steps:
[0822] In step S2601, it is determined whether the luminance sub-region prediction information includes BV information.
[0823] In step S2602, if the luma sub-region prediction information includes BV information as a result of the determination in step S2601, the BV is adjusted to determine the chromaticity sub-region BV to be applied to chromaticity.
[0824] In step S2603, if the luminance sub-region prediction information does not include BV information as a result of the determination in step S2601, a predetermined prediction mode is acquired.
[0825] In step S2604, it is determined whether the chromaticity sub-region BV is available.
[0826] In step S2605, if the determination result in step S2604 is that the chromaticity sub-region BV is not available, basic candidate chromaticity information is derived.
[0827] In step S2606, it is determined whether the candidate chromaticity information is chromaticity BV.
[0828] In step S2607, if the candidate chromaticity information is not the chromaticity BV as a result of the determination in step S2606, a predetermined prediction mode is acquired.
[0829] In step S2608, if the chromaticity sub-region BV is available as determined in step S2604, or if the candidate chromaticity information is chromaticity BV as determined in step S2606, the final chromaticity BV is obtained.
[0830] Furthermore, for deriving basic candidate chromaticity information, specifically, as shown in FIG. 27, the detailed process may include the following steps:
[0831] In step S2701, the corresponding luminance block is obtained.
[0832] In step S2702, it is determined whether the corresponding luminance block is coded in a mode that has BV information.
[0833] In step S2703, if the determination result in step S2702 is that the corresponding luminance block is not coded in a mode having BV information, a predetermined prediction mode is obtained.
[0834] In step S2704, if the determination result in step S2702 is that the corresponding luminance block is coded in a mode having BV information, the BV of the corresponding luminance block is obtained.
[0835] In step S2705, the chromaticity BV is obtained.
[0836] In step S2706, it is determined whether the chromaticity BV is available.
[0837] In step S2707, if the chromaticity BV is not available as a result of the determination in step S2706, the chromaticity BV is adjusted until it becomes available.
[0838] In step S2708, if the chromaticity BV is not available as a result of the determination in step S2706, a predetermined prediction mode is obtained.
[0839] In step S2709, the available chromaticity BV is obtained.
[0840] In one specific embodiment, based on FIGS. 25 to 27, the process may specifically include the following steps:
[0841] In step S1, a luminance region at the same position as the current chrominance block is obtained.
[0842] As shown in the above FIG. 13, the position of the current chroma block, chromaPos=(xCb, yCb), is obtained, and chromaPos is scaled based on the chroma sampling format shown in Table 8 to obtain the luma region position, lumaPos=(xCb_Y, yCb_Y), of the same position corresponding to the current chroma block.
[0843] The size of the current chroma block, chromaSize=(cbWidth, cbHeight), is obtained, and the chromaSize is scaled based on the chroma sampling format shown in Table 9 to obtain the size of the luma region at the same position corresponding to the current chroma block, lumaSize=(cbWidth_Y, cbHeight_Y).
[0844] In step S2, the luminance sub-regions are divided.
[0845] The luminance region at the same position corresponding to the current chrominance block is divided into luminance sub-regions, as follows:
[0846] The inputs are the luminance position (xCb, yCb) that specifies the position of the top left luminance sample in the luminance region corresponding to the current chromaticity block at the same position as the top left luminance sample in the current image, a variable cbWidth that specifies the width of the current coding block in luminance samples, a variable cbHeight that specifies the height of the current coding block in luminance samples, a variable SbWidth that specifies the width of the luminance sub-region, and a variable SbHeight that specifies the height of the luminance sub-region.
[0847] The output is the luminance sub-domain.
[0848] The number of luminance coding sub-blocks in the horizontal direction, numSbX, and the number of luminance coding sub-blocks in the vertical direction, numSbY, are derived as follows.
[0849] numSbX=cbWidth / SbWidth numSbY=cbHeight / SbHeight When xSbIdx=0...numSbX-1, ySbIdx=0...numSbY-1, xCbY=xCb+xSbIdx×SbWidth yCbY=yCb+ySbIdx×SbHeight A luma subregion is a luma region with position (xCbY, yCbY) and size (SbWidth, SbHeight).
[0850] In step S3, prediction information for each luminance sub-region is obtained.
[0851] The process of obtaining the luminance prediction information is as follows.
[0852] When xSbIdx=0...numSbX-1 and ySbIdx=0...numSbY-1, the luminance prediction information is derived as follows.
[0853] For the luminance sub-region (xCbY, yCbY), When CuPredMode[xCbY][yCbY] is equal to MODE_INTRA and in IntraTMP mode, the prediction information for the luma subregion is obtained as follows:
[0854] bvL[xSbIdx][ySbIdx][0]=BvL0[xCbY][yCbY][0], bvL[xSbIdx][ySbIdx][1]=BvL0[xCbY][yCbY][1], where BvL0 is the BV in the corresponding luminance sub-domain.
[0855] If CuPredMode[xCbY][yCbY] is equal to MODE_INTRA and in non-IntraTMP mode, The prediction information of the luma sub-region is given by IntraPredModeY[xCbY][yCbY], where IntraPredModeY is the intra prediction mode of the corresponding luma sub-region.
[0856] Otherwise, if CuPredMode[xCbY][yCbY] is equal to MODE_IBC, the prediction information of the luma subregion is obtained as follows:
[0857] bvL[xSbIdx][ySbIdx][0]=BvL0[xCbY][yCbY][0], bvL[xSbIdx][ySbIdx][1]=BvL0[xCbY][yCbY][1], where BvL0 is the BV in the corresponding luminance sub-domain.
[0858] In step S4, prediction information for each chromaticity sub-region is obtained.
[0859] Prediction information for the chrominance sub-region is derived from the luma sub-region, and the chrominance sub-region is derived as follows.
[0860] The variable SubWidthC specifies the horizontal sampling ratio of chroma, and the variable SubHeightC specifies the vertical sampling ratio of chroma, where the derivation process of SubWidthC and SubHeightC is as shown in Table 24.
[0861] The luminance position (xCb, yCb) specifies the position of the top left luminance sample of the luminance region at the same position corresponding to the current chromaticity block relative to the top left luminance sample of the current image, numSbX specifies the number of luminance coding sub-blocks in the horizontal direction, numSbY specifies the number of luminance coding sub-blocks in the vertical direction, the variable SbWidth specifies the width of the luminance sub-region, and the variable SbHeight specifies the height of the luminance sub-region.
[0862] Regarding chromaticity position, When xSbIdx=0...numSbX-1, ySbIdx=0...numSbY-1, xCbC=xCb / SubWidthC+xSbIdx×(SbWidth / SubWidthC) yCbC=yCb / SubHeightC+ySbIdx×(SbHeight / SubHeightC) A chromaticity subregion is a chromaticity region with location (xCbC, yCbC) and size ((SbWidth / SubWidthC), (SbHeight / SubHeightC)).
[0863] In another specific embodiment, for determining prediction information for the chromaticity sub-region, the process may include the following steps.
[0864] In step B1, it is determined whether the luminance sub-region prediction information includes BV.
[0865] If the prediction information of the luminance sub-region includes BV, proceed to step S402. If the prediction information of the luminance sub-region does not include BV, for example, if the prediction mode is a non-IntraTMP intra prediction mode, proceed to step S403 or step S405.
[0866] In step B2, BV is adjusted to accommodate the chromaticity.
[0867] The BV of the luma sub-region is adjusted as applied to the chroma sub-region, and the specific process is as follows:
[0868] The BV information of the acquired luminance sub-region is bvL[xSbIdx][ySbIdx]=(BVL hor ,BVL ver ) and the BV information of the chromaticity sub-domain is bvC[xSbIdx][ySbIdx]=(BVC hor ,BVC ver ) The adjustment method includes, but is not limited to, the following: perform scaling processing on the luminance BV parameters according to Table 9 above to obtain the adjusted chromaticity BV, and then proceed to step B4.
[0869] In step B3, a predetermined prediction mode is obtained.
[0870] Here, the predetermined prediction mode may be an intra prediction mode, and is applied to chrominance as the final prediction mode.
[0871] In step B4, it is determined whether the BV is available.
[0872] Get the current chromaticity sub-area position (xCbC, yCbC) and set the chromaticity bvC[xSbIdx][ySbIdx]=(BVC hor ,BVC ver ) and obtain the corresponding offset position (xCbC+BVC hor ,yCbC+BVC ver ) and determine whether the following conditions are met. If all of them are met, it is determined that the chromaticity BV is available. That is, the conditions are: Whether the obtained offset position exceeds the Picture boundary or not As shown in FIG. 28, whether the obtained offset position does not currently cover the chromaticity sub-region, As shown in FIG. 11, whether the obtained offset position is within the available area or not, If all the conditions are met, that is, whether the obtained offset position has been reconstructed or not, it is determined that the chromaticity BV is usable.
[0873] If it is available, proceed to step B8; if not, proceed to step B5.
[0874] In step B5, the basic candidate chromaticity BV is derived.
[0875] In the first step, the corresponding luminance block is obtained.
[0876] The acquired block location may be any location, including but not limited to the following locations:
[0877] (1) As shown in FIG. 3, the central block of the luminance region at the same position is obtained.
[0878] (2) As shown in FIG. 7, the block in the upper left corner of the luminance area at the same position is obtained.
[0879] (3) As shown in FIG. 8, the block at the bottom right corner of the luminance region at the same position is obtained.
[0880] (4) Sequentially obtain blocks containing the five luminance pixel positions shown in Figure 9 (including but not limited to five positions, and may be multiple different positions) until it is determined that the obtained blocks are coded in a mode with BV information, i.e., until a block with the first luminance pixel position coded in a mode with BV information is found. The sequential obtaining order may include, but is not limited to, C -> TL -> TR -> BL -> BR.
[0881] In the second step, the luminance block is coded in a mode that has BV information.
[0882] Determine whether the corresponding luminance block is coded in a mode with BV information, where the mode with BV information includes, but is not limited to, IBC mode or IntraTMP mode.
[0883] If it is determined that the corresponding luminance block is coded in a mode having BV information, the BV of the corresponding luminance block is obtained; otherwise, a predetermined prediction mode (ie, an intra prediction mode) is obtained.
[0884] In the third step, the chromaticity BV is obtained.
[0885] After obtaining the BV of the corresponding luma block, adjust the BV to apply to the chromaticity, luma BV = (BVL hor ,BVL ver ), chromaticity BV=(BVC hor ,BVC ver ) Adjustment methods include, but are not limited to, scaling the chroma sampling format based on Table 9 above.
[0886] In the fourth step, it is determined whether the BV is available.
[0887] In method 1, the availability of BV is determined based on information such as the position of the current chrominance block.
[0888] Get the current chromaticity block position (xCb, yCb) and set the chromaticity BVC = (BVC hor ,BVC ver ) and obtain the corresponding offset position (xCb+BVC hor ,yCb+BVC ver ) and check the following conditions. If all of them are met, it is determined that the chromaticity BV is available. That is, the conditions are: Whether the obtained offset position exceeds the Picture boundary or not As shown in FIG. 10, whether the obtained offset position does not cover the current block or not, As show...
Claims
1. A decoding method applied to a decoder, comprising: determining a first color component block of the current block; If the prediction mode of the first color component block satisfies a first condition, determining a target block vector parameter of the current block, and determining a target symmetry relationship based on the target block vector parameter of the current block; performing a prediction process on a second color component of the current block based on the target block vector parameters to determine a predicted value of the second color component of the current block; determining a reconstructed value of the second color component of the current block based on the predicted value of the second color component of the current block and the target symmetry relationship.
2. determining that the prediction mode of the first color component block satisfies a first condition includes determining that the prediction mode of the first color component block is a first prediction mode having BV information; The decoding method of claim 1 .
3. the first prediction mode includes at least one of an IBC mode and an IntraTMP mode; The decoding method according to claim 2.
4. The decoding method comprises: and if the prediction mode of the first color component block does not satisfy a first condition, not performing decoding a bitstream to determine a target prediction mode of the current block. The decoding method of claim 1 .
5. determining that the prediction mode of the first color component block does not satisfy a first condition includes determining that the prediction mode of the first color component block is a second prediction mode that does not have BV information; 5. The decoding method according to claim 4.
6. The second prediction mode does not include an IBC mode or an IntraTMP mode. The decoding method according to claim 5.
7. Determining a first color component block of the current block includes: determining a first co-location area corresponding to the current block; determining a first color component block of the current block among a plurality of blocks divided from the first co-location region; The decoding method of claim 1 .
8. Determining a first color component block of the current block includes: selecting a target block from a plurality of blocks divided from the first co-location region, and setting the target block as a first color component block of the current block; The decoding method according to claim 7.
9. Determining a first color component block of the current block includes: determining location information of the current block; performing a scaling process on the position information of the current block based on a predetermined sampling format to obtain position information of an identical position area corresponding to the current block; determining target position information based on the position information of the same position area, and setting a target block including the target position information as a first color component block of the current block; The decoding method according to claim 7.
10. Determining target position information based on position information of the same position area A center position is calculated based on the position information of the same position area, and the obtained center position information is set as the target position information; or Calculating the position of the upper left corner based on the position information of the same position area, and setting the obtained upper left position information as the target position information; or calculating a lower right corner position based on position information of the same position area, and setting the obtained lower left position information as the target position information; The decoding method according to claim 9.
11. Determining a first color component block of the current block includes: determining at least one candidate block located at a predetermined position among a plurality of blocks divided from the first coincident region; determining a target candidate block that satisfies a predetermined judgment condition from the at least one candidate block, and setting the target candidate block as a first color component block of the current block; The decoding method according to claim 7.
12. Determining the target block vector parameters of the current block includes: determining first block vector parameters for the first color component block; adjusting first block vector parameters of the first color component block to determine target block vector parameters of the current block; The decoding method of claim 1 .
13. adjusting a first block vector parameter of the first color component block and determining a target block vector parameter of the current block; performing a scaling process on first block vector parameters of the first color component block based on a predetermined sampling format to determine target block vector parameters of the current block; The decoding method according to claim 12.
14. adjusting a first block vector parameter of the first color component block and determining a target block vector parameter of the current block; performing a scaling process on the first block vector parameters of the first color component block according to a predetermined sampling format to obtain initial block vector parameters of the current block; performing a correction process on the initial block vector parameters of the current block to determine the target block vector parameters of the current block; The decoding method according to claim 12.
15. The decoding method comprises: After determining the target block vector parameters of the current block, determining whether the target block vector parameters satisfy an availability condition; If the target block vector parameters satisfy an availability condition, determining a target symmetry relationship of the current block based on the target block vector parameters of the current block. The decoding method of claim 1 .
16. The target block vector parameters satisfy the availability condition by at least the offset position indicated by the position information of the current block and the target block vector parameter does not exceed the image boundary; The offset position indicated by the position information of the current block and the target block vector parameter does not cover the current block; The offset position indicated by the position information of the current block and the target block vector parameter does not exceed a predetermined available area; and the position information of the current block and the offset position indicated by the target block vector parameter have been reconstructed; 16. The decoding method of claim 15.
17. Determining a target symmetry relationship based on the target block vector parameters of the current block includes: determining a first co-location area corresponding to the current block; determining a reference block based on the target block vector parameters, and determining a second co-location area corresponding to the reference block; performing at least one symmetrical relationship error calculation based on the first coincidence region and the second coincidence region to obtain the at least one symmetrical relationship error value; determining the target symmetry relation from the at least one symmetry relation based on an error value of the at least one symmetry relation. The decoding method of claim 1 .
18. Performing at least one symmetric relationship error calculation based on the first coincidence region and the second coincidence region to obtain the at least one symmetric relationship error value includes: performing a transformation process of a first symmetry relationship on the second coincident position area to determine a second coincident position area after the transformation; calculating a symmetric error between the transformed second coincident position area and the first coincident position area based on a predetermined error criterion to determine an error value of the first symmetric relationship; the first symmetry relation is any one of the at least one symmetry relations; 18. The decoding method of claim 17.
19. Determining a target symmetry relationship based on the target block vector parameters of the current block includes: determining a first neighboring region corresponding to the current block; determining a reference block based on the target block vector parameters, and determining a second neighboring region corresponding to the reference block; performing an error calculation of at least one symmetrical relationship based on the first adjacent region and the second adjacent region to obtain an error value of the at least one symmetrical relationship; determining the target symmetry relation from the at least one symmetry relation based on an error value of the at least one symmetry relation. The decoding method of claim 1 .
20. Performing an error calculation of at least one symmetrical relationship based on the first adjacent region and the second adjacent region to obtain an error value of the at least one symmetrical relationship includes: performing a transformation process of a first symmetry relationship on the second adjacent region to determine a transformed second adjacent region; calculating a symmetric error between the transformed second adjacent region and the first adjacent region based on a predetermined error criterion to determine an error value of the first symmetric relationship; the first symmetry relation is any one of the at least one symmetry relations; 20. The decoding method of claim 19.
21. the at least one symmetrical relationship includes at least one of: no symmetrical relationship, a vertical symmetrical relationship, and a horizontal symmetrical relationship; 20. A decoding method according to claim 17 or 19.
22. determining the target symmetry relation from the at least one symmetry relation based on an error value of the at least one symmetry relation, selecting a minimum error value from the error values of the at least one symmetric relation, and determining the symmetric relation corresponding to the minimum error value as the target symmetric relation.
20. A decoding method according to claim 17 or 19.
23. The decoding method comprises: further comprising storing the target symmetry relationship in a predetermined buffer area.
20. A decoding method according to claim 17 or 19.
24. the predetermined error criterion comprises at least one of sum of absolute errors (SAD), sum of absolute transformed errors (SATD), residual sum of squares (SSE), mean absolute difference (MAD), mean absolute error (MAE), mean squared error (MSE), and rate distortion optimization (RDO); 21. A decoding method according to claim 18 or 20.
25. Determining a target symmetry relationship based on the target block vector parameters of the current block includes: determining a target symmetry relationship by obtaining a target symmetry relationship of the first color component block from a predetermined buffer area, the target symmetry relationship being used to indicate a symmetry relationship between a first co-location area in which the first color component block is located and a second co-location area indicated by the target block vector parameters; The decoding method of claim 1 .
26. performing a prediction process on the second color component of the current block based on the target block vector parameters to determine a predicted value of the second color component of the current block; determining an offset position of the current block based on the target block vector parameters and the position information of the current block; performing a block copy process based on the offset position of the current block to obtain a first predicted block; determining a predicted value of a second color component of the current block based on the first predicted block; The decoding method of claim 1 .
27. determining a predicted value of a second color component of the current block based on the first predicted block, performing a correction operation on the first predicted block to determine a predicted value of a second color component of the current block; 27. The decoding method of claim 26.
28. determining a reconstructed value of the second color component of the current block based on the predicted value of the second color component of the current block and the target symmetry relationship; decoding the bitstream to determine a residual value of a second color component of the current block; determining an initial reconstructed value of the second color component of the current block based on the predicted value of the second color component of the current block and the residual value of the second color component of the current block; performing a transformation process on the initial reconstructed value based on the target symmetry relationship to determine a reconstructed value of a second color component of the current block; The decoding method of claim 1 .
29. determining a reconstructed value of the second color component of the current block based on the predicted value of the second color component of the current block and the target symmetry relationship; performing a transformation process on the predicted value of the second color component of the current block based on the target symmetry relationship to determine a predicted transformation value of the second color component of the current block; decoding the bitstream to determine a residual value of a second color component of the current block; determining a reconstructed value of the second color component of the current block based on the predicted transform value of the second color component of the current block and the residual value of the second color component of the current block; The decoding method of claim 1 .
30. The decoding method comprises: decoding a bitstream to determine a target prediction mode for the current block; If the target prediction mode indicates that a DBV mode is allowed for the second color component of the current block, determining a target block vector parameter of the current block is further included. The decoding method of claim 1 .
31. Decoding the bitstream to determine a target prediction mode for the current block includes: decoding the bitstream to determine a value of a first syntax element identification; If the value of the first syntax element identification information is a first value, determining that a target prediction mode of the current block is a DBV mode; If the value of the first syntax element identification information is a second value, determining that the target prediction mode of the current block is a prediction mode other than the DBV mode.
31. The decoding method of claim 30.
32. The decoding method comprises: determining a first co-location area corresponding to the current block; If any position in the first co-location region has BV information, determining that the DBV mode is permitted for the second color component of the current block.
31. The decoding method of claim 30.
33. determining the target block vector parameters of the current block includes decoding a bitstream to determine the target block vector parameters of the current block; Decoding method according to any one of claims 1 to 32.
34. determining the target symmetry relationship includes decoding a bitstream to determine the target symmetry relationship. Decoding method according to any one of claims 1 to 32.
35. The decoding method comprises: performing subblock division on the current block to obtain at least one subblock; and determining a reconstructed value of a second color component of the sub-block by performing the decoding method of claim 1 with the sub-block as a current block. Decoding method according to any one of claims 1 to 32.
36. A decoding method applied to a decoder, comprising: determining a first co-location region corresponding to the current block; Dividing the first co-located region to obtain at least one first color component sub-block; determining at least one second color component sub-block and prediction information for the at least one second color component sub-block based on the at least one first color component sub-block; determining a predicted value of a second color component of the current block based on prediction information of the at least one second color component sub-block.
37. Determining a first co-location area corresponding to the current block includes: determining position information of the current block and size information of the current block; performing a scaling process on the position information of the current block based on a predetermined sampling format to obtain position information of an identical position area corresponding to the current block; performing a scaling process on the size information of the current block based on a predetermined sampling format to obtain size information of the same position area corresponding to the current block; determining a first coincident position area corresponding to the current block based on position information of the coincident position area corresponding to the current block and size information of the coincident position area; 37. The decoding method of claim 36.
38. Determining at least one second color component sub-block based on the at least one first color component sub-block includes: determining a horizontal sampling factor and a vertical sampling factor based on a predetermined sampling format; and adjusting position information of the first color component sub-block based on the horizontal sampling factor and the vertical sampling factor to determine the second color component sub-block.
37. The decoding method of claim 36.
39. determining the second color component sub-block by adjusting position information of the first color component sub-block based on the horizontal sampling factor and the vertical sampling factor; adjusting the horizontal coordinates of the first color component sub-block based on the horizontal sampling factor to obtain the horizontal coordinates of the second color component sub-block; adjusting the vertical coordinate of the first color component sub-block based on the vertical sampling factor to obtain the vertical coordinate of the second color component sub-block; determining the second color component sub-block based on a horizontal coordinate of the second color component sub-block and a vertical coordinate of the second color component sub-block; 39. The decoding method of claim 38.
40. Determining prediction information for the at least one second color component sub-block includes: determining prediction information for the at least one first color component sub-block; determining prediction information for the at least one second color component sub-block based on prediction information for the at least one first color component sub-block; 37. The decoding method of claim 36.
41. The decoding method comprises: determining a first block vector parameter of the first color component sub-block when the prediction information of the first color component sub-block includes BV information; adjusting first block vector parameters of the first color component sub-block to determine second block vector parameters of the second color component sub-block; determining prediction information for the second color component sub-block based on second block vector parameters of the second color component sub-block.
41. The decoding method of claim 40.
42. The decoding method comprises: When the prediction information of the first color component sub-block does not include BV information, a predetermined prediction mode is obtained, and the predetermined prediction mode is determined as the prediction information of the second color component sub-block; or determining candidate information for the second color component sub-block when the prediction information for the first color component sub-block does not include BV information; and determining the prediction information for the second color component sub-block based on the candidate information.
42. The decoding method of claim 41.
43. adjusting first block vector parameters of the first color component sub-block to determine second block vector parameters of the second color component sub-block; performing a scaling operation on the first block vector parameters of the first color component sub-block based on a predetermined sampling format to determine second block vector parameters of the second color component sub-block; 42. The decoding method of claim 41.
44. adjusting first block vector parameters of the first color component sub-block to determine second block vector parameters of the second color component sub-block; performing a scaling process on the first block vector parameters of the first color component sub-block based on a predetermined sampling format to obtain initial block vector parameters of the second color component sub-block; performing a correction process on the initial block vector parameters of the second color component sub-block to determine second block vector parameters of the second color component sub-block; 42. The decoding method of claim 41.
45. The decoding method comprises: After determining second block vector parameters of the second color component sub-block, determining whether the second block vector parameters satisfy an availability condition; determining the second block vector parameters as prediction information for the second color component sub-block if the second block vector parameters satisfy an availability condition.
42. The decoding method of claim 41.
46. Whether the second block vector parameters satisfy the availability condition is determined based on at least: the offset position indicated by the position information of the current block and the second block vector parameter does not exceed an image boundary; The offset position indicated by the position information of the current block and the second block vector parameter does not cover the current block; the offset position indicated by the position information of the current block and the second block vector parameter does not exceed a predetermined available area; the position information of the current block and the offset position indicated by the second block vector parameter have been reconstructed; 46. The decoding method of claim 45.
47. Whether the second block vector parameters satisfy the availability condition is determined based on at least: the offset position indicated by the position information of the second color component sub-block and the second block vector parameter does not exceed an image boundary; the offset position indicated by the position information of the second color component sub-block and the second block vector parameter does not cover the current block; the offset position indicated by the position information of the second color component sub-block and the second block vector parameter does not exceed a predetermined available area; the position information of the second color component sub-block and the offset position indicated by the second block vector parameter have been reconstructed; 46. The decoding method of claim 45.
48. The decoding method comprises: determining candidate information for the second color component sub-block if the second block vector parameters do not satisfy an availability condition; determining prediction information for the second color component sub-block based on the candidate information.
46. The decoding method of claim 45.
49. The decoding method comprises: After determining candidate information for the second color component sub-block, determining whether the candidate information is a block vector parameter; and if the candidate information is a block vector parameter, determining the block vector parameter as prediction information for the second color component sub-block.
49. The decoding method of claim 48.
50. The decoding method comprises: If the candidate information is not a block vector parameter, obtaining a predetermined prediction mode and determining the predetermined prediction mode as prediction information of the second color component sub-block.
50. The decoding method of claim 49.
51. Determining candidate information for the second color component sub-blocks includes: determining a first color component block of the current block; determining first block vector parameters of the first color component block if the prediction mode of the first color component block satisfies a first condition; adjusting first block vector parameters of the first color component block and determining second block vector parameters of the second color component sub-block; determining candidate information for the second color component sub-block based on the second block vector parameters; 49. The decoding method of claim 48.
52. The decoding method comprises: After determining second block vector parameters of the second color component sub-block, determining whether the second block vector parameters satisfy an availability condition; If the second block vector parameters satisfy an availability condition, determining the second block vector parameters as candidate information for the second color component sub-block.
52. The decoding method of claim 51.
53. the decoding method further comprising storing candidate information for the second color component sub-block.
52. The decoding method of claim 51.
54. The decoding method may further include not decoding a bitstream to determine a target prediction mode of the current block if the prediction mode of the first color component block does not satisfy a first condition.
52. The decoding method of claim 51.
55. determining a predicted value of a second color component of the current block based on prediction information of the at least one second color component sub-block; performing a prediction process on each of the at least one second color component sub-block based on prediction information of the at least one second color component sub-block, and determining a prediction value of the at least one second color component sub-block; determining a predicted value of a second color component of the current block based on the predicted value of the at least one second color component sub-block.
37. The decoding method of claim 36.
56. performing a prediction process on each of the at least one second-color component sub-blocks based on prediction information of the at least one second-color component sub-block, and determining a predicted value of the at least one second-color component sub-block; determining second block vector parameters for the second color component sub-block based on prediction information for the second color component sub-block; determining an offset position of the second color component sub-block based on the second block vector parameters and position information of the second color component sub-block; performing a block copy process based on the offset position of the second color component sub-block to obtain a first predicted sub-block; determining a prediction of the second color component sub-block based on the first prediction sub-block.
56. The decoding method of claim 55.
57. The decoding method comprises: performing a correction operation on the first predicted sub-block to determine a predicted value of the second color component sub-block.
57. The decoding method of claim 56.
58. The decoding method comprises: analyzing the bitstream to determine a residual value of the at least one second color component sub-block; determining a reconstructed value of the at least one second color component sub-block based on the predicted value of the at least one second color component sub-block and a residual value of the at least one second color component sub-block.
56. The decoding method of claim 55.
59. The decoding method comprises: determining a target symmetry relationship; determining an initial reconstructed value for the second color component sub-block based on the predicted value for the second color component sub-block and the residual value for the second color component sub-block; performing a transformation on the initial reconstructed values based on the target symmetry relationship to determine reconstructed values of the second color component sub-block.
59. The decoding method of claim 58.
60. The decoding method comprises: determining a target symmetry relationship; performing a transformation process on the predicted value of the second color component sub-block based on the target symmetry relationship to determine a predicted transformation value of the second color component sub-block; determining a reconstructed value for the second color component sub-block based on the predicted transform value for the second color component sub-block and the residual value for the second color component sub-block.
59. The decoding method of claim 58.
61. A coding method applied to an encoder, comprising: determining a first color component block of the current block; If the prediction mode of the first color component block satisfies a first condition, determining a target block vector parameter of the current block, and determining a target symmetry relationship based on the target block vector parameter of the current block; performing a prediction process on a second color component of the current block based on the target block vector parameters to determine a predicted value of the second color component of the current block; determining a residual value of the second color component of the current block based on the predicted value of the second color component of the current block and the target symmetry relationship.
62. determining that the prediction mode of the first color component block satisfies a first condition includes determining that the prediction mode of the first color component block is a first prediction mode having BV information; 62. The encoding method of claim 61.
63. the first prediction mode includes at least one of an IBC mode and an IntraTMP mode; 63. The encoding method of claim 62.
64. The encoding method comprises: and if the prediction mode of the first color component block does not satisfy a first condition, not performing an encoding process on the target prediction mode of the current block.
62. The encoding method of claim 61.
65. determining that the prediction mode of the first color component block does not satisfy a first condition includes determining that the prediction mode of the first color component block is a second prediction mode that does not have BV information; 65. The encoding method of claim 64.
66. The second prediction mode does not include an IBC mode or an IntraTMP mode.
66. The encoding method of claim 65.
67. Determining a first color component block of the current block includes: determining a first co-location area corresponding to the current block; determining a first color component block of the current block among a plurality of blocks divided from the first co-location region; 62. The encoding method of claim 61.
68. Determining a first color component block of the current block includes: selecting a target block from a plurality of blocks divided from the first co-location region, and setting the target block as a first color component block of the current block; 68. The encoding method of claim 67.
69. Determining a first color component block of the current block includes: determining location information of the current block; performing a scaling process on the position information of the current block based on a predetermined sampling format to obtain position information of an identical position area corresponding to the current block; determining target position information based on the position information of the same position area, and setting a target block including the target position information as a first color component block of the current block; The encoding method according to claim 7.
70. Determining target position information based on position information of the same position area A center position is calculated based on the position information of the same position area, and the obtained center position information is set as the target position information; or Calculating the position of the upper left corner based on the position information of the same position area, and setting the obtained upper left position information as the target position information; or The method includes calculating the position of the lower right corner based on the position information of the same position area, and setting the obtained lower left position information as the target position information.
70. The encoding method of claim 69.
71. Determining a first color component block of the current block includes: determining at least one candidate block located at a predetermined position among a plurality of blocks divided from the first coincident region; determining a target candidate block that satisfies a predetermined judgment condition from the at least one candidate block, and setting the target candidate block as a first color component block of the current block; 68. The encoding method of claim 67.
72. Determining the target block vector parameters of the current block includes: determining first block vector parameters for the first color component block; adjusting first block vector parameters of the first color component block to determine target block vector parameters of the current block; 62. The encoding method of claim 61.
73. adjusting a first block vector parameter of the first color component block and determining a target block vector parameter of the current block; performing a scaling process on first block vector parameters of the first color component block based on a predetermined sampling format to determine target block vector parameters of the current block; 73. The encoding method of claim 72.
74. adjusting a first block vector parameter of the first color component block and determining a target block vector parameter of the current block; performing a scaling process on the first block vector parameters of the first color component block according to a predetermined sampling format to obtain initial block vector parameters of the current block; performing a correction process on the initial block vector parameters of the current block to determine the target block vector parameters of the current block; 73. The encoding method of claim 72.
75. The encoding method comprises: After determining the target block vector parameters of the current block, determining whether the target block vector parameters satisfy an availability condition; If the target block vector parameters satisfy an availability condition, determining a target symmetry relationship of the current block based on the target block vector parameters of the current block.
72. The encoding method of claim 71.
76. The target block vector parameters satisfy the availability condition by at least the offset position indicated by the position information of the current block and the target block vector parameter does not exceed the image boundary; the offset position indicated by the position information of the current block and the target block vector parameter does not cover the current block; The offset position indicated by the position information of the current block and the target block vector parameter does not exceed a predetermined available area; and the position information of the current block and the offset position indicated by the target block vector parameter have been reconstructed; 76. The encoding method of claim 75.
77. Determining a target symmetry relationship based on the target block vector parameters of the current block includes: determining a first co-location area corresponding to the current block; determining a reference block based on the target block vector parameters, and determining a second co-location area corresponding to the reference block; performing at least one symmetrical relationship error calculation based on the first coincidence region and the second coincidence region to obtain the at least one symmetrical relationship error value; determining the target symmetry relation from the at least one symmetry relation based on an error value of the at least one symmetry relation.
62. The encoding method of claim 61.
78. Performing at least one symmetric relationship error calculation based on the first coincidence region and the second coincidence region to obtain the at least one symmetric relationship error value includes: performing a transformation process of a first symmetry relationship on the second coincident position area to determine a second coincident position area after the transformation; calculating a symmetric error between the transformed second coincident position area and the first coincident position area based on a predetermined error criterion to determine an error value of the first symmetric relationship; the first symmetry relation is any one of the at least one symmetry relations; 78. The encoding method of claim 77.
79. Determining a target symmetry relationship based on the target block vector parameters of the current block includes: determining a first neighboring region corresponding to the current block; determining a reference block based on the target block vector parameters, and determining a second neighboring region corresponding to the reference block; performing an error calculation of at least one symmetrical relationship based on the first adjacent region and the second adjacent region to obtain an error value of the at least one symmetrical relationship; determining the target symmetry relation from the at least one symmetry relation based on an error value of the at least one symmetry relation.
62. The encoding method of claim 61.
80. Performing an error calculation of at least one symmetrical relationship based on the first adjacent region and the second adjacent region to obtain an error value of the at least one symmetrical relationship includes: performing a transformation process of a first symmetry relationship on the second adjacent region to determine a transformed second adjacent region; calculating a symmetric error between the transformed second adjacent region and the first adjacent region based on a predetermined error criterion to determine an error value of the first symmetric relationship; the first symmetry relation is any one of the at least one symmetry relations; 80. The encoding method of claim 79.
81. the at least one symmetrical relationship includes at least one of: no symmetrical relationship, a vertical symmetrical relationship, and a horizontal symmetrical relationship; 80. The encoding method of claim 77 or 79.
82. determining the target symmetry relation from the at least one symmetry relation based on an error value of the at least one symmetry relation, selecting a minimum error value from the error values of the at least one symmetric relation, and determining the symmetric relation corresponding to the minimum error value as the target symmetric relation.
80. The encoding method of claim 77 or 79.
83. The encoding method comprises: further comprising storing the target symmetry relationship in a predetermined buffer area.
80. The encoding method of claim 77 or 79.
84. the predetermined error criterion comprises at least one of sum of absolute errors (SAD), sum of absolute transformed errors (SATD), residual sum of squares (SSE), mean absolute difference (MAD), mean absolute error (MAE), mean squared error (MSE), and rate distortion optimization (RDO); 81. The encoding method of claim 78 or 80.
85. Determining a target symmetry relationship based on the target block vector parameters of the current block includes: determining a target symmetry relationship by obtaining a target symmetry relationship of the first color component block from a predetermined buffer area, the target symmetry relationship being used to indicate a symmetry relationship between a first co-location area in which the first color component block is located and a second co-location area indicated by the target block vector parameters; 62. The encoding method of claim 61.
86. performing a prediction process on the second color component of the current block based on the target block vector parameters to determine a predicted value of the second color component of the current block; determining an offset position of the current block based on the target block vector parameters and the position information of the current block; performing a block copy process based on the offset position of the current block to obtain a first predicted block; determining a predicted value of a second color component of the current block based on the first predicted block; 62. The encoding method of claim 61.
87. determining a predicted value of a second color component of the current block based on the first predicted block, performing a correction operation on the first predicted block to determine a predicted value of a second color component of the current block; 87. The encoding method of claim 86.
88. determining a residual value of the second color component of the current block based on the predicted value of the second color component of the current block and the target symmetry relationship; determining an original value of a second color component of the current block; Performing a transformation process on the original value of the second color component of the current block according to the target symmetry relationship to determine an initial value of the second color component of the current block; determining a residual value of the second color component of the current block based on an initial value of the second color component of the current block and a predicted value of the second color component of the current block; 62. The encoding method of claim 61.
89. The encoding method comprises: encoding a residual value of a second color component of the current block and writing the resulting encoded bits into a bitstream.
62. The encoding method of claim 61.
90. The encoding method comprises: determining a target prediction mode for the current block; If the target prediction mode indicates that a DBV mode is allowed for a second color component of the current block, encoding the target prediction mode of the current block and writing the resulting encoded bits into a bitstream.
62. The encoding method of claim 61.
91. The encoding method comprises: determining a value of a first syntax element identification; encoding the value of the first syntax element identification information and writing the resulting coded bits into a bitstream.
91. The encoding method of claim 90.
92. Determining the value of the first syntax element identification information comprises: determining that a value of the first syntax element identification information is a first value when a target prediction mode of the current block is a DBV mode; and determining that the value of the first syntax element identification information is a second value when the target prediction mode of the current block is a prediction mode other than the DBV mode.
92. The encoding method of claim 91.
93. The encoding method comprises: determining a first co-location area corresponding to the current block; determining that a DBV mode is permitted for the second color component of the current block if any position within the first co-location region has DBV information; 91. The encoding method of claim 90.
94. The encoding method comprises: encoding the target block vector parameters of the current block and writing the resulting encoded bits into a bitstream. Encoding method according to any one of claims 1 to 93.
95. The encoding method comprises: performing subblock division on the current block to obtain at least one subblock; and determining a residual value of a second color component of the sub-block by performing the encoding method of claim 61 using the sub-block as a current block. Encoding method according to any one of claims 1 to 93.
96. A coding method applied to an encoder, comprising: determining a first co-location region corresponding to the current block; Dividing the first co-located region to obtain at least one first color component sub-block; determining at least one second color component sub-block and prediction information for the at least one second color component sub-block based on the at least one first color component sub-block; determining a predicted value of a second color component of the current block based on prediction information of the at least one second color component sub-block.
97. Determining a first co-location area corresponding to the current block includes: determining position information of the current block and size information of the current block; performing a scaling process on the position information of the current block based on a predetermined sampling format to obtain position information of an identical position area corresponding to the current block; performing a scaling process on the size information of the current block based on a predetermined sampling format to obtain size information of the same position area corresponding to the current block; determining a first coincident position area corresponding to the current block based on position information of the coincident position area corresponding to the current block and size information of the coincident position area; 97. The encoding method of claim 96.
98. Determining at least one second color component sub-block based on the at least one first color component sub-block includes: determining a horizontal sampling factor and a vertical sampling factor based on a predetermined sampling format; and adjusting position information of the first color component sub-block based on the horizontal sampling factor and the vertical sampling factor to determine the second color component sub-block.
97. The encoding method of claim 96.
99. determining the second color component sub-block by adjusting position information of the first color component sub-block based on the horizontal sampling factor and the vertical sampling factor; adjusting the horizontal coordinates of the first color component sub-block based on the horizontal sampling factor to obtain the horizontal coordinates of the second color component sub-block; adjusting the vertical coordinate of the first color component sub-block based on the vertical sampling factor to obtain the vertical coordinate of the second color component sub-block; determining the second color component sub-block based on a horizontal coordinate of the second color component sub-block and a vertical coordinate of the second color component sub-block; 99. The encoding method of claim 98.
100. Determining prediction information for the at least one second color component sub-block includes: determining prediction information for the at least one first color component sub-block; determining prediction information for the at least one second color component sub-block based on prediction information for the at least one first color component sub-block; 97. The encoding method of claim 96.
101. The encoding method comprises: determining a first block vector parameter of the first color component sub-block when the prediction information of the first color component sub-block includes BV information; adjusting first block vector parameters of the first color component sub-block to determine second block vector parameters of the second color component sub-block; determining prediction information for the second color component sub-block based on second block vector parameters of the second color component sub-block.
101. The encoding method of claim 100.
102. The encoding method comprises: When the prediction information of the first color component sub-block does not include BV information, a predetermined prediction mode is obtained, and the predetermined prediction mode is determined as the prediction information of the second color component sub-block; or determining candidate information for the second color component sub-block when the prediction information for the first color component sub-block does not include BV information; and determining the prediction information for the second color component sub-block based on the candidate information.
102. The encoding method of claim 101.
103. adjusting first block vector parameters of the first color component sub-block to determine second block vector parameters of the second color component sub-block; performing a scaling operation on the first block vector parameters of the first color component sub-block based on a predetermined sampling format to determine second block vector parameters of the second color component sub-block; 102. The encoding method of claim 101.
104. adjusting first block vector parameters of the first color component sub-block to determine second block vector parameters of the second color component sub-block; performing a scaling process on the first block vector parameters of the first color component sub-block based on a predetermined sampling format to obtain initial block vector parameters of the second color component sub-block; performing a correction process on the initial block vector parameters of the second color component sub-block to determine second block vector parameters of the second color component sub-block; 102. The encoding method of claim 101.
105. The encoding method comprises: After determining second block vector parameters of the second color component sub-block, determining whether the second block vector parameters satisfy an availability condition; determining the second block vector parameters as prediction information for the second color component sub-block if the second block vector parameters satisfy an availability condition.
102. The encoding method of claim 101.
106. Whether the second block vector parameters satisfy the availability condition is determined based on at least: the offset position indicated by the position information of the current block and the second block vector parameter does not exceed the image boundary; The offset position indicated by the position information of the current block and the second block vector parameter does not cover the current block; the offset position indicated by the position information of the current block and the second block vector parameter does not exceed a predetermined available area; the offset position indicated by the position information of the current block and the second block vector parameter has been reconstructed; 106. The encoding method of claim 105.
107. Whether the second block vector parameters satisfy the availability condition is determined based on at least: the offset position indicated by the position information of the second color component sub-block and the second block vector parameter does not exceed an image boundary; the offset position indicated by the position information of the second color component sub-block and the second block vector parameter does not cover the current block; the offset position indicated by the position information of the second color component sub-block and the second block vector parameter does not exceed a predetermined available area; the position information of the second color component sub-block and the offset position indicated by the second block vector parameter have been reconstructed; 106. The encoding method of claim 105.
108. The encoding method comprises: determining candidate information for the second color component sub-block if the second block vector parameters do not satisfy an availability condition; determining prediction information for the second color component sub-block based on the candidate information.
106. The encoding method of claim 105.
109. The encoding method comprises: After determining candidate information for the second color component sub-block, determining whether the candidate information is a block vector parameter; and if the candidate information is a block vector parameter, determining the block vector parameter as prediction information for the second color component sub-block.
109. The encoding method of claim 108.
110. The encoding method comprises: If the candidate information is not a block vector parameter, obtaining a predetermined prediction mode and determining the predetermined prediction mode as prediction information of the second color component sub-block.
110. The encoding method of claim 109.
111. Determining candidate information for the second color component sub-blocks includes: determining a first color component block of the current block; determining first block vector parameters of the first color component block if the prediction mode of the first color component block satisfies a first condition; adjusting first block vector parameters of the first color component block and determining second block vector parameters of the second color component sub-block; determining candidate information for the second color component sub-block based on the second block vector parameters; 109. The encoding method of claim 108.
112. The encoding method comprises: After determining second block vector parameters of the second color component sub-block, determining whether the second block vector parameters satisfy an availability condition; If the second block vector parameters satisfy an availability condition, determining the second block vector parameters as candidate information for the second color component sub-block.
112. The encoding method of claim 111.
113. the encoding method further includes storing candidate information for the second color component sub-block.
112. The encoding method of claim 111.
114. The encoding method further includes not performing an encoding process on the target prediction mode of the current block when the prediction mode of the first color component block does not satisfy a first condition.
112. The encoding method of claim 111.
115. determining a predicted value of a second color component of the current block based on prediction information of the at least one second color component sub-block; performing a prediction process on each of the at least one second color component sub-block based on prediction information of the at least one second color component sub-block, and determining a prediction value of the at least one second color component sub-block; determining a predicted value of a second color component of the current block based on the predicted value of the at least one second color component sub-block.
97. The encoding method of claim 96.
116. performing a prediction process on each of the at least one second-color component sub-blocks based on prediction information of the at least one second-color component sub-block, and determining a predicted value of the at least one second-color component sub-block; determining second block vector parameters for the second color component sub-block based on prediction information for the second color component sub-block; determining an offset position of the second color component sub-block based on the second block vector parameters and position information of the second color component sub-block; performing a block copy process based on the offset position of the second color component sub-block to obtain a first predicted sub-block; determining a prediction of the second color component sub-block based on the first prediction sub-block.
116. The encoding method of claim 115.
117. The encoding method comprises: performing a correction operation on the first predicted sub-block to determine a predicted value of the second color component sub-block.
117. The encoding method of claim 116.
118. The encoding method comprises: determining original values of the second color component sub-block; determining a residual value for the second color component sub-block based on the original value for the second color component sub-block and the predicted value for the second color component sub-block.
111. The encoding method of claim 110.
119. determining residual values for the second color component sub-block based on original values for the second color component sub-block and predicted values for the second color component sub-block, determining a target symmetry relationship; performing a transformation process on the original values of the second color component sub-block based on the target symmetry relationship to determine initial values of the second color component sub-block; determining a residual value for the second color component sub-block based on an initial value for the second color component sub-block and a predicted value for the second color component sub-block.
119. The encoding method of claim 118.
120. determining residual values for the second color component sub-block based on original values for the second color component sub-block and predicted values for the second color component sub-block, determining a target symmetry relationship; performing a transformation process on the predicted value of the second color component sub-block based on the target symmetry relationship to determine a predicted transformation value of the second color component sub-block; determining a residual value for the second color component sub-block based on the original value for the second color component sub-block and the predicted transformed value for the second color component sub-block.
119. The encoding method of claim 118.
120. The encoding method comprises: encoding the residual values of the second color component sub-block and writing the resulting encoded bits to a bitstream.
120. An encoding method according to claim 118 or 119.
121. A bit stream generated by performing bit coding based on coding target information, the coding target information being a bitstream including at least one of a residual value of a second color component of the current block, a residual value of a second color component sub-block, a target block vector parameter of the current block, a target symmetry relationship, and a value of first syntax element identification information.
122. 1. An encoder comprising: a first determination unit; and a first prediction unit; the first determination unit is configured to determine a first color component block of a current block; determine a target block vector parameter of the current block if a prediction mode of the first color component block satisfies a first condition; and determine a target symmetry relationship based on the target block vector parameter of the current block; The first prediction unit is configured to perform a prediction process on a second color component of the current block based on the target block vector parameters to determine a predicted value of the second color component of the current block; The encoder, wherein the first determination unit is further configured to determine a residual value of a second color component of the current block based on the predicted value of the second color component of the current block and the target symmetry relationship.
123. 1. An encoder comprising: a first determination unit; and a first prediction unit; the first determining unit is configured to determine a first co-location region corresponding to a current block; divide the first co-location region to obtain at least one first color component sub-block; and determine at least one second color component sub-block and prediction information of the at least one second color component sub-block based on the at least one first color component sub-block; The encoder, wherein the first prediction unit is configured to determine a predicted value of a second color component of the current block based on prediction information of the at least one second color component sub-block.
124. An encoder comprising: a first memory; and a first processor; the first memory is configured to store a computer program executable by the first processor; An encoder, wherein the first processor is configured to perform the method of any one of claims 61 to 120 when executing the computer program.
125. a decoder comprising a second determination unit and a second prediction unit; the second determination unit is configured to determine a first color component block of a current block; determine a target block vector parameter of the current block if a prediction mode of the first color component block satisfies a first condition; and determine a target symmetry relationship based on the target block vector parameter of the current block; The second prediction unit is configured to perform a prediction process on a second color component of the current block based on the target block vector parameters to determine a predicted value of the second color component of the current block; The decoder, wherein the second determination unit is further configured to determine a reconstructed value of a second color component of the current block based on the predicted value of the second color component of the current block and the target symmetry relationship.
126. a decoder comprising a second determination unit and a second prediction unit; the second determining unit is configured to determine a first co-location region corresponding to the current block; divide the first co-location region to obtain at least one first color component sub-block; and determine at least one second color component sub-block and prediction information of the at least one second color component sub-block based on the at least one first color component sub-block; the second prediction unit is configured to determine a predicted value of a second color component of the current block based on prediction information of the at least one second color component sub-block.
127. a decoder comprising a second memory and a second processor; the second memory is configured to store a computer program executable by the second processor; A decoder, wherein the second processor, when executing the computer program, is configured to perform the method of any one of claims 1 to 60.
128. A computer-readable storage medium having stored thereon a computer program, the computer program being configured to, when executed, implement the method of any one of claims 1 to 60 or the method of any one of claims 61 to 120.