WO2024077572A1 - 编解码方法、编码器、解码器以及存储介质 - Google Patents

编解码方法、编码器、解码器以及存储介质 Download PDF

Info

Publication number
WO2024077572A1
WO2024077572A1 PCT/CN2022/125219 CN2022125219W WO2024077572A1 WO 2024077572 A1 WO2024077572 A1 WO 2024077572A1 CN 2022125219 W CN2022125219 W CN 2022125219W WO 2024077572 A1 WO2024077572 A1 WO 2024077572A1
Authority
WO
WIPO (PCT)
Prior art keywords
bvd
candidate
current block
list
symbol
Prior art date
Application number
PCT/CN2022/125219
Other languages
English (en)
French (fr)
Inventor
郝雪
霍俊彦
马彦卓
杨付正
李明
Original Assignee
Oppo广东移动通信有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Oppo广东移动通信有限公司 filed Critical Oppo广东移动通信有限公司
Priority to PCT/CN2022/125219 priority Critical patent/WO2024077572A1/zh
Publication of WO2024077572A1 publication Critical patent/WO2024077572A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • H04N19/503Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving temporal prediction
    • H04N19/51Motion estimation or motion compensation
    • H04N19/513Processing of motion vectors
    • H04N19/517Processing of motion vectors by encoding
    • H04N19/52Processing of motion vectors by encoding by predictive encoding
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/85Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using pre-processing or post-processing specially adapted for video compression
    • H04N19/86Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using pre-processing or post-processing specially adapted for video compression involving reduction of coding artifacts, e.g. of blockiness

Definitions

  • the embodiments of the present application relate to the field of image processing technology, and in particular to a coding and decoding method, an encoder, a decoder, and a storage medium.
  • H.265/High Efficiency Video Coding HEVC
  • JVET Joint Video Exploration Team
  • VVC VVC Reference software test platform
  • Intrablockcopy is an extended tool of VVC for the coding of screen content type video sequences (Screen content coding), which significantly improves the coding efficiency of screen content sequences.
  • the transmission method of the symbol information of the block vector difference (BVD) is often more complicated, which increases the transmission bit rate to a certain extent, thereby reducing the coding performance of the IBC mode.
  • the embodiments of the present application provide a coding and decoding method, an encoder, a decoder, and a storage medium, which can effectively save the code rate required for symbol transmission of BVD in the IBC mode, thereby improving the coding efficiency.
  • an embodiment of the present application provides a decoding method, which is applied to a decoder, and the method includes:
  • Sorting candidate BVDs of the current block according to the absolute value of the BVD of the current block to determine a sorting result
  • a reconstruction value of the current block is determined according to the BVD of the current block.
  • an embodiment of the present application provides an encoding method, which is applied to an encoder, and the method includes:
  • Sorting candidate BVDs of the current block according to the absolute value of the BVD of the current block to determine a sorting result
  • the BVD absolute value and the BVD symbol index information are written into the bitstream.
  • an encoder comprising a first determining unit and an encoding unit; wherein:
  • the first determining unit is configured to sort the candidate BVDs of the current block according to the BVD absolute value of the current block to determine a sorting result; determine the BVD symbol index information of the current block according to the BVD symbol information of the current block and the sorting result;
  • the encoding unit is configured to write the BVD absolute value and the BVD symbol index information into a bit stream.
  • an embodiment of the present application provides an encoder, the encoder comprising a first memory and a first processor; wherein,
  • the first memory is used to store a computer program that can be run on the first processor
  • the first processor is used to execute the method as described in the second aspect when running the computer program.
  • an embodiment of the present application provides a decoder, the decoder comprising a decoding unit and a second determining unit; wherein:
  • the decoding unit is configured to decode the code stream
  • the second determining unit is configured to determine the BVD absolute value and BVD symbol index information of the current block
  • the candidate BVDs of the current block are sorted to determine the sorting result; according to the BVD symbol index information and the sorting result, the BVD of the current block is determined; according to the BVD of the current block, the reconstruction value of the current block is determined.
  • an embodiment of the present application provides a decoder, the decoder comprising a second memory and a second processor; wherein:
  • the second memory is used to store a computer program that can be run on the second processor
  • the second processor is used to execute the method as described in the first aspect when running the computer program.
  • an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed, the method as described in the first aspect is implemented, or the method as described in the second aspect is implemented.
  • the embodiment of the present application provides a coding and decoding method, an encoder, a decoder, and a storage medium.
  • the code stream is decoded to determine the BVD absolute value and BVD symbol index information of the current block; the candidate BVDs of the current block are sorted according to the BVD absolute value of the current block to determine the sorting result; the BVD of the current block is determined according to the BVD symbol index information and the sorting result; the reconstruction value of the current block is determined according to the BVD of the current block.
  • the candidate BVDs of the current block are sorted according to the BVD absolute value of the current block to determine the sorting result; the BVD symbol index information of the current block is determined according to the BVD symbol information and the sorting result of the current block; and the BVD absolute value and BVD symbol index information are written into the code stream.
  • the candidate BVDs of the current block can be effectively sorted according to the absolute value of the BVD of the current block, so that the sorting result can be used to determine and transmit the BVD symbol index information during encoding, and the sorting result can be used to parse the BVD symbol information of the current block during decoding.
  • the CABAC encoding and decoding technology can be used to encode and decode the BVD symbol information, which can effectively save the code rate required for the symbol transmission of the BVD in the IBC mode, thereby improving the encoding efficiency.
  • Figure 1 is a schematic diagram of the prediction of the IBC model
  • FIG2 is a schematic diagram of adjacent blocks
  • FIG3 is a block diagram of a video encoding system provided by an embodiment of the present application.
  • FIG4 is a block diagram of a video decoding system provided by an embodiment of the present application.
  • FIG5 is a schematic diagram 1 of a decoding method in an embodiment of the present application.
  • FIG6 is a schematic diagram of template types
  • FIG7 is a schematic diagram of the BVP and BVD of the current coding block
  • FIG8 is a schematic diagram of template motion compensation
  • FIG9 is a schematic diagram of a BVD combination
  • FIG10 is a second schematic diagram of a decoding method in an embodiment of the present application.
  • FIG11 is a schematic diagram of calculating cost
  • FIG12 is a schematic diagram 1 of the encoding method in an embodiment of the present application.
  • FIG13 is a second schematic diagram of the encoding method in an embodiment of the present application.
  • FIG14 is a schematic diagram of the structure of the encoder
  • FIG15 is a second schematic diagram of the structure of the encoder
  • FIG16 is a schematic diagram of the structure of a decoder
  • FIG. 17 is a second schematic diagram of the composition structure of the decoder.
  • a first image component, a second image component and a third image component are generally used to represent a coding block (Codingblock, CB); wherein the three image components are a brightness component, a blue chrominance component and a red chrominance component, respectively.
  • the brightness component is usually represented by the symbol Y
  • the blue chrominance component is usually represented by the symbol Cb or U
  • the red chrominance component is usually represented by the symbol Cr or V; thus, the video image can be represented in the YCbCr format or in the YUV format.
  • the first image component may be a brightness component
  • the second image component may be a blue chrominance component
  • the third image component may be a red chrominance component
  • the general video codec standards are based on a block-based hybrid coding framework.
  • Each frame in the video image is divided into square largest coding units (LCU) or coding tree units (CTU) of the same size (such as 128 ⁇ 128, 64 ⁇ 64, etc.), and each largest coding unit or coding tree unit can be divided into rectangular coding units (CU) according to rules; and coding units may be divided into smaller prediction units (PU), transform units (TU), etc.
  • LCU square largest coding units
  • CTU coding tree units
  • CU rectangular coding units
  • coding units may be divided into smaller prediction units (PU), transform units (TU), etc.
  • the hybrid coding framework may include modules such as prediction, transform, quantization, entropy coding, and inloop filter.
  • the prediction module may include intra prediction and inter prediction
  • inter prediction may include motion estimation and motion compensation. Since there is a strong correlation between adjacent pixels in a frame of a video image, the use of intra prediction in video coding and decoding technology can eliminate the spatial redundancy between adjacent pixels; however, since there is also a strong similarity between adjacent frames in a video image, the use of inter prediction in video coding and decoding technology can eliminate the temporal redundancy between adjacent frames, thereby improving coding and decoding efficiency.
  • the basic process of video codec is as follows: at the encoding end, a frame of image is divided into blocks, intra-frame prediction or inter-frame prediction is used for the current block to generate the prediction block of the current block, the original block of the current block minus the prediction block to obtain the residual block, the residual block is transformed and quantized to obtain the quantization coefficient matrix, and the quantization coefficient matrix is entropy encoded and output to the bitstream.
  • intra-frame prediction or inter-frame prediction is used for the current block to generate the prediction block of the current block, and on the other hand, the bitstream is decoded to obtain the quantization coefficient matrix, the quantization coefficient matrix is inversely quantized and inversely transformed to obtain the residual block, and the prediction block and the residual block are added to obtain the reconstructed block.
  • the reconstructed blocks constitute the reconstructed image, and the reconstructed image is loop-filtered based on the image or block to obtain the decoded image.
  • the encoding end also needs to perform similar operations as the decoding end to obtain the decoded image.
  • the decoded image can be used as a reference frame for inter-frame prediction for subsequent frames.
  • the decoding end determines the same block division information as the encoding end by decoding and analyzing the existing information, and the mode information or parameter information such as prediction, transformation, quantization, entropy coding, loop filtering, etc., so as to ensure that the decoded image obtained by the encoding end is the same as the decoded image obtained by the decoding end.
  • the decoded image obtained by the encoding end is also usually called a reconstructed image.
  • the current block can be divided into prediction units during prediction, and the current block can be divided into transformation units during transformation.
  • the division of prediction units and transformation units can be different.
  • the above is the basic process of the video codec under the block-based hybrid coding framework. With the development of technology, some modules or steps of the framework or process may be optimized.
  • the embodiment of the present application is applicable to the basic process of the video codec under the block-based hybrid coding framework, but is not limited to the framework and process.
  • the current block (CB) may be a current coding unit (CU) or a current prediction unit (PU), etc.
  • Intrablockcopy is an extended tool of VVC for the coding of video sequences of screen content type (Screen content coding), which significantly improves the coding efficiency of screen content sequences.
  • IBC is a block-level coding mode. Similar to inter-frame technology, the encoder performs motion search, namely block matching (BM), to find the best block vector (BV), also known as motion vector (MV), for each CU.
  • BV block matching
  • MV motion vector
  • the block vector is a vector pointing from the current block to the reference block.
  • the difference from inter-frame technology is that the best block vector of IBC is obtained by searching in the reconstructed area of the frame where the current CU is located (i.e., the current coded frame), while the inter-frame motion vector is obtained by searching the adjacent reference frames of the current coded frame in the time domain.
  • Figure 1 is a prediction diagram of the IBC mode.
  • the specific process of obtaining the reconstructed pixels of the current coding block in the IBC mode in H.266/VVC may include deriving BV, deriving prediction samples using BV, deriving residual samples, and deriving reconstructed samples using the prediction samples and the residual samples.
  • Input luma position (xCb, yCb), which specifies the top left corner sample of the current coding block relative to the top left corner luma sample of the current picture, a variable cbWidth, which specifies the width of the current coding block in luma samples, and a variable cbHeight, which specifies the height of the current coding block in luma samples.
  • the IBC mode is divided into IBCMERGE and IBCAMVP.
  • IBCMERGE When deriving bvL, it is necessary to establish an IBC block vector candidate list bvCandList.
  • the following introduces the list establishment process of IBCMERGE.
  • the list establishment process of IBCAMVP is consistent with IBCMERGE, but the maximum number of candidates of the two is inconsistent.
  • Step 1 When IsGt4by4 is equal to TRUE (the variable IsGt4by4 is the brightness width multiplied by the height, and is TRUE when IsGt4by4 is greater than 16), the derivation process of the spatial block vector candidate from the adjacent coding unit specified in the decoding specification is called using the brightness coding block position (xCb, yCb), the brightness coding block width cbWidth and the height cbHeight as input, and the output is the availability flags availableFlagA1, availableFlagB1 and the block vectors bvA1 and bvB1.
  • A1 and B1 are adjacent blocks.
  • Figure 2 is a schematic diagram of adjacent blocks. As shown in Figure 2, the relative positions of the adjacent blocks where A1 and B1 are located and the current coding block are the lower left corner and the upper right corner, respectively.
  • Step 2 When IsGt4by4 is equal to TRUE, the block vector candidate list bvCandList is constructed as follows:
  • Step 3 The variable numCurrCand represents the number of candidates currently obtained.
  • the derivation process of numCurrCand is as follows:
  • numCurrCand is set equal to the number of candidates in bvCandList; otherwise numCurrCand is set to 0.
  • Step 4 When numCurrCand is less than MaxNumIbcMergeCand (the maximum number of candidates in MERGE mode) and NumHmvpIbcCand (the maximum number of candidates representing the historical optimal block vector (Hmvp) in IBC mode) is greater than 0, the derivation process of the historical IBC block vector candidate specified in the decoding specification is called with bvCandList and numCurrCand as input and the modified bvCandList and numCurrCand as output.
  • MaxNumIbcMergeCand the maximum number of candidates in MERGE mode
  • NumHmvpIbcCand the maximum number of candidates representing the historical optimal block vector (Hmvp) in IBC mode
  • bvCandList[numCurrCand][0] (ie, the horizontal component of bv) is set equal to 0.
  • bvCandList[numCurrCand][1] ie, the vertical component of bv is set equal to 0.
  • the block vector candidate list bvCandList is established, and general_merge_flag is used to indicate whether it is IBCMERGE mode.
  • the candidate index bvIdx is derived as follows:
  • bvIdx general_merge_flag[xCb][yCb]? merge_idx[xCb][yCb]:mvp_l0_flag[xCb][yCb]
  • the specific bvL can be obtained according to the index bvIdx and the block vector candidate list bvCandList:
  • the specific bvL can be obtained by indexing bvIdx and the block vector candidate list bvCandList as the predicted bvL.
  • the real bvL also needs to add the block vector difference (Block Vector Difference, BVD).
  • BVD Block Vector Difference
  • Step 1 Get the horizontal and vertical components of BVD, where MvdL0 is the forward motion vector difference.
  • Step 2 Perform a rounding operation on the prediction bvL obtained above, wherein the right shift parameter AmvrShift is used for rounding and the left shift parameter AmvrShift is used to improve the resolution.
  • Chroma If dual-tree partitioning is used, IBC is not performed for chroma. If single-tree partitioning is used, BV for chroma needs to be derived.
  • Input luma position (xCb, yCb), which specifies the top-left sample of the current coded block relative to the top-left luma sample of the current picture, a variable cbWidth, which specifies the width of the current coded block in luma samples, a variable cbHeight, which specifies the height of the current coded block in luma samples, a block vector bv, and a variable cIdx, which specifies the color component index of the current block.
  • Output array predSamples of predicted samples.
  • IbcBufWidthY is the width of the brightness pixels of the reconstructed buffer stored in IBC
  • CtbSizeY is the size of CTU (Coding Tree Unit)
  • ibcVirBuf is the reconstructed pixels stored in IBC.
  • SubWidthC and SubHeightC depend on the chroma format sampling structure specified by sps_chroma_format_idc. The specific correspondence is shown in the following table:
  • the decoding process of the residual signal of the coding block in the inter-frame prediction mode specified in the decoding specification can be called.
  • the image reconstruction process of the specified color component specified in the decoding specification can be called.
  • basic block vector prediction (Block Vector Predition, BVP) can be used for motion estimation to search for the best block motion vector, and the difference between the searched best block motion vector and the basic block vector is the block vector difference BVD.
  • BVD The encoding process of BVD is as follows: for the horizontal component and the vertical component of BVD, the flag of whether BVD is zero is encoded respectively; if it is not zero, its absolute value is encoded, and then the BVD symbol is bypassed; otherwise, no bit is encoded.
  • the decoding method of BVD in VVC is the same as the decoding method of MVD between frames.
  • the specific decoding process of MVD is:
  • mvd_sign_flag[compIdx] represents the sign of the motion vector difference of a certain (horizontal or vertical) component compIdx: if mvd_sign_flag[compIdx] is equal to 0, the corresponding motion vector component difference has a positive value; otherwise (mvd_sign_flag[compIdx] is equal to 1), the corresponding motion vector component difference is a negative value; when mvd_sign_flag[compIdx] does not exist, it is inferred to be equal to 0.
  • the value of lMvd[compIdx] should be in the range of -217 to 217-1:
  • bvd_sign_flag[compIdx] represents the sign of the motion vector difference of a certain (horizontal or vertical) component compIdx: if bvd_sign_flag[compIdx] is equal to 0, the corresponding motion vector component difference has a positive value; otherwise (bvd_sign_flag[compIdx] is equal to 1), the corresponding motion vector component difference is a negative value; when bvd_sign_flag[compIdx] does not exist, it is inferred to be equal to 0.
  • bypass coding is currently used for the BVD symbols in the IBC mode.
  • Bypass coding is an equal-probability coding method that does not require adaptive update of the probability. Instead, it uses a fixed probability of 0 and 1, each accounting for 1/2, for coding.
  • the coding method is simple and cannot be adaptively updated according to video information and historical coding information.
  • One BVD symbol information corresponds to one bit of the code stream, and there is a large bit rate redundancy.
  • the video encoding system 10 includes a transform and quantization unit 101, an intra-frame estimation unit 102, an intra-frame prediction unit 103, a motion compensation unit 104, a motion estimation unit 105, an inverse transform and inverse quantization unit 106, a filter control analysis unit 107, a filtering unit 108, an encoding unit 109 and a decoded image cache unit 110, etc.
  • the filtering unit 108 can implement deblocking filtering and sample adaptive offset (Sample Adaptive Offset, SAO) filtering
  • the encoding unit 109 can implement header information encoding and context-based adaptive binary arithmetic coding (Context-based Adaptive binary Arithmatic coding, CABAC).
  • a video coding block can be obtained by dividing the coding tree block (CTU), and then the residual pixel information obtained after intra-frame or inter-frame prediction is transformed by the transformation and quantization unit 101 to transform the video coding block, including transforming the residual information from the pixel domain to the transform domain, and quantizing the obtained transform coefficients to further reduce the bit rate;
  • the intra-frame estimation unit 102 and the intra-frame prediction unit 103 are used to perform intra-frame prediction on the video coding block; specifically, the intra-frame estimation unit 102 and the intra-frame prediction unit 103 are used to determine the intra-frame prediction mode to be used to encode the video coding block;
  • the motion compensation unit 104 and the motion estimation unit 105 are used to perform inter-frame prediction coding of the received video coding block relative to one or more blocks in one or more reference frames to provide temporal prediction information;
  • the motion estimation performed by the motion estimation unit 105 is a process of generating a motion vector, and the motion vector can estimate the motion of the video coding block, and then
  • the motion vector determined by the motion estimation unit 105 performs motion compensation; after determining the intra-frame prediction mode, the intra-frame prediction unit 103 is also used to provide the selected intra-frame prediction data to the encoding unit 109, and the motion estimation unit 105 also sends the calculated and determined motion vector data to the encoding unit 109; in addition, the inverse transform and inverse quantization unit 106 is used to reconstruct the video coding block, reconstruct the residual block in the pixel domain, and the reconstructed residual block is removed by the filter control analysis unit 107 and the filtering unit 108.
  • the encoding unit 109 is used to encode various coding parameters and quantized transform coefficients.
  • the context content can be based on adjacent coding blocks and can be used to encode information indicating the determined intra-frame prediction mode and output the code stream of the video signal; and the decoded image buffer unit 110 is used to store the reconstructed video coding block for prediction reference. As the video image encoding proceeds, new reconstructed video encoding blocks are continuously generated, and these reconstructed video encoding blocks are stored in the decoded image buffer unit 110 .
  • the video decoding system 20 includes a decoding unit 201, an inverse transform and inverse quantization unit 202, an intra-frame prediction unit 203, a motion compensation unit 204, a filtering unit 205, and a decoded image cache unit 206, etc., wherein the decoding unit 201 can implement header information decoding and CABAC decoding, and the filtering unit 205 can implement deblocking filtering and SAO filtering.
  • the decoding unit 201 can implement header information decoding and CABAC decoding
  • the filtering unit 205 can implement deblocking filtering and SAO filtering.
  • a bit stream of the video signal is output; the bit stream is input into the video decoding system 20, and first passes through the decoding unit 201 to obtain the decoded transform coefficients; the transform coefficients are processed by the inverse transform and inverse quantization unit 202 to generate residual blocks in the pixel domain; the intra-frame prediction unit 203 can be used to generate prediction data of the current video decoding block based on the determined intra-frame prediction mode and the data of the previously decoded blocks from the current frame or picture; the motion compensation unit 204 is to determine the prediction information for the video decoding block by analyzing the motion vector and other associated syntax elements, and use The prediction information is used to generate a predictive block of the video decoding block being decoded; a decoded video block is formed by summing the residual block from the inverse transform and inverse quantization unit 202 and the corresponding predictive block generated by the intra-frame prediction unit 203 or the motion compensation unit 204; the decoded video signal passes through the filtering unit 205 to remove the block effect artifacts,
  • the encoding method in the embodiment of the present application can be applied to the intra-frame prediction unit 103 shown in Figure 3 and the encoding unit 109 part that can implement the CABAC encoding algorithm.
  • the decoding method in the embodiment of the present application can also be applied to the intra-frame prediction unit 203 shown in Figure 4 and the decoding unit 201 that can implement the CABAC decoding algorithm.
  • the encoding and decoding method in the embodiment of the present application can be applied to both the video encoding system and the video decoding system, and can even be applied to both the video encoding system and the video decoding system at the same time, but the embodiment of the present application is not specifically limited.
  • the "current block” specifically refers to the current encoding block in the intra-frame prediction; when the encoding and decoding method is applied to the video decoding system, the "current block” specifically refers to the current decoding block in the intra-frame prediction.
  • FIG5 is a schematic diagram 1 of the decoding method in the embodiment of the present application.
  • the method for the decoder to perform decoding processing may include the following steps:
  • Step 101 Decode the code stream to determine the BVD absolute value and BVD symbol index information of the current block.
  • the decoder can determine the BVD absolute value and BVD symbol index information of the current block by decoding the bit stream.
  • the decoder can directly parse the bitstream to obtain the real absolute value of the BVD of the current block, that is, the decoder decodes the bitstream to determine the absolute value of the BVD of the current block.
  • the decoder decodes the bitstream and can also determine the BVD symbol index information of the current block, that is, parse and obtain the symbol prediction index of the current block.
  • the BVD absolute value includes the first component absolute value absBvdX and the second component absolute value absBvdY; that is, the BVD absolute value includes the horizontal component absolute value and the vertical component absolute value.
  • the BVD of the current block may include the first component candBvdX and the second component candBvdY, and at the same time, the candidate BVD of the current block also includes the first component candBvdX and the second component candBvdY, that is, the BVD may include the horizontal component and the vertical component.
  • absBvdX and absBvdY are both not 0, then it can be determined that the number of bits of the BVD symbol index information is 2; if absBvdX or absBvdY is 0, then it can be determined that the number of bits of the BVD symbol index information is 1.
  • variable-length encoding method may also be used to encode the BVD symbol index information.
  • the BVD symbol index information may be encoded using a truncated unary code, or a truncated binary code may be used for binarization, in which case the number of bits of the BVD symbol index information may not necessarily be 2.
  • the BVD symbol index information can be an index value in the candidate BVD list
  • the number of bits of the symbol index information corresponding to different candidate BVDs is not exactly the same, which is a variable-length code.
  • the number of bits of the binary number of the BVD symbol index information can be determined according to the absolute value of the BVD parsed during the decoding process. Among them, if the absolute values of the horizontal component and the vertical component of the BVD are not 0, the number of bits of the binary number of the BVD symbol index information is 2; if the horizontal component of the BVD is 0 and the absolute value of the vertical component is not 0, the number of bits of the binary number of the BVD symbol index information is 1; if the horizontal component of the BVD is not 0 and the absolute value of the vertical component is 0, the number of bits of the binary number of the BVD symbol index information is 1.
  • the decoder can use CABAC (context adaptive binary arithmetic coding) or bypass the corresponding decoding process to parse the binary number corresponding to the BVD symbol index information from the bitstream.
  • CABAC context adaptive binary arithmetic coding
  • a single probability model or multiple probability models may be used, which may include but not be limited to different probability models distinguished according to the absolute value of the horizontal component or vertical component of BVD, the sum or difference of the horizontal component and vertical component of BVD, etc.
  • the absolute value of the horizontal component or the vertical component of the BVD is used to classify the bits of the BVD symbol index information of the BVD using different probability models:
  • a threshold for the absolute value classification of the horizontal or vertical component of BVD is set to THR0, and there are two probability models
  • the 0th bit of this binary number is distinguished according to the size relationship between the absolute value of the horizontal component of BVD and THR0, that is, when the absolute value of the horizontal component of BVD is less than or equal to THR0, the first probability model is used, and when the absolute value of the horizontal component of BVD is greater than THR0, the second probability model is used;
  • the 1st bit of the above binary number is distinguished according to the size relationship between the absolute value of the vertical component of BVD and THR0, that is, when the absolute value of the vertical component of BVD is less than or equal to THR0, the first probability model is used, and when the absolute value of the vertical component of BVD is greater than THR0, the second probability model is used.
  • the absolute value of the BVD can be used to determine a combination list of BVDs, wherein the combination list of BVDs includes any number of candidate BVDs of the current block. That is, the absolute value of the BVD can be used to determine the candidate BVD of the current block, which can also be understood as using the absolute value of the BVD to determine the initial set of candidate BVDs of the current block.
  • a combination list of BVDs may be created between the possible symbols of BVDs and the absolute values of BVDs, which may include the cases where only horizontal BVDs exist, only vertical BVDs exist, and both exist.
  • BVDs when creating a combination list of BVDs (candidate BVDs), it mainly includes arranging and combining possible symbols of BVD, and multiplying possible horizontal symbols and vertical symbols by the horizontal absolute value component and vertical absolute value component of BVD respectively.
  • the candidate BVD can be determined according to absBvdY.
  • BVD is divided into horizontal and vertical components.
  • horizontal component is zero
  • vertical component is encoded, so only the combination list of the vertical component symbols is constructed, specifically the following two cases:
  • the first case the horizontal components are all positive, which is just a placeholder.
  • the vertical component is first positive and then negative.
  • a symbol list is constructed, and then the constructed symbol list is multiplied by the absolute values of the horizontal and vertical components of BVD to obtain the combined list of BVD.
  • the second case the horizontal components are all positive, which is just a placeholder.
  • the vertical components are first negative and then positive.
  • a symbol list is constructed, and then the constructed symbol list is multiplied by the absolute values of the horizontal and vertical components of BVD to obtain the combined list of BVD.
  • the candidate BVD may be determined according to absBvdX.
  • BVD is divided into horizontal and vertical components.
  • the vertical component is zero, only the horizontal component is encoded, so only the combination list of the symbols of the horizontal component is constructed, specifically the following two cases:
  • the first case the vertical components are all positive, which is just a placeholder.
  • the horizontal components are first positive and then negative.
  • a sign list is constructed, and then the constructed sign list is multiplied by the absolute values of the vertical and horizontal components of BVD to obtain the combined list of BVD.
  • the second case the vertical components are all positive, which is just a placeholder.
  • the horizontal components are first negative and then positive.
  • a sign list is constructed, and then the constructed sign list is multiplied by the absolute values of the vertical and horizontal components of BVD to obtain the combined list of BVD.
  • the candidate BVD can be determined according to absBvdX and absBvdY.
  • BVD is divided into horizontal and vertical components. When both components are not zero, both need to be encoded, so the BVD list is constructed for the horizontal and vertical components together.
  • the 0th bit in the list means that both the horizontal and vertical components are positive
  • the 1st bit in the list means that the horizontal component is positive and the vertical component is negative
  • the 2nd bit in the list means that the horizontal component is negative and the vertical component is positive
  • the 3rd bit in the list means that both the horizontal and vertical components are negative.
  • a sign list is constructed, and then the constructed sign list is multiplied by the absolute values of the vertical and horizontal components of BVD to obtain a combination list of BVD.
  • Step 102 sort the candidate BVDs of the current block according to the absolute value of the BVD of the current block to determine the sorting result.
  • the candidate BVDs of the current block may be further sorted according to the BVD absolute value of the current block to determine a sorting result.
  • the first-generation values corresponding to one or more candidate BVDs of the current block can be first determined according to the absolute value of the BVD; then the candidate BVDs can be sorted according to the first-generation value to determine the sorting result.
  • one or more candidate BVDs may include a BVD in which candBvdX is set equal to -absBvdX or absBvdX, and candBvdY is set equal to -absBvdY or absBvdY.
  • the first matching template when determining the first generation value corresponding to one or more candidate BVDs of the current block based on the absolute value of the BVD of the current block, can be first determined based on the candidate BVD; then, based on a preset error criterion, the matching error between the first template of the current block and the first matching template is calculated to determine the first generation value corresponding to the candidate BVD.
  • the cost function for calculating the cost of the template area that is, there are multiple choices for the preset error criterion.
  • SAD sum of absolute error
  • SATD sum of transformed absolute error
  • SSE sum of squared differences
  • MAD mean absolute difference
  • MAE mean absolute error
  • MSE mean squared error
  • RDO rate distortion function
  • predTempSizeW is the width of the template
  • predTempSizeH is the height of the template
  • predTemp[i][j] is the pixel point of the template at BV
  • recTempC[i][j] is the pixel point of the current block template.
  • the preset error criterion may include any one of the sum of absolute error SAD, the sum of transformed absolute error SATD, the sum of squared differences SSE, the mean absolute difference MAD, the mean absolute error MAE, the mean squared error MSE, and the rate-distortion function RDO.
  • the first template includes one or more sample values in the adjacent decoded area of the current block.
  • FIG6 is a schematic diagram of the template type.
  • the template can be classified into template types such as upper template, left template, upper right template, lower left template, and upper left template, based on the relative position relationship between the template and the current block.
  • the template sizes of different types of different coding blocks can be fixed the same or different.
  • the template size selects the same template size for any current coding block (current block).
  • the following formula illustrates a setting condition for the template size, where nTbW and nTbH are the width and height of the current brightness coding block (current block), and iTempW and iTempH are the width and height of the adopted template:
  • nTbW and nTbH are the width and height of the current luminance coding block, respectively
  • iTempW and iTempH are the width and height of the adopted template, respectively:
  • different template sizes can also be selected according to the number of pixels in the current brightness coding block.
  • the following formula illustrates a template size setting condition:
  • nTbW and nTbH are the width and height of the current luminance coding block
  • nTbW ⁇ nTbH are the number of pixels of the current luminance coding block
  • iTempW and iTempH are the width and height of the template used:
  • the block vector prediction value BVP of the current block when determining the first matching template based on the candidate BVD, can be determined first; then the candidate BV of the current block is determined based on the BVP and the candidate BVD; wherein the candidate BV is used to indicate the position of the first matching template; then, the first matching template can be determined based on the candidate BV.
  • the two-dimensional vector of the candidate BV can be selected to be set to (currBvpX+candBvdX, currBvpY+candBvdY), that is, the two-dimensional vector of BV is determined based on the first component candBvdX, the second component candBvdY of the candidate BVD, and the third component currBvpX, the fourth component currBvpY of BVP.
  • the first matching template when determining the first matching template according to the candidate BV, may be determined according to the position of the current point and the two-dimensional vector of the candidate BV.
  • the position of the current point can be selected as the starting point, and the area indicated by the two-dimensional vector of the candidate BV, which has the same shape and contains the same number of samples as the first template, can be determined as the first matching template.
  • FIG. 7 is a schematic diagram of the BVP and BVD of the current coding block
  • Figure 8 is a schematic diagram of template motion compensation.
  • the current block is used to determine whether the BV is available (the available condition is that the reference block pointed to by the BV has been reconstructed and does not exceed the search range set by the IBC and the image boundary and other conditions). If the current BV is available, then the template of the current block and the new BV will be used for motion compensation to obtain the template at the corresponding BV.
  • Figure 9 is a schematic diagram of the BVD combination. As shown in Figure 9, the horizontal and vertical components of the BVD generate a total of 4 combinations of BVDs, which are used for motion compensation at the templates. There are several situations in which the template is used when calculating the cost:
  • the first type the upper template and the left template of the current block both exist, and the upper template and the left template at the corresponding BV both exist. In this case, both the upper template and the left template are available.
  • the second method both the upper template and the left template of the current block exist, and only the upper template exists at the corresponding BV.
  • Method 2 If the left template at the corresponding BV does not exist, the leftmost template width column in the reference block is used instead of the left template, that is, the upper template and the left template are used for calculation.
  • the third type the upper template and the left template of the current block both exist, and only the left template exists at the corresponding BV.
  • Method 1 the upper template at the corresponding BV does not exist, so it is not used directly, that is, only the left template is used for calculation.
  • Method 2 the upper template at the corresponding BV does not exist, and the uppermost template height row inside the reference block is used to replace the upper template, that is, the upper template and the left template are used for calculation.
  • the fourth type only the upper template exists in the current block. There are three methods: Method 1: The upper template at the corresponding BV does not exist, so it is not used directly. Method 2: The upper template at the corresponding BV does not exist, and the uppermost template height row inside the reference block is used to replace the upper template. Method 3: The upper template at the corresponding BV exists, so it is used directly.
  • the fifth type only the left template exists in the current block. There are three methods: Method 1: the left template at the corresponding BV does not exist, so it is not used directly. Method 2: the left template at the corresponding BV does not exist, and the leftmost template width column in the reference block is used to replace the left template. Method 3: the left template at the corresponding BV exists, so it is used directly.
  • the sixth type the upper template and the left template of the current block do not exist, and the BVD combination of this case is ignored.
  • the cost in this case is set to the maximum value of the cost evaluation criterion.
  • the template is processed at this time, including but not limited to the following method: weighted fusion of the two, calculated as follows:
  • the standard of weighted fusion can select a fixed weighting coefficient or allocate a weighting coefficient according to the sum of the absolute values of the differences between the pixel values of the reconstructed brightness and the predicted brightness of each template.
  • the formula for calculating the weighting coefficient of the latter is as follows, where SAD A is the average absolute difference of the upper template and SAD L is the average absolute difference of the left template:
  • template prediction can be performed based on a combination list of BVP and BVD of the current block (candidate BVD), and the cost (first generation value) of each BVD combination (candidate BVD) in the BVD combination list can be calculated, that is, the cost of the template area can be calculated, and the cost of various combinations in the BVD combination list can be calculated using a template, specifically, the cost of the reconstructed brightness pixels at the position obtained by template prediction using the reconstructed brightness pixels at the current block template position and the BV obtained by the combination of the BVP and BVD of the current block.
  • the candidate BVDs can be sorted using the first generation value, thereby obtaining a sorting result.
  • the sorting result can be a sorted candidate BVD list of the current block, or a candidate BVD set that determines the candidate BVD with the smallest first generation value through sorting.
  • the sorting process can be to sort the candidate BVDs according to the first generation value to determine the candidate BVD list of the current block, wherein the candidate BVD list includes at least one candidate BVD.
  • the sorting result may be a new list OrderedList (candidate BVD list of the current block) arranged in ascending (descending) order.
  • a sorting method such as bubble sort, selection sort, insertion sort, shell sort, merge sort, quick sort, radix sort, heap sort, counting sort, bucket sort, etc. may be used.
  • the sorting result may also be a new list OrderedList (candidate BVD list of the current block) in a specific order.
  • the candidate BVDs when the candidate BVDs are sorted according to the first generation value to determine the candidate BVD list of the current block, if absBvdX and absBvdY are not equal to 0, the candidate BVDs are stored in the first array and the second array, respectively; then, based on the first generation value, the first candidate BVD and the second candidate BVD in the first array, and the third candidate BVD and the fourth candidate BVD in the second array are determined; finally, the first candidate BVD, the second candidate BVD, the third candidate BVD, and the fourth candidate BVD can be sorted based on the first generation value to determine the candidate BVD list.
  • both the horizontal component and the vertical component of BVD exist that is, both absBvdX and absBvdY are not equal to 0
  • the combination list (candidate BVD) is ⁇ (+BVD HOR , +BVD VER ), (+BVD HOR , -BVD VER ), (-BVD HOR , -BVD VER ), (-BVD HOR , +BVD VER ) ⁇
  • its corresponding cost list is ⁇ Cost(+BVD HOR , +BVD VER ), Cost(+BVD HOR , -BVD VER ), Cost(-BVD HOR , -BVD VER ), Cost(-BVD HOR , +BVD VER ) ⁇ .
  • the order of the members in the above two lists can be arranged arbitrarily.
  • posiGrp stores two BVD combinations with positive signs on the same component (level)
  • negaGrp stores two BVD combinations with negative signs on the same component (level).
  • posiGrp ⁇ (+BVD HOR , +BVD VER ), (+BVD HOR , -BVD VER ) ⁇
  • negaGrp ⁇ (-BVD HOR , +BVD VER ), (-BVD HOR , -BVD VER ) ⁇ .
  • the order of the members in the two lists posiGrp and negaGrp can be arranged arbitrarily.
  • Second comparison Compare Cost(-BVD HOR , +BVD VER ) and Cost(-BVD HOR , -BVD VER ), set negaGrp[0] to the smaller BVD combination of the two, and set negaGrp[1] to the larger BVD combination of the two;
  • the third comparison compare the Cost corresponding to posiGrp[0] and negaGrp[0].
  • an available method is as follows: if the first generation value of the first candidate BVD is less than or equal to the first generation value of the third candidate BVD, the first candidate BVD is set as the first candidate BVD in the candidate BVD list, the third candidate BVD is set as the second candidate BVD in the candidate BVD list, the second candidate BVD is set as the third candidate BVD in the candidate BVD list, and the fourth candidate BVD is set as the fourth candidate BVD in the candidate BVD list.
  • the third candidate BVD is set as the first candidate BVD in the candidate BVD list
  • the first candidate BVD is set as the second candidate BVD in the candidate BVD list
  • the fourth candidate BVD is set as the third candidate BVD in the candidate BVD list
  • the second candidate BVD is set as the fourth candidate BVD in the candidate BVD list.
  • the final sorting process can be: if in the third comparison, the Cost corresponding to posiGrp[0] is less than or equal to the Cost corresponding to negaGrp[0], posiGrp[0] is sorted at the 0th position in the candidate BVD list OrderedList, negaGrp[0] is sorted at the 1st position in the candidate BVD list OrderedList, posiGrp[1] is sorted at the 2nd position in the candidate BVD list OrderedList, and negaGrp[1] is sorted at the 3rd position in the candidate BVD list OrderedList.
  • the Cost corresponding to posiGrp[0] is greater than the Cost corresponding to negaGrp[0], sort negaGrp[0] at the 0th position in the candidate BVD list OrderedList, sort posiGrp[0] at the 1st position in the candidate BVD list OrderedList, sort negaGrp[1] at the 2nd position in the candidate BVD list OrderedList, and sort posiGrp[1] at the 3rd position in the candidate BVD list OrderedList.
  • the candidate BVD at position 0 in the candidate BVD list of the current block is the first candidate BVD in the candidate BVD list
  • the candidate BVD at position 1 is the second candidate BVD in the candidate BVD list
  • the candidate BVD at position 2 is the third candidate BVD in the candidate BVD list
  • the candidate BVD at position 3 is the fourth candidate BVD in the candidate BVD list.
  • the first candidate BVD, the second candidate BVD, the third candidate BVD, and the fourth candidate BVD are sorted based on the first generation value to determine the candidate BVD list
  • another available method is as follows: if the first generation value of the first candidate BVD is less than or equal to the first generation value of the third candidate BVD, the first candidate BVD is set as the first candidate BVD in the candidate BVD list, the second candidate BVD is set as the second candidate BVD in the candidate BVD list, the third candidate BVD is set as the third candidate BVD in the candidate BVD list, and the fourth candidate BVD is set as the fourth candidate BVD in the candidate BVD list.
  • the third candidate BVD is set as the first candidate BVD in the candidate BVD list
  • the fourth candidate BVD is set as the second candidate BVD in the candidate BVD list
  • the first candidate BVD is set as the third candidate BVD in the candidate BVD list
  • the second candidate BVD is set as the fourth candidate BVD in the candidate BVD list.
  • the final sorting process can be: if in the third comparison, the Cost corresponding to posiGrp[0] is less than or equal to the Cost corresponding to negaGrp[0], posiGrp[0] is sorted at the 0th position in the candidate BVD list OrderedList, negaGrp[0] is sorted at the 2nd position in the candidate BVD list OrderedList, posiGrp[1] is sorted at the 1st position in the candidate BVD list OrderedList, and negaGrp[1] is sorted at the 3rd position in the candidate BVD list OrderedList.
  • the Cost corresponding to posiGrp[0] is greater than the Cost corresponding to negaGrp[0], sort negaGrp[0] at the 0th position in the candidate BVD list OrderedList, sort posiGrp[0] at the 2nd position in the candidate BVD list OrderedList, sort negaGrp[1] at the 1st position in the candidate BVD list OrderedList, and sort posiGrp[1] at the 3rd position in the candidate BVD list OrderedList.
  • the candidate BVDs are sorted according to the first generation value to determine the candidate BVD list of the current block, if absBvdX is equal to 0 or absBvdY is equal to 0, the candidate BVD with the smallest first generation value among the candidate BVDs is set as the first candidate BVD in the candidate BVD list, and another candidate BVD among the candidate BVDs is set as the second candidate BVD in the candidate BVD list.
  • the two candidate BVDs can be directly sorted according to the size of the first generation value to generate a candidate BVD list.
  • the combination list is ⁇ (0, +BVD VER ), (0, -BVD VER ) ⁇
  • the corresponding cost list is ⁇ Cost(0, +BVD VER ), Cost(0, -BVD VER ) ⁇ .
  • the sorting process is: compare the size of Cost (0, +BVD VER ) and Cost (0, -BVD VER ):
  • the combination list is ⁇ (+BVD HOR , 0), (-BVD HOR , 0) ⁇
  • the corresponding cost list is ⁇ Cost(+BVD HOR , 0), Cost(-BVD HOR , 0) ⁇ .
  • the sorting process is: compare the size of Cost (+BVD HOR , 0) and Cost (-BVD HOR , 0):
  • (+BVD HOR , 0) is sorted at the 0th position of the candidate BVD list OrderedList, and (-BVD HOR , 0) is sorted at the 1st position of the candidate BVD list OrderedList;
  • (-BVD HOR , 0) is sorted at the 0th position of the candidate BVD list OrderedList, and (+BVD HOR , 0) is sorted at the 1st position of the candidate BVD list OrderedList.
  • the sorting process can be to sort the candidate BVDs according to the first generation value to determine the candidate BVD set of the current block, wherein the candidate BVD set includes at least one candidate BVD.
  • the candidate BVDs are sorted according to the first-generation values to determine the candidate BVD set of the current block, if absBvdX and absBvdY are not equal to 0, the candidate BVDs are stored in the first array and the second array respectively; then the fifth candidate BVD with the smallest first-generation value in the first array and the sixth candidate BVD with the smallest first-generation value in the second array are determined; finally, the candidate BVD with the smallest first-generation value among the fifth candidate BVD and the sixth candidate BVD can be determined as the BVD with the smallest cost in the candidate BVD set.
  • posiGrp stores the sign combination of two BVDs with positive signs on the same component (level)
  • negaGrp stores the sign combination of two BVDs with negative signs on the same component (level).
  • posiGrp ⁇ (+, +), (+, -) ⁇
  • negaGrp ⁇ (-, +), (-, -) ⁇ .
  • the order of the members in the two lists posiGrp and negaGrp can be arranged arbitrarily.
  • First comparison compare Cost(+, +) and Cost(+, -), set posiGrp[0] to the smaller BVD sign combination of the two, and set posiGrp[1] to the larger BVD sign combination of the two;
  • Second comparison Compare Cost(-, +) and Cost(-, -), set negaGrp[0] to the smaller BVD sign combination of the two, and set negaGrp[1] to the larger BVD sign combination of the two;
  • the third comparison compare the Cost corresponding to posiGrp[0] and negaGrp[0].
  • a symbol combination of a BVD with the minimum cost can be determined, that is, the BVD with the minimum cost in the candidate BVD set can be determined.
  • the two candidate BVDs can be directly sorted according to the size of the first generation value to determine the BVD with the minimum cost in the candidate BVD set.
  • the candidate BVDs when the candidate BVDs are sorted according to the first-generation value to determine the candidate BVD set of the current block, if absBvdX is equal to 0 or absBvdY is equal to 0, then the candidate BVD with the smallest first-generation value among the candidate BVDs can be determined as the BVD with the smallest cost in the candidate BVD set.
  • the combination list is ⁇ (+, +), (+, -) ⁇
  • the corresponding cost list is ⁇ Cost(+, +), Cost(+, -) ⁇ .
  • the order of the members in the above two lists can be arranged arbitrarily.
  • the comparison process is: compare the size of Cost(+, +) and Cost(+, -), and then determine the sign combination of a BVD with the smallest Cost, that is, determine the BVD with the smallest cost in the candidate BVD set.
  • the combination list is ⁇ (+, +), (-, +) ⁇
  • the corresponding cost list is ⁇ Cost(+, +), Cost(-, +) ⁇ .
  • the order of the members in the above two lists can be arranged arbitrarily.
  • the comparison process is: compare the size of Cost(+, +) and Cost(-, +), and then determine the sign combination of a BVD with the smallest Cost, that is, determine the BVD with the smallest cost in the candidate BVD set.
  • Step 103 Determine the BVD of the current block according to the BVD symbol index information and the sorting result.
  • the BVD of the current block can be determined according to the BVD symbol index information and the sorting result.
  • the candidate BVD list of the current block obtained by the sorting process is an ascending (descending) list
  • the BVD combination list OrderedList may be firstly transformed into the index transformation list TransformedList according to the transformation rule.
  • the candidate BVD list may be transformed to determine an index transformation list (TransformedList).
  • the candBvdX of the BVD of the current block when determining the BVD of the current block based on the BVD symbol index information and the sorting result, when absBvdX and absBvdY are both not 0, if the first bit of the BVD symbol index information is 0, it is determined that the candBvdX of the BVD of the current block is the same as the candBvdX of the first candidate BVD or the third candidate BVD in the index conversion list; then the candBvdY of the BVD of the current block can be determined according to the first candidate BVD or the third candidate BVD.
  • the second bit of the BVD symbol index information is 0, it is determined that the candBvdY of the BVD of the current block is the same as the candBvdY of the first candidate BVD; if the second bit is 1, it is determined that the candBvdY of the BVD of the current block is the same as the candBvdY of the third candidate BVD.
  • the BVD of the current block when determining the BVD of the current block based on the BVD symbol index information and the sorting result, when absBvdX and absBvdY are both not 0, if the first bit of the BVD symbol index information is 1, it is determined that the first component symbol is the same as the first component symbol of the second candidate BVD or the fourth candidate BVD in the index conversion list; then candBvdY of the BVD of the current block can be determined according to the second candidate BVD or the fourth candidate BVD.
  • the second bit of the BVD symbol index information is 0, it is determined that the candBvdY of the BVD of the current block is the same as the candBvdY of the second candidate BVD; if the second bit is 1, it is determined that the candBvdY of the BVD of the current block is the same as the candBvdY of the fourth candidate BVD.
  • the symbol prediction index of BVD is two bits.
  • the symbol of the real BVD is obtained according to the following rules.
  • the predicted index of the parsed symbol is equal to the index of the leftmost column in the table:
  • the true BVD horizontal component is equal to a1.
  • Check its vertical component If the 1st bit is 0, the true BVD vertical component is equal to a2; if the 1st bit is 1, the true BVD vertical component is equal to -a2.
  • the true BVD horizontal component is equal to -a1.
  • the real BVD combination is the horizontal component -BVD HOR and the vertical component +BVD VER .
  • the real BVD combination is the horizontal component -BVD HOR and the vertical component -BVD VER .
  • the real BVD combination is the horizontal component +BVD HOR and the vertical component +BVD VER .
  • the real BVD combination is the horizontal component +BVD HOR and the vertical component -BVD VER .
  • the BVD symbol index information when determining the BVD of the current block based on the BVD symbol index information and the sorting result, when absBvdX is 0, if the value of the BVD symbol index information is 0, it is determined that the candBvdY of the BVD of the current block is the same as the candBvdY of the first candidate BVD in the index conversion list; if the value of the BVD symbol index information is 1, it is determined that the candBvdY of the BVD of the current block is the same as the candBvdY of the second candidate BVD in the index conversion list.
  • the symbol prediction index of the BVD is one bit.
  • index transformation list TransformedList is the same as the sorted BVD combination list OrderedList.
  • the index transformation list TransformedList is:
  • the symbol of the real BVD is obtained according to the following rules.
  • the predicted index of the parsed symbol is equal to the index of the leftmost column in the table:
  • the true BVD vertical component is a2, otherwise, the true BVD vertical component is -a2.
  • the index transformation list TransformedList is:
  • the BVD symbol index information when determining the BVD of the current block based on the BVD symbol index information and the sorting result, when absBvdY is 0, if the value of the BVD symbol index information is 0, it is determined that the candBvdX of the BVD of the current block is the same as the candBvdX of the first candidate BVD in the index conversion list; if the value of the BVD symbol index information is 1, it is determined that the candBvdX of the BVD of the current block is the same as the candBvdX of the second candidate BVD in the index conversion list.
  • the symbol prediction index of the BVD is one bit.
  • index transformation list TransformedList is the same as the sorted BVD combination list OrderedList.
  • the index transformation list TransformedList is:
  • the symbol of the real BVD is obtained according to the following rules.
  • the predicted index of the parsed symbol is equal to the index of the leftmost column in the table:
  • the true BVD horizontal component is a1, otherwise, the true BVD horizontal component is -a1.
  • the index transformation list TransformedList is:
  • BVD of the current block when determining the BVD of the current block based on the BVD symbol index information and the candidate BVD list, when both absBvdX and absBvdY are not 0, if the first bit of the BVD symbol index information is 0, then it is determined that the candBvdX of the BVD of the current block is the same as the candBvdX of the first candidate BVD in the candidate BVD list, otherwise they are different; then the candidate BVD list is traversed to determine the first candidate BVD with the same candBvdX as the BVD of the current block; if the second bit of the BVD symbol index information is 0, then it is determined that the candBvdY of the BVD of the current block is the same as the candBvdY of the first candidate BVD, otherwise they are different.
  • both the horizontal component and the vertical component of BVD exist.
  • the symbol prediction index of BVD is two bits:
  • the horizontal component of the real BVD is equal to a1; if the 0th bit is 1, the horizontal component of the real BVD is equal to -a1, that is, the opposite of a1, and the horizontal component of the real BVD is judged to be e1. Then, the sorted list (the candidate BVD list of the current block) is traversed starting from index 0. When the BVD with the same horizontal component as the real BVD judged above appears in the list for the first time, its vertical component is checked.
  • the vertical component of the real BVD is equal to f2; if the 1st bit is 1, the vertical component of the real BVD is equal to -f2, that is, the opposite of f2, and the vertical component of the real BVD is judged to be e2.
  • the real BVD is obtained, that is, the BVD with a horizontal component of e1 and a vertical component of e2.
  • the horizontal component of the true BVD is -BVD HOR
  • the vertical component is +BVD VER .
  • the horizontal component of the true BVD is -BVD HOR and the vertical component is -BVD VER .
  • BVD symbol index information when determining the BVD of the current block based on the BVD symbol index information and the candidate BVD list, when absBvdX is 0, if the value of the BVD symbol index information is 0, then it is determined that the candBvdY of the BVD of the current block is the same as the candBvdY of the first candidate BVD in the candidate BVD list; if the value of the BVD symbol index information is 1, then it is determined that the candBvdY of the BVD of the current block is the same as the candBvdY of the second candidate BVD in the candidate BVD list.
  • the vertical component of the real BVD is equal to a2; if the 0th bit is 1, the vertical component of the real BVD is equal to -a2, that is, the opposite of a2. At this time, the vertical component of the real BVD is e2 and the horizontal component is 0. In this way, the real BVD is obtained, that is, the BVD with a horizontal component of 0 and a vertical component of e2.
  • BVD symbol index information when determining the BVD of the current block based on the BVD symbol index information and the candidate BVD list, when absBvdY is 0, if the value of the BVD symbol index information is 0, then it is determined that the candBvdX of the BVD of the current block is the same as the candBvdX of the first candidate BVD in the candidate BVD list; if the value of the BVD symbol index information is 1, then it is determined that the candBvdX of the BVD of the current block is the same as the candBvdX of the second candidate BVD in the candidate BVD list.
  • the horizontal component of the real BVD is equal to a1; if the 0th bit is 1, the horizontal component of the real BVD is equal to -a1, that is, the opposite of a1. At this time, the horizontal component of the real BVD is e1 and the vertical component is 0. In this way, the real BVD is obtained, that is, the BVD with a horizontal component of e1 and a vertical component of 0.
  • the candidate BVD list of the current block obtained by the sorting process is a list in a specific order
  • the candidate BVD indicated by the BVD symbol index information in the candidate BVD list can be directly determined as the BVD of the current block.
  • the sorted BVD combination list OrderedList can be directly assigned to TransformedList, that is, the candidate BVD list OrderedList and the index transformation list TransformedList are the same. Therefore, in TransformedList (or OrderedList), the BVD combination corresponding to the symbol prediction index of BVD is the real BVD.
  • the candidate BVD list of the current block obtained by the sorting process is a list in a specific order
  • the two components corresponding to the BVD can be directly encoded at the same time, and correspondingly, at the decoding end, the two components corresponding to the BVD can be directly determined together through the BVD symbol index information.
  • the BVD symbol index information obtained by decoding can be directly used to determine the candidate BVD indicated by the BVD symbol index information from the candidate BVD list.
  • the encoder can use a traversal method to determine the transmitted index (BVD symbol index information).
  • the candidate BVD indicated by the BVD symbol index information in the candidate BVD list can also be directly determined as the BVD of the current block.
  • both the horizontal component and the vertical component of BVD exist.
  • the symbol prediction index of BVD is two bits:
  • Table 21 OrderedList of sorted BVD combinations where both horizontal and vertical BVDs exist
  • the symbol of the real BVD is obtained according to the following rules.
  • the predicted index of the parsed symbol is equal to the index of the leftmost column in the table:
  • the true BVD horizontal component is equal to a1.
  • Check its vertical component If the 1st bit is 0, the true BVD vertical component is equal to a2; if the 1st bit is 1, the true BVD vertical component is equal to -a2.
  • the true BVD horizontal component is equal to -a1.
  • the real BVD combination is the horizontal component -BVD HOR and the vertical component +BVD VER .
  • the real BVD combination is the horizontal component -BVD HOR and the vertical component -BVD VER .
  • the real BVD combination is the horizontal component +BVD HOR and the vertical component +BVD VER .
  • the real BVD combination is the horizontal component +BVD HOR and the vertical component -BVD VER .
  • the symbol of the real BVD is obtained according to the following rules.
  • the predicted index of the parsed symbol is equal to the index of the leftmost column in the table:
  • the vertical component of the real BVD is equal to a2, otherwise, the vertical component of the real BVD is equal to -a2.
  • TransformedList is:
  • the symbol of the real BVD is obtained according to the following rules.
  • the predicted index of the parsed symbol is equal to the index of the leftmost column in the table:
  • the horizontal component of the real BVD is equal to a1, otherwise, the horizontal component of the real BVD is equal to -a1.
  • TransformedList is:
  • the candidate BVD with the minimum template matching cost is determined after the sorting, that is, the minimum cost BVD in the candidate BVD set is determined.
  • the minimum cost BVD in the candidate BVD set is determined.
  • the minimum BVD symbol combination determines the symbol of bit0 and bit1 when the value is equal to 0, and the symbol when the value is equal to 1 is opposite to this.
  • the candBvdX of the BVD of the current block when determining the BVD of the current block based on the BVD symbol index information and the sorting result, when absBvdX and absBvdY are both not 0, if the first bit of the BVD symbol index information is 1, then it is determined that the candBvdX of the BVD of the current block has an opposite sign to the candBvdX of the BVD with the lowest cost in the candidate BVD set; then the candBvdY of the BVD of the current block can be determined according to the BVD with the lowest cost in another array other than the array where the BVD with the lowest cost in the candidate BVD set is located.
  • the second bit of the BVD sign index information is 0, it is determined that the candBvdY of the BVD of the current block is the same as the candBvdY of the BVD with the lowest cost in the candidate BVD set; if the second bit is 1, it is determined that the candBvdY of the BVD of the current block is opposite in sign to the candBvdY of the BVD with the lowest cost in the candidate BVD set.
  • the candBvdY of the BVD of the current block when determining the candBvdY of the BVD of the current block according to the BVD with the lowest cost in another array other than the array where the BVD with the lowest cost in the candidate BVD set is located, if the second bit of the BVD sign index information is 0, it is determined that the candBvdY of the BVD of the current block is the same as the candBvdY of the BVD with the lowest cost in another array; if the second bit is 1, it is determined that the candBvdY of the BVD of the current block has an opposite sign to the candBvdY of the BVD with the lowest cost in another array.
  • the signs of the horizontal component and the vertical component of the real BVD are bvdSign[0] and bvdSign[1], where a value of 0 is positive and a value of 1 is negative.
  • the above method of determining the BVD of the current block based on the candidate BVD set can save the steps of establishing a list and obtaining the symbol prediction index.
  • the decoding end can directly obtain the real BVD symbol through three comparisons, which is less complex.
  • Step 104 Determine a reconstruction value of the current block according to the BVD of the current block.
  • the decoder can use the BVD of the current block to perform motion compensation, thereby determining a reconstructed value of the current block.
  • the overall process of the decoding end is as follows:
  • the symbol prediction index (ie, BVD symbol index information) bvdIdx is derived as follows:
  • bvsd_idx_single can use different probability models according to the absolute value:
  • compIdx 0...1, indicating horizontal component or vertical component.
  • bvsd_idx can use two different probability models:
  • bvsd_idx_single can use a single probability model:
  • the first form is:
  • abs_bvd_greater0_flag[0] or abs_bvd_greater0_flag[1] is TRUE:
  • abs_bvd_greater0_flag[0] and abs_bvd_greater0_flag[1] are both TRUE, when the binary string of the parsed bvsd_idx is 00B, bvsd_idx is 0; when the binary string of the parsed bvsd_idx is 01B, bvsd_idx is 1; when the binary string of the parsed bvsd_idx is 10B, bvsd_idx is 2; when the binary string of the parsed bvsd_idx is 11B, bvsd_idx is 3.
  • abs_bvd_greater0_flag[0] or abs_bvd_greater0_flag[1] is TRUE, when the binary string of the parsed bvsd_idx is 0B, bvsd_idx is 0; when the binary string of the parsed bvsd_idx is 1B, bvsd_idx is 1.
  • abs_bvd_greater0_flag[0] or abs_bvd_greater0_flag[1] is TRUE:
  • the second form is:
  • abs_bvd_greater0_flag[0] and abs_bvd_greater0_flag[1] are both TRUE, when the binary string of the parsed bvsd_idx is 00B, bvsd_idx is 0; when the binary string of the parsed bvsd_idx is 01B, bvsd_idx is 1; when the binary string of the parsed bvsd_idx is 10B, bvsd_idx is 2; when the binary string of the parsed bvsd_idx is 11B, bvsd_idx is 3.
  • abs_bvd_greater0_flag[0] or abs_bvd_greater0_flag[1] is TRUE:
  • abs_bvd_greater0_flag[0] or abs_bvd_greater0_flag[1] is TRUE:
  • bvsd_idx When the binary string of the parsed bvsd_idx is 00B, bvsd_idx is 0; when the binary string of the parsed bvsd_idx is 01B, bvsd_idx is 1; when the binary string of the parsed bvsd_idx is 100B, bvsd_idx is 2; when the binary string of the parsed bvsd_idx is 101B, bvsd_idx is 3.
  • bvsd_idx When the binary string of the parsed bvsd_idx is 1B, bvsd_idx is 0; when the binary string of the parsed bvsd_idx is 010B, bvsd_idx is 1; when the binary string of the parsed bvsd_idx is 011B, bvsd_idx is 2; when the binary string of the parsed bvsd_idx is 00100B, bvsd_idx is 3.
  • the decoding method proposed in the above steps 101 to 104 creates a combination list of BVD between possible symbols of BVD and the absolute value of BVD, and sorts the combination list using a template.
  • the symbol prediction index is obtained using the real BVD symbol and the sorted list for CABAC encoding, which has higher coding efficiency than bypass coding, thereby saving the bit rate required for BVD transmission in IBC.
  • the decoding method proposed in the embodiment of the present application can make full use of the similarity between the template and the current coding block to effectively sort the symbol combination list of BVD; on the other hand, CABAC can be used for encoding, which has higher coding efficiency than bypass coding.
  • the embodiment of the present application provides a coding and decoding method, at the decoding end, decoding the bitstream, determining the BVD absolute value and BVD symbol index information of the current block; sorting the candidate BVDs of the current block according to the BVD absolute value of the current block, and determining the sorting result; determining the BVD of the current block according to the BVD symbol index information and the sorting result; determining the reconstruction value of the current block according to the BVD of the current block.
  • the candidate BVDs of the current block can be effectively sorted according to the absolute value of the BVD of the current block, so that the sorting result can be used to determine and transmit the BVD symbol index information during encoding, and the sorting result can be used to parse the BVD symbol information of the current block during decoding.
  • the CABAC encoding and decoding technology can be used to encode and decode the BVD symbol information, which can effectively save the code rate required for the symbol transmission of the BVD in the IBC mode, thereby improving the encoding efficiency.
  • another embodiment of the present application proposes a decoding method, wherein, for a decoder, when performing decoding processing, the BVD decoding input can be the code stream information of the BVD absolute value and symbol (BVD symbol index information), and the BVD decoding output can be the real information of the BVD absolute value and symbol.
  • the BVD decoding input can be the code stream information of the BVD absolute value and symbol (BVD symbol index information)
  • the BVD decoding output can be the real information of the BVD absolute value and symbol.
  • Figure 10 is a second schematic diagram of the decoding method in an embodiment of the present application.
  • the BVD decoding process includes parsing the absolute value of the BVD (step 201), parsing the symbol prediction index of the BVD, that is, parsing the BVD symbol index information (step 202), by creating a combination list of BVDs between possible symbols of the BVD and the absolute value of the BVD, that is, determining the candidate BVD of the current block (step 203), performing template prediction based on the combination list of the BVP and BVD of the current block, calculating the cost of each BVD combination in the BVD combination list, that is, calculating the cost of the template area for the combination list (first generation value) (step 204), sorting the list and deriving the real BVD based on the symbol prediction index and the sorted list, and performing motion compensation (step 205).
  • the decoder can directly parse the real absolute value of BVD from the bitstream, that is, the decoder decodes the bitstream and can determine the absolute value of BVD of the current block.
  • the number of bits of the binary number of the symbol prediction index can be determined according to the absolute value of BVD parsed in step 201 during the decoding process. If the absolute values of the horizontal component and the vertical component of BVD are not 0, the number of bits of the binary number of the symbol prediction index is 2; if the horizontal component of BVD is 0 and the absolute value of the vertical component is not 0, the number of bits of the binary number of the symbol prediction index is 1; if the horizontal component of BVD is not 0 and the absolute value of the vertical component is 0, the number of bits of the binary number of the symbol prediction index is 1.
  • the decoder can use CABAC (context adaptive binary arithmetic coding) or bypass the corresponding decoding process to parse the binary number corresponding to the symbol prediction index from the bitstream.
  • CABAC context adaptive binary arithmetic coding
  • a single probability model or multiple probability models can be used, which may include but are not limited to different probability models distinguished according to the absolute value of the horizontal component or vertical component of BVD, the sum or difference of the horizontal component and vertical component of BVD, etc.
  • the combination list of BVDs can be created according to different situations, such as only horizontal BVDs exist, only vertical BVDs exist, and both exist.
  • Determining the BVD combination list includes permuting and combining possible symbols of the BVD, and multiplying possible horizontal symbols and vertical symbols by the horizontal absolute value component and the vertical absolute value component of the BVD respectively.
  • Classification example 1 BVD is divided into horizontal component and vertical component.
  • the horizontal component is zero, only the vertical component is encoded, so only the combination list of the vertical component symbols is constructed, specifically the following two cases:
  • the first case the horizontal components are all positive, which is just a placeholder.
  • the vertical component is first positive and then negative.
  • a symbol list is constructed, and then the constructed symbol list is multiplied by the absolute values of the horizontal and vertical components of BVD to obtain the combined list of BVD.
  • the second case the horizontal components are all positive, which is just a placeholder.
  • the vertical components are first negative and then positive.
  • a symbol list is constructed, and then the constructed symbol list is multiplied by the absolute values of the horizontal and vertical components of BVD to obtain the combined list of BVD.
  • Classification example 2 BVD is divided into horizontal component and vertical component.
  • the vertical component is zero, only the horizontal component is encoded, so only the combination list of the horizontal component symbols is constructed, specifically the following two cases:
  • the first case the vertical components are all positive, which is just a placeholder.
  • the horizontal components are first positive and then negative.
  • a sign list is constructed, and then the constructed sign list is multiplied by the absolute values of the vertical and horizontal components of BVD to obtain the combined list of BVD.
  • the second case the vertical components are all positive, which is just a placeholder.
  • the horizontal components are first negative and then positive.
  • a sign list is constructed, and then the constructed sign list is multiplied by the absolute values of the vertical and horizontal components of BVD to obtain the combined list of BVD.
  • Classification example 3 BVD is divided into horizontal component and vertical component. When both components are not zero, both need to be encoded, so the BVD list is constructed for the horizontal and vertical components together. There are 24 cases, namely, any arrangement of the four combinations of ⁇ +1, +1 ⁇ , ⁇ +1, -1 ⁇ , ⁇ -1, +1 ⁇ and ⁇ -1, -1 ⁇ .
  • the following examples illustrate:
  • the 0th bit in the list means that both the horizontal and vertical components are positive
  • the 1st bit in the list means that the horizontal component is positive and the vertical component is negative
  • the 2nd bit in the list means that the horizontal component is negative and the vertical component is positive
  • the 3rd bit in the list means that both the horizontal and vertical components are negative.
  • a sign list is constructed, and then the constructed sign list is multiplied by the absolute values of the vertical and horizontal components of BVD to obtain a combination list of BVD.
  • the cost (first generation value) of each BVD combination (candidate BVD) in the BVD combination list is calculated, that is, the cost of the template area is calculated.
  • the cost of various combinations in the BVD combination list can be calculated using the template, specifically, the cost of the reconstructed luminance pixels at the position obtained by template prediction using the reconstructed luminance pixels at the current block template position and the BV obtained by the combination of the BVP and BVD of the current block.
  • the pixel availability of the template position can be determined based on the pixel availability of the neighboring area of the current block, including the reconstruction of brightness information.
  • the template can be classified into template types such as upper template, left template, upper right template, lower left template, and upper left template according to the relative position relationship between the template and the current block.
  • the template sizes of different types of different coding blocks can be fixed the same or different.
  • the template size may select the same template size for any current coding block (current block), or may select different template sizes according to different sizes of the current coding block, or may select different template sizes according to the number of pixels in the current brightness coding block.
  • a new BV can be generated using the combined list of the BVP and BVD of the current block.
  • the current block is used to determine whether the BV is available (the available condition is that the reference block pointed to by the BV has been reconstructed and does not exceed the search range set by the IBC and the image boundary and other conditions). If the current BV is available, the template of the current block and the new BV are used for motion compensation to obtain the template at the corresponding BV.
  • the horizontal and vertical components of the BVD generate a total of 4 combinations of BVDs, which are used for motion compensation at the templates. There are several situations in which the template is used when calculating the cost:
  • the first type the upper template and the left template of the current block both exist, and the upper template and the left template at the corresponding BV both exist. In this case, both the upper template and the left template are available.
  • the second method both the upper template and the left template of the current block exist, and only the upper template exists at the corresponding BV.
  • Method 2 If the left template at the corresponding BV does not exist, the leftmost template width column in the reference block is used instead of the left template, that is, the upper template and the left template are used for calculation.
  • the third type the upper template and the left template of the current block both exist, and only the left template exists at the corresponding BV.
  • Method 1 the upper template at the corresponding BV does not exist, so it is not used directly, that is, only the left template is used for calculation.
  • Method 2 the upper template at the corresponding BV does not exist, and the uppermost template height row inside the reference block is used to replace the upper template, that is, the upper template and the left template are used for calculation.
  • the fourth type only the upper template exists in the current block. There are three methods: Method 1: The upper template at the corresponding BV does not exist, so it is not used directly. Method 2: The upper template at the corresponding BV does not exist, and the uppermost template height row inside the reference block is used to replace the upper template. Method 3: The upper template at the corresponding BV exists, so it is used directly.
  • the fifth type only the left template exists in the current block. There are three methods: Method 1: the left template at the corresponding BV does not exist, so it is not used directly. Method 2: the left template at the corresponding BV does not exist, and the leftmost template width column in the reference block is used to replace the left template. Method 3: the left template at the corresponding BV exists, so it is used directly.
  • the sixth type the upper template and the left template of the current block do not exist, and the BVD combination of this case is ignored.
  • the cost in this case is set to the maximum value of the cost evaluation criterion.
  • the evaluation criteria such as the sum of absolute difference (SAD), the sum of absolute difference (SATD), the sum of squared differences (SSE), the mean absolute difference (MAD), the mean absolute error (MAE), the mean squared error (MSE), and the rate distortion function (RDO) can be selected.
  • SAD sum of absolute difference
  • SATD sum of absolute difference
  • SSE sum of squared differences
  • MAD mean absolute difference
  • MAE mean absolute error
  • MSE mean squared error
  • RDO rate distortion function
  • step 205 can be executed, that is, sorting the combination list according to the cost obtained for the template area, that is, the candidate BVDs can be sorted using the first generation value, and the symbol prediction index of the BVD and the sorted list (the candidate BVD list of the current block) can be used to obtain the real BVD, and then perform motion compensation.
  • a new list OrderedList (candidate BVD list of the current block) arranged in ascending (descending) order can be used, or a new list OrderedList arranged in a specific order can be used.
  • sorting methods such as bubble sort, selection sort, insertion sort, shell sort, merge sort, quick sort, radix sort, heap sort, counting sort, and bucket sort.
  • Case 1 Assume that the combination list (candidate BVD) is ⁇ (+BVD HOR , +BVD VER ), (+BVD HOR , -BVD VER ), (-BVD HOR , -BVD VER ), (-BVD HOR , +BVD VER ) ⁇ , and its corresponding cost list is ⁇ Cost(+BVD HOR , +BVD VER ), Cost(+BVD HOR , -BVD VER ), Cost(-BVD HOR , -BVD VER ), Cost(-BVD HOR , +BVD VER ) ⁇ .
  • the order of the members in the above two lists can be arranged arbitrarily.
  • posiGrp stores two BVD combinations with positive signs on the same component (level)
  • negaGrp stores two BVD combinations with negative signs on the same component (level).
  • posiGrp ⁇ (+BVD HOR , +BVD VER ), (+BVD HOR , -BVD VER ) ⁇
  • negaGrp ⁇ (-BVD HOR , +BVD VER ), (-BVD HOR , -BVD VER ) ⁇ .
  • the order of the members in the two lists posiGrp and negaGrp can be arranged arbitrarily.
  • Second comparison Compare Cost(-BVD HOR , +BVD VER ) and Cost(-BVD HOR , -BVD VER ), set negaGrp[0] to the smaller BVD combination of the two, and set negaGrp[1] to the larger BVD combination of the two;
  • the third comparison compare the Cost corresponding to posiGrp[0] and negaGrp[0];
  • the Cost corresponding to posiGrp[0] is less than or equal to the Cost corresponding to negaGrp[0]
  • posiGrp[0] is sorted at the 0th position in the candidate BVD list OrderedList
  • negaGrp[0] is sorted at the 1st position in the candidate BVD list OrderedList
  • posiGrp[1] is sorted at the 2nd position in the candidate BVD list OrderedList
  • negaGrp[1] is sorted at the 3rd position in the candidate BVD list OrderedList.
  • the Cost corresponding to posiGrp[0] is greater than the Cost corresponding to negaGrp[0], sort negaGrp[0] at the 0th position in the candidate BVD list OrderedList, sort posiGrp[0] at the 1st position in the candidate BVD list OrderedList, sort negaGrp[1] at the 2nd position in the candidate BVD list OrderedList, and sort posiGrp[1] at the 3rd position in the candidate BVD list OrderedList.
  • the candidate BVD at position 0 in the candidate BVD list of the current block is the first candidate BVD in the candidate BVD list
  • the candidate BVD at position 1 is the second candidate BVD in the candidate BVD list
  • the candidate BVD at position 2 is the third candidate BVD in the candidate BVD list
  • the candidate BVD at position 3 is the fourth candidate BVD in the candidate BVD list.
  • the Cost corresponding to posiGrp[0] is less than or equal to the Cost corresponding to negaGrp[0], sort posiGrp[0] at the 0th position in the candidate BVD list OrderedList, sort negaGrp[0] at the 2nd position in the candidate BVD list OrderedList, sort posiGrp[1] at the 1st position in the candidate BVD list OrderedList, and sort negaGrp[1] at the 3rd position in the candidate BVD list OrderedList.
  • the Cost corresponding to posiGrp[0] is greater than the Cost corresponding to negaGrp[0], sort negaGrp[0] at the 0th position in the candidate BVD list OrderedList, sort posiGrp[0] at the 2nd position in the candidate BVD list OrderedList, sort negaGrp[1] at the 1st position in the candidate BVD list OrderedList, and sort posiGrp[1] at the 3rd position in the candidate BVD list OrderedList.
  • the sorting process is: compare the size of Cost (0, +BVD VER ) and Cost (0, -BVD VER ):
  • the third case Assume that the combination list is ⁇ (+BVD HOR , 0), (-BVD HOR , 0) ⁇ , and its corresponding cost list is ⁇ Cost(+BVD HOR , 0), Cost(-BVD HOR , 0) ⁇ .
  • the order of the members in the above two lists can be arranged arbitrarily.
  • the sorting process is: compare the size of Cost (+BVD HOR , 0) and Cost (-BVD HOR , 0):
  • (+BVD HOR , 0) is sorted at the 0th position of the candidate BVD list OrderedList, and (-BVD HOR , 0) is sorted at the 1st position of the candidate BVD list OrderedList;
  • (-BVD HOR , 0) is sorted at the 0th position of the candidate BVD list OrderedList, and (+BVD HOR , 0) is sorted at the 1st position of the candidate BVD list OrderedList.
  • the sorting result obtained may also be the candidate BVD set of the current block.
  • the candidate BVDs may be sorted according to the first generation value to determine the candidate BVD set of the current block, wherein the candidate BVD set includes at least one candidate BVD.
  • posiGrp stores the sign combination of two BVDs with positive signs on the same component (level)
  • negaGrp stores the sign combination of two BVDs with negative signs on the same component (level).
  • posiGrp ⁇ (+, +), (+, -) ⁇
  • negaGrp ⁇ (-, +), (-, -) ⁇ .
  • the order of the members in the two lists posiGrp and negaGrp can be arranged arbitrarily.
  • First comparison compare Cost(+, +) and Cost(+, -), set posiGrp[0] to the smaller BVD combination, and set posiGrp[1] to the larger BVD combination;
  • Second comparison Compare Cost(-, +) and Cost(-, -), set negaGrp[0] to the smaller BVD sign combination of the two, and set negaGrp[1] to the larger BVD sign combination of the two;
  • the third comparison compare the Cost corresponding to posiGrp[0] and negaGrp[0].
  • a symbol combination of a BVD with the minimum cost can be determined, that is, the BVD with the minimum cost in the candidate BVD set can be determined.
  • the combination list is ⁇ (+, +), (+, -) ⁇
  • the corresponding cost list is ⁇ Cost(+, +), Cost(+, -) ⁇ .
  • the order of the members in the above two lists can be arranged arbitrarily.
  • the comparison process is: compare the size of Cost(+, +) and Cost(+, -), and then determine the sign combination of a BVD with the smallest Cost, that is, determine the BVD with the smallest cost in the candidate BVD set.
  • the combination list is ⁇ (+, +), (-, +) ⁇
  • the corresponding cost list is ⁇ Cost(+, +), Cost(-, +) ⁇ .
  • the order of the members in the above two lists can be arranged arbitrarily.
  • the comparison process is: compare the size of Cost(+, +) and Cost(-, +), and then determine the sign combination of a BVD with the smallest Cost, that is, determine the BVD with the smallest cost in the candidate BVD set.
  • the sorted list (candidate BVD list of the current block) is divided into three cases, namely, BVD has only horizontal components, BVD has only vertical components, and BVD has both horizontal and vertical components, so three cases are also introduced here.
  • OrderedList arranged in ascending (descending) order.
  • One is to use the conversion list to indirectly obtain the symbol of the real BVD, and the other is to directly use logical reasoning to obtain the real BVD symbol.
  • the decoder Before using the transformation list to indirectly obtain the real BVD symbol, the decoder needs to first convert the BVD combination list OrderedList into the index transformation list TransformedList according to the transformation rules.
  • both the horizontal component and the vertical component of BVD exist.
  • the symbol prediction index of BVD is two bits:
  • the symbol of the real BVD is obtained according to the following rules.
  • the predicted index of the parsed symbol is equal to the index of the leftmost column in the table:
  • the true BVD horizontal component is equal to a1.
  • Check its vertical component If the 1st bit is 0, the true BVD vertical component is equal to a2; if the 1st bit is 1, the true BVD vertical component is equal to -a2.
  • the true BVD horizontal component is equal to -a1.
  • index transformation list TransformedList is the same as the sorted BVD combination list OrderedList.
  • the index transformation list TransformedList is:
  • the symbol of the real BVD is obtained according to the following rules.
  • the predicted index of the parsed symbol is equal to the index of the leftmost column in the table:
  • the true BVD vertical component is a2, otherwise, the true BVD vertical component is -a2.
  • index transformation list TransformedList is the same as the sorted BVD combination list OrderedList.
  • the index transformation list TransformedList is:
  • the symbol of the real BVD is obtained according to the following rules.
  • the predicted index of the parsed symbol is equal to the index of the leftmost column in the table:
  • the true BVD horizontal component is a1, otherwise, the true BVD horizontal component is -a1.
  • the horizontal component of the real BVD is equal to a1; if the 0th bit is 1, the horizontal component of the real BVD is equal to -a1, that is, the opposite of a1, and the horizontal component of the real BVD is judged to be e1. Then, the sorted list (the candidate BVD list of the current block) is traversed starting from index 0. When the BVD with the same horizontal component as the real BVD judged above appears in the list for the first time, its vertical component is checked.
  • the vertical component of the real BVD is equal to f2; if the 1st bit is 1, the vertical component of the real BVD is equal to -f2, that is, the opposite of f2, and the vertical component of the real BVD is judged to be e2.
  • the real BVD is obtained, that is, the BVD with a horizontal component of e1 and a vertical component of e2.
  • the vertical component of the real BVD is equal to a2; if the 0th bit is 1, the vertical component of the real BVD is equal to -a2, that is, the opposite of a2. At this time, the vertical component of the real BVD is e2 and the horizontal component is 0. In this way, the real BVD is obtained, that is, the BVD with a horizontal component of 0 and a vertical component of e2.
  • Table 70 OrderedList of sorted BVD combinations where only horizontal BVDs exist
  • the horizontal component of the real BVD is equal to a1; if the 0th bit is 1, the horizontal component of the real BVD is equal to -a1, that is, the opposite of a1. At this time, the horizontal component of the real BVD is e1 and the vertical component is 0. In this way, the real BVD is obtained, that is, the BVD with a horizontal component of e1 and a vertical component of 0.
  • the sorted BVD combination list OrderedList can be directly assigned to TransformedList.
  • the BVD combination corresponding to the symbol prediction index of BVD is the real BVD.
  • both the horizontal component and the vertical component of BVD exist.
  • the symbol prediction index of BVD is two bits:
  • the symbol of the real BVD is obtained according to the following rules.
  • the predicted index of the parsed symbol is equal to the index of the leftmost column in the table:
  • the true BVD horizontal component is equal to a1.
  • Check its vertical component If the 1st bit is 0, the true BVD vertical component is equal to a2; if the 1st bit is 1, the true BVD vertical component is equal to -a2.
  • the true BVD horizontal component is equal to -a1.
  • the symbol of the real BVD is obtained according to the following rules.
  • the predicted index of the parsed symbol is equal to the index of the leftmost column in the table:
  • the vertical component of the real BVD is equal to a2, otherwise, the vertical component of the real BVD is equal to -a2.
  • the symbol of the real BVD is obtained according to the following rules.
  • the predicted index of the parsed symbol is equal to the index of the leftmost column in the table:
  • the horizontal component of the real BVD is equal to a1, otherwise, the horizontal component of the real BVD is equal to -a1.
  • the candidate BVD with the minimum template matching cost is determined after the sorting, that is, the minimum cost BVD in the candidate BVD set is determined.
  • the minimum cost BVD in the candidate BVD set is determined.
  • the minimum BVD symbol combination determines the symbol of bit0 and bit1 when the value is equal to 0, and the symbol when the value is equal to 1 is opposite to this.
  • the signs of the horizontal component and the vertical component of the real BVD are bvdSign[0] and bvdSign[1], where a value of 0 is positive and a value of 1 is negative.
  • the above method for determining the BVD of the current block based on the candidate BVD set can omit the steps of establishing a list and obtaining a symbol prediction index, and the decoding end can directly obtain the real BVD symbol through three comparisons.
  • the parsing position is as described in (1) in the overall process of the decoding end of the main technical solution, and is located after bvd_coding(), the overall process of the decoding end is as follows:
  • bvd_sign_bin[1] is the 0th bit mentioned above.
  • abs_bvd[compIdx] abs_bvd_greater0_flag[compIdx]*(abs_bvd_minus1[compIdx]+1)
  • compIdx 0...1, indicating horizontal component or vertical component.
  • posiGrp stores the sign combination of two BVDs with positive signs on the same component (vertical)
  • negaGrp stores the sign combination of two BVDs with negative signs on the same component (vertical).
  • posiGrp ⁇ (+, +), (-, +) ⁇
  • negaGrp ⁇ (+, -), (-, -) ⁇ .
  • the order of the members in the two lists posiGrp and negaGrp can be arranged arbitrarily.
  • Second comparison Compare Cost(+,-) and Cost(-,-), set negaGrp[0] to the smaller BVD combination of the two, and set negaGrp[1] to the larger BVD combination of the two;
  • the third comparison compare the Cost corresponding to posiGrp[0] and negaGrp[0];
  • the order of the horizontal component and the vertical component can be interchanged, and the order of the horizontal component and the vertical component can be determined by a certain criterion, including but not limited to the following method, the order of the horizontal component and the vertical component is determined by the absolute value of the horizontal component and the vertical component of the BVD.
  • the sorted BVD combination list (candidate BVD list) their respective costs can be stored, and then a reordering can be performed based on these stored costs.
  • the specific process is: if the cost difference between a candidate in the list and the previous candidate is lower than the ⁇ value, for example,
  • FIG11 is a schematic diagram of calculating the cost.
  • the algorithm for calculating the cost is defined as follows:
  • the list is considered diverse enough and the re-ranking stops.
  • this minimum cost difference is less than ⁇ , the candidate is considered redundant and is moved to another position that is sufficiently diverse compared to its previous candidates.
  • the encoding and decoding method proposed in the embodiment of the present application can effectively save the code rate required for the symbol transmission of BVD in the IBC mode.
  • a combination list of BVD can be created between the possible symbols of BVD and the absolute value of BVD, and the combination list can be sorted using a template, and the symbol prediction index can be obtained using the real BVD symbol and the sorted list for CABAC encoding.
  • the proposed scheme has higher coding efficiency than bypass coding, thereby saving the code rate required for BVD transmission in IBC.
  • the embodiment of the present application proposes a new symbol transmission method for BVD in IBC, which can make full use of the similarity between the template and the current coding block to effectively sort the symbol combination list of BVD; at the same time, CABAC is used for encoding, which has higher coding efficiency than bypass coding.
  • the embodiment of the present application provides a coding and decoding method, at the decoding end, decoding the bitstream, determining the BVD absolute value and BVD symbol index information of the current block; sorting the candidate BVDs of the current block according to the BVD absolute value of the current block, and determining the sorting result; determining the BVD of the current block according to the BVD symbol index information and the sorting result; determining the reconstruction value of the current block according to the BVD of the current block.
  • the candidate BVDs of the current block can be effectively sorted according to the absolute value of the BVD of the current block, so that the sorting result can be used to determine and transmit the BVD symbol index information during encoding, and the sorting result can be used to parse the BVD symbol information of the current block during decoding.
  • the CABAC encoding and decoding technology can be used to encode and decode the BVD symbol information, which can effectively save the code rate required for the symbol transmission of the BVD in the IBC mode, thereby improving the encoding efficiency.
  • FIG12 is a schematic diagram 1 of the encoding method in the embodiment of the present application.
  • the method for a decoder to perform decoding processing may include the following steps:
  • Step 301 Sort candidate BVDs of the current block according to the absolute value of the BVD of the current block to determine a sorting result.
  • the encoder may first determine the absolute value of the BVD of the current block, and then sort the candidate BVDs of the current block according to the absolute value of the BVD of the current block, thereby determining the sorting result.
  • the BVD absolute value includes the first component absolute value absBvdX and the second component absolute value absBvdY; that is, the BVD absolute value includes the horizontal component absolute value and the vertical component absolute value.
  • the BVD of the current block may include the first component candBvdX and the second component candBvdY, and at the same time, the candidate BVD of the current block also includes the first component candBvdX and the second component candBvdY, that is, the BVD may include the horizontal component and the vertical component.
  • absBvdX and absBvdY are both not 0, then it can be determined that the number of bits of the BVD symbol index information is 2; if absBvdX or absBvdY is 0, then it can be determined that the number of bits of the BVD symbol index information is 1.
  • variable-length encoding method may also be used to encode the BVD symbol index information.
  • the BVD symbol index information may be encoded using a truncated unary code, or a truncated binary code may be used for binarization, in which case the number of bits of the BVD symbol index information may not necessarily be 2.
  • the BVD symbol index information can be an index value in the candidate BVD list
  • the number of bits of the symbol index information corresponding to different candidate BVDs is not exactly the same, which is a variable-length code.
  • the absolute value of the BVD can be used to determine a combination list of BVDs, wherein the combination list of BVDs includes any number of candidate BVDs of the current block. That is, the candidate BVD of the current block can be determined by the absolute value of the BVD, which can also be understood as determining the initial set of candidate BVDs of the current block by using the absolute value of the BVD.
  • a combination list of BVDs may be created between the possible symbols of BVDs and the absolute values of BVDs, which may include the cases where only horizontal BVDs exist, only vertical BVDs exist, and both exist.
  • BVDs when creating a combination list of BVDs (candidate BVDs), it mainly includes arranging and combining possible symbols of BVD, and multiplying possible horizontal symbols and vertical symbols by the horizontal absolute value component and vertical absolute value component of BVD respectively.
  • the candidate BVD can be determined according to absBvdY.
  • BVD is divided into horizontal and vertical components.
  • horizontal component is zero
  • vertical component is encoded, so only the combination list of the vertical component symbols is constructed, specifically the following two cases:
  • the first case the horizontal components are all positive, which is just a placeholder.
  • the vertical component is first positive and then negative.
  • a symbol list is constructed, and then the constructed symbol list is multiplied by the absolute values of the horizontal and vertical components of BVD to obtain the combined list of BVD.
  • the second case the horizontal components are all positive, which is just a placeholder.
  • the vertical components are first negative and then positive.
  • a symbol list is constructed, and then the constructed symbol list is multiplied by the absolute values of the horizontal and vertical components of BVD to obtain the combined list of BVD.
  • the candidate BVD may be determined according to absBvdX.
  • BVD is divided into horizontal and vertical components.
  • the vertical component is zero, only the horizontal component is encoded, so only the combination list of the symbols of the horizontal component is constructed, specifically the following two cases:
  • the first case the vertical components are all positive, which is just a placeholder.
  • the horizontal components are first positive and then negative.
  • a sign list is constructed, and then the constructed sign list is multiplied by the absolute values of the vertical and horizontal components of BVD to obtain the combined list of BVD.
  • the second case the vertical components are all positive, which is just a placeholder.
  • the horizontal components are first negative and then positive.
  • a sign list is constructed, and then the constructed sign list is multiplied by the absolute values of the vertical and horizontal components of BVD to obtain the combined list of BVD.
  • the candidate BVD can be determined according to absBvdX and absBvdY.
  • BVD is divided into horizontal and vertical components. When both components are not zero, both need to be encoded, so the BVD list is constructed for the horizontal and vertical components together.
  • the 0th bit in the list means that both the horizontal and vertical components are positive
  • the 1st bit in the list means that the horizontal component is positive and the vertical component is negative
  • the 2nd bit in the list means that the horizontal component is negative and the vertical component is positive
  • the 3rd bit in the list means that both the horizontal and vertical components are negative.
  • a sign list is constructed, and then the constructed sign list is multiplied by the absolute values of the vertical and horizontal components of BVD to obtain a combination list of BVD.
  • the candidate BVDs of the current block may be sorted according to the absolute value of the BVD to determine a sorting result.
  • the first-generation value corresponding to one or more candidate BVDs of the current block can be determined according to the absolute value of the BVD; then the candidate BVDs can be sorted according to the first-generation value to determine the sorting result.
  • one or more candidate BVDs may include a BVD in which candBvdX is set equal to -absBvdX or absBvdX, and candBvdY is set equal to -absBvdY or absBvdY.
  • the first matching template when determining the first generation value corresponding to one or more candidate BVDs of the current block based on the absolute value of the BVD of the current block, can be first determined based on the candidate BVD; then, based on a preset error criterion, the matching error between the first template of the current block and the first matching template is calculated to determine the first generation value corresponding to the candidate BVD.
  • the cost function for calculating the cost of the template area that is, there are multiple choices for the preset error criterion.
  • SAD sum of absolute error
  • SATD sum of transformed absolute error
  • SSE sum of squared differences
  • MAD mean absolute difference
  • MAE mean absolute error
  • MSE mean squared error
  • RDO rate distortion function
  • predTempSizeW is the width of the template
  • predTempSizeH is the height of the template
  • predTemp[i][j] is the pixel point of the template at BV
  • recTempC[i][j] is the pixel point of the current block template.
  • the preset error criterion may include any one of the sum of absolute error SAD, the sum of transformed absolute error SATD, the sum of squared differences SSE, the mean absolute difference MAD, the mean absolute error MAE, the mean squared error MSE, and the rate-distortion function RDO.
  • the first template includes one or more sample values in the adjacent decoded area of the current block.
  • the template when selecting a template (the first template of the current block), it is possible to determine whether the pixels at the template position are available, including reconstructing brightness information, based on the pixel availability of the neighboring area of the current block.
  • the template can be classified into template types such as upper template, left template, upper right template, lower left template, and upper left template, based on the relative position relationship between the template and the current block.
  • the template sizes of different types of different coding blocks can be fixed the same or different.
  • the template size may select the same template size for any current coding block (current block), or may select different template sizes according to different sizes of the current coding block, or may select different template sizes according to the number of pixels in the current brightness coding block.
  • the block vector prediction value BVP of the current block when determining the first matching template based on the candidate BVD, can be determined first; then the candidate BV of the current block is determined based on the BVP and the candidate BVD; wherein the candidate BV is used to indicate the position of the first matching template; then, the first matching template can be determined based on the candidate BV.
  • the two-dimensional vector of the candidate BV can be selected to be set to (currBvpX+candBvdX, currBvpY+candBvdY), that is, the two-dimensional vector of BV is determined based on the first component candBvdX, the second component candBvdY of the candidate BVD, and the third component currBvpX, the fourth component currBvpY of BVP.
  • the first matching template when determining the first matching template according to the candidate BV, may be determined according to the position of the current point and the two-dimensional vector of the candidate BV.
  • the position of the current point can be selected as the starting point, and the area indicated by the two-dimensional vector of the candidate BV, which has the same shape and contains the same number of samples as the first template, can be determined as the first matching template.
  • a new BV can be generated using the combined list of the BVP and BVD of the current block.
  • the current block is used to determine whether the BV is available (the available condition is that the reference block pointed to by the BV has been reconstructed and does not exceed the search range set by the IBC and the image boundary and other conditions). If the current BV is available, the template of the current block and the new BV are used for motion compensation to obtain the template at the corresponding BV.
  • the horizontal and vertical components of the BVD generate a total of 4 combinations of BVDs, which are used for motion compensation at the templates. There are several situations in which the template is used when calculating the cost:
  • the first type the upper template and the left template of the current block both exist, and the upper template and the left template at the corresponding BV both exist. In this case, both the upper template and the left template are available.
  • the second method both the upper template and the left template of the current block exist, and only the upper template exists at the corresponding BV.
  • Method 2 If the left template at the corresponding BV does not exist, the leftmost template width column in the reference block is used instead of the left template, that is, the upper template and the left template are used for calculation.
  • the third type the upper template and the left template of the current block both exist, and only the left template exists at the corresponding BV.
  • Method 1 The upper template at the corresponding BV does not exist, so it is not used directly, that is, only the left template is used for calculation.
  • Method 2 The upper template at the corresponding BV does not exist, and the template height row at the top of the reference block is used to replace the upper template, that is, the upper template and the left template are used for calculation.
  • the fourth type only the upper template exists in the current block. There are three methods: Method 1: The upper template at the corresponding BV does not exist, so it is not used directly. Method 2: The upper template at the corresponding BV does not exist, and the uppermost template height row inside the reference block is used to replace the upper template. Method 3: The upper template at the corresponding BV exists, so it is used directly.
  • the fifth type only the left template exists in the current block. There are three methods: Method 1: the left template at the corresponding BV does not exist, so it is not used directly. Method 2: the left template at the corresponding BV does not exist, and the leftmost template width column in the reference block is used to replace the left template. Method 3: the left template at the corresponding BV exists, so it is used directly.
  • the sixth type the upper template and the left template of the current block do not exist, and the BVD combination of this case is ignored.
  • the cost in this case is set to the maximum value of the cost evaluation criterion.
  • the template is processed at this time, including but not limited to the following method: weighted fusion of the two.
  • the weighted fusion standard can select a fixed weighting coefficient or allocate a weighting coefficient according to the sum of the absolute values of the differences between the pixel values of the reconstructed brightness and the predicted brightness of each template.
  • template prediction can be performed based on a combination list of BVP and BVD of the current block (candidate BVD), and the cost (first generation value) of each BVD combination (candidate BVD) in the BVD combination list can be calculated, that is, the cost of the template area can be calculated, and the cost of various combinations in the BVD combination list can be calculated using a template, specifically, the cost of the reconstructed brightness pixels at the position obtained by template prediction using the reconstructed brightness pixels at the current block template position and the BV obtained by the combination of the BVP and BVD of the current block.
  • the candidate BVDs can be sorted using the first generation value, thereby obtaining a sorting result.
  • the sorting result can be a sorted candidate BVD list of the current block, or a candidate BVD set that determines the candidate BVD with the smallest first generation value through sorting.
  • the sorting process can be to sort the candidate BVDs according to the first generation value to determine the candidate BVD list of the current block, wherein the candidate BVD list includes at least one candidate BVD.
  • the sorting result may be a new list OrderedList (candidate BVD list of the current block) arranged in ascending (descending) order.
  • a sorting method such as bubble sort, selection sort, insertion sort, shell sort, merge sort, quick sort, radix sort, heap sort, counting sort, bucket sort, etc. may be used.
  • the sorting result may also be a new list OrderedList (candidate BVD list of the current block) in a specific order.
  • the candidate BVDs when the candidate BVDs are sorted according to the first generation value to determine the candidate BVD list of the current block, if absBvdX and absBvdY are not equal to 0, the candidate BVDs are stored in the first array and the second array, respectively; then, based on the first generation value, the first candidate BVD and the second candidate BVD in the first array, and the third candidate BVD and the fourth candidate BVD in the second array are determined; finally, the first candidate BVD, the second candidate BVD, the third candidate BVD, and the fourth candidate BVD can be sorted based on the first generation value to determine the candidate BVD list.
  • both the horizontal component and the vertical component of BVD exist that is, both absBvdX and absBvdY are not equal to 0
  • the combination list (candidate BVD) is ⁇ (+BVD HOR , +BVD VER ), (+BVD HOR , -BVD VER ), (-BVD HOR , -BVD VER ), (-BVD HOR , +BVD VER ) ⁇
  • its corresponding cost list is ⁇ Cost(+BVD HOR , +BVD VER ), Cost(+BVD HOR , -BVD VER ), Cost(-BVD HOR , -BVD VER ), Cost(-BVD HOR , +BVD VER ) ⁇ .
  • the order of the members in the above two lists can be arranged arbitrarily.
  • posiGrp stores two BVD combinations with positive signs on the same component (level)
  • negaGrp stores two BVD combinations with negative signs on the same component (level).
  • posiGrp ⁇ (+BVD HOR , +BVD VER ), (+BVD HOR , -BVD VER ) ⁇
  • negaGrp ⁇ (-BVD HOR , +BVD VER ), (-BVD HOR , -BVD VER ) ⁇ .
  • the order of the members in the two lists posiGrp and negaGrp can be arranged arbitrarily.
  • Second comparison Compare Cost(-BVD HOR , +BVD VER ) and Cost(-BVD HOR , -BVD VER ), set negaGrp[0] to the smaller BVD combination of the two, and set negaGrp[1] to the larger BVD combination of the two;
  • the third comparison compare the Cost corresponding to posiGrp[0] and negaGrp[0].
  • an available method is as follows: if the first generation value of the first candidate BVD is less than or equal to the first generation value of the third candidate BVD, the first candidate BVD is set as the first candidate BVD in the candidate BVD list, the third candidate BVD is set as the second candidate BVD in the candidate BVD list, the second candidate BVD is set as the third candidate BVD in the candidate BVD list, and the fourth candidate BVD is set as the fourth candidate BVD in the candidate BVD list.
  • the third candidate BVD is set as the first candidate BVD in the candidate BVD list
  • the first candidate BVD is set as the second candidate BVD in the candidate BVD list
  • the fourth candidate BVD is set as the third candidate BVD in the candidate BVD list
  • the second candidate BVD is set as the fourth candidate BVD in the candidate BVD list.
  • the final sorting process can be: if in the third comparison, the Cost corresponding to posiGrp[0] is less than or equal to the Cost corresponding to negaGrp[0], posiGrp[0] is sorted at the 0th position in the candidate BVD list OrderedList, negaGrp[0] is sorted at the 1st position in the candidate BVD list OrderedList, posiGrp[1] is sorted at the 2nd position in the candidate BVD list OrderedList, and negaGrp[1] is sorted at the 3rd position in the candidate BVD list OrderedList.
  • the Cost corresponding to posiGrp[0] is greater than the Cost corresponding to negaGrp[0], sort negaGrp[0] at the 0th position in the candidate BVD list OrderedList, sort posiGrp[0] at the 1st position in the candidate BVD list OrderedList, sort negaGrp[1] at the 2nd position in the candidate BVD list OrderedList, and sort posiGrp[1] at the 3rd position in the candidate BVD list OrderedList.
  • the candidate BVD at position 0 in the candidate BVD list of the current block is the first candidate BVD in the candidate BVD list
  • the candidate BVD at position 1 is the second candidate BVD in the candidate BVD list
  • the candidate BVD at position 2 is the third candidate BVD in the candidate BVD list
  • the candidate BVD at position 3 is the fourth candidate BVD in the candidate BVD list.
  • the first candidate BVD, the second candidate BVD, the third candidate BVD, and the fourth candidate BVD are sorted based on the first generation value to determine the candidate BVD list
  • another available method is as follows: if the first generation value of the first candidate BVD is less than or equal to the first generation value of the third candidate BVD, the first candidate BVD is set as the first candidate BVD in the candidate BVD list, the second candidate BVD is set as the second candidate BVD in the candidate BVD list, the third candidate BVD is set as the third candidate BVD in the candidate BVD list, and the fourth candidate BVD is set as the fourth candidate BVD in the candidate BVD list.
  • the third candidate BVD is set as the first candidate BVD in the candidate BVD list
  • the fourth candidate BVD is set as the second candidate BVD in the candidate BVD list
  • the first candidate BVD is set as the third candidate BVD in the candidate BVD list
  • the second candidate BVD is set as the fourth candidate BVD in the candidate BVD list.
  • the final sorting process can be: if in the third comparison, the Cost corresponding to posiGrp[0] is less than or equal to the Cost corresponding to negaGrp[0], posiGrp[0] is sorted at the 0th position in the candidate BVD list OrderedList, negaGrp[0] is sorted at the 2nd position in the candidate BVD list OrderedList, posiGrp[1] is sorted at the 1st position in the candidate BVD list OrderedList, and negaGrp[1] is sorted at the 3rd position in the candidate BVD list OrderedList.
  • the Cost corresponding to posiGrp[0] is greater than the Cost corresponding to negaGrp[0], sort negaGrp[0] at the 0th position in the candidate BVD list OrderedList, sort posiGrp[0] at the 2nd position in the candidate BVD list OrderedList, sort negaGrp[1] at the 1st position in the candidate BVD list OrderedList, and sort posiGrp[1] at the 3rd position in the candidate BVD list OrderedList.
  • the candidate BVDs are sorted according to the first generation value to determine the candidate BVD list of the current block, if absBvdX is equal to 0 or absBvdY is equal to 0, the candidate BVD with the smallest first generation value among the candidate BVDs is set as the first candidate BVD in the candidate BVD list, and another candidate BVD among the candidate BVDs is set as the second candidate BVD in the candidate BVD list.
  • the two candidate BVDs can be directly sorted according to the size of the first generation value to generate a candidate BVD list.
  • the combination list is ⁇ (0, +BVD VER ), (0, -BVD VER ) ⁇
  • the corresponding cost list is ⁇ Cost(0, +BVD VER ), Cost(0, -BVD VER ) ⁇ .
  • the sorting process is: compare the size of Cost (0, +BVD VER ) and Cost (0, -BVD VER ):
  • the combination list is ⁇ (+BVD HOR , 0), (-BVD HOR , 0) ⁇
  • the corresponding cost list is ⁇ Cost(+BVD HOR , 0), Cost(-BVD HOR , 0) ⁇ .
  • the sorting process is: compare the size of Cost (+BVD HOR , 0) and Cost (-BVD HOR , 0):
  • (+BVD HOR , 0) is sorted at the 0th position of the candidate BVD list OrderedList, and (-BVD HOR , 0) is sorted at the 1st position of the candidate BVD list OrderedList;
  • (-BVD HOR , 0) is sorted at the 0th position of the candidate BVD list OrderedList, and (+BVD HOR , 0) is sorted at the 1st position of the candidate BVD list OrderedList.
  • the sorting process can be to sort the candidate BVDs according to the first generation value to determine the candidate BVD set of the current block, wherein the candidate BVD set includes at least one candidate BVD.
  • the candidate BVDs are sorted according to the first-generation values to determine the candidate BVD set of the current block, if absBvdX and absBvdY are not equal to 0, the candidate BVDs are stored in the first array and the second array respectively; then the fifth candidate BVD with the smallest first-generation value in the first array and the sixth candidate BVD with the smallest first-generation value in the second array are determined; finally, the candidate BVD with the smallest first-generation value among the fifth candidate BVD and the sixth candidate BVD can be determined as the BVD with the smallest cost in the candidate BVD set.
  • posiGrp stores the sign combination of two BVDs with positive signs on the same component (level)
  • negaGrp stores the sign combination of two BVDs with negative signs on the same component (level).
  • posiGrp ⁇ (+, +), (+, -) ⁇
  • negaGrp ⁇ (-, +), (-, -) ⁇ .
  • the order of the members in the two lists posiGrp and negaGrp can be arranged arbitrarily.
  • First comparison compare Cost(+, +) and Cost(+, -), set posiGrp[0] to the smaller BVD combination, and set posiGrp[1] to the larger BVD combination;
  • Second comparison Compare Cost(-, +) and Cost(-, -), set negaGrp[0] to the smaller BVD sign combination of the two, and set negaGrp[1] to the larger BVD sign combination of the two;
  • the third comparison compare the Cost corresponding to posiGrp[0] and negaGrp[0].
  • a symbol combination of a BVD with the minimum cost can be determined, that is, the BVD with the minimum cost in the candidate BVD set can be determined.
  • the two candidate BVDs can be directly sorted according to the size of the first generation value to determine the BVD with the minimum cost in the candidate BVD set.
  • the candidate BVDs when the candidate BVDs are sorted according to the first-generation value to determine the candidate BVD set of the current block, if absBvdX is equal to 0 or absBvdY is equal to 0, then the candidate BVD with the smallest first-generation value among the candidate BVDs can be determined as the BVD with the smallest cost in the candidate BVD set.
  • the combination list is ⁇ (+, +), (+, -) ⁇
  • the corresponding cost list is ⁇ Cost(+, +), Cost(+, -) ⁇ .
  • the order of the members in the above two lists can be arranged arbitrarily.
  • the comparison process is: compare the size of Cost(+, +) and Cost(+, -), and then determine the sign combination of a BVD with the smallest Cost, that is, determine the BVD with the smallest cost in the candidate BVD set.
  • the combination list is ⁇ (+, +), (-, +) ⁇
  • the corresponding cost list is ⁇ Cost(+, +), Cost(-, +) ⁇ .
  • the order of the members in the above two lists can be arranged arbitrarily.
  • the comparison process is: compare the size of Cost(+, +) and Cost(-, +), and then determine the sign combination of a BVD with the smallest Cost, that is, determine the BVD with the smallest cost in the candidate BVD set.
  • Step 302 Determine the BVD symbol index information of the current block according to the BVD symbol information of the current block and the sorting result.
  • the BVD symbol index information of the current block can be further determined based on the BVD symbol information of the current block and the sorting result.
  • the candidate BVD list of the current block obtained by the sorting process is an ascending (descending) list
  • the BVD combination list OrderedList may be converted into the index conversion list TransformedList according to the conversion rule.
  • the candidate BVD list may be transformed to determine an index transformation list (TransformedList).
  • the first bit of the BVD symbol index information is determined to be 0; otherwise, the first bit is determined to be 1.
  • the second bit of the BVD symbol index information is determined to be 0; otherwise, the second bit is determined to be 1.
  • the first bit when the first bit is determined to be 1, if the second component symbol of the BVD symbol information of the current block is the same as the second component symbol of the candidate BVD with an index of 1 in the index conversion list, the second bit of the BVD symbol index information is determined to be 0; otherwise, the second bit is determined to be 1.
  • the symbol prediction index of BVD is two bits.
  • Table 78 OrderedList of sorted BVD combinations where both horizontal and vertical BVDs exist
  • the symbol prediction index is obtained according to the following rules.
  • the symbol prediction index is equal to the index of the leftmost column in the table:
  • Table 80 OrderedList instance of sorted BVD combination list where both horizontal and vertical BVD exist
  • the BVD symbol index information of the current block when determining the BVD symbol index information of the current block based on the BVD symbol information and the sorting result of the current block, when absBvdX is 0, if the second component symbol of the BVD symbol information of the current block is the same as the second component symbol of the first candidate BVD in the index conversion list, the BVD symbol index information is determined to be 0; otherwise, the BVD symbol index information is determined to be 1.
  • the symbol prediction index of BVD is one bit:
  • index transformation list TransformedList is the same as the sorted BVD combination list OrderedList.
  • the index transformation list TransformedList is:
  • the symbol prediction index is obtained according to the following rules.
  • the symbol prediction index is equal to the index of the leftmost column in the table:
  • the index transformation list TransformedList is:

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)

Abstract

本申请实施例提供了一种编解码方法,在解码端,解码码流,确定当前块的BVD绝对值和BVD符号索引信息;根据当前块的BVD绝对值,对当前块的候选BVD进行排序处理,确定排序结果;根据BVD符号索引信息和排序结果,确定当前块的BVD;根据当前块的BVD,确定当前块的重建值。在编码端,根据当前块的BVD绝对值,对当前块的候选BVD进行排序处理,确定排序结果;根据当前块的BVD符号信息和排序结果,确定当前块的BVD符号索引信息;将BVD绝对值和BVD符号索引信息写入码流。

Description

编解码方法、编码器、解码器以及存储介质 技术领域
本申请实施例涉及图像处理技术领域,尤其涉及一种编解码方法、编码器、解码器以及存储介质。
背景技术
随着人们对视频显示质量要求的提高,高清和超高清视频等新视频应用形式应运而生。H.265/高效率视频编码(High Efficiency Videocoding,HEVC)已经无法满足视频应用迅速发展的需求,联合视频研究组(Joint Video Exploration Team,JVET)提出了下一代视频编码标准H.266/多功能视频编码(Versatile Videocoding,VVC),其相应的测试模型为VVC的参考软件测试平台(VVCTest Model,VTM)。
帧内块拷贝(Intrablockcopy,IBC)是VVC针对屏幕内容类型的视频序列的编码(Screencontentcoding)的扩展工具,它显著提高了屏幕内容序列的编码效率。然而,在IBC模式中,块向量差异(Block Vector Difference,BVD)的符号信息的传输方法往往比较复杂,在一定程度上增大了传输码率,进而降低IBC模式的编码性能。
发明内容
本申请实施例提供一种编解码方法、编码器、解码器以及存储介质,能够有效地节省IBC模式中的BVD的符号传输所需的码率,从而可以提高编码效率。
本申请实施例的技术方案可以如下实现:
第一方面,本申请实施例提供了一种解码方法,应用于解码器,所述方法包括:
解码码流,确定当前块的BVD绝对值和BVD符号索引信息;
根据当前块的BVD绝对值,对所述当前块的候选BVD进行排序处理,确定排序结果;
根据所述BVD符号索引信息和所述排序结果,确定所述当前块的BVD;
根据所述当前块的BVD,确定所述当前块的重建值。
第二方面,本申请实施例提供了一种编码方法,应用于编码器,所述方法包括:
根据当前块的BVD绝对值,对所述当前块的候选BVD进行排序处理,确定排序结果;
根据所述当前块的BVD符号信息和所述排序结果,确定所述当前块的BVD符号索引信息;
将所述BVD绝对值和所述BVD符号索引信息写入码流。
第三方面,本申请实施例提供了一种编码器,所述编码器包括第一确定单元,编码单元;其中,
所述第一确定单元,配置为根据当前块的BVD绝对值,对所述当前块的候选BVD进行排序处理,确定排序结果;根据所述当前块的BVD符号信息和所述排序结果,确定所述当前块的BVD符号索引信息;
所述编码单元,配置为将所述BVD绝对值和所述BVD符号索引信息写入码流。
第四方面,本申请实施例提供了一种编码器,所述编码器包括第一存储器和第一处理器;其中,
所述第一存储器,用于存储能够在所述第一处理器上运行的计算机程序;
所述第一处理器,用于在运行所述计算机程序时,执行如第二方面所述的方法。
第五方面,本申请实施例提供了一种解码器,所述解码器包括解码单元,第二确定单元;其中,
所述解码单元,配置为解码码流;
所述第二确定单元,配置为确定当前块的BVD绝对值和BVD符号索引信息;
根据当前块的BVD绝对值,对所述当前块的候选BVD进行排序处理,确定排序结果;根据所述BVD符号索引信息和所述排序结果,确定所述当前块的BVD;根据所述当前块的BVD,确定所述当前块的重建值。
第六方面,本申请实施例提供了一种解码器,所述解码器包括第二存储器和第二处理器;其中,
所述第二存储器,用于存储能够在所述第二处理器上运行的计算机程序;
所述第二处理器,用于在运行所述计算机程序时,执行如第一方面所述的方法。
第七方面,本申请实施例提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序被执行时实现如第一方面所述的方法、或者实现如第二方面所述的方法。
本申请实施例提供了一种编解码方法、编码器、解码器以及存储介质,在解码端,解码码流,确定当前块的BVD绝对值和BVD符号索引信息;根据当前块的BVD绝对值,对当前块的候选BVD进行排序处理,确定排序结果;根据BVD符号索引信息和排序结果,确定当前块的BVD;根据当前块的BVD,确定当前块的重建值。在编码端,根据当前块的BVD绝对值,对当前块的候选BVD进行排序处理,确定排序结果;根据当前块的BVD符号信息和排序结果,确定当前块的BVD符号索引信息;将BVD绝对值和BVD符号索引信息写入码流。由此可见,在本申请的实施例中,可以根据当前块的BVD绝对值对当前块的候选BVD进行有效排序处理,从而可以在编码时利用排序结果进行BVD符号索引信息的确定和传输,在解码时利用排序结果进行当前块的BVD符号信息的解析,同时可以使用CABAC编解码技术对BVD符号信息进行编解码处理,能够有效地节省IBC模式中的BVD的符号传输所需的码率,从而可以提高编码效率。
附图说明
图1为IBC模式的预测示意图;
图2为相邻块的示意图;
图3为本申请实施例提供的一种视频编码系统的组成框图;
图4为本申请实施例提供的一种视频解码系统的组成框图;
图5为本申请实施例中的解码方法的示意图一;
图6为模板类型的示意图;
图7为当前编码块的BVP和BVD的示意图;
图8为模板运动补偿的示意图;
图9为BVD组合的示意图;
图10为本申请实施例中的解码方法的示意图二;;
图11为计算成本的示意图;
图12为本申请实施例中的编码方法的示意图一;
图13为本申请实施例中的编码方法的示意图二;
图14为编码器的组成结构示意图一;
图15为编码器的组成结构示意图二;
图16为解码器的组成结构示意图一;
图17为解码器的组成结构示意图二。
具体实施方式
为了能够更加详尽地了解本申请实施例的特点与技术内容,下面结合附图对本申请实施例的实现进行详细阐述,所附附图仅供参考说明之用,并非用来限定本申请实施例。
在以下的描述中,涉及到“一些实施例”,其描述了所有可能实施例的子集,但是可以理解,“一些实施例”可以是所有可能实施例的相同子集或不同子集,并且可以在不冲突的情况下相互结合。还需要指出,本申请实施例所涉及的术语“第一\第二\第三”仅是用于区别类似的对象,不代表针对对象的特定排序,可以理解地,“第一\第二\第三”在允许的情况下可以互换特定的顺序或先后次序,以使这里描述的本申请实施例能够以除了在这里图示或描述的以外的顺序实施。
在视频图像中,一般采用第一图像分量、第二图像分量和第三图像分量来表征编码块(Codingblock,CB);其中,这三个图像分量分别为一个亮度分量、一个蓝色色度分量和一个红色色度分量,具体地,亮度分量通常使用符号Y表示,蓝色色度分量通常使用符号Cb或者U表示,红色色度分量通常使用符号Cr或者V表示;这样,视频图像可以用YCbCr格式表示,也可以用YUV格式表示。
在本申请实施例中,第一图像分量可以为亮度分量,第二图像分量可以为蓝色色度分量,第三图像分量可以为红色色度分量,但是本申请实施例不作具体限定。
通用的视频编解码标准基于都采用基于块的混合编码框架。视频图像中的每一帧被分割成相同大小(比如128×128,64×64等)的正方形的最大编码单元(Largestcoding Unit,LCU)或编码树单元(Coding Tree Unit,CTU),每个最大编码单元或编码树单元还可以根据规则划分成矩形的编码单元(Coding Unit,CU);而且编码单元可能还会划分成更小的预测单元(Prediction Unit,PU)、变换单元(Transform Unit,TU)等。
混合编码框架可以包括有预测(Prediction)、变换(Transform)、量化(Quantization)、熵编码(Entropycoding)、环路滤波(Inloop Filter)等模块。其中,预测模块可以包括帧内预测(Intra Prediction)和帧间预测(Inter Prediction),帧间预测可以包括运动估计(Motion Estimation)和运动补偿(Motioncompensation)。由于视频图像的一个帧内相邻像素之间存在很强的相关性,在视频编解码技术中使用帧内预测方式能够消除相邻像素之间的空间冗余;但是由于视频图像中的相邻帧之间也存在着很强的相似性,在视频编解码技术中使用帧间预测方式消除相邻帧之间的时间冗余,从而能够提高编解码效率。
视频编解码器的基本流程如下:在编码端,将一帧图像划分成块,对当前块使用帧内预测或帧间预测产生当前块的预测块,当前块的原始块减去预测块得到残差块,对残差块进行变换、量化得到量化系数矩阵,对量化系数矩阵进行熵编码输出到码流中。在解码端,对当前块使用帧内预测或帧间预测产生当前块的预测块,另一方面解码码流得到量化系数矩阵,对量化系数矩阵进行反量化、反变换得到残差块,将预测块和残差块相加得到重建块。重建块组成重建图像,基于图像或基于块对重建图像进行环路滤波得到解码图像。编码端同样需要和解码端类似的操作获得解码图像。解码图像可以为后续的帧作为帧间预测的参考帧。编码端确定的块划分信息,预测、变换、量化、熵编码、环路滤波等模式信息或者参数信息如果有必要需要在输出到码流中。解码端通过解码及根据已有信息进行分析确定与编码端相同的块划分信息,预测、变换、量化、熵编码、环路滤波等模式信息或者参数信息,从而保证编码端获得的解码图像和解码端获得的解码图像相同。编码端获得的解码图像通常也叫做重建图像。在预测时可以将当前块划分成预测单元,在变换时可以将当前块划分成变换单元,预测单元和变换单元的划分可以不同。上述是基于块的混合编码框架下的视频编解码器的基本流程,随着技术的发展,该框架或流程的一些模块或步骤可能会被优化,本申请实施例适用于该基于块的混合编码框架下的视频编解码器的基本流程,但不限于该框架及流程。
当前块(Currentblock,CB)可以是当前编码单元(CU)或当前预测单元(PU)等。
帧内块拷贝(Intrablockcopy,IBC)是VVC针对屏幕内容类型的视频序列的编码(Screencontentcoding)的扩展工具,它显著提高了屏幕内容序列的编码效率。
IBC是一种块级的编码模式,和帧间技术类似,编码端执行运动搜索,即块匹配(Block Maching,BM),为每个CU找到其最佳的块向量(Block Vector,BV),也可以称为运动向量(Motion Vector,MV),块向量是从当前块指向参考块的向量。和帧间技术不同的地方在于,IBC的最佳块向量是在当前cU所处帧(即当前编码帧)的重建区域搜索得到的,而帧间的运动向量是通过当前编码帧在时间域上的相邻参考帧搜索得到的。
图1为IBC模式的预测示意图,如图1所示,H.266/VVC中IBC模式下获取当前编码块的重建像素的具体流程可以包括推导BV、利用BV推导预测样本、推导残差样本和利用预测样本以及残差样本推导重建样本。
其中,推导BV的具体流程如下:
(1)亮度:
输入:亮度位置(xCb,yCb),指定当前编码块的左上角样本相对于当前图片的左上角亮度样本,一个变量cbWidth,指定亮度样本中当前编码块的宽度,一个变量cbHeight,指定亮度样本中当前编码块的高度。
输出:亮度的bvL(Block Vector Luma)。
IBC模式分为IBCMERGE和IBCAMVP,在推导bvL的时候均需要建立IBC块向量候选列表bvCandList,下面介绍IBCMERGE的列表的建立流程,IBCAMVP的列表建立流程与IBCMERGE一致,但两者的最大候选数量不一致。
步骤一:当IsGt4by4等于TRUE时(变量IsGt4by4为当亮度宽度乘以高度,当IsGt4by4大于16时为TRUE),使用亮度编码块位置(xCb,yCb)、亮度编码块宽度cbWidth和高度cbHeight调用解码规范所规定的来自相邻编码单元的空间块向量候选的推导过程作为输入,输出是可用性标志availableFlagA1、availableFlagB1和块向量bvA1和bvB1。其中,A1和B1为相邻块。图2为相邻块的示意图,如图2所示,A1和B1所在的相邻块与当前编码块的相对位置分别为左下角和右上角。
步骤二:当IsGt4by4等于TRUE时,块向量候选列表bvCandList构造如下:
i=0
if(availableFlagA1)
bvCandList[i++]=bvA1
if(availableFlagB1)
bvCandList[i++]=bvB1
步骤三:变量numCurrCand表示当前已经得到的候选数量,numCurrCand推导过程如下:
若IsGt4by4等于TRUE,numCurrCand设置为等于bvCandList中的候选数;否则numCurrCand设置为0。
步骤四:当numCurrCand小于MaxNumIbcMergeCand(MERGE模式下的最大候选数量)且NumHmvpIbcCand(表征IBC模式下的历史最优块向量(Hmvp)的最大候选数量)大于0时,以bvCandList和numCurrCand作为输入,修改后的bvCandList和numCurrCand作为输出,调用解码规范所规定的基于历史的IBC块向量候选的推导过程。
步骤五:
当numCurrCand小于MaxNumIbcMergeCand时,以下适用直到numCurrCand等于MaxNumIbcMergeCand:
bvCandList[numCurrCand][0](即bv的水平分量)设置为等于0。
bvCandList[numCurrCand][1](即bv的垂直分量)设置为等于0。
numCurrCand增加1。
这样,块向量候选列表bvCandList建立完成,使用general_merge_flag表示是否为IBCMERGE模式,候选的索引bvIdx采用如下方式推导:
bvIdx=general_merge_flag[xCb][yCb]?merge_idx[xCb][yCb]:mvp_l0_flag[xCb][yCb]
这样根据索引bvIdx以及块向量候选列表bvCandList就可以得到具体的bvL:
bvL[0]=bvCandList[bvIdx][0]
bvL[1]=bvCandList[bvIdx][1]
对于IBCAMVP模式,通过索引bvIdx以及块向量候选列表bvCandList就可以得到具体的bvL为预测bvL,真实bvL还需要加上块向量差异(Block Vector Difference,BVD),其具体流程如下:
步骤一:得到BVD的水平和垂直分量,其中MvdL0为前向的运动向量差异。
bvd[0]=MvdL0[xCb][yCb][0]
bvd[1]=MvdL0[xCb][yCb][1]
步骤二:对上述获取的预测bvL进行舍入操作,其中右移参数AmvrShift进行舍入,左移参数AmvrShift用于提高分辨率。
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)步骤三:真实bvL的推导如下,其范围需要控制在-217到217–1之间:
u[0]=(bvL[0]+bvd[0]+218)%218
bvL[0]=(u[0]>=217)?(u[0]-218):u[0]
u[1]=(bvL[1]+bvd[1]+218)%218
bvL[1]=(u[1]>=217)?(u[1]-218):u[1]
(2)色度:如果是双树划分,色度不做IBC;如果是单树划分,需要推导色度的BV。
输入:亮度的bvL(1/16像素精度)
输出:色度的bvC(Block Vectorchroma)(1/32像素精度)
推导过程如下:
bvC[0]=((bvL[0]>>(3+SubWidthC))×32)
bvC[1]=((bvL[1]>>(3+SubHeightC))×32)
其中,利用BV推导预测样本的具体流程如下:
输入:亮度位置(xCb,yCb),指定当前编码块的左上角样本相对于当前图片的左上角亮度样本,一个变量cbWidth,指定亮度样本中当前编码块的宽度,一个变量cbHeight,指定亮度样本中当前编码块的高度,块向量bv,一个变量cIdx,指定当前块的颜色分量索引。
输出:预测样本的数组predSamples。
推导过程如下:
当cIdx等于0即为亮度分量的时候,对于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]
IbcBufWidthY为IBC存储的重建buffer的亮度像素的宽,CtbSizeY为CTU(Coding Tree Unit)的大小,ibcVirBuf为IBC存储的重建像素。
当cIdx不等于0即为色度分量的时候,对于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]
变量SubWidthC和SubHeightC具体取决于通过sps_chroma_format_idc指定的色度格式采样结构,具体对应关系如下表所示:
表1
sps_chroma_format_idc 颜色采样格式 SubWidthC SubHeightC
0 单色 1 1
1 4:2:0 2 2
2 4:2:2 2 1
3 4:4:4 1 1
其中,在推导残差样本时,可以调用解码规范所规定的帧间预测模式下编码块的残差信号的解码过程。在利用预测样本以及残差样本推导重建样本时,可以调用解码规范所规定的指定颜色分量的图像重建过程。
进一步地,在IBC的BVD的编码过程中,对于IBCAMVP模式,可以使用基础块向量预测(Block Vector Predition,BVP)进行运动估计,搜索最佳块运动向量,搜索得到的最佳块运动向量和基础块向量的差值为块向量差异BVD。
其中,BVD的编码过程为:对于BVD水平分量和垂直分量,分别先编码BVD是否为零的标志:如果其不为零则编码其绝对值,然后再旁路编码BVD符号;否则将不继续编码任何比特位。
进一步地,对于H.266/VVC中IBC的BVD的解码过程,VVC中BVD的解码方式同帧间的MVD的解码方式。MVD具体的解码流程:
Figure PCTCN2022125219-appb-000001
Figure PCTCN2022125219-appb-000002
Figure PCTCN2022125219-appb-000003
其中,mvd_sign_flag[compIdx]表示某个(水平或垂直)分量compIdx的运动矢量差异的符号:如果mvd_sign_flag[compIdx]等于0,则对应的运动矢量分量差异具有正值;否则(mvd_sign_flag[compIdx]等于1),对应的运动矢量分量差异为负值;当mvd_sign_flag[compIdx]不存在时,推断为等于0。
compIdx=0..1的运动矢量差异lMvd[compIdx]的推导如下,lMvd[compIdx]的值应在-217到217-1的范围内:
lMvd[compIdx]=abs_mvd_greater0_flag[compIdx]×(abs_mvd_minus2[compIdx]+2)×(1-2×mvd_sign_flag[compIdx])
IBC模式下,refList等于0,对于compIdx=0..1(0表示水平分量,1表示垂直分量),MvdL0[x0][y0][compIdx]设置为等于lMvd[compIdx],进而推导出BVD的水平和垂直分量:
bvd[0]=MvdL0[x0][y0][0]
bvd[1]=MvdL0[x0][y0][1]
表2
Figure PCTCN2022125219-appb-000004
进一步,Beyond VVC中IBC的BVD的解码过程:
Figure PCTCN2022125219-appb-000005
Figure PCTCN2022125219-appb-000006
其中,bvd_sign_flag[compIdx]表示某个(水平或垂直)分量compIdx的运动矢量差异的符号:如果bvd_sign_flag[compIdx]等于0,则对应的运动矢量分量差异具有正值;否则(bvd_sign_flag[compIdx]等于1),对应的运动矢量分量差异为负值;当bvd_sign_flag[compIdx]不存在时,推断为等于0。
compIdx=0..1的运动矢量差异bvd[compIdx]的推导如下:
bvd[compIdx]=abs_bvd_greater0_flag[compIdx]×
(abs_bvd_minus1[compIdx]+1)×(1-2×bvd_sign_flag[compIdx])
表3
Figure PCTCN2022125219-appb-000007
如上所示,目前对IBC模式下的BVD的符号采用旁路编码,而旁路编码是一种等概的编码方式,无须对概率进行自适应更新,而是采用0和1概率各占1/2的固定概率进行编码,编码方式简单,无法根据视频信息以及历史编码信息进行自适应更新,1个BVD符号信息对应码流的1个比特,存在较大的码率冗余。
可见,目前常见的BVD编码方案依然存在很大的改进空间。
参见图3,其示出了本申请实施例提供的一种视频编码系统的组成框图示例;如图3所示,该视频编码系统10包括变换与量化单元101、帧内估计单元102、帧内预测单元103、运动补偿单元104、运动估计单元105、反变换与反量化单元106、滤波器控制分析单元107、滤波单元108、编码单元109和解码图像缓存单元110等,其中,滤波单元108可 以实现去方块滤波及样本自适应缩进(Sample Adaptive 0ffset,SAO)滤波,编码单元109可以实现头信息编码及基于上下文的自适应二进制算术编码(Context-based Adaptivebinary Arithmaticcoding,CABAC)。针对输入的原始视频信号,通过编码树块(Coding Tree Unit,CTU)的划分可以得到一个视频编码块,然后对经过帧内或帧间预测后得到的残差像素信息通过变换与量化单元101对该视频编码块进行变换,包括将残差信息从像素域变换到变换域,并对所得的变换系数进行量化,用以进一步减少比特率;帧内估计单元102和帧内预测单元103是用于对该视频编码块进行帧内预测;明确地说,帧内估计单元102和帧内预测单元103用于确定待用以编码该视频编码块的帧内预测模式;运动补偿单元104和运动估计单元105用于执行所接收的视频编码块相对于一或多个参考帧中的一或多个块的帧间预测编码以提供时间预测信息;由运动估计单元105执行的运动估计为产生运动向量的过程,所述运动向量可以估计该视频编码块的运动,然后由运动补偿单元104基于由运动估计单元105所确定的运动向量执行运动补偿;在确定帧内预测模式之后,帧内预测单元103还用于将所选择的帧内预测数据提供到编码单元109,而且运动估计单元105将所计算确定的运动向量数据也发送到编码单元109;此外,反变换与反量化单元106是用于该视频编码块的重构建,在像素域中重构建残差块,该重构建残差块通过滤波器控制分析单元107和滤波单元108去除方块效应伪影,然后将该重构残差块添加到解码图像缓存单元110的帧中的一个预测性块,用以产生经重构建的视频编码块;编码单元109是用于编码各种编码参数及量化后的变换系数,在基于CABAC的编码算法中,上下文内容可基于相邻编码块,可用于编码指示所确定的帧内预测模式的信息,输出该视频信号的码流;而解码图像缓存单元110是用于存放重构建的视频编码块,用于预测参考。随着视频图像编码的进行,会不断生成新的重构建的视频编码块,这些重构建的视频编码块都会被存放在解码图像缓存单元110中。
参见图4,其示出了本申请实施例提供的一种视频解码系统的组成框图示例;如图4所示,该视频解码系统20包括解码单元201、反变换与反量化单元202、帧内预测单元203、运动补偿单元204、滤波单元205和解码图像缓存单元206等,其中,解码单元201可以实现头信息解码以及CABAC解码,滤波单元205可以实现去方块滤波以及SAO滤波。输入的视频信号经过图4的编码处理之后,输出该视频信号的码流;该码流输入视频解码系统20中,首先经过解码单元201,用于得到解码后的变换系数;针对该变换系数通过反变换与反量化单元202进行处理,以便在像素域中产生残差块;帧内预测单元203可用于基于所确定的帧内预测模式和来自当前帧或图片的先前经解码块的数据而产生当前视频解码块的预测数据;运动补偿单元204是通过剖析运动向量和其他关联语法元素来确定用于视频解码块的预测信息,并使用该预测信息以产生正被解码的视频解码块的预测性块;通过对来自反变换与反量化单元202的残差块与由帧内预测单元203或运动补偿单元204产生的对应预测性块进行求和,而形成解码的视频块;该解码的视频信号通过滤波单元205以便去除方块效应伪影,可以改善视频质量;然后将经解码的视频块存储于解码图像缓存单元206中,解码图像缓存单元206存储用于后续帧内预测或运动补偿的参考图像,同时也用于视频信号的输出,即得到了所恢复的原始视频信号。
本申请实施例中的编码方法,可以应用在如图3所示的帧内预测单元103和能够实现CABAC编码算法的编码单元109部分。另外,本申请实施例中的解码方法,还可以应用在如图4所示的帧内预测单元203和能够实现CABAC解码算法的解码单元201。也就是说,本申请实施例中的编解码方法,既可以应用于视频编码系统,也可以应用于视频解码系统,甚至还可以同时应用于视频编码系统和视频解码系统,但是本申请实施例不作具体限定。还需要说明的是,当该编解码方法应用于视频编码系统时,“当前块”具体是指帧内预测中的当前编码块;当该编解码方法应用于视频解码系统时,“当前块”具体是指帧内预测中的当前解码块。
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述。
本申请的实施例提出了一种解码方法,该解码方法可以应用于解码器,图5为本申请实施例中的解码方法的示意图一,如图5所示,解码器进行解码处理的方法可以包括以下步骤:
步骤101、解码码流,确定当前块的BVD绝对值和BVD符号索引信息。
在本申请的实施例中,解码器通过解码码流,可以确定出当前块的BVD绝对值和BVD符号索引信息。
需要说明的是,在本申请的实施例中,解码器可以直接从码流中解析出真实的当前块的BVD绝对值。即解码器解码码流,可以确定当前块的BVD绝对值。
进一步地,在本申请的实施例中,解码器解码码流,还可以确定出当前块的BVD符号索引信息,即解析获得当前块的符号预测索引。
可以理解的是,在本申请的实施例中,BVD绝对值包括第一分量绝对值absBvdX和第二分量绝对值absBvdY;即BVD绝对值包括水平分量绝对值和垂直分量绝对值。相应的,当前块的BVD可以包括第一分量candBvdX和第二分量candBvdY,同时,当前块的候选BVD也包括第一分量candBvdX和第二分量candBvdY,即BVD可以包括水平分量和垂直分量。
进一步地,在本申请的实施例中,如果absBvdX和absBvdY均不为0,那么可以确定BVD符号索引信息的比特位数为2;如果absBvdX或absBvdY为0,那么可以确定BVD符号索引信息的比特位数为1。
需要说明的是,在本申请的实施例中,除了例如上述的定长编码方法以外,还可以采用变长编码方法对BVD符号索引信息进行编码处理。例如采用截断一元码编码BVD符号索引信息,既可以使用使用截断二进制码(Truncated binarization)进行二值化处理,此时BVD符号索引信息的比特位数不一定为2。
也就是说,在本申请的实施例中,如果采用截断一元码编码BVD符号索引信息(这里,该BVD符号索引信息可以为候选BVD列表中的索引值),则不同候选BVD对应的符号索引信息的比特位数不完全相同,即为变长编码。
需要说明的是,在本申请的实施例中,可以根据解码过程中的所解析出来的BVD绝对值来判断BVD符号索引信息的二进制数的比特位的数目。其中,若BVD的水平分量和垂直分量的绝对值都不为0时,则BVD符号索引信息的二进制数的比特位的数目为2;若BVD的水平分量为0并且垂直分量的绝对值不为0时,则BVD符号索引信息的二进制数的比特位的数目为1;若BVD的水平分量不为0并且垂直分量的绝对值为0时,则BVD符号索引信息的二进制数的比特位的数目为1。
然后,解码器可以使用CABAC(上下文自适应的二进制算术编码)或旁路对应的解码过程将BVD符号索引信息对应的二进制数可以从码流中解析出来。
针对BVD符号索引信息所使用的CABAC的上下文模型,可以使用单个概率模型,或者多个概率模型,可以包括 但不限于根据BVD的水平分量或垂直分量的绝对值大小、BVD的水平分量与垂直分量的和或差值等进行区分不同的概率模型。
例如,使用BVD的水平分量或垂直分量的绝对值大小对BVD的BVD符号索引信息的比特位使用不同的概率模型进行分类:
(1)假设BVD的水平或垂直分量的绝对值分类的一个阈值设为THR0,共有两个概率模型,则当BVD符号索引信息为两个比特位时,此二进制数的第0个比特位根据BVD的水平分量的绝对值与THR0的大小关系进行区分,即当BVD的水平分量的绝对值小于等于THR0时,使用第一个概率模型,当BVD的水平分量的绝对值大于THR0时,使用第二个概率模型;然后,上述二进制数的第1个比特位根据BVD的垂直分量的绝对值与THR0的大小关系进行区分,即当BVD的垂直分量的绝对值小于等于THR0时,使用第一个概率模型,当BVD的垂直分量的绝对值大于THR0时,使用第二个概率模型。
(2)假设BVD的水平分量的绝对值分类的一个阈值设为THR0,垂直分量的绝对值分类的一个阈值设为THR1,共有四个概率模型,则当BVD符号索引信息为两个比特位时,此二进制数的第0个比特位根据BVD的水平分量的绝对值与THR0的大小关系进行区分,即当BVD的水平分量的绝对值小于等于THR0时,使用第一个概率模型,当BVD的水平分量的绝对值大于THR0时,使用第二个概率模型;然后,上述二进制数的第1个比特位根据BVD的垂直分量的绝对值与THR1的大小关系进行区分,即当BVD的垂直分量的绝对值小于等于THR1时,使用第三个概率模型,当BVD的垂直分量的绝对值大于THR1时,使用第四个概率模型。
进一步地,在本申请的实施例中,在确定出当前块的BVD绝对值之后,可以利用BVD绝对值确定BVD的组合列表,其中,BVD的组合列表中包括当前块的任意数量的候选BVD。即可以利用BVD绝对值确定当前块的候选BVD,也可以理解为利用BVD绝对值确定当前块的候选BVD的初始集合。
需要说明的是,在本申请的实施例中,可以通过在BVD的可能符号和BVD绝对值之间创建BVD的组合列表(候选BVD)。其中,可以包括仅水平BVD存在、仅垂直BVD存在以及二者都存在的情况。
进一步地,在本申请的实施例中,在创建BVD的组合列表(候选BVD)时,主要包括对BVD的可能符号进行排列组合、对可能的水平符号和垂直符号分别乘以BVD的水平绝对值分量和垂直绝对值分量。
示例性的,在本申请的实施例中,如果仅垂直BVD存在,即如果absBvdX等于0,那么可以根据absBvdY确定候选BVD。
例如,BVD分为水平分量和垂直分量,当水平分量为零的时候,只对垂直分量进行编码,所以只对垂直分量的符号构建组合列表,具体为以下两种情况:
第一种情况:水平分量都为正号,只是一个占位,垂直分量先为正号,后为负号,构建一个符号列表,然后将构建的符号列表乘以BVD的水平和垂直分量的绝对值,进而得到BVD的组合列表。
Figure PCTCN2022125219-appb-000008
第二种情况:水平分量都为正号,只是一个占位,垂直分量先为负号,后为正号,构建一个符号列表,然后将构建的符号列表乘以BVD的水平和垂直分量的绝对值,进而得到BVD的组合列表。
Figure PCTCN2022125219-appb-000009
示例性的,在本申请的实施例中,如果仅水平BVD存在,即如果absBvdY等于0,那么可以根据absBvdX确定候选BVD。
例如,BVD分为水平分量和垂直分量,当垂直分量为零的时候,只对水平分量进行编码,所以只对水平分量的符号构建组合列表,具体为以下两种情况:
第一种情况:垂直分量都为正号,只是一个占位,水平分量先为正号,后为负号,构建一个符号列表,然后将构建的符号列表乘以BVD的垂直和水平分量的绝对值,进而得到BVD的组合列表。
Figure PCTCN2022125219-appb-000010
Figure PCTCN2022125219-appb-000011
第二种情况:垂直分量都为正号,只是一个占位,水平分量先为负号,后为正号,构建一个符号列表,然后将构建的符号列表乘以BVD的垂直和水平分量的绝对值,进而得到BVD的组合列表。
Figure PCTCN2022125219-appb-000012
示例性的,在本申请的实施例中,如果水平BVD和垂直BVD均存在,即如果absBvdX和absBvdY均不等于0,那么可以根据absBvdX和absBvdY确定候选BVD。
例如,BVD分为水平分量和垂直分量,当两分量均不为零的时候,二者均需要进行编码,所以要对水平和垂直分量一起构建BVD列表,具体分为24种情况,即{+1,+1}、{+1,-1}、{-1,+1}和{-1,-1}这4种组合下的任意排列,下述举例说明:
列表第0位为水平和垂直分量均为正号,列表第1位为水平分量为正号垂直分量为负号,列表第2位为水平分量为负号垂直分量为正号,列表第3位为水平分量和垂直分量均为负号,构建一个符号列表,然后将构建的符号列表乘以BVD的垂直和水平分量的绝对值,进而得到BVD的组合列表。
Figure PCTCN2022125219-appb-000013
步骤102、根据当前块的BVD绝对值,对当前块的候选BVD进行排序处理,确定排序结果。
在本申请的实施例中,在确定当前块的BVD绝对值和BVD符号索引信息之后,可以进一步根据当前块的BVD绝对值,对当前块的候选BVD进行排序处理,确定排序结果。
进一步地,在本申请的实施例中,在根据当前块的BVD绝对值,对当前块的候选BVD进行排序处理,确定排序结果时,可以先根据BVD绝对值,确定当前块的一个或多个候选BVD对应的第一代价值;然后可以根据第一代价值,对候选BVD进行排序,确定排序结果。
可以理解的是,在本申请的实施例中,一个或多个候选BVD可以包括candBvdX分别设置为等于–absBvdX或absBvdX、candBvdY分别设置为等于–absBvdY或absBvdY的BVD。
需要说明的是,在本申请的实施例中,在根据当前块的BVD绝对值,确定当前块的一个或多个候选BVD对应的第一代价值时,可以先根据候选BVD确定的第一匹配模板;然后根据预设的误差准则,计算当前块的第一模板与第一匹配模板之间的匹配误差,以确定候选BVD对应的第一代价值。
示例性的,在本申请的实施例中,在进行成本计算时,即确定第一代价值时,对于计算模板区域的成本的成本函数有多种选择,即预设的误差准则可以有多种选择。例如,可以选择绝对误差和(SAD)、变换绝对误差和(SATD)、差值平方和(SSE)、平均绝对差值(MAD)、平均绝对误差(MAE)、平均平方误差(MSE)、率失真函数(RDO)等评价准则。下述内容所提到的某种评价准则均可从上述准则中选择其一,以SAD的评价准则为例,计算公式如下:
Figure PCTCN2022125219-appb-000014
其中,predTempSizeW为模板的宽度,predTempSizeH为模板的高度,predTemp[i][j]为BV处模板的像素点,recTempC[i][j]为当前块模板的像素点。
也就是说,在本申请的实施例中,预设的误差准则可以包括绝对误差和SAD、变换绝对误差和SATD、差值平方和SSE、平均绝对差值MAD、平均绝对误差MAE、平均平方误差MSE、率失真函数RDO中的任意一种。
可以理解的是,在本申请的实施例中,第一模板包括当前块的相邻已解码区域中的一个或多个样值。
示例性的,在本申请的实施例中,在进行模板(当前块的第一模板)的选择时,可以根据当前块的邻近区域的像素可用性,判断模板位置的像素是否可用,包括重建亮度信息。图6为模板类型的示意图,如图6所示,根据模板与当前块的相对位置关系,可将模板分类为上模板、左模板、右上模板、左下模板、左上模板等模板类型。其中,不同编码块的不同类型的模板尺寸可以固定相同,也可以不同。
例如,模板尺寸对当前任意编码块(当前块)选择相同的模板尺寸,如下公式说明了一种模板尺寸的设置条件,其中,nTbW和nTbH分别为当前亮度编码块(当前块)的宽度和高度,iTempW和iTempH分别为采用的模板的宽度和高度:
上模板:
Figure PCTCN2022125219-appb-000015
左模板:
Figure PCTCN2022125219-appb-000016
例如,可以根据当前编码块的不同尺寸选择不同的模板尺寸,如下公式说明了一种模板的尺寸设置条件,nTbW和nTbH分别为当前亮度编码块的宽度和高度,iTempW和iTempH分别为采用的模板的宽度和高度:
上模板:
Figure PCTCN2022125219-appb-000017
左模板:
Figure PCTCN2022125219-appb-000018
Figure PCTCN2022125219-appb-000019
例如,也可以根据当前亮度编码块内的像素数选择不同的模板尺寸,如下公式说明了一种模板的尺寸设置条件,
nTbW和nTbH分别为当前亮度编码块的宽度和高度,nTbW×nTbH分别为当前亮度编码块的像素数,iTempW和iTempH分别为采用的模板的宽度和高度:
上模板:
Figure PCTCN2022125219-appb-000020
左模板:
Figure PCTCN2022125219-appb-000021
需要说明的是,在本申请的实施例中,在根据候选BVD确定的第一匹配模板时,可以先确定当前块的块向量预测值BVP;然后根据BVP和候选BVD确定当前块的候选BV;其中,候选BV用于指示第一匹配模板的位置;接着,可以根据候选BV确定第一匹配模板。
示例性的,在本申请的实施例中,假设BVP包括第三分量currBvpX和第四分量currBvpY,那么在根据BVP和候选BVD确定当前块的候选BV时,可以选择将候选BV的二维矢量设置为(currBvpX+candBvdX,currBvpY+candBvdY),即根据候选BVD的第一分量candBvdX、第二分量candBvdY,以及BVP的第三分量currBvpX、第四分量currBvpY进行BV的二维矢量的确定。
进一步地,在本申请的实施例中,在根据候选BV确定第一匹配模板时,可以根据当前点的位置和候选BV的二维矢量确定第一匹配模板。
示例性的,在本申请的实施例中,可以选择以当前点的位置为起点,将候选BV的二维矢量所指示的、与第一模板具有相同形状和包含相同数量样值的区域,确定为第一匹配模板。
在进行当前块的BV预测时,可以利用当前块的BVP以及BVD的组合列表,产生新的BV。图7为当前编码块的BVP和BVD的示意图,图8为模板运动补偿的示意图,如图7和图8所示,利用当前块判断这个BV是否可用(可用的条件为该BV指向的参考块已经重建,且未超出IBC所设定的搜索范围以及图像边界等条件),如果当前BV是可用的,然后就会利用当前块的模板和新的BV进行运动补偿,得到对应BV处的模板。图9为BVD组合的示意图,如图9所示,BVD水平和垂直分量共产生4种组合的BVD,分别进行模板处的运动补偿。计算成本时的模板的使用情况存在以下几种情况:
第一种:当前块的上模板和左模板均存在,且对应BV处的上模板和左模板均存在,此时上模板和左模板均可用。
第二种:当前块的上模板和左模板均存在,对应BV处仅上模板存在,此时存在两种方法:方法一:对应BV处左模板不存在,直接不用,即仅用上模板计算。方法二:对应BV处左模板不存在,采用参考块内部最左侧的模板宽度列代替左模板,即采用上模板和左模板计算。
第三种:当前块的上模板和左模板均存在,对应BV处仅左模板存在,此时存在两种方法:方法一:对应BV处上模板不存在,直接不用,即仅用左模板计算。方法二:对应BV处上模板不存在,采用参考块内部最上侧的模板高度行代替上模板,即采用上模板和左模板计算。
第四种:当前块仅上模板存在,此时存在三种方法:方法一:对应BV处上模板不存在,直接不用。方法二:对应BV处上模板不存在,采用参考块内部最上侧的模板高度行代替上模板。方法三:对应BV处上模板存在,直接用。
第五种:当前块仅左模板存在,此时存在三种方法:方法一:对应BV处左模板不存在,直接不用。方法二:对应BV处左模板不存在,采用参考块内部最左侧的模板宽度列代替左模板。方法三:对应BV处左模板存在,直接用。
第六种:当前块上模板和左模板均不存在,忽略此种情况的BVD组合情况。
以上六种情况下,当BV指向的参考块不可用时,均忽略此种情况下的BVD组合情况。当忽略某种情况下的BVD组合情况时,将此种情况下的成本置为成本评价准则的最大值。
进一步地,在本申请的实施例中,如果上述两个模板均能获取到,此时对这个模板进行处理,包括但不限于以下方法:将两者进行加权融合,计算方式为:
cost=w 0×above+w 1×left
其中,加权融合的标准可以选择固定加权系数或者根据各自模板的重建亮度与预测亮度的像素值之差的绝对值之和进行分配加权系数等,后者的计算加权系数的公式如下,SAD A为上模板的平均绝对差值,SAD L为左模板的平均绝对差值:
Figure PCTCN2022125219-appb-000022
由此可见,在本申请的实施例中,可以根据根据当前块的BVP和BVD的组合列表(候选BVD)进行模板预测,计算出BVD组合列表中的每个BVD组合(候选BVD)的成本(第一代价值),即计算模板区域的成本,可以对BVD组合列表中的各种组合利用模板进行成本的计算,具体为利用当前块模板位置处的重建亮度像素和利用当前块的BVP及BVD的组合得出的BV进行模板预测得到的位置处的重建亮度像素计算成本。
需要说明的是,在本申请的实施例中,在计算成本(第一代价值)时,不仅可以采用亮度,还可以包含色度即Cb和Cr分量。本申请不进行具体限定。
进一步地,在本申请的实施例中,在计算获得每一个候选BVD的第一代价值之后,便可以利用第一代价值对候选BVD进行排序处理,从而可以获得排序结果。其中,排序结果可以为排序后的当前块的候选BVD列表,也可以为通过排序确定出第一代价值最小的候选BVD的候选BVD集合。本申请不进行具体限定。
需要说明的是,在本申请的实施例中,如果排序结果为当前块的候选BVD列表,那么相应的,执行排序的过程可以为根据第一代价值,对候选BVD进行排序,确定当前块的候选BVD列表,其中,候选BVD列表至少包括一个候选BVD。
进一步地,在本申请的实施例中,在根据第一代价值,对候选BVD进行排序,确定当前块的候选BVD列表时,可以选择根据预设的误差准则,按第一代价值指示的匹配误差从小到大的顺序,对一个或多个候选BVD进行排序,确定候选BVD列表。
可以理解的是,在本申请的实施例中,排序结果可以为排列为升(降)序的新列表OrderedList(当前块的候选BVD列表)。例如,例如,采用冒泡排序、选择排序、插入排序、希尔排序、归并排序、快速排序、基数排序、堆排序、计数排序、桶排序等排序方法。
进一步地,在本申请的实施例中,排序结果还可以为特定顺序的新列表OrderedList(当前块的候选BVD列表)。
示例性的,在本申请的实施例中,在根据第一代价值,对候选BVD进行排序,确定当前块的候选BVD列表时,如果absBvdX和absBvdY均不等于0,将候选BVD分别存储至第一数组和第二数组;然后基于第一代价值,确定第一数组中的第一候选BVD和第二候选BVD,以及第二数组中的第三候选BVD和第四候选BVD;最后便可以基于第一代价值,对第一候选BVD、第二候选BVD、第三候选BVD、第四候选BVD进行排序处理,确定候选BVD列表。
如果BVD水平分量和垂直分量均存在,即absBvdX和absBvdY均不等于0,假设该组合列表(候选BVD)为{(+BVD HOR,+BVD VER),(+BVD HOR,-BVD VER),(-BVD HOR,-BVD VER),(-BVD HOR,+BVD VER)},其对应的成本列表为{Cost(+BVD HOR,+BVD VER),Cost(+BVD HOR,-BVD VER),Cost(-BVD HOR,-BVD VER),Cost(-BVD HOR,+BVD VER)}。上述两个列表中成员的顺序可任意排列。
定义两个数组posiGrp和negaGrp,posiGrp存储在同一分量(水平)上符号为正号的两个BVD组合,negaGrp存储在同一分量(水平)上符号为负号的两个BVD组合。
假设posiGrp={(+BVD HOR,+BVD VER),(+BVD HOR,-BVD VER)},negaGrp={(-BVD HOR,+BVD VER),(-BVD HOR,-BVD VER)}。posiGrp和negaGrp两个列表中成员的顺序可任意排列。
第一次比较:比较Cost(+BVD HOR,+BVD VER)和Cost(+BVD HOR,-BVD VER)的大小,将posiGrp[0]置为两者较小的BVD组合,将posiGrp[1]置为两者较大的BVD组合;
第二次比较:比较Cost(-BVD HOR,+BVD VER)和Cost(-BVD HOR,-BVD VER)的大小,将negaGrp[0]置为两者较小的BVD组合,将negaGrp[1]置为两者较大的BVD组合;
第三次比较:比较posiGrp[0]和negaGrp[0]对应的Cost的大小。
需要说明的是,在本申请的实施例中,在基于第一代价值,对第一候选BVD、第二候选BVD、第三候选BVD、第四候选BVD进行排序处理,确定候选BVD列表时,一种可用的方式如下:如果第一候选BVD的第一代价值小于等于第三候选BVD的第一代价值,将第一候选BVD设置为候选BVD列表中的第一个候选BVD,将第三候选BVD设置为候选BVD列表中的第二个候选BVD,将第二候选BVD设置为候选BVD列表中的第三个候选BVD,将第四候选BVD设置为候选BVD列表中的第四个候选BVD。如果第一候选BVD的第一代价值大于第三候选BVD的第一代价值,将第三候选BVD设置为候选BVD列表中的第一个候选BVD,将第一候选BVD设置为候选BVD列表中的第二个候选BVD,将第四候选BVD设置为候选BVD列表中的第三个候选BVD,将第二候选BVD设置为候选BVD列表中的第四个候选BVD。
相应的,最后的排序过程可以为:若在第三次比较中,posiGrp[0]对应的Cost<=negaGrp[0]对应的Cost,将posiGrp[0]排序在候选BVD列表OrderedList的第0位,将negaGrp[0]排序在候选BVD列表OrderedList的第1位,将posiGrp[1]排序在候选BVD列表OrderedList的第2位,将negaGrp[1]排序在候选BVD列表OrderedList的第3位。
若在第三次比较中,posiGrp[0]对应的Cost>negaGrp[0]对应的Cost,将negaGrp[0]排序在候选BVD列表OrderedList的第0位,将posiGrp[0]排序在候选BVD列表OrderedList的第1位,将negaGrp[1]排序在候选BVD列表OrderedList的第2位,将posiGrp[1]排序在候选BVD列表OrderedList的第3位。
其中,当前块的候选BVD列表的第0位的候选BVD即为候选BVD列表中的第一个候选BVD,第1位的候选BVD即为候选BVD列表中的第二个候选BVD,第2位的候选BVD即为候选BVD列表中的第三个候选BVD,第3位的候选BVD即为候选BVD列表中的第四个候选BVD。
需要说明的是,在本申请的实施例中,在基于第一代价值,对第一候选BVD、第二候选BVD、第三候选BVD、第四候选BVD进行排序处理,确定候选BVD列表时,另一种可用的方式如下:如果第一候选BVD的第一代价值小于等于第三候选BVD的第一代价值,将第一候选BVD设置为候选BVD列表中的第一个候选BVD,将第二候选BVD设置为候选BVD列表中的第二个候选BVD,将第三候选BVD设置为候选BVD列表中的第三个候选BVD,将第四候选BVD设置为候选BVD列表中的第四个候选BVD。如果第一候选BVD的第一代价值大于第三候选BVD的第一代价值,将第 三候选BVD设置为候选BVD列表中的第一个候选BVD,将第四候选BVD设置为候选BVD列表中的第二个候选BVD,将第一候选BVD设置为候选BVD列表中的第三个候选BVD,将第二候选BVD设置为候选BVD列表中的第四个候选BVD。
相应的,最后的排序过程可以为:若在第三次比较中,posiGrp[0]对应的Cost<=negaGrp[0]对应的Cost,将posiGrp[0]排序在候选BVD列表OrderedList的第0位,将negaGrp[0]排序在候选BVD列表OrderedList的第2位,将posiGrp[1]排序在候选BVD列表OrderedList的第1位,将negaGrp[1]排序在候选BVD列表OrderedList的第3位。
若在第三次比较中,posiGrp[0]对应的Cost>negaGrp[0]对应的Cost,将negaGrp[0]排序在候选BVD列表OrderedList的第0位,将posiGrp[0]排序在候选BVD列表OrderedList的第2位,将negaGrp[1]排序在候选BVD列表OrderedList的第1位,将posiGrp[1]排序在候选BVD列表OrderedList的第3位。
示例性的,在本申请的实施例中,在根据第一代价值,对候选BVD进行排序,确定当前块的候选BVD列表时,如果absBvdX等于0或者absBvdY等于0,将候选BVD中的第一代价值最小的一个候选BVD设置为候选BVD列表中的第一个候选BVD,将候选BVD中的另一个候选BVD设置为候选BVD列表中的第二个候选BVD。
如果仅BVD水平分量或者垂直分量存在,即absBvdX或absBvdY等于0,那么可以直接按照第一代价值的大小对两个候选BVD进行排序处理,以生成候选BVD列表。
对于仅BVD垂直分量存在的情况,假设该组合列表为{(0,+BVD VER),(0,-BVD VER)},其对应的成本列表为{Cost(0,+BVD VER),Cost(0,-BVD VER)}。上述两个列表中成员的顺序可任意排列。
排序过程为:比较Cost(0,+BVD VER)和Cost(0,-BVD VER)的大小:
若Cost(0,+BVD VER)<=Cost(0,-BVD VER),则将(0,+BVD VER)排序在候选BVD列表OrderedList的第0位,将(0,-BVD VER)排序在候选BVD列表OrderedList的第1位;
若Cost(0,+BVD VER)>Cost(0,-BVD VER),则将(0,-BVD VER)排序在候选BVD列表OrderedList的第0位,将(0,+BVD VER)排序在候选BVD列表OrderedList的第1位。
对于仅BVD水平分量存在的情况,假设该组合列表为{(+BVD HOR,0),(-BVD HOR,0)},其对应的成本列表为{Cost(+BVD HOR,0),Cost(-BVD HOR,0)}。上述两个列表中成员的顺序可任意排列。
排序过程为:比较Cost(+BVD HOR,0)和Cost(-BVD HOR,0)的大小:
若Cost(+BVD HOR,0)<=Cost(-BVD HOR,0),则将(+BVD HOR,0)排序在候选BVD列表OrderedList的第0位,将(-BVD HOR,0)排序在候选BVD列表OrderedList的第1位;
若Cost(+BVD HOR,0)>Cost(-BVD HOR,0),则将(-BVD HOR,0)排序在候选BVD列表OrderedList的第0位,将(+BVD HOR,0)排序在候选BVD列表OrderedList的第1位。
需要说明的是,在本申请的实施例中,如果排序结果为当前块的候选BVD集合,那么相应的,执行排序的过程可以为根据第一代价值,对候选BVD进行排序,确定当前块的候选BVD集合,其中,候选BVD集合至少包括一个候选BVD。
进一步地,在根据第一代价值,对候选BVD进行排序,确定当前块的候选BVD集合时,如果absBvdX和absBvdY均不等于0,将候选BVD分别存储至第一数组和第二数组;然后确定第一数组中的、第一代价值最小的第五候选BVD,以及第二数组中的、第一代价值最小的第六候选BVD;最后可以将第五候选BVD和第六候选BVD中的、第一代价值最小的候选BVD,确定为候选BVD集合中的代价最小BVD。
如果BVD水平分量和垂直分量均存在,即absBvdX和absBvdY均不等于0,假设该组合列表为{(+,+),(+,-),(-,-),(-,+)},其对应的成本列表为{Cost(+,+),Cost(+,-),Cost(-,-),Cost(-,+)}。上述两个列表中成员的顺序可任意排列。
定义两个数组posiGrp和negaGrp,posiGrp存储在同一分量(水平)上符号为正号的两个BVD的符号组合,negaGrp存储在同一分量(水平)上符号为负号的两个BVD的符号组合。
假设posiGrp={(+,+),(+,-)},negaGrp={(-,+),(-,-)}。posiGrp和negaGrp两个列表中成员的顺序可任意排列。
第一次比较:比较Cost(+,+)和Cost(+,-)的大小,将posiGrp[0]置为两者较小的BVD的符号组合,将posiGrp[1]置为两者较大的BVD的符号组合;
第二次比较:比较Cost(-,+)和Cost(-,-)的大小,将negaGrp[0]置为两者较小的BVD的符号组合,将negaGrp[1]置为两者较大的BVD的符号组合;
第三次比较:比较posiGrp[0]和negaGrp[0]对应的Cost的大小。
进而可以确定出Cost最小的一个BVD的符号组合,即确定出候选BVD集合中的代价最小BVD。
如果仅BVD水平分量或者垂直分量存在,即absBvdX或absBvdY等于0,那么可以直接按照第一代价值的大小对两个候选BVD进行排序处理,以确定出候选BVD集合中的代价最小BVD。
示例性的,在本申请的实施例中,在根据第一代价值,对候选BVD进行排序,确定当前块的候选BVD集合时,如果absBvdX等于0或者absBvdY等于0,那么可以将候选BVD中的第一代价值最小的一个候选BVD确定为候选BVD集合中的代价最小BVD。
对于仅BVD垂直分量存在的情况,假设该组合列表为{(+,+),(+,-)},其对应的成本列表为{Cost(+,+),Cost(+,-)}。上述两个列表中成员的顺序可任意排列。比较过程为:比较Cost(+,+)和Cost(+,-)的大小,进而可以确定出Cost最小的一个BVD的符号组合,即确定出候选BVD集合中的代价最小BVD。
对于仅BVD水平分量存在的情况,假设该组合列表为{(+,+),(-,+)},其对应的成本列表为{Cost(+,+),Cost(-,+)}。上述两个列表中成员的顺序可任意排列。比较过程为:比较Cost(+,+)和Cost(-,+)的大小,进而可以确定出Cost最小的一个BVD的符号组合,即确定出候选BVD集合中的代价最小BVD。
步骤103、根据BVD符号索引信息和排序结果,确定当前块的BVD。
在本申请的实施例中,在根据当前块的BVD绝对值,对当前块的候选BVD进行排序处理,确定排序结果之后,便 可以根据BVD符号索引信息和排序结果,确定当前块的BVD。
需要说明的是,在本申请的实施例中,如果排序处理获得的当前块的候选BVD列表为升(降)序的列表,那么可以选择采用转换列表间接得到真实BVD的符号,也可以直接采用逻辑推理得到真实BVD符号。
其中,在采用转换列表间接得到真实BVD的符号时,可以先按照转换规则将BVD组合列表OrderedList转换为索引转换列表TransformedList。
示例性的,在本申请的实施例中,可以对候选BVD列表进行转换处理,确定索引转换列表(TransformedList)。
进一步地,在本申请的实施例中,在根据BVD符号索引信息和排序结果,确定当前块的BVD时,当absBvdX和absBvdY均不为0时,若BVD符号索引信息的第一比特位取值为0,则确定当前块的BVD的candBvdX与索引转换列表中第一个候选BVD或第三个候选BVD的candBvdX相同;然后可以按照第一个候选BVD或第三个候选BVD确定当前块的BVD的candBvdY。
进一步地,在本申请的实施例中,在按照第一个候选BVD或第三个候选BVD确定当前块的BVD的candBvdY时,若BVD符号索引信息的第二比特位取值为0,则确定当前块的BVD的candBvdY与第一个候选BVD的candBvdY相同;若第二比特位取值为1,则确定当前块的BVD的candBvdY与第三个候选BVD的candBvdY相同。
进一步地,在本申请的实施例中,在根据BVD符号索引信息和排序结果,确定当前块的BVD时,当absBvdX和absBvdY均不为0时,若BVD符号索引信息的第一比特位取值为1,则确定第一分量符号与索引转换列表中第二个候选BVD或第四个候选BVD的第一分量符号相同;然后可以按照第二个候选BVD或第四个候选BVD确定当前块的BVD的candBvdY。
进一步地,在本申请的实施例中,在按照第二个候选BVD或第四个候选BVD确定当前块的BVD的candBvdY时,若BVD符号索引信息的第二比特位取值为0,则确定当前块的BVD的candBvdY与第二个候选BVD的candBvdY相同;若第二比特位取值为1,则确定当前块的BVD的candBvdY与第四个候选BVD的candBvdY相同。
也就是说,在本申请的实施例中,对于BVD水平分量和垂直分量均存在的情况,BVD的符号预测索引为两个比特位。
假设排序后的BVD组合列表OrderedList为:
表4.水平垂直BVD均存在的排序后的BVD组合列表OrderedList
索引 水平分量 垂直分量
0 a1 a2
1 b1 b2
2 c1 c2
3 d1 d2
利用以下转换规则将排序后的BVD组合列表OrderedList转换为TransformedList(索引转换列表):
将排序后最小cost的BVD组合放在TransformedList列表的第0位,即将(a1,a2)放在TransformedList列表的第0位。将与a1同号的BVD组合放在TransformedList列表的第2位,即假设b1与其同号,则将(b1,b2)放在TransformedList列表的第2位。将与a1异号的较小cost的BVD组合放在TransformedList列表的第1位,即将(c1,c2)放在TransformedList列表的第1位。将与a1异号的较大cost的BVD组合放在TransformedList列表的第3位,即将(d1,d2)放在TransformedList列表的第3位。
则索引转换列表TransformedList为:
表5.水平垂直BVD均存在的索引转换列表TransformedList
索引 水平分量 垂直分量
0 a1 a2
1 c1(-a1) c2
2 b1(a1) b2
3 d1(-a1) d2
对于索引转换列表,按照以下规则得到真实BVD的符号,此时解析的符号预测索引等于表中最左列的索引:
解析符号预测索引的第0个比特位:
第0个比特位为0时,则真实BVD水平分量等于a1,检查其垂直分量,若第1个比特位为0,则真实BVD垂直分量等于a2;若第1个比特位为1时,则真实BVD垂直分量等于-a2。
第0个比特位为1时,则真实BVD水平分量等于-a1,检查索引1的候选BVD的垂直分量,若第1个比特位为0,则真实BVD垂直分量等于c2;若第1个比特位为1时,则真实BVD垂直分量等于-c2。
例如:假设排序后的BVD组合列表OrderedList为:
表6.水平垂直BVD均存在的排序后的BVD组合列表OrderedList实例
索引 水平分量 垂直分量
0 -BVD HOR +BVD VER
1 -BVD HOR -BVD VER
2 +BVD HOR +BVD VER
3 +BVD HOR -BVD VER
则按照转换规则将排序后的BVD组合列表OrderedList转换为TransformedList:
表34.水平垂直BVD均存在的索引转换列表TransformedList实例
索引 水平分量 垂直分量
0 -BVD HOR +BVD VER
1 +BVD HOR +BVD VER
2 -BVD HOR -BVD VER
3 +BVD HOR -BVD VER
(1)假设解析出的
bvsdIdx=0
则真实BVD组合为水平分量为-BVD HOR,垂直分量为+BVD VER
(2)假设解析出的
bvsdIdx=2
则真实BVD组合为水平分量为-BVD HOR,垂直分量为-BVD VER
(3)假设解析出的
bvsdIdx=1
则真实BVD组合为水平分量为+BVD HOR,垂直分量为+BVD VER
(4)假设解析出的
bvsdIdx=3
则真实BVD组合为水平分量为+BVD HOR,垂直分量为-BVD VER
进一步地,在本申请的实施例中,在根据BVD符号索引信息和排序结果,确定当前块的BVD时,当absBvdX为0时,若BVD符号索引信息的取值为0,则确定当前块的BVD的candBvdY与索引转换列表中的第一个候选BVD的candBvdY相同;若BVD符号索引信息的取值为1,则确定当前块的BVD的candBvdY与索引转换列表中的第二个候选BVD的candBvdY相同。
也就是说,在本申请的实施例中,对于BVD垂直分量存在的情况,BVD的符号预测索引为一个比特位。
假设排序后的BVD组合列表OrderedList为:
表7.仅垂直BVD存在的排序后的BVD组合列表OrderedList
索引 水平分量 垂直分量
0 0 a2
1 0 b2(-a2)
则索引转换列表TransformedList与排序后的BVD组合列表OrderedList相同。
索引转换列表TransformedList为:
表8.仅垂直BVD存在的索引转换列表TransformedList
索引 水平分量 垂直分量
0 0 a2
1 0 b2(-a2)
对于索引转换列表,按照以下规则得到真实BVD的符号,此时解析的符号预测索引等于表中最左列的索引:
如果第0个比特位为0,则真实的BVD垂直分量为a2,否则,真实的BVD垂直分量为-a2。
例如:假设排序后的BVD组合列表OrderedList为:
表9.仅垂直BVD存在的排序后的BVD组合列表OrderedList实例
索引 水平分量 垂直分量
0 0 +BVD VER
1 0 -BVD VER
索引转换列表TransformedList为:
表10.仅垂直BVD存在的索引转换列表TransformedList实例
索引 水平分量 垂直分量
0 0 +BVD VER
1 0 -BVD VER
(1)假设符号预测索引为:
bvsdIdx=0
则真实的BVD的水平分量为0,垂直分量为+BVD VER
(2)假设符号预测索引为:
bvsdIdx=1
则真实的BVD的水平分量为0,垂直分量为-BVD VER
进一步地,在本申请的实施例中,在根据BVD符号索引信息和排序结果,确定当前块的BVD时,当absBvdY为0时,若BVD符号索引信息的取值为0,则确定当前块的BVD的candBvdX与索引转换列表中的第一个候选BVD的candBvdX相同;若BVD符号索引信息的取值为1,则确定当前块的BVD的candBvdX与索引转换列表中的第二个候选BVD的candBvdX相同。
也就是说,在本申请的实施例中,对于BVD水平分量存在的情况,BVD的符号预测索引为一个比特位。
假设排序后的BVD组合列表OrderedList为:
表11.仅水平BVD存在的排序后的BVD组合列表OrderedList
索引 水平分量 垂直分量
0 a1 0
1 b1(-a1) 0
则索引转换列表TransformedList与排序后的BVD组合列表OrderedList相同。
索引转换列表TransformedList为:
表12仅水平BVD存在的索引转换列表TransformedList
索引 水平分量 垂直分量
0 a1 0
1 b1(-a1) 0
对于索引转换列表,按照以下规则得到真实BVD的符号,此时解析的符号预测索引等于表中最左列的索引:
如果第0个比特位为0,则真实的BVD水平分量为a1,否则,真实的BVD水平分量为-a1。
例如:假设排序后的BVD组合列表OrderedList为:
表13.仅水平BVD存在的排序后的BVD组合列表OrderedList实例
索引 水平分量 垂直分量
0 +BVD HOR 0
1 -BVD HOR 0
索引转换列表TransformedList为:
表14.仅水平BVD存在的转换列表TransformedList实例
索引 水平分量 垂直分量
0 +BVD HOR 0
1 -BVD HOR 0
(1)假设符号预测索引为:
bvsdIdx=0
则真实的BVD的水平分量为+BVD HOR,垂直分量为0。
(2)假设符号预测索引为:
bvsdIdx=1
则真实的BVD的水平分量为-BVD HOR,垂直分量为0。
进一步地,在本申请的实施例中,如果选择采用逻辑推理得到真实BVD符号,在根据BVD符号索引信息和候选BVD列表,确定当前块的BVD时,当absBvdX和absBvdY均不为0时,若BVD符号索引信息的第一比特位取值为0,则确定当前块的BVD的candBvdX与候选BVD列表中的第一个候选BVD的candBvdX相同,否则不同;然后遍历候选BVD列表,确定与当前块的BVD具有相同candBvdX的首个候选BVD;若BVD符号索引信息的第二比特位取值为0,则确定当前块的BVD的candBvdY与首个候选BVD的candBvdY相同,否则不同。
第一种情况BVD水平分量和垂直分量均存在,此时BVD的符号预测索引为两个比特位:
假设排序后的BVD组合列表OrderedList为:
表15.水平垂直BVD均存在的排序后的BVD组合列表OrderedList
索引 水平分量 垂直分量
0 a1 a2
1 b1 b2
2 c1 c2
3 d1 d2
若解析出的BVD的符号预测索引的第0个比特位为0时,则真实BVD水平分量等于a1;若第0个比特位为1时,则真实BVD水平分量等于-a1,即a1的相反数,此时判断真实BVD的水平分量为e1。然后从索引0开始遍历排序后的列表(当前块的候选BVD列表),当列表中首次出现与上述判断出的真实BVD水平分量相同的BVD时,检查其垂直分量,假设其垂直分量为f2,若第1个比特位为0,则真实BVD垂直分量等于f2;若第1个比特位为1时,则真实BVD垂直分量等于-f2,即f2的相反数,此时判断真实BVD的垂直分量为e2。这样,就得到了真实BVD,即水平分量为e1,垂直分量为e2的BVD。
例如:假设排序后的BVD组合列表OrderedList为:
表16.水平垂直BVD均存在的排序后的BVD组合列表OrderedList实例
索引 水平分量 垂直分量
0 -BVD HOR +BVD VER
1 -BVD HOR -BVD VER
2 +BVD HOR +BVD VER
3 +BVD HOR -BVD VER
(1)假设解析出的BVD的符号预测索引的第0个比特位为0,第1个比特位为0。
则真实BVD的水平分量为-BVD HOR,垂直分量为+BVD VER
(2)假设解析出的BVD的符号预测索引的第0个比特位为1,第1个比特位为0。
则真实BVD的水平分量为+BVD HOR,垂直分量为+BVD VER
(3)假设解析出的BVD的符号预测索引的第0个比特位为0,第1个比特位为1。
则真实BVD的水平分量为-BVD HOR,垂直分量为-BVD VER
(4)假设解析出的BVD的符号预测索引的第0个比特位为1,第1个比特位为1。
则真实BVD的水平分量为+BVD HOR,垂直分量为-BVD VER
进一步地,在本申请的实施例中,如果选择采用逻辑推理得到真实BVD符号,在根据BVD符号索引信息和候选BVD列表,确定当前块的BVD时,当absBvdX为0时,若BVD符号索引信息的取值为0,则确定当前块的BVD的candBvdY与候选BVD列表中的第一个候选BVD的candBvdY相同;若BVD符号索引信息的取值为1,则确定当前块的BVD的candBvdY与候选BVD列表中的第二个候选BVD的candBvdY相同。
第二种情况仅BVD的垂直分量存在,此时BVD的符号预测索引为一个比特位:
假设排序后的BVD组合列表OrderedList为:
表17.仅垂直BVD存在的排序后的BVD组合列表OrderedList
索引 水平分量 垂直分量
0 0 a2
1 0 b2(-a2)
若解析出的BVD的符号预测索引的第0个比特位为0时,则真实BVD垂直分量等于a2;若第0个比特位为1时,则真实BVD垂直分量等于-a2,即a2的相反数,此时判断真实BVD的垂直分量为e2,水平分量为0。这样,就得到了真实BVD,即水平分量为0,垂直分量为e2的BVD。
例如:假设排序后的BVD组合列表OrderedList为:
表18.仅垂直BVD存在的排序后的BVD组合列表OrderedList实例
索引 水平分量 垂直分量
0 0 +BVD VER
1 0 -BVD VER
(1)假设解析出的BVD的符号预测索引的第0个比特位为0。
则真实BVD的水平分量为0,垂直分量为+BVD VER
(2)假设解析出的BVD的符号预测索引的第0个比特位为1。
则真实BVD的水平分量为0,垂直分量为-BVD VER
进一步地,在本申请的实施例中,如果选择采用逻辑推理得到真实BVD符号,在根据BVD符号索引信息和候选BVD列表,确定当前块的BVD时,当absBvdY为0时,若BVD符号索引信息的取值为0,则确定当前块的BVD的candBvdX与候选BVD列表中的第一个候选BVD的candBvdX相同;若BVD符号索引信息的取值为1,则确定当前块的BVD的candBvdX与候选BVD列表中的第二个候选BVD的candBvdX相同。
第三种情况仅BVD的水平分量存在,此时BVD的符号预测索引为一个比特位:
假设排序后的BVD组合列表OrderedList为:
表19.仅水平BVD存在的排序后的BVD组合列表OrderedList
索引 水平分量 垂直分量
0 a1 0
1 b1(-a1) 0
若解析出的BVD的符号预测索引的第0个比特位为0时,则真实BVD水平分量等于a1;若第0个比特位为1时,则真实BVD水平分量等于-a1,即a1的相反数,此时判断真实BVD的水平分量为e1,垂直分量为0。这样,就得到了真实BVD,即水平分量为e1,垂直分量为0的BVD。
例如:假设排序后的BVD组合列表OrderedList为:
表20.仅水平BVD存在的排序后的BVD组合列表OrderedList实例
索引 水平分量 垂直分量
0 +BVD HOR 0
1 -BVD HOR 0
(1)假设解析出的BVD的符号预测索引的第0个比特位为0。
则真实BVD的水平分量为+BVD HOR,垂直分量为0。
(2)假设解析出的BVD的符号预测索引的第0个比特位为1。
则真实BVD的水平分量为-BVD HOR,垂直分量为0。
需要说明的是,在本申请的实施例中,如果排序处理获得的当前块的候选BVD列表为特定顺序的列表,那么在确定当前块的BVD时,可以直接将候选BVD列表中的、BVD符号索引信息指示的候选BVD确定为当前块的BVD。其中,可以将排序后的BVD组合列表OrderedList,直接赋值给TransformedList,即候选BVD列表OrderedList和索引转换列表TransformedList是相同的。因此在TransformedList(或OrderedList)中,BVD的符号预测索引对应的BVD组合,即为真实的BVD。
可以理解的是,在本申请的实施例中,如果排序处理获得的当前块的候选BVD列表为特定顺序的列表,那么在编码端,可以直接对BVD对应的两个分量同时编码,对应的,在解码端,BVD对应的两个分量可以直接通过BVD符号索引信息一起确定出来。
也就是说,在本申请的实施例中,可以直接通过解码获得的BVD符号索引信息,从候选BVD列表中确定出BVD符号索引信息所指示的候选BVD。
相应的,在本申请的实施例中,对于解码端解析组合索引(BVD符号索引信息)后同时得出水平和垂直分量的方案,在编码端,编码器可以采用遍历的方法决定所传索引(BVD符号索引信息)。
可以理解的是,在本申请的实施例中,对于按照第一代价值指示的匹配误差从小到大的顺序排序所确定的候选BVD列表,即在当前块的候选BVD列表为升(降)序的列表的情况下,也可以直接将候选BVD列表中的、BVD符号索引信息指示的候选BVD确定为当前块的BVD。
第一种情况BVD水平分量和垂直分量均存在,此时BVD的符号预测索引为两个比特位:
假设排序后的BVD组合列表OrderedList为:
表21.水平垂直BVD均存在的排序后的BVD组合列表OrderedList
索引 水平分量 垂直分量
0 a1 a2
1 b1(-a1) b2
2 c1(a1) c2
3 d1(-a1) d2
则索引转换列表TransformedList为:
表22.水平垂直BVD均存在的索引转换列表TransformedList
索引 水平分量 垂直分量
0 a1 a2
1 b1(-a1) b2
2 c1(a1) c2
3 d1(-a1) d2
对于索引转换列表,按照以下规则得到真实BVD的符号,此时解析的符号预测索引等于表中最左列的索引:
解析符号预测索引的第0个比特位:
第0个比特位为0时,则真实BVD水平分量等于a1,检查其垂直分量,若第1个比特位为0,则真实BVD垂直分量等于a2;若第1个比特位为1时,则真实BVD垂直分量等于-a2。
第0个比特位为1时,则真实BVD水平分量等于-a1,检查索引1的候选BVD的垂直分量,若第1个比特位为0,则真实BVD垂直分量等于c2;若第1个比特位为1时,则真实BVD垂直分量等于-c2。
例如:假设排序后的BVD组合列表OrderedList为:
表23.水平垂直BVD均存在的排序后的BVD组合列表OrderedList实例
索引 水平分量 垂直分量
0 -BVD HOR +BVD VER
1 +BVD HOR +BVD VER
2 -BVD HOR -BVD HOR
3 +BVD HOR -BVD VER
则TransformedList为:
表24.水平垂直BVD均存在的索引转换列表TransformedList实例
索引 水平分量 垂直分量
0 -BVD HOR +BVD VER
1 +BVD HOR +BVD VER
2 -BVD HOR -BVD HOR
3 +BVD HOR -BVD VER
(1)假设解析出的
bvsdIdx=0
则真实BVD组合为水平分量为-BVD HOR,垂直分量为+BVD VER
(2)假设解析出的
bvsdIdx=2
则真实BVD组合为水平分量为-BVD HOR,垂直分量为-BVD VER
(3)假设解析出的
bvsdIdx=1
则真实BVD组合为水平分量为+BVD HOR,垂直分量为+BVD VER
(4)假设解析出的
bvsdIdx=3
则真实BVD组合为水平分量为+BVD HOR,垂直分量为-BVD VER
第二种情况仅BVD垂直分量存在,此时BVD的符号预测索引为一个比特位:
假设排序后的BVD组合列表OrderedList为:
表25.仅垂直BVD存在的排序后的BVD组合列表OrderedList
索引 水平分量 垂直分量
0 0 a2
1 0 b2(-a2)
则索引转换列表TransformedList为:
表54.仅垂直BVD存在的索引转换列表TransformedList
索引 水平分量 垂直分量
0 0 a2
1 0 b2(-a2)
对于索引转换列表,按照以下规则得到真实BVD的符号,此时解析的符号预测索引等于表中最左列的索引:
第0个比特位为0时,则真实BVD的垂直分量等于a2,否则,真实BVD的垂直分量等于-a2。
例如:假设排序后的BVD组合列表OrderedList为:
表26.仅垂直BVD存在的排序后的BVD组合列表OrderedList实例
索引 水平分量 垂直分量
0 0 +BVD VER
1 0 -BVD VER
TransformedList为:
表56.仅垂直BVD存在的索引转换列表TransformedList实例
索引 水平分量 垂直分量
0 0 +BVD VER
1 0 -BVD VER
(1)假设解析出的符号预测索引为:
bvsdIdx=0
则真实的BVD的水平分量为0,垂直分量为+BVD VER
(2)假设解析出符号预测索引:
bvsdIdx=1
则真实的BVD的水平分量为0,垂直分量为-BVD VER
第三种情况仅BVD水平分量存在,此时BVD的符号预测索引为一个比特位:
假设排序后的BVD组合列表OrderedList为:
表27.仅水平BVD存在的排序后的BVD组合列表OrderedList
索引 水平分量 垂直分量
0 a1 0
1 b1(-a1) 0
则索引转换列表TransformedList为:
表28.仅水平BVD存在的索引转换列表TransformedList
索引 水平分量 垂直分量
0 a1 0
1 b1(-a1) 0
对于索引转换列表,按照以下规则得到真实BVD的符号,此时解析的符号预测索引等于表中最左列的索引:
第0个比特位为0时,则真实BVD的水平分量等于a1,否则,真实BVD的水平分量等于-a1。
例如:假设排序后的BVD组合列表OrderedList为:
表29.仅水平BVD存在的排序后的BVD组合列表OrderedList实例
索引 水平分量 垂直分量
0 +BVD HOR 0
1 -BVD HOR 0
TransformedList为:
表60.仅水平BVD存在的转换列表TransformedList实例
索引 水平分量 垂直分量
0 +BVD HOR 0
1 -BVD HOR 0
(1)假设解析出的符号预测索引为:
bvsdIdx=0
则真实的BVD的水平分量为+BVD HOR,垂直分量为0。
(2)假设解析出的符号预测索引为:
bvsdIdx=1
则真实的BVD的水平分量为-BVD HOR,垂直分量为0。
进一步地,在本申请的实施例中,如果排序处理后的排序结果为当前块的候选BVD集合,那么排序后即确定了模板匹配代价最小的候选BVD,即确定了候选BVD集合中的代价最小BVD。此时,如果bvsdIdx的数值是bit0+bit1<<1,即bit0代表水平分量符号,bit1代表垂直分量符号,那么,最小的BVD符号组合(代价最小BVD),确定了bit0和bit1在取值等于0时的符号,取值等于1时的符号与此相反。
需要说明的是,在本申请的实施例中,在根据BVD符号索引信息和排序结果,确定当前块的BVD时,当absBvdX和absBvdY均不为0时,若BVD符号索引信息的第一比特位取值为0,则确定当前块的BVD的candBvdX与候选BVD集合中的代价最小BVD的candBvdX相同;那么可以继续按照候选BVD集合中的代价最小BVD确定当前块的BVD的candBvdY。
需要说明的是,在本申请的实施例中,在根据BVD符号索引信息和排序结果,确定当前块的BVD时,当absBvdX和absBvdY均不为0时,若BVD符号索引信息的第一比特位取值为1,则确定当前块的BVD的candBvdX与候选BVD集合中的代价最小BVD的candBvdX符号相反;那么可以继续按照候选BVD集合中的代价最小BVD所在的数组以外的、另一个数组中的代价最小BVD确定当前块的BVD的candBvdY。
进一步地,在本申请的实施例中,在按照候选BVD集合中的代价最小BVD确定当前块的BVD的candBvdY时,若BVD符号索引信息的第二比特位取值为0,则确定当前块的BVD的candBvdY与候选BVD集合中的代价最小BVD的candBvdY相同;若第二比特位取值为1,则确定当前块的BVD的candBvdY与候选BVD集合中的代价最小BVD的candBvdY符号相反。
进一步地,在本申请的实施例中,在按照候选BVD集合中的代价最小BVD所在的数组以外的、另一个数组中的代价最小BVD确定当前块的BVD的candBvdY时,若BVD符号索引信息的第二比特位取值为0,则确定当前块的BVD的candBvdY与另一个数组中的代价最小BVD的candBvdY相同;若第二比特位取值为1,则确定当前块的BVD的candBvdY与另一个数组中的代价最小BVD的candBvdY符号相反。
需要说明的是,在本申请的实施例中,假设真实BVD的水平分量和垂直分量的符号为bvdSign[0]和bvdSign[1]。其中,取值为0则为正,取值为1则为负。
示例性的,在本申请的实施例中,如果BVD水平和垂直分量均存在,对于排序后确定的候选BVD集合中的代价最小BVD的两种可能情况如下:
(1)若在第三次比较中,posiGrp[0]对应的Cost<=negaGrp[0]对应的Cost:
如果第0个比特位为0,则bvd_sign[0]=0。如果第1个比特位为0,则bvd_sign[1]=posiGrp[0][1];如果第1个比特位为1,则bvd_sign[1]=posiGrp[1][1]。
如果第0个比特位为1,则bvd_sign[0]=1。如果第1个比特位为0,则bvd_sign[1]=negaGrp[0][1];如果第1个比特位为1,则bvd_sign[1]=negaGrp[1][1]。
(2)若在第三次比较中,posiGrp[0]对应的Cost>negaGrp[0]对应的Cost:
如果第0个比特位为1,则bvd_sign[0]=0。如果第1个比特位为0,则bvd_sign[1]=posiGrp[0][1];如果第1个比特位为1,则bvd_sign[1]=posiGrp[1][1]。
如果第0个比特位为0,则bvd_sign[0]=1。如果第1个比特位为0,则bvd_sign[1]=negaGrp[0][1];如果第1个比特位为1,则bvd_sign[1]=negaGrp[1][1]。
需要说明的是,在本申请的实施例中,在根据BVD符号索引信息和排序结果,确定当前块的BVD时,当absBvdX为0时,若BVD符号索引信息的取值为0,则确定当前块的BVD的candBvdY与候选BVD集合中的代价最小BVD的candBvdY相同;若BVD符号索引信息的取值为1,则确定当前块的BVD的candBvdY与候选BVD集合中的代价最小BVD的candBvdY符号相反。
示例性的,在本申请的实施例中,如果BVD仅垂直分量存在,对于排序后确定的候选BVD集合中的代价最小BVD的两种可能情况如下:
(1)若Cost(+,+)<=Cost(+,-):
如果第0个比特位为0,那么bvd_sign[1]=0。
如果第0个比特位为1,那么bvd_sign[1]=1。
(2)若Cost(+,+)>Cost(+,-):
如果第0个比特位为0,那么bvd_sign[1]=1。
如果第0个比特位为1,那么bvd_sign[1]=0。
需要说明的是,在本申请的实施例中,在根据BVD符号索引信息和排序结果,确定当前块的BVD时,当absBvdY为0时,若BVD符号索引信息的取值为0,则确定当前块的BVD的absBvdX与候选BVD集合中的代价最小BVD的absBvdX相同;若BVD符号索引信息的取值为1,则确定当前块的BVD的absBvdX与候选BVD集合中的代价最小BVD的absBvdX符号相反。
示例性的,在本申请的实施例中,如果BVD仅水平分量存在,对于排序后确定的候选BVD集合中的代价最小BVD的两种可能情况如下:
(1)若Cost(+,+)<=Cost(-,+):
如果第0个比特位为0,那么bvd_sign[0]=0。
如果第0个比特位为1,那么bvd_sign[0]=1。
(2)若Cost(+,+)>Cost(-,+):
如果第0个比特位为0,那么bvd_sign[0]=1。
如果第0个比特位为1,那么bvd_sign[0]=0。
可见,上述基于候选BVD集合确定当前块的BVD的方法,可以省去建立列表和得到符号预测索引的步骤,对于BVD的水平和垂直分量均存在的情况,解码端直接通过三次比较便可以得到真实的BVD符号,复杂度更低。
步骤104、根据当前块的BVD,确定当前块的重建值。
在本申请的实施例中,在根据BVD符号索引信息和排序结果,确定当前块的BVD之后,解码器便可以利用当前块的BVD进行运动补偿,从而确定当前块的重建值。
示例性的,在本申请的实施例中,解码端整体流程如下:
存在以下几种方式:
(1)解析BVD符号在解析BVD绝对值的过程之后进行:
Figure PCTCN2022125219-appb-000023
Figure PCTCN2022125219-appb-000024
Figure PCTCN2022125219-appb-000025
符号预测索引(即BVD符号索引信息)bvdIdx的推导如下:
若abs_bvd_greater0_flag[0]和abs_bvd_greater0_flag[1]都为TRUE时,则bvsdIdx=bvsd_idx;
否则,若abs_bvd_greater0_flag[0]或abs_bvd_greater0_flag[1]一者为TRUE时,则bvsdIdx=bvsd_idx_single。
compIdx=0..1的运动矢量差异的绝对值abs_bvd[compIdx]的推导如下:
abs_bvd[compIdx]=abs_bvd_greater0_flag[compIdx]*(abs_bvd_minus1[compIdx]+1)bvsd_idx既可以使用不同的两个概率模型:
表30
Figure PCTCN2022125219-appb-000026
或使用不同的四个概率模型:
表31
Figure PCTCN2022125219-appb-000027
也可以是一个使用概率模型,一个使用旁路编码:
表32
Figure PCTCN2022125219-appb-000028
表33
Figure PCTCN2022125219-appb-000029
bvsd_idx_single既可以根据绝对值大小使用不同的概率模型:
表34
Figure PCTCN2022125219-appb-000030
compIdx=0…1,表示水平分量或者垂直分量。
也可以使用一个单独的概率模型:
表35
Figure PCTCN2022125219-appb-000031
也可以使用旁路编码:
表36
Figure PCTCN2022125219-appb-000032
(2)解析BVD符号的过程在解析BVD绝对值的函数bvd_coding()中间进行,即在解析BVD的水平和垂直分量是否为零的标识abs_bvd_greater0_flag[0]和abs_bvd_greater0_flag[1]之后进行:
Figure PCTCN2022125219-appb-000033
Figure PCTCN2022125219-appb-000034
符号预测索引bvdIdx的推导如下:
若abs_bvd_greater0_flag[0]和abs_bvd_greater0_flag[1]都为TRUE时,则bvsdIdx=bvsd_idx;
否则,若abs_bvd_greater0_flag[0]或abs_bvd_greater0_flag[1]一者为TRUE时,则bvsdIdx=bvsd_idx_single。
bvsd_idx既可以使用不同的两个概率模型:
表37
Figure PCTCN2022125219-appb-000035
也可以是一个使用概率模型,一个使用旁路编码:
表38
Figure PCTCN2022125219-appb-000036
表39
Figure PCTCN2022125219-appb-000037
bvsd_idx_single既可以使用单独的概率模型:
表40
Figure PCTCN2022125219-appb-000038
也可以使用旁路编码:
表41
Figure PCTCN2022125219-appb-000039
(3)解析BVD符号的过程在解析BVD绝对值的函数bvd_coding()中间进行,即在解析BVD的水平和垂直分量是否为零的标识abs_bvd_greater0_flag[0]和abs_bvd_greater0_flag[1]之后进行,但与(2)不同的是仅引入一个bvsd_idx变量,该变量的二值化移至CABAC中处理(该过程涉及的二值化与CABAC的处理流程在(1)中也可实现,即解析BVD符号的过程在解析BVD绝对值的函数bvd_coding()之后进行也可应用类似于下述的二值化流程):
Figure PCTCN2022125219-appb-000040
Figure PCTCN2022125219-appb-000041
符号预测索引bvdIdx的推导如下:
bvsdIdx=bvsd_idx
下面描述了bvsd_idx的二值化过程及对应的具体形式,包括但不限于以下几种:
1)使用定长码(Fixed-length binarization)对bvsd_idx进行二值化:
此时,存在两种形式:
第一种形式为:
若abs_bvd_greater0_flag[0]和abs_bvd_greater0_flag[1]都为TRUE时:
表42
Figure PCTCN2022125219-appb-000042
否则,若abs_bvd_greater0_flag[0]或abs_bvd_greater0_flag[1]一者为TRUE时:
表43
Figure PCTCN2022125219-appb-000043
对上述过程进行简述:
若abs_bvd_greater0_flag[0]和abs_bvd_greater0_flag[1]都为TRUE时,当解析到的bvsd_idx的二值化后二进制串为00B时,bvsd_idx为0;当解析到的bvsd_idx的二值化后二进制串为01B时,bvsd_idx为1;当解析到的bvsd_idx的二值化后二进制串为10B时,bvsd_idx为2;当解析到的bvsd_idx的二值化后二进制串为11B时,bvsd_idx为3。
否则,若abs_bvd_greater0_flag[0]或abs_bvd_greater0_flag[1]一者为TRUE时,当解析到的bvsd_idx的二值化后二进制串为0B时,bvsd_idx为0;当解析到的bvsd_idx的二值化后二进制串为1B时,bvsd_idx为1。
此时,关于bvsd_idx语法元素的上下文概率模型与binIdx的关系为:
若abs_bvd_greater0_flag[0]和abs_bvd_greater0_flag[1]都为TRUE时:
既可以是不同的两个概率模型:
表44
Figure PCTCN2022125219-appb-000044
也可以是一个使用概率模型,一个使用旁路编码:
表45
Figure PCTCN2022125219-appb-000045
表46
Figure PCTCN2022125219-appb-000046
否则,若abs_bvd_greater0_flag[0]或abs_bvd_greater0_flag[1]一者为TRUE时:
既可以使用独立的概率模型:
表47
Figure PCTCN2022125219-appb-000047
也可以使用旁路编码:
表48
Figure PCTCN2022125219-appb-000048
第二种形式为:
若abs_bvd_greater0_flag[0]和abs_bvd_greater0_flag[1]都为TRUE时:
表49
Figure PCTCN2022125219-appb-000049
即若abs_bvd_greater0_flag[0]和abs_bvd_greater0_flag[1]都为TRUE时,当解析到的bvsd_idx的二值化后二进制串为00B时,bvsd_idx为0;当解析到的bvsd_idx的二值化后二进制串为01B时,bvsd_idx为1;当解析到的bvsd_idx的二值化后二进制串为10B时,bvsd_idx为2;当解析到的bvsd_idx的二值化后二进制串为11B时,bvsd_idx为3。
否则,若abs_bvd_greater0_flag[0]或abs_bvd_greater0_flag[1]一者为TRUE时:
表50
Figure PCTCN2022125219-appb-000050
即当解析到的bvsd_idx的二值化后二进制串为00B时,bvsd_idx为0;当解析到的bvsd_idx的二值化后二进制串为01B时,bvsd_idx为1。
此时,关于bvsd_idx语法元素的上下文概率模型与binIdx的关系为:
若abs_bvd_greater0_flag[0]和abs_bvd_greater0_flag[1]都为TRUE时,与第一种形式相同;
否则,若abs_bvd_greater0_flag[0]或abs_bvd_greater0_flag[1]一者为TRUE时:
既可以使用一个或两个概率模型:
表51
Figure PCTCN2022125219-appb-000051
Figure PCTCN2022125219-appb-000052
也可以独立的概率模型和旁路编码共用:
表52
Figure PCTCN2022125219-appb-000053
也可以均使用旁路编码:
表53
Figure PCTCN2022125219-appb-000054
2)使用截断二进制码(Truncated binarization)对bvsd_idx进行二值化:
表54
Figure PCTCN2022125219-appb-000055
当解析到的bvsd_idx的二值化后二进制串为00B时,bvsd_idx为0;当解析到的bvsd_idx的二值化后二进制串为01B时,bvsd_idx为1;当解析到的bvsd_idx的二值化后二进制串为100B时,bvsd_idx为2;当解析到的bvsd_idx的二值化后二进制串为101B时,bvsd_idx为3。
此时,关于bvsd_idx语法元素的上下文概率模型与binIdx的关系为:
既可以使用三个概率模型,或者两个,或者一个:
表55
Figure PCTCN2022125219-appb-000056
表56
Figure PCTCN2022125219-appb-000057
表57
Figure PCTCN2022125219-appb-000058
也可以将上述的任意binIdx使用旁路编码,即可任意组合,此处仅举一例:
表58
Figure PCTCN2022125219-appb-000059
3)使用零阶指数哥伦布码(Exp-Golomb binarization)对bvsd_idx进行二值化:
表59
Figure PCTCN2022125219-appb-000060
当解析到的bvsd_idx的二值化后二进制串为1B时,bvsd_idx为0;当解析到的bvsd_idx的二值化后二进制串为010B时,bvsd_idx为1;当解析到的bvsd_idx的二值化后二进制串为011B时,bvsd_idx为2;当解析到的bvsd_idx的二值化后二进制串为00100B时,bvsd_idx为3。
此时,关于bvsd_idx语法元素的上下文概率模型与binIdx的关系为:
可以使用概率模型与旁路编码的任意组合,下述仅举两例:
表60
Figure PCTCN2022125219-appb-000061
表61
Figure PCTCN2022125219-appb-000062
综上所述,通过上述步骤101至步骤104所提出的解码方法,通过在BVD的可能符号和BVD的绝对值之间创建BVD的组合列表,并对组合列表利用模板进行排序,利用真实的BVD符号和排序后的列表得到符号预测索引进行CABAC的编码,相较于比旁路编码具有更高的编码效率,从而节省了IBC中的BVD传输所需的码率。
需要说明的是,本申请实施例提出的解码方法,一方面,可以充分利用模板与当前编码块的相似性,将BVD的符号组合列表进行有效地排序;另一方面,可以使用CABAC进行编码,比旁路编码具有更高的编码效率。
本申请实施例提供了一种编解码方法,在解码端,解码码流,确定当前块的BVD绝对值和BVD符号索引信息;根据当前块的BVD绝对值,对当前块的候选BVD进行排序处理,确定排序结果;根据BVD符号索引信息和排序结果,确定当前块的BVD;根据当前块的BVD,确定当前块的重建值。在编码端,根据当前块的BVD绝对值,对当前块的候选BVD进行排序处理,确定排序结果;根据当前块的BVD符号信息和排序结果,确定当前块的BVD符号索引信息;将BVD绝对值和BVD符号索引信息写入码流。由此可见,在本申请的实施例中,可以根据当前块的BVD绝对值对当前块的候选BVD进行有效排序处理,从而可以在编码时利用排序结果进行BVD符号索引信息的确定和传输,在解码时利用排序结果进行当前块的BVD符号信息的解析,同时可以使用CABAC编解码技术对BVD符号信息进行编解码处理,能够有效地节省IBC模式中的BVD的符号传输所需的码率,从而可以提高编码效率。
基于上述实施例,本申请的再一实施例提出了一种解码方法,其中,对解码器而言,在进行解码处理时,BVD解码输入可以为BVD绝对值和符号(BVD符号索引信息)的码流信息。而BVD解码输出可以为BVD绝对值和符号的真实信息。
其中,图10为本申请实施例中的解码方法的示意图二,如图10所示,BVD解码过程包含解析BVD绝对值(步骤201)、解析BVD的符号预测索引,即解析BVD符号索引信息(步骤202)、通过在BVD的可能符号和BVD绝对值之间创建BVD的组合列表,即确定当前块的候选BVD(步骤203)、根据当前块的BVP和BVD的组合列表进行模板预测,计算出BVD组合列表中的每个BVD组合的成本,即对组合列表计算模板区域的成本(第一代价值)(步骤204),对列表排序并根据符号预测索引和排序列表推导真实BVD,并进行运动补偿(步骤205)。
对于步骤201所提出的解析BVD绝对值,解码器可以直接从码流中解析出真实的BVD绝对值。即解码器解码码流,可以确定当前块的BVD绝对值。
对于步骤202所提出的符号预测索引(BVD符号索引信息)的确定,首先,可以根据解码过程中的、步骤201所解析出来的BVD绝对值来判断符号预测索引的二进制数的比特位的数目。其中,若BVD的水平分量和垂直分量的绝对值都不为0时,则符号预测索引的二进制数的比特位的数目为2;若BVD的水平分量为0并且垂直分量的绝对值不为0时,则符号预测索引的二进制数的比特位的数目为1;若BVD的水平分量不为0并且垂直分量的绝对值为0时,则符号预测索引的二进制数的比特位的数目为1。
然后,解码器可以使用CABAC(上下文自适应的二进制算术编码)或旁路对应的解码过程将符号预测索引对应的二进制数可以从码流中解析出来。
针对符号预测索引所使用的CABAC的上下文模型,可以使用单个概率模型,或者多个概率模型,可以包括但不限 于根据BVD的水平分量或垂直分量的绝对值大小、BVD的水平分量与垂直分量的和或差值等进行区分不同的概率模型。
对于步骤203所提出的确定当前块的候选BVD过程,即通过在BVD的可能符号和BVD绝对值之间创建BVD的组合列表(候选BVD或初始集合),可以通过不同的情况创建BVD的组合列表,比如仅水平BVD存在、仅垂直BVD存在以及二者都存在的情况。
BVD组合列表的确定包括对BVD的可能符号进行排列组合、对可能的水平符号和垂直符号分别乘以BVD的水平绝对值分量和垂直绝对值分量。
为了更好的说明如何构建BVD组合列表(候选BVD或初始集合),以三个简单分类为例说明:
分类例子1:BVD分为水平分量和垂直分量,当水平分量为零的时候,只对垂直分量进行编码,所以只对垂直分量的符号构建组合列表,具体为以下两种情况:
第一种情况:水平分量都为正号,只是一个占位,垂直分量先为正号,后为负号,构建一个符号列表,然后将构建的符号列表乘以BVD的水平和垂直分量的绝对值,进而得到BVD的组合列表。
第二种情况:水平分量都为正号,只是一个占位,垂直分量先为负号,后为正号,构建一个符号列表,然后将构建的符号列表乘以BVD的水平和垂直分量的绝对值,进而得到BVD的组合列表。
分类例子2:BVD分为水平分量和垂直分量,当垂直分量为零的时候,只对水平分量进行编码,所以只对水平分量的符号构建组合列表,具体为以下两种情况:
第一种情况:垂直分量都为正号,只是一个占位,水平分量先为正号,后为负号,构建一个符号列表,然后将构建的符号列表乘以BVD的垂直和水平分量的绝对值,进而得到BVD的组合列表。
第二种情况:垂直分量都为正号,只是一个占位,水平分量先为负号,后为正号,构建一个符号列表,然后将构建的符号列表乘以BVD的垂直和水平分量的绝对值,进而得到BVD的组合列表。
分类例子3:BVD分为水平分量和垂直分量,当两分量均不为零的时候,二者均需要进行编码,所以要对水平和垂直分量一起构建BVD列表,具体分为24种情况,即{+1,+1}、{+1,-1}、{-1,+1}和{-1,-1}这4种组合下的任意排列,下述举例说明:
列表第0位为水平和垂直分量均为正号,列表第1位为水平分量为正号垂直分量为负号,列表第2位为水平分量为负号垂直分量为正号,列表第3位为水平分量和垂直分量均为负号,构建一个符号列表,然后将构建的符号列表乘以BVD的垂直和水平分量的绝对值,进而得到BVD的组合列表。
对于步骤204所提出的根据当前块的BVP和BVD的组合列表(候选BVD)进行模板预测,计算出BVD组合列表中的每个BVD组合(候选BVD)的成本(第一代价值),即计算模板区域的成本,可以对BVD组合列表中的各种组合利用模板进行成本的计算,具体为利用当前块模板位置处的重建亮度像素和利用当前块的BVP及BVD的组合得出的BV进行模板预测得到的位置处的重建亮度像素计算成本。
需要说明的是,在本申请的实施例中,在计算成本(第一代价值)时,不仅可以采用亮度,还可以包含色度即Cb和Cr分量。本申请不进行具体限定。
在进行模板(当前块的第一模板)的选择时,可以根据当前块的邻近区域的像素可用性,判断模板位置的像素是否可用,包括重建亮度信息。如图6所示,根据模板与当前块的相对位置关系,可将模板分类为上模板、左模板、右上模板、左下模板、左上模板等模板类型。其中,不同编码块的不同类型的模板尺寸可以固定相同,也可以不同。
例如,模板尺寸对当前任意编码块(当前块)选择相同的模板尺寸,也可以根据当前编码块的不同尺寸选择不同的模板尺寸,还可以根据当前亮度编码块内的像素数选择不同的模板尺寸。
在进行当前块的BV预测时,可以利用当前块的BVP以及BVD的组合列表,产生新的BV。如图8所示,利用当前块判断这个BV是否可用(可用的条件为该BV指向的参考块已经重建,且未超出IBC所设定的搜索范围以及图像边界等条件),如果当前BV是可用的,然后就会利用当前块的模板和新的BV进行运动补偿,得到对应BV处的模板。如图9所示,BVD水平和垂直分量共产生4种组合的BVD,分别进行模板处的运动补偿。计算成本时的模板的使用情况存在以下几种情况:
第一种:当前块的上模板和左模板均存在,且对应BV处的上模板和左模板均存在,此时上模板和左模板均可用。
第二种:当前块的上模板和左模板均存在,对应BV处仅上模板存在,此时存在两种方法:方法一:对应BV处左模板不存在,直接不用,即仅用上模板计算。方法二:对应BV处左模板不存在,采用参考块内部最左侧的模板宽度列代替左模板,即采用上模板和左模板计算。
第三种:当前块的上模板和左模板均存在,对应BV处仅左模板存在,此时存在两种方法:方法一:对应BV处上模板不存在,直接不用,即仅用左模板计算。方法二:对应BV处上模板不存在,采用参考块内部最上侧的模板高度行代替上模板,即采用上模板和左模板计算。
第四种:当前块仅上模板存在,此时存在三种方法:方法一:对应BV处上模板不存在,直接不用。方法二:对应BV处上模板不存在,采用参考块内部最上侧的模板高度行代替上模板。方法三:对应BV处上模板存在,直接用。
第五种:当前块仅左模板存在,此时存在三种方法:方法一:对应BV处左模板不存在,直接不用。方法二:对应BV处左模板不存在,采用参考块内部最左侧的模板宽度列代替左模板。方法三:对应BV处左模板存在,直接用。
第六种:当前块上模板和左模板均不存在,忽略此种情况的BVD组合情况。
以上六种情况下,当BV指向的参考块不可用时,均忽略此种情况下的BVD组合情况。其中,当忽略某种情况下的BVD组合情况时,将此种情况下的成本置为成本评价准则的最大值。
在进行成本计算时,即确定第一代价值时,对于计算模板区域的成本的成本函数有多种选择,即预设的误差准则可以有多种选择。例如,可以选择绝对误差和(SAD)、变换绝对误差和(SATD)、差值平方和(SSE)、平均绝对差值(MAD)、平均绝对误差(MAE)、平均平方误差(MSE)、率失真函数(RDO)等评价准则。
在通过上述步骤就204计算模板区域的成本(第一代价值)之后,便可以执行步骤205,即按照模板区域得到的成本对组合列表进行排序,即可以利用第一代价值对候选BVD进行排序处理,并利用BVD的符号预测索引和排序后的列表(当前块的候选BVD列表),得到真实的BVD,然后再进行运动补偿。
在根据模板区域得到的成本对组合列表进行排序,即按照第一代价值对候选BVD进行排序处理时,既可以采用排列为升(降)序的新列表OrderedList(当前块的候选BVD列表),也可以排列为特定顺序的新列表OrderedList。
(1)排列为升(降)序的新列表OrderedList。
例如,采用冒泡排序、选择排序、插入排序、希尔排序、归并排序、快速排序、基数排序、堆排序、计数排序、桶排序等排序方法。
(2)排列为特定顺序的新列表OrderedList。
包括但不限定以下形式:这里列举一种特定顺序的排列方法:
第一种情况:假设该组合列表(候选BVD)为{(+BVD HOR,+BVD VER),(+BVD HOR,-BVD VER),(-BVD HOR,-BVD VER),(-BVD HOR,+BVD VER)},其对应的成本列表为{Cost(+BVD HOR,+BVD VER),Cost(+BVD HOR,-BVD VER),Cost(-BVD HOR,-BVD VER),Cost(-BVD HOR,+BVD VER)}。上述两个列表中成员的顺序可任意排列。
定义两个数组posiGrp和negaGrp,posiGrp存储在同一分量(水平)上符号为正号的两个BVD组合,negaGrp存储在同一分量(水平)上符号为负号的两个BVD组合。
假设posiGrp={(+BVD HOR,+BVD VER),(+BVD HOR,-BVD VER)},negaGrp={(-BVD HOR,+BVD VER),(-BVD HOR,-BVD VER)}。posiGrp和negaGrp两个列表中成员的顺序可任意排列。
第一次比较:比较Cost(+BVD HOR,+BVD VER)和Cost(+BVD HOR,-BVD VER)的大小,将posiGrp[0]置为两者较小的BVD组合,将posiGrp[1]置为两者较大的BVD组合;
第二次比较:比较Cost(-BVD HOR,+BVD VER)和Cost(-BVD HOR,-BVD VER)的大小,将negaGrp[0]置为两者较小的BVD组合,将negaGrp[1]置为两者较大的BVD组合;
第三次比较:比较posiGrp[0]和negaGrp[0]对应的Cost的大小;
最后的排序过程:
若在第三次比较中,posiGrp[0]对应的Cost<=negaGrp[0]对应的Cost,将posiGrp[0]排序在候选BVD列表OrderedList的第0位,将negaGrp[0]排序在候选BVD列表OrderedList的第1位,将posiGrp[1]排序在候选BVD列表OrderedList的第2位,将negaGrp[1]排序在候选BVD列表OrderedList的第3位。
若在第三次比较中,posiGrp[0]对应的Cost>negaGrp[0]对应的Cost,将negaGrp[0]排序在候选BVD列表OrderedList的第0位,将posiGrp[0]排序在候选BVD列表OrderedList的第1位,将negaGrp[1]排序在候选BVD列表OrderedList的第2位,将posiGrp[1]排序在候选BVD列表OrderedList的第3位。
其中,当前块的候选BVD列表的第0位的候选BVD即为候选BVD列表中的第一个候选BVD,第1位的候选BVD即为候选BVD列表中的第二个候选BVD,第2位的候选BVD即为候选BVD列表中的第三个候选BVD,第3位的候选BVD即为候选BVD列表中的第四个候选BVD。
还有一种排序的实施方式为:
若在第三次比较中,posiGrp[0]对应的Cost<=negaGrp[0]对应的Cost,将posiGrp[0]排序在候选BVD列表OrderedList的第0位,将negaGrp[0]排序在候选BVD列表OrderedList的第2位,将posiGrp[1]排序在候选BVD列表OrderedList的第1位,将negaGrp[1]排序在候选BVD列表OrderedList的第3位。
若在第三次比较中,posiGrp[0]对应的Cost>negaGrp[0]对应的Cost,将negaGrp[0]排序在候选BVD列表OrderedList的第0位,将posiGrp[0]排序在候选BVD列表OrderedList的第2位,将negaGrp[1]排序在候选BVD列表OrderedList的第1位,将posiGrp[1]排序在候选BVD列表OrderedList的第3位。
第二种情况:假设该组合列表为{(0,+BVD VER),(0,-BVD VER)},其对应的成本列表为{Cost(0,+BVD VER),Cost(0,-BVD VER)}。上述两个列表中成员的顺序可任意排列。
排序过程为:比较Cost(0,+BVD VER)和Cost(0,-BVD VER)的大小:
若Cost(0,+BVD VER)<=Cost(0,-BVD VER),则将(0,+BVD VER)排序在候选BVD列表OrderedList的第0位,将(0,-BVD VER)排序在候选BVD列表OrderedList的第1位;
若Cost(0,+BVD VER)>Cost(0,-BVD VER),则将(0,-BVD VER)排序在候选BVD列表OrderedList的第0位,将(0,+BVD VER)排序在候选BVD列表OrderedList的第1位。
第三种情况:假设该组合列表为{(+BVD HOR,0),(-BVD HOR,0)},其对应的成本列表为{Cost(+BVD HOR,0),Cost(-BVD HOR,0)}。上述两个列表中成员的顺序可任意排列。
排序过程为:比较Cost(+BVD HOR,0)和Cost(-BVD HOR,0)的大小:
若Cost(+BVD HOR,0)<=Cost(-BVD HOR,0),则将(+BVD HOR,0)排序在候选BVD列表OrderedList的第0位,将(-BVD HOR,0)排序在候选BVD列表OrderedList的第1位;
若Cost(+BVD HOR,0)>Cost(-BVD HOR,0),则将(-BVD HOR,0)排序在候选BVD列表OrderedList的第0位,将(+BVD HOR,0)排序在候选BVD列表OrderedList的第1位。
在根据模板区域得到的成本对组合列表进行排序,即按照第一代价值对候选BVD进行排序处理之后,获得的排序结果也可以为当前块的候选BVD集合。其中,可以为根据第一代价值,对候选BVD进行排序,确定当前块的候选BVD集合,其中,候选BVD集合至少包括一个候选BVD。
如果BVD水平分量和垂直分量均存在,即absBvdX和absBvdY均不等于0,假设该组合列表为{(+,+),(+,-),(-,-),(-,+)},其对应的成本列表为{Cost(+,+),Cost(+,-),Cost(-,-),Cost(-,+)}。上述两个列表中成员的顺序可任意排列。
定义两个数组posiGrp和negaGrp,posiGrp存储在同一分量(水平)上符号为正号的两个BVD的符号组合,negaGrp存储在同一分量(水平)上符号为负号的两个BVD的符号组合。
假设posiGrp={(+,+),(+,-)},negaGrp={(-,+),(-,-)}。posiGrp和negaGrp两个列表中成员的顺序可任意排列。
第一次比较:比较Cost(+,+)和Cost(+,-)的大小,将posiGrp[0]置为两者较小的BVD的符号组合,将posiGrp[1] 置为两者较大的BVD的符号组合;
第二次比较:比较Cost(-,+)和Cost(-,-)的大小,将negaGrp[0]置为两者较小的BVD的符号组合,将negaGrp[1]置为两者较大的BVD的符号组合;
第三次比较:比较posiGrp[0]和negaGrp[0]对应的Cost的大小。
进而可以确定出Cost最小的一个BVD的符号组合,即确定出候选BVD集合中的代价最小BVD。
对于仅BVD垂直分量存在的情况,假设该组合列表为{(+,+),(+,-)},其对应的成本列表为{Cost(+,+),Cost(+,-)}。上述两个列表中成员的顺序可任意排列。比较过程为:比较Cost(+,+)和Cost(+,-)的大小,进而可以确定出Cost最小的一个BVD的符号组合,即确定出候选BVD集合中的代价最小BVD。
对于仅BVD水平分量存在的情况,假设该组合列表为{(+,+),(-,+)},其对应的成本列表为{Cost(+,+),Cost(-,+)}。上述两个列表中成员的顺序可任意排列。比较过程为:比较Cost(+,+)和Cost(-,+)的大小,进而可以确定出Cost最小的一个BVD的符号组合,即确定出候选BVD集合中的代价最小BVD。
在利用BVD的符号预测索引(BVD符号索引信息)和排序后的列表(当前块的候选BVD列表),确定真实的BVD时,因为排序后的列表(当前块的候选BVD列表)分为三种情况,即BVD仅存在水平分量、BVD仅存在垂直分量和BVD既存在水平分量又存在垂直分量,所以这里也分三种情况介绍。
其中,对于排列为升(降)序的新列表OrderedList,可以存在两种方案,一种是采用转换列表间接得到真实BVD的符号,另一种是直接采用逻辑推理得到真实BVD符号。
在采用转换列表间接得到真实BVD的符号,解码器需要先按照转换规则将BVD组合列表OrderedList转换为索引转换列表TransformedList。
第一种情况BVD水平分量和垂直分量均存在,此时BVD的符号预测索引为两个比特位:
假设排序后的BVD组合列表OrderedList为:
表62.水平垂直BVD均存在的排序后的BVD组合列表OrderedList
索引 水平分量 垂直分量
0 a1 a2
1 b1 b2
2 c1 c2
3 d1 d2
利用以下转换规则将排序后的BVD组合列表OrderedList转换为TransformedList(索引转换列表):
将排序后最小cost的BVD组合放在TransformedList列表的第0位,即将(a1,a2)放在TransformedList列表的第0位。将与a1同号的BVD组合放在TransformedList列表的第2位,即假设b1与其同号,则将(b1,b2)放在TransformedList列表的第2位。将与a1异号的较小cost的BVD组合放在TransformedList列表的第1位,即将(c1,c2)放在TransformedList列表的第1位。将与a1异号的较大cost的BVD组合放在TransformedList列表的第3位,即将(d1,d2)放在TransformedList列表的第3位。
则索引转换列表TransformedList为:
表63.水平垂直BVD均存在的索引转换列表TransformedList
索引 水平分量 垂直分量
0 a1 a2
1 c1(-a1) c2
2 b1(a1) b2
3 d1(-a1) d2
对于索引转换列表,按照以下规则得到真实BVD的符号,此时解析的符号预测索引等于表中最左列的索引:
解析符号预测索引的第0个比特位:
第0个比特位为0时,则真实BVD水平分量等于a1,检查其垂直分量,若第1个比特位为0,则真实BVD垂直分量等于a2;若第1个比特位为1时,则真实BVD垂直分量等于-a2。
第0个比特位为1时,则真实BVD水平分量等于-a1,检查索引1的候选BVD的垂直分量,若第1个比特位为0,则真实BVD垂直分量等于c2;若第1个比特位为1时,则真实BVD垂直分量等于-c2。
第二种情况仅BVD垂直分量存在,此时BVD的符号预测索引为一个比特位:
假设排序后的BVD组合列表OrderedList为:
表64.仅垂直BVD存在的排序后的BVD组合列表OrderedList
索引 水平分量 垂直分量
0 0 a2
1 0 b2(-a2)
则索引转换列表TransformedList与排序后的BVD组合列表OrderedList相同。
索引转换列表TransformedList为:
表65.仅垂直BVD存在的索引转换列表TransformedList
索引 水平分量 垂直分量
0 0 a2
1 0 b2(-a2)
对于索引转换列表,按照以下规则得到真实BVD的符号,此时解析的符号预测索引等于表中最左列的索引:
如果第0个比特位为0,则真实的BVD垂直分量为a2,否则,真实的BVD垂直分量为-a2。
第三种情况仅BVD水平分量存在,此时BVD的符号预测索引为一个比特位:
假设排序后的BVD组合列表OrderedList为:
表66.仅水平BVD存在的排序后的BVD组合列表OrderedList
索引 水平分量 垂直分量
0 a1 0
1 b1(-a1) 0
则索引转换列表TransformedList与排序后的BVD组合列表OrderedList相同。
索引转换列表TransformedList为:
表67.仅水平BVD存在的索引转换列表TransformedList
索引 水平分量 垂直分量
0 a1 0
1 b1(-a1) 0
对于索引转换列表,按照以下规则得到真实BVD的符号,此时解析的符号预测索引等于表中最左列的索引:
如果第0个比特位为0,则真实的BVD水平分量为a1,否则,真实的BVD水平分量为-a1。
在直接采用逻辑推理得到真实BVD符号时,第一种情况BVD水平分量和垂直分量均存在,此时BVD的符号预测索引为两个比特位:
假设排序后的BVD组合列表OrderedList为:
表68.水平垂直BVD均存在的排序后的BVD组合列表OrderedList
索引 水平分量 垂直分量
0 a1 a2
1 b1 b2
2 c1 c2
3 d1 d2
若解析出的BVD的符号预测索引的第0个比特位为0时,则真实BVD水平分量等于a1;若第0个比特位为1时,则真实BVD水平分量等于-a1,即a1的相反数,此时判断真实BVD的水平分量为e1。然后从索引0开始遍历排序后的列表(当前块的候选BVD列表),当列表中首次出现与上述判断出的真实BVD水平分量相同的BVD时,检查其垂直分量,假设其垂直分量为f2,若第1个比特位为0,则真实BVD垂直分量等于f2;若第1个比特位为1时,则真实BVD垂直分量等于-f2,即f2的相反数,此时判断真实BVD的垂直分量为e2。这样,就得到了真实BVD,即水平分量为e1,垂直分量为e2的BVD。
第二种情况仅BVD的垂直分量存在,此时BVD的符号预测索引为一个比特位:
假设排序后的BVD组合列表OrderedList为:
表69.仅垂直BVD存在的排序后的BVD组合列表OrderedList
索引 水平分量 垂直分量
0 0 a2
1 0 b2(-a2)
若解析出的BVD的符号预测索引的第0个比特位为0时,则真实BVD垂直分量等于a2;若第0个比特位为1时,则真实BVD垂直分量等于-a2,即a2的相反数,此时判断真实BVD的垂直分量为e2,水平分量为0。这样,就得到了真实BVD,即水平分量为0,垂直分量为e2的BVD。
第三种情况仅BVD的水平分量存在,此时BVD的符号预测索引为一个比特位:
假设排序后的BVD组合列表OrderedList为:
表70.仅水平BVD存在的排序后的BVD组合列表OrderedList
索引 水平分量 垂直分量
0 a1 0
1 b1(-a1) 0
若解析出的BVD的符号预测索引的第0个比特位为0时,则真实BVD水平分量等于a1;若第0个比特位为1时,则真实BVD水平分量等于-a1,即a1的相反数,此时判断真实BVD的水平分量为e1,垂直分量为0。这样,就得到了真实BVD,即水平分量为e1,垂直分量为0的BVD。
进一步地,对于排列为特定顺序的新列表OrderedList,可以将排序后的BVD组合列表OrderedList,直接赋值给TransformedList。
在TransformedList中,BVD的符号预测索引对应的BVD组合,即为真实的BVD。
第一种情况BVD水平分量和垂直分量均存在,此时BVD的符号预测索引为两个比特位:
假设排序后的BVD组合列表OrderedList为:
表71.水平垂直BVD均存在的排序后的BVD组合列表OrderedList
索引 水平分量 垂直分量
0 a1 a2
1 b1(-a1) b2
2 c1(a1) c2
3 d1(-a1) d2
则索引转换列表TransformedList为:
表72.水平垂直BVD均存在的索引转换列表TransformedList
索引 水平分量 垂直分量
0 a1 a2
1 b1(-a1) b2
2 c1(a1) c2
3 d1(-a1) d2
对于索引转换列表,按照以下规则得到真实BVD的符号,此时解析的符号预测索引等于表中最左列的索引:
解析符号预测索引的第0个比特位:
第0个比特位为0时,则真实BVD水平分量等于a1,检查其垂直分量,若第1个比特位为0,则真实BVD垂直分量等于a2;若第1个比特位为1时,则真实BVD垂直分量等于-a2。
第0个比特位为1时,则真实BVD水平分量等于-a1,检查索引1的候选BVD的垂直分量,若第1个比特位为0,则真实BVD垂直分量等于c2;若第1个比特位为1时,则真实BVD垂直分量等于-c2。
第二种情况仅BVD垂直分量存在,此时BVD的符号预测索引为一个比特位:
假设排序后的BVD组合列表OrderedList为:
表73.仅垂直BVD存在的排序后的BVD组合列表OrderedList
索引 水平分量 垂直分量
0 0 a2
1 0 b2(-a2)
则索引转换列表TransformedList为:
表74.仅垂直BVD存在的索引转换列表TransformedList
索引 水平分量 垂直分量
0 0 a2
1 0 b2(-a2)
对于索引转换列表,按照以下规则得到真实BVD的符号,此时解析的符号预测索引等于表中最左列的索引:
第0个比特位为0时,则真实BVD的垂直分量等于a2,否则,真实BVD的垂直分量等于-a2。
第三种情况仅BVD水平分量存在,此时BVD的符号预测索引为一个比特位:
假设排序后的BVD组合列表OrderedList为:
表75.仅水平BVD存在的排序后的BVD组合列表OrderedList
索引 水平分量 垂直分量
0 a1 0
1 b1(-a1) 0
则索引转换列表TransformedList为:
表76.仅水平BVD存在的索引转换列表TransformedList
索引 水平分量 垂直分量
0 a1 0
1 b1(-a1) 0
对于索引转换列表,按照以下规则得到真实BVD的符号,此时解析的符号预测索引等于表中最左列的索引:
第0个比特位为0时,则真实BVD的水平分量等于a1,否则,真实BVD的水平分量等于-a1。
进一步地,在本申请的实施例中,如果排序处理后的排序结果为当前块的候选BVD集合,那么排序后即确定了模板匹配代价最小的候选BVD,即确定了候选BVD集合中的代价最小BVD。此时,如果bvsdIdx的数值是bit0+bit1<<1,即bit0代表水平分量符号,bit1代表垂直分量符号,那么,最小的BVD符号组合(代价最小BVD),确定了bit0和bit1在取值等于0时的符号,取值等于1时的符号与此相反。
需要说明的是,在本申请的实施例中,假设真实BVD的水平分量和垂直分量的符号为bvdSign[0]和bvdSign[1]。其中,取值为0则为正,取值为1则为负。
第一种情况:BVD水平和垂直分量均存在。
(1)若在第三次比较中,posiGrp[0]对应的Cost<=negaGrp[0]对应的Cost:
如果第0个比特位为0,则bvd_sign[0]=0。如果第1个比特位为0,则bvd_sign[1]=posiGrp[0][1];如果第1个比特位为1,则bvd_sign[1]=posiGrp[1][1]。
如果第0个比特位为1,则bvd_sign[0]=1。如果第1个比特位为0,则bvd_sign[1]=negaGrp[0][1];如果第1个比特位为1,则bvd_sign[1]=negaGrp[1][1]。
(2)若在第三次比较中,posiGrp[0]对应的Cost>negaGrp[0]对应的Cost:
如果第0个比特位为1,则bvd_sign[0]=0。如果第1个比特位为0,则bvd_sign[1]=posiGrp[0][1];如果第1个比特位为1,则bvd_sign[1]=posiGrp[1][1]。
如果第0个比特位为0,则bvd_sign[0]=1。如果第1个比特位为0,则bvd_sign[1]=negaGrp[0][1];如果第1个比特位为1,则bvd_sign[1]=negaGrp[1][1]。
第二种情况:BVD仅垂直分量存在。
(1)若Cost(+,+)<=Cost(+,-):
如果第0个比特位为0,那么bvd_sign[1]=0。
如果第0个比特位为1,那么bvd_sign[1]=1。
(2)若Cost(+,+)>Cost(+,-):
如果第0个比特位为0,那么bvd_sign[1]=1。
如果第0个比特位为1,那么bvd_sign[1]=0。
第三种情况:BVD仅水平分量存在。
(1)若Cost(+,+)<=Cost(-,+):
如果第0个比特位为0,那么bvd_sign[0]=0。
如果第0个比特位为1,那么bvd_sign[0]=1。
(2)若Cost(+,+)>Cost(-,+):
如果第0个比特位为0,那么bvd_sign[0]=1。
如果第0个比特位为1,那么bvd_sign[0]=0。
可见,上述基于候选BVD集合确定当前块的BVD的方法,可以省去建立列表和得到符号预测索引的步骤,解码端直接通过三次比较便可以得到真实的BVD符号。
示例性的,在本申请的实施例中,以CABAC模型中有两个概率模型的情况为例,解析位置如主技术方案的解码端整体流程中的(1)所述的位于bvd_coding()之后为例,解码端的整体流程如下:
Figure PCTCN2022125219-appb-000063
Figure PCTCN2022125219-appb-000064
Figure PCTCN2022125219-appb-000065
若abs_bvd_greater0_flag[0]和abs_bvd_greater0_flag[1]都为TRUE时,则bvd_sign_bin[0]为上述的第0个比特位,bvd_sign_bin[1]为第1个比特位;
若仅abs_bvd_greater0_flag[0]为TRUE时,则bvd_sign_bin[0]为上述的第0个比特位;
若仅abs_bvd_greater0_flag[1]为TRUE时,则bvd_sign_bin[1]为上述的第0个比特位。
compIdx=0..1的运动矢量差异的绝对值abs_bvd[compIdx]的推导如下:
abs_bvd[compIdx]=abs_bvd_greater0_flag[compIdx]*(abs_bvd_minus1[compIdx]+1)
表77
Figure PCTCN2022125219-appb-000066
compIdx=0…1,表示水平分量或者垂直分量。
真实BVD的推导过程如下:
bvd[compIdx]=abs_bvd_greater0_flag[compIdx]*
(abs_bvd_minus1[compIdx]+1)*(1-2*bvd_sign[compIdx])
进一步地,在本申请的实施例中,对于上述实施例在采用特定顺序的候选BVD列表OrderedList和确定候选BVD集合中所提出的使用两个数组分别存储候选BVD的方案,其中,BVD水平垂直分量均存在的情况下,水平分量和垂直分量的先后顺序可进行互换。
示例性的,在本申请的实施例中,如果BVD水平和垂直分量均存在,假设该组合列表为{(+,+),(+,-),(-,-),(-,+)},其对应的成本列表为{Cost(+,+),Cost(+,-),Cost(-,-),Cost(-,+)}。上述两个列表中成员的顺序可任意排列。
定义两个数组posiGrp和negaGrp,posiGrp存储在同一分量(垂直)上符号为正号的两个BVD的符号组合,negaGrp存储在同一分量(垂直)上符号为负号的两个BVD的符号组合。
假设posiGrp={(+,+),(-,+)},negaGrp={(+,-),(-,-)}。posiGrp和negaGrp两个列表中成员的顺序可任意排列。
第一次比较:比较Cost(+,+)和Cost(-,+)的大小,将posiGrp[0]置为两者较小的BVD组合,将posiGrp[1]置为两者较大的BVD组合;
第二次比较:比较Cost(+,-)和Cost(-,-)的大小,将negaGrp[0]置为两者较小的BVD组合,将negaGrp[1]置为两者较大的BVD组合;
第三次比较:比较posiGrp[0]和negaGrp[0]对应的Cost的大小;
(1)若在第三次比较中,posiGrp[0]对应的Cost<=negaGrp[0]对应的Cost:
如果第0个比特位为0,则bvd_sign[1]=0。如果第1个比特位为0,则bvd_sign[0]=posiGrp[0][0];如果第1个比特位为1,则bvd_sign[0]=posiGrp[1][0]。
如果第0个比特位为1,则bvd_sign[1]=1。如果第1个比特位为0,则bvd_sign[0]=negaGrp[0][0];如果第1个比特位为1,则bvd_sign[0]=negaGrp[1][0]。
(2)若在第三次比较中,posiGrp[0]对应的Cost>negaGrp[0]对应的Cost:
如果第0个比特位为1,则bvd_sign[1]=0。如果第1个比特位为0,则bvd_sign[0]=posiGrp[0][0];如果第1个比特位为1,则bvd_sign[0]=posiGrp[1][0]。
如果第0个比特位为0,则bvd_sign[1]=1。如果第1个比特位为0,则bvd_sign[0]=negaGrp[0][0];如果第1个比特位为1,则bvd_sign[0]=negaGrp[1][0]。
进一步地,在本申请的实施例中,在BVD水平垂直分量均存在的情况下,水平分量和垂直分量的先后顺序可进行互换的操作流程,可以通过某种准则来决策水平分量和垂直分量的先后顺序。其中包括但不限定于以下的方式,通过BVD的水平分量和垂直分量的绝对值大小等准则来决策水平分量和垂直分量的先后顺序。
进一步地,在本申请的实施例中,针对排序后的BVD组合列表(候选BVD列表),可以存储它们各自的cost,然后基于这些存储的cost进行一个重新排序,具体过程为:如果列表中一个候选与前一个候选之间的cost差异低于λ值,例如|D1-D2|<λ,则认为该候选是冗余的,其中D1和D2是在第一次排序后获得的cost,λ是编码器端RD准则中使用的拉格朗日参数。
示例性的,图11为计算成本的示意图,如图11所示,计算成本的算法定义如下:
(1)确定列表所有候选中候选与其之前候选之间的最小成本差异
如果最小成本差异大于等于λ,则认为列表足够多样化并且停止重排。
如果这个最小成本差异小于λ,则候选被认为是多余的,并将其移动到另外一个位置。这个位置是和其之前的候选相比足够多样化的一个位置。
(2)该算法在有限次数的迭代后停止。
由此可见,本申请实施例提出的编解码方法可以有效地节省IBC模式中的BVD的符号传输所需的码率。具体地,可以通过在BVD的可能符号和BVD的绝对值之间创建BVD的组合列表,并对组合列表利用模板进行排序,利用真实的BVD符号和排序后的列表得到符号预测索引进行CABAC的编码。所提方案比旁路编码具有更高的编码效率,从而节省了IBC中的BVD传输所需的码率。
也就是说,本申请实施例提出了一种新的IBC中的BVD的符号传输方法,可以充分利用模板与当前编码块的相似性,将BVD的符号组合列表进行有效地排序;同时使用CABAC进行编码,比旁路编码具有更高的编码效率。
本申请实施例提供了一种编解码方法,在解码端,解码码流,确定当前块的BVD绝对值和BVD符号索引信息;根据当前块的BVD绝对值,对当前块的候选BVD进行排序处理,确定排序结果;根据BVD符号索引信息和排序结果,确定当前块的BVD;根据当前块的BVD,确定当前块的重建值。在编码端,根据当前块的BVD绝对值,对当前块的候选BVD进行排序处理,确定排序结果;根据当前块的BVD符号信息和排序结果,确定当前块的BVD符号索引信息;将BVD绝对值和BVD符号索引信息写入码流。由此可见,在本申请的实施例中,可以根据当前块的BVD绝对值对当前块的候选BVD进行有效排序处理,从而可以在编码时利用排序结果进行BVD符号索引信息的确定和传输,在解码时利用排序结果进行当前块的BVD符号信息的解析,同时可以使用CABAC编解码技术对BVD符号信息进行编解码处理,能够有效地节省IBC模式中的BVD的符号传输所需的码率,从而可以提高编码效率。
本申请的实施例提出了一种编码方法,该编码方法可以应用于编码器,图12为本申请实施例中的编码方法的示意图一,如图12所示,解码器进行解码处理的方法可以包括以下步骤:
步骤301、根据当前块的BVD绝对值,对当前块的候选BVD进行排序处理,确定排序结果。
在本申请的实施例中,编码器可以先确定当前块的BVD绝对值,然后根据当前块的BVD绝对值,对当前块的候选BVD进行排序处理,从而可以确定排序结果。
可以理解的是,在本申请的实施例中,BVD绝对值包括第一分量绝对值absBvdX和第二分量绝对值absBvdY;即BVD绝对值包括水平分量绝对值和垂直分量绝对值。相应的,当前块的BVD可以包括第一分量candBvdX和第二分量candBvdY,同时,当前块的候选BVD也包括第一分量candBvdX和第二分量candBvdY,即BVD可以包括水平分量和垂直分量。
进一步地,在本申请的实施例中,如果absBvdX和absBvdY均不为0,那么可以确定BVD符号索引信息的比特位数为2;如果absBvdX或absBvdY为0,那么可以确定BVD符号索引信息的比特位数为1。
需要说明的是,在本申请的实施例中,除了例如上述的定长编码方法以外,还可以采用变长编码方法对BVD符号索引信息进行编码处理。例如采用截断一元码编码BVD符号索引信息,既可以使用使用截断二进制码(Truncated binarization)进行二值化处理,此时BVD符号索引信息的比特位数不一定为2。
也就是说,在本申请的实施例中,如果采用截断一元码编码BVD符号索引信息(这里,该BVD符号索引信息可以为候选BVD列表中的索引值),则不同候选BVD对应的符号索引信息的比特位数不完全相同,即为变长编码。
进一步地,在本申请的实施例中,在确定出当前块的BVD绝对值之后,可以利用BVD绝对值确定BVD的组合列 表,其中,BVD的组合列表中包括当前块的任意数量的候选BVD。即可以利用BVD绝对值确定当前块的候选BVD,也可以理解为利用BVD绝对值确定当前块的候选BVD的初始集合。
需要说明的是,在本申请的实施例中,可以通过在BVD的可能符号和BVD绝对值之间创建BVD的组合列表(候选BVD)。其中,可以包括仅水平BVD存在、仅垂直BVD存在以及二者都存在的情况。
进一步地,在本申请的实施例中,在创建BVD的组合列表(候选BVD)时,主要包括对BVD的可能符号进行排列组合、对可能的水平符号和垂直符号分别乘以BVD的水平绝对值分量和垂直绝对值分量。
示例性的,在本申请的实施例中,如果仅垂直BVD存在,即如果absBvdX等于0,那么可以根据absBvdY确定候选BVD。
例如,BVD分为水平分量和垂直分量,当水平分量为零的时候,只对垂直分量进行编码,所以只对垂直分量的符号构建组合列表,具体为以下两种情况:
第一种情况:水平分量都为正号,只是一个占位,垂直分量先为正号,后为负号,构建一个符号列表,然后将构建的符号列表乘以BVD的水平和垂直分量的绝对值,进而得到BVD的组合列表。
Figure PCTCN2022125219-appb-000067
第二种情况:水平分量都为正号,只是一个占位,垂直分量先为负号,后为正号,构建一个符号列表,然后将构建的符号列表乘以BVD的水平和垂直分量的绝对值,进而得到BVD的组合列表。
Figure PCTCN2022125219-appb-000068
示例性的,在本申请的实施例中,如果仅水平BVD存在,即如果absBvdY等于0,那么可以根据absBvdX确定候选BVD。
例如,BVD分为水平分量和垂直分量,当垂直分量为零的时候,只对水平分量进行编码,所以只对水平分量的符号构建组合列表,具体为以下两种情况:
第一种情况:垂直分量都为正号,只是一个占位,水平分量先为正号,后为负号,构建一个符号列表,然后将构建的符号列表乘以BVD的垂直和水平分量的绝对值,进而得到BVD的组合列表。
Figure PCTCN2022125219-appb-000069
第二种情况:垂直分量都为正号,只是一个占位,水平分量先为负号,后为正号,构建一个符号列表,然后将构建的符号列表乘以BVD的垂直和水平分量的绝对值,进而得到BVD的组合列表。
Figure PCTCN2022125219-appb-000070
示例性的,在本申请的实施例中,如果水平BVD和垂直BVD均存在,即如果absBvdX和absBvdY均不等于0,那么可以根据absBvdX和absBvdY确定候选BVD。
例如,BVD分为水平分量和垂直分量,当两分量均不为零的时候,二者均需要进行编码,所以要对水平和垂直分量一起构建BVD列表,具体分为24种情况,即{+1,+1}、{+1,-1}、{-1,+1}和{-1,-1}这4种组合下的任意排列,下述举例说明:
列表第0位为水平和垂直分量均为正号,列表第1位为水平分量为正号垂直分量为负号,列表第2位为水平分量为 负号垂直分量为正号,列表第3位为水平分量和垂直分量均为负号,构建一个符号列表,然后将构建的符号列表乘以BVD的垂直和水平分量的绝对值,进而得到BVD的组合列表。
Figure PCTCN2022125219-appb-000071
进一步地,在本申请的实施例中,在确定当前块的BVD绝对值之后,可以进一步根据BVD绝对值,对当前块的候选BVD进行排序处理,确定排序结果。
进一步地,在本申请的实施例中,在根据BVD绝对值,对当前块的候选BVD进行排序处理,确定排序结果时,可以先根据BVD绝对值,确定当前块的一个或多个候选BVD对应的第一代价值;然后可以根据第一代价值,对候选BVD进行排序,确定排序结果。
可以理解的是,在本申请的实施例中,一个或多个候选BVD可以包括candBvdX分别设置为等于–absBvdX或absBvdX、candBvdY分别设置为等于–absBvdY或absBvdY的BVD。
需要说明的是,在本申请的实施例中,在根据当前块的BVD绝对值,确定当前块的一个或多个候选BVD对应的第一代价值时,可以先根据候选BVD确定的第一匹配模板;然后根据预设的误差准则,计算当前块的第一模板与第一匹配模板之间的匹配误差,以确定候选BVD对应的第一代价值。
示例性的,在本申请的实施例中,在进行成本计算时,即确定第一代价值时,对于计算模板区域的成本的成本函数有多种选择,即预设的误差准则可以有多种选择。例如,可以选择绝对误差和(SAD)、变换绝对误差和(SATD)、差值平方和(SSE)、平均绝对差值(MAD)、平均绝对误差(MAE)、平均平方误差(MSE)、率失真函数(RDO)等评价准则。下述内容所提到的某种评价准则均可从上述准则中选择其一,以SAD的评价准则为例,计算公式如下:
Figure PCTCN2022125219-appb-000072
其中,predTempSizeW为模板的宽度,predTempSizeH为模板的高度,predTemp[i][j]为BV处模板的像素点,recTempC[i][j]为当前块模板的像素点。
也就是说,在本申请的实施例中,预设的误差准则可以包括绝对误差和SAD、变换绝对误差和SATD、差值平方和SSE、平均绝对差值MAD、平均绝对误差MAE、平均平方误差MSE、率失真函数RDO中的任意一种。
可以理解的是,在本申请的实施例中,第一模板包括当前块的相邻已解码区域中的一个或多个样值。
示例性的,在本申请的实施例中,在进行模板(当前块的第一模板)的选择时,可以根据当前块的邻近区域的像素可用性,判断模板位置的像素是否可用,包括重建亮度信息。如图6所示,根据模板与当前块的相对位置关系,可将模板分类为上模板、左模板、右上模板、左下模板、左上模板等模板类型。其中,不同编码块的不同类型的模板尺寸可以固定相同,也可以不同。
例如,模板尺寸对当前任意编码块(当前块)选择相同的模板尺寸,也可以根据当前编码块的不同尺寸选择不同的模板尺寸,还可以根据当前亮度编码块内的像素数选择不同的模板尺寸。
需要说明的是,在本申请的实施例中,在根据候选BVD确定的第一匹配模板时,可以先确定当前块的块向量预测值BVP;然后根据BVP和候选BVD确定当前块的候选BV;其中,候选BV用于指示第一匹配模板的位置;接着,可以根据候选BV确定第一匹配模板。
示例性的,在本申请的实施例中,假设BVP包括第三分量currBvpX和第四分量currBvpY,那么在根据BVP和候选BVD确定当前块的候选BV时,可以选择将候选BV的二维矢量设置为(currBvpX+candBvdX,currBvpY+candBvdY),即根据候选BVD的第一分量candBvdX、第二分量candBvdY,以及BVP的第三分量currBvpX、第四分量currBvpY进行BV的二维矢量的确定。
进一步地,在本申请的实施例中,在根据候选BV确定第一匹配模板时,可以根据当前点的位置和候选BV的二维矢量确定第一匹配模板。
示例性的,在本申请的实施例中,可以选择以当前点的位置为起点,将候选BV的二维矢量所指示的、与第一模板具有相同形状和包含相同数量样值的区域,确定为第一匹配模板。
在进行当前块的BV预测时,可以利用当前块的BVP以及BVD的组合列表,产生新的BV。如图8所示,利用当前块判断这个BV是否可用(可用的条件为该BV指向的参考块已经重建,且未超出IBC所设定的搜索范围以及图像边界等条件),如果当前BV是可用的,然后就会利用当前块的模板和新的BV进行运动补偿,得到对应BV处的模板。如图9所示,BVD水平和垂直分量共产生4种组合的BVD,分别进行模板处的运动补偿。计算成本时的模板的使用情况存在以下几种情况:
第一种:当前块的上模板和左模板均存在,且对应BV处的上模板和左模板均存在,此时上模板和左模板均可用。
第二种:当前块的上模板和左模板均存在,对应BV处仅上模板存在,此时存在两种方法:方法一:对应BV处左模板不存在,直接不用,即仅用上模板计算。方法二:对应BV处左模板不存在,采用参考块内部最左侧的模板宽度列代替左模板,即采用上模板和左模板计算。
第三种:当前块的上模板和左模板均存在,对应BV处仅左模板存在,此时存在两种方法:方法一:对应BV处上 模板不存在,直接不用,即仅用左模板计算。方法二:对应BV处上模板不存在,采用参考块内部最上侧的模板高度行代替上模板,即采用上模板和左模板计算。
第四种:当前块仅上模板存在,此时存在三种方法:方法一:对应BV处上模板不存在,直接不用。方法二:对应BV处上模板不存在,采用参考块内部最上侧的模板高度行代替上模板。方法三:对应BV处上模板存在,直接用。
第五种:当前块仅左模板存在,此时存在三种方法:方法一:对应BV处左模板不存在,直接不用。方法二:对应BV处左模板不存在,采用参考块内部最左侧的模板宽度列代替左模板。方法三:对应BV处左模板存在,直接用。
第六种:当前块上模板和左模板均不存在,忽略此种情况的BVD组合情况。
以上六种情况下,当BV指向的参考块不可用时,均忽略此种情况下的BVD组合情况。当忽略某种情况下的BVD组合情况时,将此种情况下的成本置为成本评价准则的最大值。
进一步地,在本申请的实施例中,如果上述两个模板均能获取到,此时对这个模板进行处理,包括但不限于以下方法:将两者进行加权融合。其中,加权融合的标准可以选择固定加权系数或者根据各自模板的重建亮度与预测亮度的像素值之差的绝对值之和进行分配加权系数等。
由此可见,在本申请的实施例中,可以根据根据当前块的BVP和BVD的组合列表(候选BVD)进行模板预测,计算出BVD组合列表中的每个BVD组合(候选BVD)的成本(第一代价值),即计算模板区域的成本,可以对BVD组合列表中的各种组合利用模板进行成本的计算,具体为利用当前块模板位置处的重建亮度像素和利用当前块的BVP及BVD的组合得出的BV进行模板预测得到的位置处的重建亮度像素计算成本。
需要说明的是,在本申请的实施例中,在计算成本(第一代价值)时,不仅可以采用亮度,还可以包含色度即Cb和Cr分量。本申请不进行具体限定。
进一步地,在本申请的实施例中,在计算获得每一个候选BVD的第一代价值之后,便可以利用第一代价值对候选BVD进行排序处理,从而可以获得排序结果。其中,排序结果可以为排序后的当前块的候选BVD列表,也可以为通过排序确定出第一代价值最小的候选BVD的候选BVD集合。本申请不进行具体限定。
需要说明的是,在本申请的实施例中,如果排序结果为当前块的候选BVD列表,那么相应的,执行排序的过程可以为根据第一代价值,对候选BVD进行排序,确定当前块的候选BVD列表,其中,候选BVD列表至少包括一个候选BVD。
进一步地,在本申请的实施例中,在根据第一代价值,对候选BVD进行排序,确定当前块的候选BVD列表时,可以选择根据预设的误差准则,按第一代价值指示的匹配误差从小到大的顺序,对一个或多个候选BVD进行排序,确定候选BVD列表。
可以理解的是,在本申请的实施例中,排序结果可以为排列为升(降)序的新列表OrderedList(当前块的候选BVD列表)。例如,例如,采用冒泡排序、选择排序、插入排序、希尔排序、归并排序、快速排序、基数排序、堆排序、计数排序、桶排序等排序方法。
进一步地,在本申请的实施例中,排序结果还可以为特定顺序的新列表OrderedList(当前块的候选BVD列表)。
示例性的,在本申请的实施例中,在根据第一代价值,对候选BVD进行排序,确定当前块的候选BVD列表时,如果absBvdX和absBvdY均不等于0,将候选BVD分别存储至第一数组和第二数组;然后基于第一代价值,确定第一数组中的第一候选BVD和第二候选BVD,以及第二数组中的第三候选BVD和第四候选BVD;最后便可以基于第一代价值,对第一候选BVD、第二候选BVD、第三候选BVD、第四候选BVD进行排序处理,确定候选BVD列表。
如果BVD水平分量和垂直分量均存在,即absBvdX和absBvdY均不等于0,假设该组合列表(候选BVD)为{(+BVD HOR,+BVD VER),(+BVD HOR,-BVD VER),(-BVD HOR,-BVD VER),(-BVD HOR,+BVD VER)},其对应的成本列表为{Cost(+BVD HOR,+BVD VER),Cost(+BVD HOR,-BVD VER),Cost(-BVD HOR,-BVD VER),Cost(-BVD HOR,+BVD VER)}。上述两个列表中成员的顺序可任意排列。
定义两个数组posiGrp和negaGrp,posiGrp存储在同一分量(水平)上符号为正号的两个BVD组合,negaGrp存储在同一分量(水平)上符号为负号的两个BVD组合。
假设posiGrp={(+BVD HOR,+BVD VER),(+BVD HOR,-BVD VER)},negaGrp={(-BVD HOR,+BVD VER),(-BVD HOR,-BVD VER)}。posiGrp和negaGrp两个列表中成员的顺序可任意排列。
第一次比较:比较Cost(+BVD HOR,+BVD VER)和Cost(+BVD HOR,-BVD VER)的大小,将posiGrp[0]置为两者较小的BVD组合,将posiGrp[1]置为两者较大的BVD组合;
第二次比较:比较Cost(-BVD HOR,+BVD VER)和Cost(-BVD HOR,-BVD VER)的大小,将negaGrp[0]置为两者较小的BVD组合,将negaGrp[1]置为两者较大的BVD组合;
第三次比较:比较posiGrp[0]和negaGrp[0]对应的Cost的大小。
需要说明的是,在本申请的实施例中,在基于第一代价值,对第一候选BVD、第二候选BVD、第三候选BVD、第四候选BVD进行排序处理,确定候选BVD列表时,一种可用的方式如下:如果第一候选BVD的第一代价值小于等于第三候选BVD的第一代价值,将第一候选BVD设置为候选BVD列表中的第一个候选BVD,将第三候选BVD设置为候选BVD列表中的第二个候选BVD,将第二候选BVD设置为候选BVD列表中的第三个候选BVD,将第四候选BVD设置为候选BVD列表中的第四个候选BVD。如果第一候选BVD的第一代价值大于第三候选BVD的第一代价值,将第三候选BVD设置为候选BVD列表中的第一个候选BVD,将第一候选BVD设置为候选BVD列表中的第二个候选BVD,将第四候选BVD设置为候选BVD列表中的第三个候选BVD,将第二候选BVD设置为候选BVD列表中的第四个候选BVD。
相应的,最后的排序过程可以为:若在第三次比较中,posiGrp[0]对应的Cost<=negaGrp[0]对应的Cost,将posiGrp[0]排序在候选BVD列表OrderedList的第0位,将negaGrp[0]排序在候选BVD列表OrderedList的第1位,将posiGrp[1]排序在候选BVD列表OrderedList的第2位,将negaGrp[1]排序在候选BVD列表OrderedList的第3位。
若在第三次比较中,posiGrp[0]对应的Cost>negaGrp[0]对应的Cost,将negaGrp[0]排序在候选BVD列表OrderedList的第0位,将posiGrp[0]排序在候选BVD列表OrderedList的第1位,将negaGrp[1]排序在候选BVD列 表OrderedList的第2位,将posiGrp[1]排序在候选BVD列表OrderedList的第3位。
其中,当前块的候选BVD列表的第0位的候选BVD即为候选BVD列表中的第一个候选BVD,第1位的候选BVD即为候选BVD列表中的第二个候选BVD,第2位的候选BVD即为候选BVD列表中的第三个候选BVD,第3位的候选BVD即为候选BVD列表中的第四个候选BVD。
需要说明的是,在本申请的实施例中,在基于第一代价值,对第一候选BVD、第二候选BVD、第三候选BVD、第四候选BVD进行排序处理,确定候选BVD列表时,另一种可用的方式如下:如果第一候选BVD的第一代价值小于等于第三候选BVD的第一代价值,将第一候选BVD设置为候选BVD列表中的第一个候选BVD,将第二候选BVD设置为候选BVD列表中的第二个候选BVD,将第三候选BVD设置为候选BVD列表中的第三个候选BVD,将第四候选BVD设置为候选BVD列表中的第四个候选BVD。如果第一候选BVD的第一代价值大于第三候选BVD的第一代价值,将第三候选BVD设置为候选BVD列表中的第一个候选BVD,将第四候选BVD设置为候选BVD列表中的第二个候选BVD,将第一候选BVD设置为候选BVD列表中的第三个候选BVD,将第二候选BVD设置为候选BVD列表中的第四个候选BVD。
相应的,最后的排序过程可以为:若在第三次比较中,posiGrp[0]对应的Cost<=negaGrp[0]对应的Cost,将posiGrp[0]排序在候选BVD列表OrderedList的第0位,将negaGrp[0]排序在候选BVD列表OrderedList的第2位,将posiGrp[1]排序在候选BVD列表OrderedList的第1位,将negaGrp[1]排序在候选BVD列表OrderedList的第3位。
若在第三次比较中,posiGrp[0]对应的Cost>negaGrp[0]对应的Cost,将negaGrp[0]排序在候选BVD列表OrderedList的第0位,将posiGrp[0]排序在候选BVD列表OrderedList的第2位,将negaGrp[1]排序在候选BVD列表OrderedList的第1位,将posiGrp[1]排序在候选BVD列表OrderedList的第3位。
示例性的,在本申请的实施例中,在根据第一代价值,对候选BVD进行排序,确定当前块的候选BVD列表时,如果absBvdX等于0或者absBvdY等于0,将候选BVD中的第一代价值最小的一个候选BVD设置为候选BVD列表中的第一个候选BVD,将候选BVD中的另一个候选BVD设置为候选BVD列表中的第二个候选BVD。
如果仅BVD水平分量或者垂直分量存在,即absBvdX或absBvdY等于0,那么可以直接按照第一代价值的大小对两个候选BVD进行排序处理,以生成候选BVD列表。
对于仅BVD垂直分量存在的情况,假设该组合列表为{(0,+BVD VER),(0,-BVD VER)},其对应的成本列表为{Cost(0,+BVD VER),Cost(0,-BVD VER)}。上述两个列表中成员的顺序可任意排列。
排序过程为:比较Cost(0,+BVD VER)和Cost(0,-BVD VER)的大小:
若Cost(0,+BVD VER)<=Cost(0,-BVD VER),则将(0,+BVD VER)排序在候选BVD列表OrderedList的第0位,将(0,-BVD VER)排序在候选BVD列表OrderedList的第1位;
若Cost(0,+BVD VER)>Cost(0,-BVD VER),则将(0,-BVD VER)排序在候选BVD列表OrderedList的第0位,将(0,+BVD VER)排序在候选BVD列表OrderedList的第1位。
对于仅BVD水平分量存在的情况,假设该组合列表为{(+BVD HOR,0),(-BVD HOR,0)},其对应的成本列表为{Cost(+BVD HOR,0),Cost(-BVD HOR,0)}。上述两个列表中成员的顺序可任意排列。
排序过程为:比较Cost(+BVD HOR,0)和Cost(-BVD HOR,0)的大小:
若Cost(+BVD HOR,0)<=Cost(-BVD HOR,0),则将(+BVD HOR,0)排序在候选BVD列表OrderedList的第0位,将(-BVD HOR,0)排序在候选BVD列表OrderedList的第1位;
若Cost(+BVD HOR,0)>Cost(-BVD HOR,0),则将(-BVD HOR,0)排序在候选BVD列表OrderedList的第0位,将(+BVD HOR,0)排序在候选BVD列表OrderedList的第1位。
需要说明的是,在本申请的实施例中,如果排序结果为当前块的候选BVD集合,那么相应的,执行排序的过程可以为根据第一代价值,对候选BVD进行排序,确定当前块的候选BVD集合,其中,候选BVD集合至少包括一个候选BVD。
进一步地,在根据第一代价值,对候选BVD进行排序,确定当前块的候选BVD集合时,如果absBvdX和absBvdY均不等于0,将候选BVD分别存储至第一数组和第二数组;然后确定第一数组中的、第一代价值最小的第五候选BVD,以及第二数组中的、第一代价值最小的第六候选BVD;最后可以将第五候选BVD和第六候选BVD中的、第一代价值最小的候选BVD,确定为候选BVD集合中的代价最小BVD。
如果BVD水平分量和垂直分量均存在,即absBvdX和absBvdY均不等于0,假设该组合列表为{(+,+),(+,-),(-,-),(-,+)},其对应的成本列表为{Cost(+,+),Cost(+,-),Cost(-,-),Cost(-,+)}。上述两个列表中成员的顺序可任意排列。
定义两个数组posiGrp和negaGrp,posiGrp存储在同一分量(水平)上符号为正号的两个BVD的符号组合,negaGrp存储在同一分量(水平)上符号为负号的两个BVD的符号组合。
假设posiGrp={(+,+),(+,-)},negaGrp={(-,+),(-,-)}。posiGrp和negaGrp两个列表中成员的顺序可任意排列。
第一次比较:比较Cost(+,+)和Cost(+,-)的大小,将posiGrp[0]置为两者较小的BVD的符号组合,将posiGrp[1]置为两者较大的BVD的符号组合;
第二次比较:比较Cost(-,+)和Cost(-,-)的大小,将negaGrp[0]置为两者较小的BVD的符号组合,将negaGrp[1]置为两者较大的BVD的符号组合;
第三次比较:比较posiGrp[0]和negaGrp[0]对应的Cost的大小。
进而可以确定出Cost最小的一个BVD的符号组合,即确定出候选BVD集合中的代价最小BVD。
如果仅BVD水平分量或者垂直分量存在,即absBvdX或absBvdY等于0,那么可以直接按照第一代价值的大小对两个候选BVD进行排序处理,以确定出候选BVD集合中的代价最小BVD。
示例性的,在本申请的实施例中,在根据第一代价值,对候选BVD进行排序,确定当前块的候选BVD集合时,如果absBvdX等于0或者absBvdY等于0,那么可以将候选BVD中的第一代价值最小的一个候选BVD确定为候选BVD 集合中的代价最小BVD。
对于仅BVD垂直分量存在的情况,假设该组合列表为{(+,+),(+,-)},其对应的成本列表为{Cost(+,+),Cost(+,-)}。上述两个列表中成员的顺序可任意排列。比较过程为:比较Cost(+,+)和Cost(+,-)的大小,进而可以确定出Cost最小的一个BVD的符号组合,即确定出候选BVD集合中的代价最小BVD。
对于仅BVD水平分量存在的情况,假设该组合列表为{(+,+),(-,+)},其对应的成本列表为{Cost(+,+),Cost(-,+)}。上述两个列表中成员的顺序可任意排列。比较过程为:比较Cost(+,+)和Cost(-,+)的大小,进而可以确定出Cost最小的一个BVD的符号组合,即确定出候选BVD集合中的代价最小BVD。
步骤302、根据当前块的BVD符号信息和排序结果,确定当前块的BVD符号索引信息。
在本申请的实施例中,在根据当前块的BVD绝对值,对当前块的候选BVD进行排序处理,确定排序结果之后,可以进一步根据当前块的BVD符号信息和排序结果,从而可以确定当前块的BVD符号索引信息。
需要说明的是,在本申请的实施例中,如果排序处理获得的当前块的候选BVD列表为升(降)序的列表,那么可以选择采用转换列表间接得到BVD符号索引信息(符号预测索引),也可以直接采用逻辑推理得到BVD符号索引信息。
其中,在采用转换列表间接得到BVD符号索引信息时,可以先按照转换规则将BVD组合列表OrderedList转换为索引转换列表TransformedList。
示例性的,在本申请的实施例中,可以对候选BVD列表进行转换处理,确定索引转换列表(TransformedList)。
进一步地,在本申请的实施例中,在根据当前块的BVD符号信息和排序结果,确定当前块的BVD符号索引信息时,当absBvdX和absBvdY均不为0时,若当前块的BVD符号信息的第一分量符号与索引转换列表中的第一个候选BVD的第一分量符号相同,则将BVD符号索引信息的第一比特位确定为0;否则将第一比特位确定为1。
进一步地,在本申请的实施例中,当第一比特位确定为0时,若当前块的BVD符号信息的第二分量符号与索引转换列表中的第一个候选BVD的第二分量符号相同,则将BVD符号索引信息的第二比特位确定为0;否则将第二比特位确定为1。
进一步地,在本申请的实施例中,当第一比特位确定为1时,若当前块的BVD符号信息的第二分量符号与索引转换列表中、索引为1的候选BVD的第二分量符号相同,则将BVD符号索引信息的第二比特位确定为0;否则将第二比特位确定为1。
也就是说,在本申请的实施例中,对于BVD水平分量和垂直分量均存在的情况,BVD的符号预测索引为两个比特位。
假设排序后的BVD组合列表OrderedList为:
表78.水平垂直BVD均存在的排序后的BVD组合列表OrderedList
索引 水平分量 垂直分量
0 a1 a2
1 b1 b2
2 c1 c2
3 d1 d2
利用以下转换规则将排序后的BVD组合列表OrderedList转换为TransformedList(索引转换列表):
将排序后最小cost的BVD组合放在TransformedList列表的第0位,即将(a1,a2)放在TransformedList列表的第0位。将与a1同号的BVD组合放在TransformedList列表的第2位,即假设b1与其同号,则将(b1,b2)放在TransformedList列表的第2位。将与a1异号的较小cost的BVD组合放在TransformedList列表的第1位,即将(c1,c2)放在TransformedList列表的第1位。将与a1异号的较大cost的BVD组合放在TransformedList列表的第3位,即将(d1,d2)放在TransformedList列表的第3位。
则索引转换列表TransformedList为:
表79.水平垂直BVD均存在的索引转换列表TransformedList
索引 水平分量 垂直分量
0 a1 a2
1 c1(-a1) c2
2 b1(a1) b2
3 d1(-a1) d2
对于索引转换列表,按照以下规则得到符号预测索引,此时符号预测索引等于表中最左列的索引:
假设真实的BVD的水平分量为e1,垂直分量为e2。
针对索引0的候选BVD:
如果满足水平分量a1==e1,则第0个比特位为0,然后检查其垂直分量,如果满足垂直分量a2==e2,则第1个比特位为0,否则第1个比特位为1。
如果不满足水平分量a1==e1,则第0个比特位为1,然后检查索引1的候选BVD的垂直分量,如果满足垂直分量c2==e2,则第1个比特位为0,否则第1个比特位为1。
符号预测索引表示如下:
bvsdIdx=bit0+bit1<<1
例如:假设排序后的BVD组合列表OrderedList为:
表80.水平垂直BVD均存在的排序后的BVD组合列表OrderedList实例
索引 水平分量 垂直分量
0 -BVD HOR +BVD VER
1 -BVD HOR -BVD VER
2 +BVD HOR +BVD VER
3 +BVD HOR -BVD VER
则按照上述转换规则将排序后的BVD组合列表OrderedList转换为TransformedList:
表81.水平垂直BVD均存在的索引转换列表TransformedList实例
索引 水平分量 垂直分量
0 -BVD HOR +BVD VER
1 +BVD HOR +BVD VER
2 -BVD HOR -BVD VER
3 +BVD HOR -BVD VER
(1)假设真实的BVD的水平分量为-BVD HOR,垂直分量为+BVD VER,则:
bvsdIdx=0
(2)假设真实的BVD的水平分量为-BVD HOR,垂直分量为-BVD VER,则:
bvsdIdx=2
(3)假设真实的BVD的水平分量为+BVD HOR,垂直分量为+BVD VER,则:
bvsdIdx=1
(4)假设真实的BVD的水平分量为+BVD HOR,垂直分量为-BVD VER,则:
bvsdIdx=3
进一步地,在本申请的实施例中,在根据当前块的BVD符号信息和排序结果,确定当前块的BVD符号索引信息时,当absBvdX为0时,若当前块的BVD符号信息的第二分量符号与索引转换列表中的第一个候选BVD的第二分量符号相同,则将BVD符号索引信息确定为0;否则将BVD符号索引信息确定为1。
也就是说,如果仅BVD垂直分量存在,此时BVD的符号预测索引为一个比特位:
假设排序后的BVD组合列表OrderedList为:
表82.仅垂直BVD存在的排序后的BVD组合列表OrderedList
索引 水平分量 垂直分量
0 0 a2
1 0 b2(-a2)
则索引转换列表TransformedList与排序后的BVD组合列表OrderedList相同。
索引转换列表TransformedList为:
表6.仅垂直BVD存在的索引转换列表TransformedList
索引 水平分量 垂直分量
0 0 a2
1 0 b2(-a2)
对于索引转换列表,按照以下规则得到符号预测索引,此时符号预测索引等于表中最左列的索引:
假设真实的BVD的水平分量为0,垂直分量为e2。
如果a2==e2,则第0个比特位为0,否则,第0个比特位为1。
符号预测索引表示如下:
bvsdIdx=bit0
例如:假设排序后的BVD组合列表OrderedList为:
表83.仅垂直BVD存在的排序后的BVD组合列表OrderedList实例
索引 水平分量 垂直分量
0 0 +BVD VER
1 0 -BVD VER
索引转换列表TransformedList为:
表8.仅垂直BVD存在的索引转换列表TransformedList实例
索引 水平分量 垂直分量
0 0 +BVD VER
1 0 -BVD VER
(1)假设真实的BVD的水平分量为0,垂直分量为+BVD VER,则:
bvsdIdx=0
(2)假设真实的BVD的水平分量为0,垂直分量为-BVD VER,则:
bvsdIdx=1
进一步地,在本申请的实施例中,在根据当前块的BVD符号信息和排序结果,确定当前块的BVD符号索引信息时,当absBvdY为0时,若当前块的BVD符号信息的第一分量符号与索引转换列表中的第一个候选BVD的第一分量符号相同,则将BVD符号索引信息确定为0;否则将BVD符号索引信息确定为1。
也就是说,如果仅BVD水平分量存在,此时BVD的符号预测索引为一个比特位:
假设排序后的BVD组合列表OrderedList为:
表84.仅水平BVD存在的排序后的BVD组合列表OrderedList
索引 水平分量 垂直分量
0 a1 0
1 b1(-a1) 0
则索引转换列表TransformedList与排序后的BVD组合列表OrderedList相同。
索引转换列表TransformedList为:
表85.仅水平BVD存在的索引转换列表TransformedList
索引 水平分量 垂直分量
0 a1 0
1 b1(-a1) 0
对于索引转换列表,按照以下转换规则得到符号预测索引,此时符号预测索引等于表中最左列的索引:
假设真实的BVD的水平分量为e1,垂直分量为0。
如果a1==e1,则第0个比特位为0,否则,第0个比特位为1。
符号预测索引表示如下:
bvsdIdx=bit0
例如:假设排序后的BVD组合列表OrderedList为:
表86.仅水平BVD存在的排序后的BVD组合列表OrderedList实例
索引 水平分量 垂直分量
0 +BVD HOR 0
1 -BVD HOR 0
索引转换列表TransformedList为:
表87.仅水平BVD存在的转换列表TransformedList实例
索引 水平分量 垂直分量
0 +BVD HOR 0
1 -BVD HOR 0
(1)假设真实的BVD的水平分量为+BVD HOR,垂直分量为0,则:
bvsdIdx=0
(2)假设真实的BVD的水平分量为-BVD HOR,垂直分量为0,则:
bvsdIdx=1
进一步地,在直接采用逻辑推理得到BVD符号索引信息时,如果BVD水平分量和垂直分量均存在,那么在根据当前块的BVD符号信息和排序结果,确定当前块的BVD符号索引信息时,当absBvdX和absBvdY均不为0时,若当前块的BVD符号信息的第一分量符号与与候选BVD列表中的第一个候选BVD的第一分量符号相同,则将BVD符号索引信息的第一比特位确定为0;否则将第一比特位确定为1;遍历候选BVD列表,确定与当前块的BVD符号信息具有相同第一分量符号的首个候选BVD;若当前块的BVD符号信息的第二分量符号与首个候选BVD的第二分量符号相同,则将BVD符号索引信息的第二比特位确定为0;否则将第二比特位确定为1。
由此可见,第一种情况BVD水平分量和垂直分量均存在,此时BVD的符号预测索引为两个比特位:
假设排序后的BVD组合列表OrderedList为:
表88.水平垂直BVD均存在的排序后的BVD组合列表OrderedList
索引 水平分量 垂直分量
0 a1 a2
1 b1 b2
2 c1 c2
3 d1 d2
假设真实的BVD的水平分量为e1,垂直分量为e2。
针对索引0的候选BVD,如果满足水平分量a1==e1,则第0个比特位为0,否则,第0个比特位为1。然后从索引0开始遍历排序后的列表,当列表中首次出现与真实BVD水平分量相同的BVD时,检查其垂直分量。假设其垂直分量为f2,若满足f2==e2,则第1个比特位为0,否则第1个比特位为1。符号预测索引表示如下:
bvsdIdx=bit0+bit1<<1
bit0为第0个比特位,bit1为第1个比特位。
例如:假设排序后的BVD组合列表OrderedList为:
表89.水平垂直BVD均存在的排序后的BVD组合列表OrderedList实例
索引 水平分量 垂直分量
0 -BVD HOR +BVD VER
1 -BVD HOR -BVD VER
2 +BVD HOR +BVD VER
3 +BVD HOR -BVD VER
(1)假设真实的BVD的水平分量为-BVD HOR,垂直分量为+BVD VER
则第0个比特位为0,第1个比特位为0。符号预测索引表示如下:
bvsdIdx=bit0+bit1<<1=0
(2)假设真实的BVD的水平分量为-BVD HOR,垂直分量为-BVD VER
则第0个比特位为0,第1个比特位为1。符号预测索引表示如下:
bvsdIdx=bit0+bit1<<1=2
(3)假设真实的BVD的水平分量为+BVD HOR,垂直分量为+BVD VER
则第0个比特位为1,第1个比特位为0。符号预测索引表示如下:
bvsdIdx=bit0+bit1<<1=1
(4)假设真实的BVD的水平分量为+BVD HOR,垂直分量为-BVD VER
则第0个比特位为1,第1个比特位为1。符号预测索引表示如下:
bvsdIdx=bit0+bit1<<1=3
进一步地,在直接采用逻辑推理得到BVD符号索引信息时,如果仅BVD垂直分量存在,那么在根据当前块的BVD符号信息和排序结果,确定当前块的BVD符号索引信息时,当absBvdX为0时,若当前块的BVD符号信息的第二分量符号与候选BVD列表中的第一个候选BVD的第二分量符号相同,则将BVD符号索引信息确定为0,否则将BVD符号索引信息确定为1。
由此可见,第二种情况仅BVD的垂直分量存在,此时BVD的符号预测索引为一个比特位:
假设排序后的BVD组合列表OrderedList为:
表90仅垂直BVD存在的排序后的BVD组合列表OrderedList
索引 水平分量 垂直分量
0 0 a2
1 0 b2(-a2)
假设真实的BVD的水平分量为0,垂直分量为e2。
如果a2==e2,则第0个比特位为0,否则,第0个比特位为1。
符号预测索引表示如下:
bvsdIdx=bit0
例如:假设排序后的BVD组合列表OrderedList为:
表91.仅垂直BVD存在的排序后的BVD组合列表OrderedList实例
索引 水平分量 垂直分量
0 0 +BVD VER
1 0 -BVD VER
(1)假设真实的BVD的水平分量为0,垂直分量为+BVD VER
第0个比特位为0。符号预测索引表示如下:
bvsdIdx=bit0=0
(2)假设真实的BVD的水平分量为0,垂直分量为-BVD VER
第0个比特位为1。符号预测索引表示如下:
bvsdIdx=bit0=1
进一步地,在直接采用逻辑推理得到BVD符号索引信息时,如果仅BVD水平分量存在,那么在根据当前块的BVD符号信息和排序结果,确定当前块的BVD符号索引信息时,当absBvdY为0时,若当前块的BVD符号信息的第一分量符号与候选BVD列表中的第一个候选BVD的第一分量符号相同,则将BVD符号索引信息确定为0,否则将BVD符号索引信息确定为1。
由此可见,第三种情况仅BVD的水平分量存在,此时BVD的符号预测索引为一个比特位:
假设排序后的BVD组合列表OrderedList为:
表92.仅水平BVD存在的排序后的BVD组合列表OrderedList
索引 水平分量 垂直分量
0 a1 0
1 b1(-a1) 0
假设真实的BVD的水平分量为e1,垂直分量为0。
如果a1==e1,则第0个比特位为0,否则,第0个比特位为1。
符号预测索引表示如下:
bvsdIdx=bit0
例如:
假设排序后的BVD组合列表OrderedList为:
表93.仅水平BVD存在的排序后的BVD组合列表OrderedList实例
索引 水平分量 垂直分量
0 +BVD HOR 0
1 -BVD HOR 0
(1)假设真实的BVD的水平分量为+BVD HOR,垂直分量为0。
第0个比特位为0。符号预测索引表示如下:
bvsdIdx=bit0=0
(2)假设真实的BVD的水平分量为-BVD HOR,垂直分量为0。
第0个比特位为1。符号预测索引表示如下:
bvsdIdx=bit0=1
需要说明的是,在本申请的实施例中,如果排序处理获得的当前块的候选BVD列表为特定顺序的列表,那么可以直接将与真实的BVD的水平和垂直分量的符号对应相等的候选BVD的列表索引,确定为BVD的BVD符号索引信息(符号预测索引)。其中,可以将排序后的BVD组合列表OrderedList,直接赋值给TransformedList,即候选BVD列表OrderedList和索引转换列表TransformedList是相同的。
可以理解的是,在本申请的实施例中,如果排序处理获得的当前块的候选BVD列表为特定顺序的列表,那么在编码端,可以直接对BVD对应的两个分量同时编码,对应的,在解码端,BVD对应的两个分量可以直接通过BVD符号索引信息一起确定出来。
也就是说,在本申请的实施例中,可以直接通过解码获得的BVD符号索引信息,从候选BVD列表中确定出BVD符号索引信息所指示的候选BVD。
相应的,在本申请的实施例中,对于解码端解析组合索引(BVD符号索引信息)后同时得出水平和垂直分量的方案, 在编码端,编码器可以采用遍历的方法决定所传索引(BVD符号索引信息)。
可以理解的是,在本申请的实施例中,对于按照第一代价值指示的匹配误差从小到大的顺序排序所确定的候选BVD列表,即在当前块的候选BVD列表为升(降)序的列表的情况下,也可以直接按照与当前块的BVD符号信息相同的候选BVD在列表中的索引值设置BVD符号索引信息。
示例性的,在本申请的实施例中,在根据当前块的BVD符号信息和排序结果,确定当前块的BVD符号索引信息时,可以在候选BVD列表中确定与当前块的BVD符号信息相同的候选BVD;然后按照候选BVD的索引值设置BVD符号索引信息。
第一种情况BVD水平分量和垂直分量均存在,此时BVD的符号预测索引为两个比特位:
假设排序后的BVD组合列表OrderedList为:
表94.水平垂直BVD均存在的排序后的BVD组合列表OrderedList
索引 水平分量 垂直分量
0 a1 a2
1 b1(-a1) b2
2 c1(a1) c2
3 d1(-a1) d2
则索引转换列表TransformedList为:
表95.水平垂直BVD均存在的索引转换列表TransformedList
索引 水平分量 垂直分量
0 a1 a2
1 b1(-a1) b2
2 c1(a1) c2
3 d1(-a1) d2
对于索引转换列表,按照以下规则得到符号预测索引,此时符号预测索引等于表中最左列的索引:
假设真实的BVD的水平分量为e1,垂直分量为e2。
针对索引0的候选BVD:
如果满足水平分量a1==e1,则第0个比特位为0,然后检查其垂直分量,如果满足垂直分量a2==e2,则第1个比特位为0,否则第1个比特位为1。
如果不满足水平分量a1==e1,则第0个比特位为1,然后检查索引1的候选BVD的垂直分量,如果满足垂直分量c2==e2,则第1个比特位为0,否则第1个比特位为1。
符号预测索引表示如下:
bvsdIdx=bit0+bit1<<1
例如:假设排序后的BVD组合列表OrderedList为:
表96.水平垂直BVD均存在的排序后的BVD组合列表OrderedList实例
索引 水平分量 垂直分量
0 -BVD HOR +BVD VER
1 +BVD HOR +BVD VER
2 -BVD HOR -BVD HOR
3 +BVD HOR -BVD VER
则TransformedList为:
表97.水平垂直BVD均存在的索引转换列表TransformedList实例
索引 水平分量 垂直分量
0 -BVD HOR +BVD VER
1 +BVD HOR +BVD VER
2 -BVD HOR -BVD HOR
3 +BVD HOR -BVD VER
(1)假设真实的BVD的水平分量为-BVD HOR,垂直分量为+BVD VER,则:
bvsdIdx=0
(2)假设真实的BVD的水平分量为-BVD HOR,垂直分量为-BVD VER,则:
bvsdIdx=2
(3)假设真实的BVD的水平分量为+BVD HOR,垂直分量为+BVD VER,则:
bvsdIdx=1
(4)假设真实的BVD的水平分量为+BVD HOR,垂直分量为-BVD VER,则:
bvsdIdx=3
第二种情况仅BVD垂直分量存在,此时BVD的符号预测索引为一个比特位:
假设排序后的BVD组合列表OrderedList为:
表98.仅垂直BVD存在的排序后的BVD组合列表OrderedList
索引 水平分量 垂直分量
0 0 a2
1 0 b2(-a2)
则索引转换列表TransformedList为:
表99.仅垂直BVD存在的索引转换列表TransformedList
索引 水平分量 垂直分量
0 0 a2
1 0 b2(-a2)
对于索引转换列表,按照以下规则得到符号预测索引,此时符号预测索引等于表中最左列的索引:
假设真实的BVD的水平分量为0,垂直分量为e2。
如果a2==e2,则第0个比特位为0,否则,第0个比特位为1。
符号预测索引表示如下:
bvsdIdx=bit0
例如:假设排序后的BVD组合列表OrderedList为:
表100.仅垂直BVD存在的排序后的BVD组合列表OrderedList实例
索引 水平分量 垂直分量
0 0 +BVD VER
1 0 -BVD VER
TransformedList为:
表101.仅垂直BVD存在的索引转换列表TransformedList实例
索引 水平分量 垂直分量
0 0 +BVD VER
1 0 -BVD VER
(1)假设真实的BVD的水平分量为0,垂直分量为+BVD VER,则:
bvsdIdx=0
(2)假设真实的BVD的水平分量为0,垂直分量为-BVD VER,则:
bvsdIdx=1
第三种情况仅BVD水平分量存在,此时BVD的符号预测索引为一个比特位:
假设排序后的BVD组合列表OrderedList为:
表102.仅水平BVD存在的排序后的BVD组合列表OrderedList
索引 水平分量 垂直分量
0 a1 0
1 b1(-a1) 0
则索引转换列表TransformedList为:
表103.仅水平BVD存在的索引转换列表TransformedList
索引 水平分量 垂直分量
0 a1 0
1 b1(-a1) 0
对于索引转换列表,按照以下规则得到符号预测索引,此时符号预测索引等于表中最左列的索引:
假设真实的BVD的水平分量为e1,垂直分量为0。
如果a1==e1,则第0个比特位为0,否则,第0个比特位为1。
符号预测索引表示如下:
bvsdIdx=bit0
例如:假设排序后的BVD组合列表OrderedList为:
表104.仅水平BVD存在的排序后的BVD组合列表OrderedList实例
索引 水平分量 垂直分量
0 +BVD HOR 0
1 -BVD HOR 0
TransformedList为:
表105.仅水平BVD存在的转换列表TransformedList实例
索引 水平分量 垂直分量
0 +BVD HOR 0
1 -BVD HOR 0
(1)假设真实的BVD的水平分量为+BVD HOR,垂直分量为0,则:
bvsdIdx=0
(2)假设真实的BVD的水平分量为-BVD HOR,垂直分量为0,则:
bvsdIdx=1
需要说明的是,在本申请的实施例中,如果排序处理后的排序结果为当前块的候选BVD集合,那么排序后即确定了模板匹配代价最小的候选BVD,即确定了候选BVD集合中的代价最小BVD。此时,如果bvsdIdx的数值是bit0+bit1<<1,即bit0代表水平分量符号,bit1代表垂直分量符号,那么,最小的BVD符号组合(代价最小BVD),确定了bit0和bit1在取值等于0时的符号,取值等于1时的符号与此相反。
进一步地,在本申请的实施例中,在根据当前块的BVD符号信息和排序结果,确定当前块的BVD符号索引信息时,当absBvdX和absBvdY均不为0时,若当前块的BVD符号信息的第一分量符号与候选BVD集合中的代价最小BVD的第一分量符号相同,则确定BVD符号索引信息的第一比特位取值为0;接着可以按照候选BVD集合中的代价最小BVD确定当前块的BVD符号索引信息的第二比特位。
进一步地,在本申请的实施例中,在根据当前块的BVD符号信息和排序结果,确定当前块的BVD符号索引信息时,当absBvdX和absBvdY均不为0时,若当前块的BVD符号信息的第一分量符号与候选BVD集合中的代价最小BVD的第一分量符号不同,则确定BVD符号索引信息的第一比特位取值为1;接着可以按照候选BVD集合中的代价最小BVD 所在的数组以外的、另一个数组中的代价最小BVD确定当前块的BVD符号索引信息的第二比特位。
需要说明的是,在本申请的实施例中,在按照候选BVD集合中的代价最小BVD确定当前块的BVD符号索引信息的第二比特位时,若当前块的BVD符号信息的第二分量符号与候选BVD集合中的代价最小BVD的第二分量符号相同,则确定BVD符号索引信息的第二比特位取值为0;若当前块的BVD符号信息的第二分量符号与候选BVD集合中的代价最小BVD的第二分量符号不同,则确定BVD符号索引信息的第二比特位取值为1。
需要说明的是,在本申请的实施例中,在按照候选BVD集合中的代价最小BVD所在的数组以外的、另一个数组中的代价最小BVD确定当前块的BVD符号索引信息的第二比特位时,若当前块的BVD符号信息的第二分量符号与另一个数组中的代价最小BVD的第二分量符号相同,则确定BVD符号索引信息的第二比特位取值为0;若当前块的BVD符号信息的第二分量符号与另一个数组中的代价最小BVD的第二分量符号不同,则确定BVD符号索引信息的第二比特位取值为1。
需要说明的是,在本申请的实施例中,假设真实BVD的水平分量和垂直分量的符号为bvdSign[0]和bvdSign[1]。其中,取值为0则为正,取值为1则为负。
示例性的,在本申请的实施例中,如果BVD水平和垂直分量均存在,对于排序后确定的候选BVD集合中的代价最小BVD的两种可能情况如下:
(1)若在第三次比较中,posiGrp[0]对应的Cost<=negaGrp[0]对应的Cost:
如果bvd_sign[0]=0,那么第0个比特位为0。然后,判断bvd_sign[1]是否等于posiGrp[0][1],如果相等则第1个比特位为0,否则第1个比特位为1。
如果bvd_sign[0]=1,那么第0个比特位为1。然后,判断bvd_sign[1]是否等于negaGrp[0][1],如果相等则第1个比特位为0,否则第1个比特位为1。
(2)若在第三次比较中,posiGrp[0]对应的Cost>negaGrp[0]对应的Cost:
如果bvd_sign[0]=0,那么第0个比特位为1。然后,判断bvd_sign[1]是否等于posiGrp[0][1],如果相等则第1个比特位为0,否则第1个比特位为1。
如果bvd_sign[0]=1,那么第0个比特位为0。然后,判断bvd_sign[1]是否等于negaGrp[0][1],如果相等则第1个比特位为0,否则第1个比特位为1。
进一步地,在本申请的实施例中,在根据当前块的BVD符号信息和排序结果,确定当前块的BVD符号索引信息时,当absBvdX为0时,若当前块的BVD符号信息的第二分量符号与候选BVD集合中的代价最小BVD的第二分量符号相同,则确定BVD符号索引信息的取值为0;否则确定BVD符号索引信息的取值为1。
示例性的,在本申请的实施例中,如果BVD仅垂直分量存在,对于排序后确定的候选BVD集合中的代价最小BVD的两种可能情况如下:
(1)若Cost(+,+)<=Cost(+,-):
如果bvd_sign[1]=0,那么第0个比特位为0。
如果bvd_sign[1]=1,那么第0个比特位为1。
(2)若Cost(+,+)>Cost(+,-):
如果bvd_sign[1]=0,那么第0个比特位为1。
如果bvd_sign[1]=1,那么第0个比特位为0。
进一步地,在本申请的实施例中,在根据当前块的BVD符号信息和排序结果,确定当前块的BVD符号索引信息时,当absBvdY为0时,若当前块的BVD符号信息的第一分量符号与候选BVD集合中的代价最小BVD的第一分量符号相同,则确定BVD符号索引信息的取值为0;否则确定BVD符号索引信息的取值为1。
示例性的,在本申请的实施例中,如果BVD仅水平分量存在,对于排序后确定的候选BVD集合中的代价最小BVD的两种可能情况如下:
(1)若Cost(+,+)<=Cost(-,+):
如果bvd_sign[0]=0,那么第0个比特位为0。
如果bvd_sign[0]=1,那么第0个比特位为1。
(2)若Cost(+,+)>Cost(-,+):
如果bvd_sign[0]=0,那么第0个比特位为1。
如果bvd_sign[0]=1,那么第0个比特位为0。
可见,上述基于候选BVD集合确定当前块的BVD符号索引信息的方法,可以省去建立列表和得到符号预测索引的步骤,对于BVD的水平和垂直分量均存在的情况,编码端直接通过三次比较得到要编码的bit0和bit1,复杂度更低。
步骤303、将BVD绝对值和BVD符号索引信息写入码流。
在本申请的实施例中,在根据当前块的BVD符号信息和排序结果,确定当前块的BVD符号索引信息之后,便可以将BVD绝对值和BVD符号索引信息写入码流。
进一步地,在本申请的实施例中,可以选择使用上下文自适应的二进制算术编码CABAC编码BVD绝对值和BVD符号索引信息。也可以使用旁路模式编码BVD绝对值和BVD符号索引信息。
需要说明的是,在本申请的实施例中,需要将BVD绝对值和BVD符号索引信息(符号预测索引)写入码流。其中,可以先将BVD符号索引信息(符号预测索引)二值化。
示例性的,在本申请的实施例中,符号预测索引为两个比特位时,其为0时,编码为00B;其为1时,编码为01B;其为2时,编码为10B;其为3时,编码为11B。符号预测索引为一个比特位时,其为0时,编码为0B;其为1时,编码为1B。
然后,可以使用CABAC(上下文自适应的二进制算术编码)或旁路对上述转换的二进制数进行每个比特位的编码,即将BVD的符号预测索引写入码流中。
针对符号预测索引所使用的CABAC的上下文模型,可以使用单个概率模型,或者多个概率模型:包括但不限于根 据BVD的水平分量或垂直分量的绝对值大小、BVD的水平分量与垂直分量的和或差值等进行区分不同的概率模型。
例如,根据BVD的水平分量或垂直分量的绝对值大小对BVD的符号预测索引的比特位使用不同的概率模型:
(1)假设BVD的水平或垂直分量的绝对值分类的一个阈值设为THR0,共有两个概率模型,则当符号预测索引为两个比特位时,此二进制数的第0个比特位根据BVD的水平分量的绝对值与THR0的大小关系进行区分,即当BVD的水平分量的绝对值小于等于THR0时,使用第一个概率模型,当BVD的水平分量的绝对值大于THR0时,使用第二个概率模型;然后,上述二进制数的第1个比特位也根据BVD的垂直分量的绝对值与THR0的大小关系进行区分,即当BVD的垂直分量的绝对值小于等于THR0时,使用第一个概率模型,当BVD的垂直分量的绝对值大于THR0时,使用第二个概率模型。
(2)假设BVD的水平分量的绝对值分类的一个阈值设为THR0,垂直分量的绝对值分类的一个阈值设为THR1,共有四个概率模型,则当符号预测索引为两个比特位时,此二进制数的第0个比特位根据BVD的水平分量的绝对值与THR0的大小关系进行区分,即当BVD的水平分量的绝对值小于等于THR0时,使用第一个概率模型,当BVD的水平分量的绝对值大于THR0时,使用第二个概率模型;然后,上述二进制数的第1个比特位也根据BVD的垂直分量的绝对值与THR1的大小关系进行区分,即当BVD的垂直分量的绝对值小于等于THR1时,使用第三个概率模型,当BVD的垂直分量的绝对值大于THR1时,使用第四个概率模型。
综上所述,通过上述步骤301至步骤303所提出的编码方法,通过在BVD的可能符号和BVD的绝对值之间创建BVD的组合列表,并对组合列表利用模板进行排序,利用真实的BVD符号和排序后的列表得到符号预测索引进行CABAC的编码,相较于比旁路编码具有更高的编码效率,从而节省了IBC中的BVD传输所需的码率。
需要说明的是,本申请实施例提出的编码方法,一方面,可以充分利用模板与当前编码块的相似性,将BVD的符号组合列表进行有效地排序;另一方面,可以使用CABAC进行编码,比旁路编码具有更高的编码效率。
进一步地,本申请的实施例提出的编码方法,对编码器而言,在进行编码处理时,BVD编码输入可以为BVD绝对值和符号的真实信息。而BVD编码输出可以为BVD绝对值和符号(BVD符号索引信息)的码流信息。
其中,图13为本申请实施例中的编码方法的示意图二,如图13所示,BVD编码过程包含编码BVD的绝对值(步骤401)、通过在BVD的可能符号和BVD的绝对值之间创建BVD的组合列表,即确定当前块的候选BVD(步骤402)、根据当前块的BVP和BVD的组合列表进行模板预测,计算出BVD组合列表中的每个BVD组合的成本,即对组合列表计算模板区域的成本(第一代价值)(步骤403)、对列表排序并利用真实的BVD符号和排序后的列表得到符号预测索引(BVD符号索引信息)(步骤404)以及最后将BVD的符号预测索引(BVD符号索引信息)进行编码(步骤405)。
需要说明的是,在本申请的实施例中,在计算成本(第一代价值)时,不仅可以采用亮度,还可以包含色度即Cb和Cr分量。本申请不进行具体限定。
进一步地,在本申请的实施例中,在计算成本时,如果两个模板均能获取到,此时对这个模板进行处理,包括但不限于以下方法:将两者进行加权融合,其中,加权融合的标准可以选择固定加权系数或者根据各自模板的重建亮度与预测亮度的像素值之差的绝对值之和进行分配加权系数等。
进一步地,在本申请的实施例中,针对排序后的BVD组合列表(候选BVD列表),可以存储它们各自的cost,然后基于这些存储的cost进行一个重新排序,具体过程为:如果列表中一个候选与前一个候选之间的cost差异低于λ值,例如|D1-D2|<λ,则认为该候选是冗余的,其中D1和D2是在第一次排序后获得的cost,λ是编码器端RD准则中使用的拉格朗日参数。
示例性的,计算成本的算法定义如下:
(1)确定列表所有候选中候选与其之前候选之间的最小成本差异
如果最小成本差异大于等于λ,则认为列表足够多样化并且停止重排。
如果这个最小成本差异小于λ,则候选被认为是多余的,并将其移动到另外一个位置。这个位置是和其之前的候选相比足够多样化的一个位置。
(2)该算法在有限次数的迭代后停止。
进一步地,在本申请的实施例中,对于上述实施例在采用特定顺序的候选BVD列表OrderedList和确定候选BVD集合中所提出的使用两个数组分别存储候选BVD的方案,其中,BVD水平垂直分量均存在的情况下,水平分量和垂直分量的先后顺序可进行互换。
示例性的,在本申请的实施例中,假设该组合列表为{(+,+),(+,-),(-,-),(-,+)},其对应的成本列表为{Cost(+,+),Cost(+,-),Cost(-,-),Cost(-,+)}。上述两个列表中成员的顺序可任意排列。
定义两个数组posiGrp和negaGrp,posiGrp存储在同一分量(垂直)上符号为正号的两个BVD的符号组合,negaGrp存储在同一分量(垂直)上符号为负号的两个BVD的符号组合。
假设posiGrp={(+,+),(-,+)},negaGrp={(+,-),(-,-)}。posiGrp和negaGrp两个列表中成员的顺序可任意排列。
第一次比较:比较Cost(+,+)和Cost(-,+)的大小,将posiGrp[0]置为两者较小的BVD组合,将posiGrp[1]置为两者较大的BVD组合;
第二次比较:比较Cost(+,-)和Cost(-,-)的大小,将negaGrp[0]置为两者较小的BVD组合,将negaGrp[1]置为两者较大的BVD组合;
第三次比较:比较posiGrp[0]和negaGrp[0]对应的Cost的大小;
(1)若在第三次比较中,posiGrp[0]对应的Cost<=negaGrp[0]对应的Cost:
如果bvd_sign[1]=0,那么第0个比特位为0。然后,判断bvd_sign[0]是否等于posiGrp[0][0],如果相等则第1个比特位为0,否则第1个比特位为1。
如果bvd_sign[1]=1,那么第0个比特位为1。然后,判断bvd_sign[0]是否等于negaGrp[0][0],如果相等则第1个比特位为0,否则第1个比特位为1。
(2)若在第三次比较中,posiGrp[0]对应的Cost>negaGrp[0]对应的Cost:
如果bvd_sign[1]=0,那么第0个比特位为1。然后,判断bvd_sign[0]是否等于posiGrp[0][0],如果相等则第1个比特位为0,否则第1个比特位为1。
如果bvd_sign[1]=1,那么第0个比特位为0。然后,判断bvd_sign[0]是否等于negaGrp[0][0],如果相等则第1个比特位为0,否则第1个比特位为1。
进一步地,在本申请的实施例中,在BVD水平垂直分量均存在的情况下,水平分量和垂直分量的先后顺序可进行互换的操作流程,可以通过某种准则来决策水平分量和垂直分量的先后顺序。其中包括但不限定于以下的方式,通过BVD的水平分量和垂直分量的绝对值大小等准则来决策水平分量和垂直分量的先后顺序。
本申请实施例提供了一种编解码方法,在解码端,解码码流,确定当前块的BVD绝对值和BVD符号索引信息;根据当前块的BVD绝对值,对当前块的候选BVD进行排序处理,确定排序结果;根据BVD符号索引信息和排序结果,确定当前块的BVD;根据当前块的BVD,确定当前块的重建值。在编码端,根据当前块的BVD绝对值,对当前块的候选BVD进行排序处理,确定排序结果;根据当前块的BVD符号信息和排序结果,确定当前块的BVD符号索引信息;将BVD绝对值和BVD符号索引信息写入码流。由此可见,在本申请的实施例中,可以根据当前块的BVD绝对值对当前块的候选BVD进行有效排序处理,从而可以在编码时利用排序结果进行BVD符号索引信息的确定和传输,在解码时利用排序结果进行当前块的BVD符号信息的解析,同时可以使用CABAC编解码技术对BVD符号信息进行编解码处理,能够有效地节省IBC模式中的BVD的符号传输所需的码率,从而可以提高编码效率。
基于上述实施例,在本申请的再一实施例中,基于前述实施例相同的发明构思,图14为编码器的组成结构示意图一,如图14所示,编码器110可以包括:第一确定单元111,编码单元112,其中,
所述第一确定单元111,配置为根据当前块的BVD绝对值,对所述当前块的候选BVD进行排序处理,确定排序结果;根据所述当前块的BVD符号信息和所述排序结果,确定所述当前块的BVD符号索引信息;
所述编码单元112,配置为将所述BVD绝对值和所述BVD符号索引信息写入码流。
可以理解地,在本实施例中,“单元”可以是部分电路、部分处理器、部分程序或软件等等,当然也可以是模块,还可以是非模块化的。而且在本实施例中的各组成部分可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。
所述集成的单元如果以软件功能模块的形式实现并非作为独立的产品进行销售或使用时,可以存储在一个计算机可读取存储介质中,基于这样的理解,本实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)或processor(处理器)执行本实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。
因此,本申请实施例提供了一种计算机可读存储介质,应用于编码器110,该计算机可读存储介质存储有计算机程序,所述计算机程序被第一处理器执行时实现前述实施例中任一项所述的方法。
基于上述编码器110的组成以及计算机可读存储介质,图15为编码器的组成结构示意图二,如图15所示,编码器110可以包括:第一存储器113和第一处理器114,第一通信接口115和第一总线系统116。第一存储器113、第一处理器114、第一通信接口115通过第一总线系统116耦合在一起。可理解,第一总线系统116用于实现这些组件之间的连接通信。第一总线系统116除包括数据总线之外,还包括电源总线、控制总线和状态信号总线。但是为了清楚说明起见,在图10中将各种总线都标为第一总线系统116。其中,
第一通信接口115,用于在与其他外部网元之间进行收发信息过程中,信号的接收和发送;
所述第一存储器113,用于存储能够在所述第一处理器上运行的计算机程序;
所述第一处理器114,用于在运行所述计算机程序时,根据当前块的BVD绝对值,对所述当前块的候选BVD进行排序处理,确定排序结果;根据所述当前块的BVD符号信息和所述排序结果,确定所述当前块的BVD符号索引信息;将所述BVD绝对值和所述BVD符号索引信息写入码流。
可以理解,本申请实施例中的第一存储器113可以是易失性存储器或非易失性存储器,或可包括易失性和非易失性存储器两者。其中,非易失性存储器可以是只读存储器(Read-Only Memory,ROM)、可编程只读存储器(Programmable ROM,PROM)、可擦除可编程只读存储器(Erasable PROM,EPROM)、电可擦除可编程只读存储器(Electrically EPROM,EEPROM)或闪存。易失性存储器可以是随机存取存储器(Random Access Memory,RAM),其用作外部高速缓存。通过示例性但不是限制性说明,许多形式的RAM可用,例如静态随机存取存储器(Static RAM,SRAM)、动态随机存取存储器(Dynamic RAM,DRAM)、同步动态随机存取存储器(Synchronous DRAM,SDRAM)、双倍数据速率同步动态随机存取存储器(Double Data Rate SDRAM,DDRSDRAM)、增强型同步动态随机存取存储器(Enhanced SDRAM,ESDRAM)、同步连接动态随机存取存储器(Synchlink DRAM,SLDRAM)和直接内存总线随机存取存储器(Direct Rambus RAM,DRRAM)。本申请描述的系统和方法的第一存储器113旨在包括但不限于这些和任意其它适合类型的存储器。
而第一处理器114可能是一种集成电路芯片,具有信号的处理能力。在实现过程中,上述方法的各步骤可以通过第一处理器114中的硬件的集成逻辑电路或者软件形式的指令完成。上述的第一处理器114可以是通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。可以实现或者执行本申请实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。结合本申请实施例所公开的方法的步骤可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于第一存储器113,第一处理器114读取第一存储器113中的信息,结合其硬件完成上述方法的步骤。
可以理解的是,本申请描述的这些实施例可以用硬件、软件、固件、中间件、微码或其组合来实现。对于硬件实现, 处理单元可以实现在一个或多个专用集成电路(Application Specific Integrated Circuits,ASIC)、数字信号处理器(Digital Signal Processing,DSP)、数字信号处理设备(DSP Device,DSPD)、可编程逻辑设备(Programmable Logic Device,PLD)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)、通用处理器、控制器、微控制器、微处理器、用于执行本申请所述功能的其它电子单元或其组合中。对于软件实现,可通过执行本申请所述功能的模块(例如过程、函数等)来实现本申请所述的技术。软件代码可存储在存储器中并通过处理器执行。存储器可以在处理器中或在处理器外部实现。
可选地,作为另一个实施例,第一处理器114还配置为在运行所述计算机程序时,执行前述实施例中任一项所述的方法。
图16为解码器的组成结构示意图一,如图16所示,解码器120可以包括:解码单元121和第二确定单元122;其中,
所述解码单元121,配置为解码码流;
所述第二确定单元122,配置为确定当前块的BVD绝对值和BVD符号索引信息;
根据当前块的BVD绝对值,对所述当前块的候选BVD进行排序处理,确定排序结果;根据所述BVD符号索引信息和所述排序结果,确定所述当前块的BVD;根据所述当前块的BVD,确定所述当前块的重建值。
可以理解地,在本实施例中,“单元”可以是部分电路、部分处理器、部分程序或软件等等,当然也可以是模块,还可以是非模块化的。而且在本实施例中的各组成部分可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。
所述集成的单元如果以软件功能模块的形式实现并非作为独立的产品进行销售或使用时,可以存储在一个计算机可读取存储介质中,基于这样的理解,本实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)或processor(处理器)执行本实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。
因此,本申请实施例提供了一种计算机可读存储介质,应用于解码器120,该计算机可读存储介质存储有计算机程序,所述计算机程序被第一处理器执行时实现前述实施例中任一项所述的方法。
基于上述解码器120的组成以及计算机可读存储介质,图17为解码器的组成结构示意图二,如图17所示,解码器120可以包括:第二存储器123和第二处理器124,第二通信接口125和第二总线系统126。第二存储器123和第二处理器124,第二通信接口125通过第二总线系统126耦合在一起。可理解,第二总线系统126用于实现这些组件之间的连接通信。第二总线系统126除包括数据总线之外,还包括电源总线、控制总线和状态信号总线。但是为了清楚说明起见,在图12中将各种总线都标为第二总线系统126。其中,
第二通信接口125,用于在与其他外部网元之间进行收发信息过程中,信号的接收和发送;
所述第二存储器123,用于存储能够在所述第二处理器上运行的计算机程序;
所述第二处理器124,用于在运行所述计算机程序时,解码码流,确定当前块的BVD绝对值和BVD符号索引信息;根据当前块的BVD绝对值,对所述当前块的候选BVD进行排序处理,确定排序结果;根据所述BVD符号索引信息和所述排序结果,确定所述当前块的BVD;根据所述当前块的BVD,确定所述当前块的重建值。
可以理解,本申请实施例中的第二存储器123可以是易失性存储器或非易失性存储器,或可包括易失性和非易失性存储器两者。其中,非易失性存储器可以是只读存储器(Read-Only Memory,ROM)、可编程只读存储器(Programmable ROM,PROM)、可擦除可编程只读存储器(Erasable PROM,EPROM)、电可擦除可编程只读存储器(Electrically EPROM,EEPROM)或闪存。易失性存储器可以是随机存取存储器(Random Access Memory,RAM),其用作外部高速缓存。通过示例性但不是限制性说明,许多形式的RAM可用,例如静态随机存取存储器(Static RAM,SRAM)、动态随机存取存储器(Dynamic RAM,DRAM)、同步动态随机存取存储器(Synchronous DRAM,SDRAM)、双倍数据速率同步动态随机存取存储器(Double Data Rate SDRAM,DDRSDRAM)、增强型同步动态随机存取存储器(Enhanced SDRAM,ESDRAM)、同步连接动态随机存取存储器(Synchlink DRAM,SLDRAM)和直接内存总线随机存取存储器(Direct Rambus RAM,DRRAM)。本申请描述的系统和方法的第二存储器123旨在包括但不限于这些和任意其它适合类型的存储器。
而第二处理器124可能是一种集成电路芯片,具有信号的处理能力。在实现过程中,上述方法的各步骤可以通过第二处理器124中的硬件的集成逻辑电路或者软件形式的指令完成。上述的第二处理器124可以是通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。可以实现或者执行本申请实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。结合本申请实施例所公开的方法的步骤可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于第二存储器123,第二处理器124读取第二存储器123中的信息,结合其硬件完成上述方法的步骤。
可以理解的是,本申请描述的这些实施例可以用硬件、软件、固件、中间件、微码或其组合来实现。对于硬件实现,处理单元可以实现在一个或多个专用集成电路(Application Specific Integrated Circuits,ASIC)、数字信号处理器(Digital Signal Processing,DSP)、数字信号处理设备(DSP Device,DSPD)、可编程逻辑设备(Programmable Logic Device,PLD)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)、通用处理器、控制器、微控制器、微处理器、用于执行本申请所述功能的其它电子单元或其组合中。对于软件实现,可通过执行本申请所述功能的模块(例如过程、函数等)来实现本申请所述的技术。软件代码可存储在存储器中并通过处理器执行。存储器可以在处理器中或在处理器外部实现。
本申请实施例提供了一种编码器和解码器,在解码端,解码码流,确定当前块的BVD绝对值和BVD符号索引信息;根据当前块的BVD绝对值,对当前块的候选BVD进行排序处理,确定排序结果;根据BVD符号索引信息和排序结果, 确定当前块的BVD;根据当前块的BVD,确定当前块的重建值。在编码端,根据当前块的BVD绝对值,对当前块的候选BVD进行排序处理,确定排序结果;根据当前块的BVD符号信息和排序结果,确定当前块的BVD符号索引信息;将BVD绝对值和BVD符号索引信息写入码流。由此可见,在本申请的实施例中,可以根据当前块的BVD绝对值对当前块的候选BVD进行有效排序处理,从而可以在编码时利用排序结果进行BVD符号索引信息的确定和传输,在解码时利用排序结果进行当前块的BVD符号信息的解析,同时可以使用CABAC编解码技术对BVD符号信息进行编解码处理,能够有效地节省IBC模式中的BVD的符号传输所需的码率,从而可以提高编码效率。
需要说明的是,在本申请的实施例中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者装置不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者装置所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者装置中还存在另外的相同要素。
上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。
本申请所提供的几个方法实施例中所揭露的方法,在不冲突的情况下可以任意组合,得到新的方法实施例。
本申请所提供的几个产品实施例中所揭露的特征,在不冲突的情况下可以任意组合,得到新的产品实施例。
本申请所提供的几个方法或设备实施例中所揭露的特征,在不冲突的情况下可以任意组合,得到新的方法实施例或设备实施例。
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。
工业实用性
本申请实施例提供了一种编解码方法、编码器、解码器以及存储介质,在解码端,解码码流,确定当前块的BVD绝对值和BVD符号索引信息;根据当前块的BVD绝对值,对当前块的候选BVD进行排序处理,确定排序结果;根据BVD符号索引信息和排序结果,确定当前块的BVD;根据当前块的BVD,确定当前块的重建值。在编码端,根据当前块的BVD绝对值,对当前块的候选BVD进行排序处理,确定排序结果;根据当前块的BVD符号信息和排序结果,确定当前块的BVD符号索引信息;将BVD绝对值和BVD符号索引信息写入码流。由此可见,在本申请的实施例中,可以根据当前块的BVD绝对值对当前块的候选BVD进行有效排序处理,从而可以在编码时利用排序结果进行BVD符号索引信息的确定和传输,在解码时利用排序结果进行当前块的BVD符号信息的解析,同时可以使用CABAC编解码技术对BVD符号信息进行编解码处理,能够有效地节省IBC模式中的BVD的符号传输所需的码率,从而可以提高编码效率。

Claims (87)

  1. 一种解码方法,应用于解码器,所述方法包括:
    解码码流,确定当前块的块向量差BVD绝对值和BVD符号索引信息;
    根据当前块的BVD绝对值,对所述当前块的候选BVD进行排序处理,确定排序结果;
    根据所述BVD符号索引信息和所述排序结果,确定所述当前块的BVD;
    根据所述当前块的BVD,确定所述当前块的重建值。
  2. 根据权利要求1所述的方法,其中,
    所述BVD绝对值包括第一分量绝对值absBvdX和第二分量绝对值absBvdY;
    所述候选BVD包括第一分量candBvdX和第二分量candBvdY。
  3. 根据权利要求2所述的方法,其中,所述方法还包括:
    若所述absBvdX等于0,根据所述absBvdY确定所述候选BVD。
  4. 根据权利要求2所述的方法,其中,所述方法还包括:
    若所述absBvdY等于0,根据所述absBvdX确定所述候选BVD。
  5. 根据权利要求2所述的方法,其中,所述方法还包括:
    若所述absBvdX和所述absBvdY均不等于0,根据所述absBvdX和所述absBvdY确定所述候选BVD。
  6. 根据权利要求2所述的方法,其中,所述根据当前块的BVD绝对值,对所述当前块的候选BVD进行排序处理,确定排序结果,包括:
    根据所述BVD绝对值,确定所述当前块的一个或多个候选BVD对应的第一代价值;
    根据所述第一代价值,对所述候选BVD进行排序,确定所述排序结果。
  7. 根据权利要求6所述的方法,其中,所述方法还包括:
    所述一个或多个候选BVD包括所述candBvdX分别设置为等于–absBvdX或absBvdX、所述candBvdY分别设置为等于–absBvdY或absBvdY的BVD。
  8. 根据权利要求7所述的方法,其中,所述根据所述当前块的BVD绝对值,确定所述当前块的一个或多个候选BVD对应的第一代价值,包括:
    根据所述候选BVD确定的第一匹配模板;
    根据预设的误差准则,计算所述当前块的第一模板与所述第一匹配模板之间的匹配误差,以确定所述候选BVD对应的第一代价值。
  9. 根据权利要求8所述的方法,其中,所述方法还包括:
    所述第一模板包括所述当前块的相邻已解码区域中的一个或多个样值。
  10. 根据权利要求8所述的方法,其中,所述根据所述候选BVD确定的第一匹配模板,包括:
    确定所述当前块的块向量预测值BVP;
    根据所述BVP和所述候选BVD确定所述当前块的候选BV;其中,所述候选BV用于指示所述第一匹配模板的位置;
    根据所述候选BV确定所述第一匹配模板。
  11. 根据权利要求10所述的方法,其中,所述BVP包括第三分量currBvpX和第四分量currBvpY,所述根据所述BVP和所述候选BVD确定所述当前块的候选BV,包括:
    将所述候选BV的二维矢量设置为(currBvpX+candBvdX,currBvpY+candBvdY)。
  12. 根据权利要求11所述的方法,其中,所述根据所述候选BV确定所述第一匹配模板,包括:
    根据所述当前点的位置和所述候选BV的二维矢量确定所述第一匹配模板。
  13. 根据权利要求12所述的方法,其中,所述方法还包括:
    以所述当前点的位置为起点,将所述候选BV的二维矢量所指示的、与所述第一模板具有相同形状和包含相同数量样值的区域,确定为所述第一匹配模板。
  14. 根据权利要求8所述的方法,其中,
    所述预设的误差准则包括绝对误差和SAD、变换绝对误差和SATD、差值平方和SSE、平均绝对差值MAD、平均绝对误差MAE、平均平方误差MSE、率失真函数RDO中的任意一种。
  15. 根据权利要求8所述的方法,其中,所述排序结果为所述当前块的候选BVD列表,所述方法还包括:
    根据所述第一代价值,对所述候选BVD进行排序,确定所述当前块的候选BVD列表,其中,所述候选BVD列表至少包括一个候选BVD。
  16. 根据权利要求15所述的方法,其中,所述根据所述第一代价值,对所述候选BVD进行排序,确定所述当前块的候选BVD列表,包括:
    根据所述预设的误差准则,按所述第一代价值指示的匹配误差从小到大的顺序,对所述一个或多个候选BVD进行排序,确定所述候选BVD列表。
  17. 根据权利要求15所述的方法,其中,所述根据所述第一代价值,对所述候选BVD进行排序,确定所述当前块的候选BVD列表,包括:
    若所述absBvdX和所述absBvdY均不等于0,将所述候选BVD分别存储至第一数组和第二数组;
    基于所述第一代价值,确定所述第一数组中的第一候选BVD和第二候选BVD,以及所述第二数组中的第三候选BVD和第四候选BVD;
    基于所述第一代价值,对所述第一候选BVD、所述第二候选BVD、所述第三候选BVD、所述第四候选BVD进行 排序处理,确定所述候选BVD列表。
  18. 根据权利要求17所述的方法,其中,所述方法还包括:
    若所述第一候选BVD的第一代价值小于等于所述第三候选BVD的第一代价值,将所述第一候选BVD设置为所述候选BVD列表中的第一个候选BVD,将所述第三候选BVD设置为所述候选BVD列表中的第二个候选BVD,将所述第二候选BVD设置为所述候选BVD列表中的第三个候选BVD,将所述第四候选BVD设置为所述候选BVD列表中的第四个候选BVD;
    否则,将所述第三候选BVD设置为所述候选BVD列表中的第一个候选BVD,将所述第一候选BVD设置为所述候选BVD列表中的第二个候选BVD,将所述第四候选BVD设置为所述候选BVD列表中的第三个候选BVD,将所述第二候选BVD设置为所述候选BVD列表中的第四个候选BVD。
  19. 根据权利要求17所述的方法,其中,所述方法还包括:
    若所述第一候选BVD的第一代价值小于等于所述第三候选BVD的第一代价值,将所述第一候选BVD设置为所述候选BVD列表中的第一个候选BVD,将所述第二候选BVD设置为所述候选BVD列表中的第二个候选BVD,将所述第三候选BVD设置为所述候选BVD列表中的第三个候选BVD,将所述第四候选BVD设置为所述候选BVD列表中的第四个候选BVD;
    否则,将所述第三候选BVD设置为所述候选BVD列表中的第一个候选BVD,将所述第四候选BVD设置为所述候选BVD列表中的第二个候选BVD,将所述第一候选BVD设置为所述候选BVD列表中的第三个候选BVD,将所述第二候选BVD设置为所述候选BVD列表中的第四个候选BVD。
  20. 根据权利要求15所述的方法,其中,所述根据所述第一代价值,对所述候选BVD进行排序,确定所述当前块的候选BVD列表,包括:
    若所述absBvdX等于0或者所述absBvdY等于0,将所述候选BVD中的所述第一代价值最小的一个候选BVD设置为所述候选BVD列表中的第一个候选BVD,将所述候选BVD中的另一个候选BVD设置为所述候选BVD列表中的第二个候选BVD。
  21. 根据权利要求8所述的方法,其中,所述排序结果为所述当前块的候选BVD集合,所述方法还包括:
    根据所述第一代价值,对所述候选BVD进行排序,确定所述当前块的候选BVD集合,其中,所述候选BVD集合至少包括一个候选BVD。
  22. 根据权利要求21所述的方法,其中,所述根据所述第一代价值,对所述候选BVD进行排序,确定所述当前块的候选BVD集合,包括:
    若所述absBvdX和所述absBvdY均不等于0,将所述候选BVD分别存储至第一数组和第二数组;
    确定所述第一数组中的、所述第一代价值最小的第五候选BVD,以及所述第二数组中的、所述第一代价值最小的第六候选BVD;
    将所述第五候选BVD和所述第六候选BVD中的、所述第一代价值最小的候选BVD,确定为所述候选BVD集合中的代价最小BVD。
  23. 根据权利要求21所述的方法,其中,所述根据所述第一代价值,对所述候选BVD进行排序,确定所述当前块的候选BVD集合,包括:
    若所述absBvdX等于0或者所述absBvdY等于0,将所述候选BVD中的所述第一代价值最小的一个候选BVD确定为所述候选BVD集合中的代价最小BVD。
  24. 根据权利要求16-20任一项所述的方法,其中,所述根据所述BVD符号索引信息和所述排序结果,确定所述当前块的BVD包括:
    将所述候选BVD列表中的、所述BVD符号索引信息指示的候选BVD确定为所述当前块的BVD。
  25. 根据权利要求16所述的方法,其中,所述方法还包括:
    对所述候选BVD列表进行转换处理,确定索引转换列表。
  26. 根据权利要求25所述的方法,其中,所述根据所述BVD符号索引信息和所述排序结果,确定所述当前块的BVD,包括:
    当所述absBvdX和所述absBvdY均不为0时,若所述BVD符号索引信息的第一比特位取值为0,则确定所述当前块的BVD的candBvdX与所述索引转换列表中第一个候选BVD或第三个候选BVD的candBvdX相同;
    按照所述第一个候选BVD或第三个候选BVD确定所述当前块的BVD的candBvdY。
  27. 根据权利要求26所述的方法,其中,所述方法还包括:
    若所述BVD符号索引信息的第二比特位取值为0,则确定所述当前块的BVD的candBvdY与所述第一个候选BVD的candBvdY相同;
    若所述第二比特位取值为1,则确定所述当前块的BVD的candBvdY与所述第三个候选BVD的candBvdY相同。
  28. 根据权利要求25所述的方法,其中,所述根据所述BVD符号索引信息和所述排序结果,确定所述当前块的BVD,包括:
    当所述absBvdX和所述absBvdY均不为0时,若所述BVD符号索引信息的第一比特位取值为1,则确定所述第一分量符号与所述索引转换列表中第二个候选BVD或第四个候选BVD的第一分量符号相同;
    按照所述第二个候选BVD或第四个候选BVD确定所述当前块的BVD的candBvdY。
  29. 根据权利要求28所述的方法,其中,所述方法还包括:
    若所述BVD符号索引信息的第二比特位取值为0,则确定所述当前块的BVD的candBvdY与所述第二个候选BVD的candBvdY相同;
    若所述第二比特位取值为1,则确定所述当前块的BVD的candBvdY与所述第四个候选BVD的candBvdY相同。
  30. 根据权利要求25所述的方法,其中,所述根据所述BVD符号索引信息和所述排序结果,确定所述当前块的BVD,包括:
    当所述absBvdX为0时,若所述BVD符号索引信息的取值为0,则确定所述当前块的BVD的candBvdY与所述索引转换列表中的第一个候选BVD的candBvdY相同;若所述BVD符号索引信息的取值为1,则确定所述当前块的BVD的candBvdY与所述索引转换列表中的第二个候选BVD的candBvdY相同。
  31. 根据权利要求25所述的方法,其中,所述根据所述BVD符号索引信息和所述排序结果,确定所述当前块的BVD,包括:
    当所述absBvdY为0时,若所述BVD符号索引信息的取值为0,则确定所述当前块的BVD的candBvdX与所述索引转换列表中的第一个候选BVD的candBvdX相同;若所述BVD符号索引信息的取值为1,则确定所述当前块的BVD的candBvdX与所述索引转换列表中的第二个候选BVD的candBvdX相同。
  32. 根据权利要求16所述的方法,其中,所述根据所述BVD符号索引信息和所述候选BVD列表,确定所述当前块的BVD,包括:
    当所述absBvdX和所述absBvdY均不为0时,若所述BVD符号索引信息的第一比特位取值为0,则确定所述当前块的BVD的candBvdX与所述候选BVD列表中的第一个候选BVD的candBvdX相同,否则不同;
    遍历所述候选BVD列表,确定与所述当前块的BVD具有相同candBvdX的首个候选BVD;
    若所述BVD符号索引信息的第二比特位取值为0,则确定所述当前块的BVD的candBvdY与所述首个候选BVD的candBvdY相同,否则不同。
  33. 根据权利要求16所述的方法,其中,所述根据所述BVD符号索引信息和所述候选BVD列表,确定所述当前块的BVD,包括:
    当所述absBvdX为0时,若所述BVD符号索引信息的取值为0,则确定所述当前块的BVD的candBvdY与所述候选BVD列表中的第一个候选BVD的candBvdY相同;若所述BVD符号索引信息的取值为1,则确定所述当前块的BVD的candBvdY与所述候选BVD列表中的第二个候选BVD的candBvdY相同。
  34. 根据权利要求16所述的方法,其中,所述根据所述BVD符号索引信息和所述候选BVD列表,确定所述当前块的BVD,包括:
    当所述absBvdY为0时,若所述BVD符号索引信息的取值为0,则确定所述当前块的BVD的candBvdX与所述候选BVD列表中的第一个候选BVD的candBvdX相同;若所述BVD符号索引信息的取值为1,则确定所述当前块的BVD的candBvdX与所述候选BVD列表中的第二个候选BVD的candBvdX相同。
  35. 根据权利要求21所述的方法,其中,所述根据所述BVD符号索引信息和所述排序结果,确定所述当前块的BVD,包括:
    当所述absBvdX和所述absBvdY均不为0时,若所述BVD符号索引信息的第一比特位取值为0,则确定所述当前块的BVD的candBvdX与所述候选BVD集合中的代价最小BVD的candBvdX相同;
    按照所述候选BVD集合中的代价最小BVD确定所述当前块的BVD的candBvdY。
  36. 根据权利要求21所述的方法,其中,所述根据所述BVD符号索引信息和所述排序结果,确定所述当前块的BVD,包括:
    当所述absBvdX和所述absBvdY均不为0时,若所述BVD符号索引信息的第一比特位取值为1,则确定所述当前块的BVD的candBvdX与所述候选BVD集合中的代价最小BVD的candBvdX符号相反;
    按照所述候选BVD集合中的代价最小BVD所在的数组以外的、另一个数组中的代价最小BVD确定所述当前块的BVD的candBvdY。
  37. 根据权要求35所述的方法,其中,所述方法还包括:
    若所述BVD符号索引信息的第二比特位取值为0,则确定所述当前块的BVD的candBvdY与所述候选BVD集合中的代价最小BVD的candBvdY相同;
    若所述第二比特位取值为1,则确定所述当前块的BVD的candBvdY与所述候选BVD集合中的代价最小BVD的candBvdY符号相反。
  38. 根据权要求36所述的方法,其中,所述方法还包括:
    若所述BVD符号索引信息的第二比特位取值为0,则确定所述当前块的BVD的candBvdY与所述另一个数组中的代价最小BVD的candBvdY相同;
    若所述第二比特位取值为1,则确定所述当前块的BVD的candBvdY与所述另一个数组中的代价最小BVD的candBvdY符号相反。
  39. 根据权利要求21所述的方法,其中,所述根据所述BVD符号索引信息和所述排序结果,确定所述当前块的BVD,包括:
    当所述absBvdX为0时,若所述BVD符号索引信息的取值为0,则确定所述当前块的BVD的candBvdY与所述候选BVD集合中的代价最小BVD的candBvdY相同;若所述BVD符号索引信息的取值为1,则确定所述当前块的BVD的candBvdY与所述候选BVD集合中的代价最小BVD的candBvdY符号相反。
  40. 根据权利要求21所述的方法,其中,所述根据所述BVD符号索引信息和所述排序结果,确定所述当前块的BVD,包括:
    当所述absBvdY为0时,若所述BVD符号索引信息的取值为0,则确定所述当前块的BVD的absBvdX与所述候选BVD集合中的代价最小BVD的absBvdX相同;若所述BVD符号索引信息的取值为1,则确定所述当前块的BVD的absBvdX与所述候选BVD集合中的代价最小BVD的absBvdX符号相反。
  41. 根据权利要求2所述的方法,其中,所述方法还包括:
    若所述absBvdX和所述absBvdY均不为0,确定所述BVD符号索引信息的比特位数为2;若所述absBvdX或所述absBvdY为0,确定所述BVD符号索引信息的比特位数为1。
  42. 根据权利要求2所述的方法,其中,所述方法还包括:
    采用截断一元码编码所述BVD符号索引信息,则不同候选BVD对应的所述符号索引信息的比特位数不完全相同。
  43. 一种编码方法,应用于编码器,所述方法包括:
    根据当前块的BVD绝对值,对所述当前块的候选BVD进行排序处理,确定排序结果;
    根据所述当前块的BVD符号信息和所述排序结果,确定所述当前块的BVD符号索引信息;
    将所述BVD绝对值和所述BVD符号索引信息写入码流。
  44. 根据权利要求43所述的方法,其中,
    所述BVD绝对值包括第一分量绝对值absBvdX和第二分量绝对值absBvdY;
    所述候选BVD包括第一分量candBvdX和第二分量candBvdY。
  45. 根据权利要求44所述的方法,其中,所述方法还包括:
    若所述absBvdX等于0,根据所述absBvdY确定所述候选BVD。
  46. 根据权利要求44所述的方法,其中,所述方法还包括:
    若所述absBvdY等于0,根据所述absBvdX确定所述候选BVD。
  47. 根据权利要求44所述的方法,其中,所述方法还包括:
    若所述absBvdX和所述absBvdY均不等于0,根据所述absBvdX和所述absBvdY确定所述候选BVD。
  48. 根据权利要求44所述的方法,其中,所述根据当前块的BVD绝对值,对所述当前块的候选BVD进行排序处理,确定排序结果,包括:
    根据所述BVD绝对值,确定所述当前块的一个或多个候选BVD对应的第一代价值;
    根据所述第一代价值,对所述候选BVD进行排序,确定所述排序结果。
  49. 根据权利要求48所述的方法,其中,所述方法还包括:
    所述一个或多个候选BVD包括所述candBvdX分别设置为等于–absBvdX或absBvdX、所述candBvdY分别设置为等于–absBvdY或absBvdY的BVD。
  50. 根据权利要求49所述的方法,其中,所述根据所述当前块的BVD绝对值,确定所述当前块的一个或多个候选BVD对应的第一代价值,包括:
    根据所述候选BVD确定的第一匹配模板;
    根据预设的误差准则,计算所述当前块的第一模板与所述第一匹配模板之间的匹配误差,以确定所述候选BVD对应的第一代价值。
  51. 根据权利要求50所述的方法,其中,所述方法还包括:
    所述第一模板包括所述当前块的相邻已解码区域中的一个或多个样值。
  52. 根据权利要求50所述的方法,其中,所述根据所述候选BVD确定的第一匹配模板,包括:
    确定所述当前块的块向量预测值BVP;
    根据所述BVP和所述候选BVD确定所述当前块的候选BV;其中,所述候选BV用于指示所述第一匹配模板的位置;
    根据所述候选BV确定所述第一匹配模板。
  53. 根据权利要求52所述的方法,其中,所述BVP包括第三分量currBvpX和第四分量currBvpY,所述根据所述BVP和所述候选BVD确定所述当前块的候选BV,包括:
    将所述候选BV的二维矢量设置为(currBvpX+candBvdX,currBvpY+candBvdY)。
  54. 根据权利要求53所述的方法,其中,所述根据所述候选BV确定所述第一匹配模板,包括:
    根据所述当前点的位置和所述候选BV的二维矢量确定所述第一匹配模板。
  55. 根据权利要求54所述的方法,其中,所述方法还包括:
    以所述当前点的位置为起点,将所述候选BV的二维矢量所指示的、与所述第一模板具有相同形状和包含相同数量样值的区域,确定为所述第一匹配模板。
  56. 根据权利要求50所述的方法,其中,
    所述预设的误差准则包括绝对误差和SAD、变换绝对误差和SATD、差值平方和SSE、平均绝对差值MAD、平均绝对误差MAE、平均平方误差MSE、率失真函数RDO中的任意一种。
  57. 根据权利要求50所述的方法,其中,所述排序结果为所述当前块的候选BVD列表,所述方法还包括:
    根据所述第一代价值,对所述候选BVD进行排序,确定所述当前块的候选BVD列表,其中,所述候选BVD列表至少包括一个候选BVD。
  58. 根据权利要求57所述的方法,其中,所述根据所述第一代价值,对所述候选BVD进行排序,确定所述当前块的候选BVD列表,包括:
    根据所述预设的误差准则,按所述第一代价值指示的匹配误差从小到大的顺序,对所述一个或多个候选BVD进行排序,确定所述候选BVD列表。
  59. 根据权利要求57所述的方法,其中,所述根据所述第一代价值,对所述候选BVD进行排序,确定所述当前块的候选BVD列表,包括:
    若所述absBvdX和所述absBvdY均不等于0,将所述候选BVD分别存储至第一数组和第二数组;
    基于所述第一代价值,确定所述第一数组中的第一候选BVD和第二候选BVD,以及所述第二数组中的第三候选BVD和第四候选BVD;
    基于所述第一代价值,对所述第一候选BVD、所述第二候选BVD、所述第三候选BVD、所述第四候选BVD进行排序处理,确定所述候选BVD列表。
  60. 根据权利要求59所述的方法,其中,所述方法还包括:
    若所述第一候选BVD的第一代价值小于等于所述第三候选BVD的第一代价值,将所述第一候选BVD设置为所述候选BVD列表中的第一个候选BVD,将所述第三候选BVD设置为所述候选BVD列表中的第二个候选BVD,将所述第二候选BVD设置为所述候选BVD列表中的第三个候选BVD,将所述第四候选BVD设置为所述候选BVD列表中的 第四个候选BVD;
    否则,将所述第三候选BVD设置为所述候选BVD列表中的第一个候选BVD,将所述第一候选BVD设置为所述候选BVD列表中的第二个候选BVD,将所述第四候选BVD设置为所述候选BVD列表中的第三个候选BVD,将所述第二候选BVD设置为所述候选BVD列表中的第四个候选BVD。
  61. 根据权利要求59所述的方法,其中,所述方法还包括:
    若所述第一候选BVD的第一代价值小于等于所述第三候选BVD的第一代价值,将所述第一候选BVD设置为所述候选BVD列表中的第一个候选BVD,将所述第二候选BVD设置为所述候选BVD列表中的第二个候选BVD,将所述第三候选BVD设置为所述候选BVD列表中的第三个候选BVD,将所述第四候选BVD设置为所述候选BVD列表中的第四个候选BVD;
    否则,将所述第三候选BVD设置为所述候选BVD列表中的第一个候选BVD,将所述第四候选BVD设置为所述候选BVD列表中的第二个候选BVD,将所述第一候选BVD设置为所述候选BVD列表中的第三个候选BVD,将所述第二候选BVD设置为所述候选BVD列表中的第四个候选BVD。
  62. 根据权利要求57所述的方法,其中,所述根据所述第一代价值,对所述候选BVD进行排序,确定所述当前块的候选BVD列表,包括:
    若所述absBvdX等于0或者所述absBvdY等于0,将所述候选BVD中的所述第一代价值最小的一个候选BVD设置为所述候选BVD列表中的第一个候选BVD,将所述候选BVD中的另一个候选BVD设置为所述候选BVD列表中的第二个候选BVD。
  63. 根据权利要求50所述的方法,其中,所述排序结果为所述当前块的候选BVD集合,所述方法还包括:
    根据所述第一代价值,对所述候选BVD进行排序,确定所述当前块的候选BVD集合,其中,所述候选BVD集合至少包括一个候选BVD。
  64. 根据权利要求62所述的方法,其中,所述根据所述第一代价值,对所述候选BVD进行排序,确定所述当前块的候选BVD集合,包括:
    若所述absBvdX和所述absBvdY均不等于0,将所述候选BVD分别存储至第一数组和第二数组;
    确定所述第一数组中的、所述第一代价值最小的第五候选BVD,以及所述第二数组中的、所述第一代价值最小的第六候选BVD;
    将所述第五候选BVD和所述第六候选BVD中的、所述第一代价值最小的候选BVD,确定为所述候选BVD集合中的代价最小BVD。
  65. 根据权利要求63所述的方法,其中,所述根据所述第一代价值,对所述候选BVD进行排序,确定所述当前块的候选BVD集合,包括:
    若所述absBvdX等于0或者所述absBvdY等于0,将所述候选BVD中的所述第一代价值最小的一个候选BVD确定为所述候选BVD集合中的代价最小BVD。
  66. 根据权利要求56-62任一项所述的方法,其中,所述根据所述当前块的BVD符号信息和所述排序结果,确定所述当前块的BVD符号索引信息,包括:
    在所述候选BVD列表中确定与所述当前块的BVD符号信息相同的所述候选BVD;
    按照所述候选BVD的索引值设置所述BVD符号索引信息。
  67. 根据权利要求58所述的方法,其中,所述方法还包括:
    对所述候选BVD列表进行转换处理,确定索引转换列表。
  68. 根据权利要求67所述的方法,其中,所述根据所述当前块的BVD符号信息和所述排序结果,确定所述当前块的BVD符号索引信息,包括:
    当所述absBvdX和所述absBvdY均不为0时,若所述当前块的BVD符号信息的第一分量符号与所述索引转换列表中的第一个候选BVD的第一分量符号相同,则将所述BVD符号索引信息的第一比特位确定为0;否则将所述第一比特位确定为1。
  69. 根据权利要求67所述的方法,其中,所述方法还包括:
    当所述第一比特位确定为0时,若所述当前块的BVD符号信息的第二分量符号与所述索引转换列表中的第一个候选BVD的第二分量符号相同,则将所述BVD符号索引信息的第二比特位确定为0;否则将所述第二比特位确定为1;
    当所述第一比特位确定为1时,若所述当前块的BVD符号信息的第二分量符号与所述索引转换列表中、索引为1的候选BVD的第二分量符号相同,则将所述BVD符号索引信息的第二比特位确定为0;否则将所述第二比特位确定为1。
  70. 根据权利要求67所述的方法,其中,所述根据所述当前块的BVD符号信息和所述排序结果,确定所述当前块的BVD符号索引信息,包括:
    当所述absBvdX为0时,若所述当前块的BVD符号信息的第二分量符号与所述索引转换列表中的第一个候选BVD的第二分量符号相同,则将所述BVD符号索引信息确定为0;否则将所述BVD符号索引信息确定为1。
  71. 根据权利要求67所述的方法,其中,所述根据所述当前块的BVD符号信息和所述排序结果,确定所述当前块的BVD符号索引信息,包括:
    当所述absBvdY为0时,若所述当前块的BVD符号信息的第一分量符号与所述索引转换列表中的第一个候选BVD的第一分量符号相同,则将所述BVD符号索引信息确定为0;否则将所述BVD符号索引信息确定为1。
  72. 根据权利要求58所述的方法,其中,所述根据所述当前块的BVD符号信息和所述排序结果,确定所述当前块的BVD符号索引信息,包括:
    当所述absBvdX和所述absBvdY均不为0时,若所述当前块的BVD符号信息的第一分量符号与与所述候选BVD列表中的第一个候选BVD的第一分量符号相同,则将所述BVD符号索引信息的第一比特位确定为0;否则将所述第一比特位确定为1;
    遍历所述候选BVD列表,确定与所述当前块的BVD符号信息具有相同第一分量符号的首个候选BVD;
    若所述当前块的BVD符号信息的第二分量符号与所述首个候选BVD的第二分量符号相同,则将所述BVD符号索引信息的第二比特位确定为0;否则将所述第二比特位确定为1。
  73. 根据权利要求58所述的方法,其中,所述根据所述当前块的BVD符号信息和所述排序结果,确定所述当前块的BVD符号索引信息,包括:
    当所述absBvdX为0时,若所述当前块的BVD符号信息的第二分量符号与所述候选BVD列表中的第一个候选BVD的第二分量符号相同,则将所述BVD符号索引信息确定为0,否则将所述BVD符号索引信息确定为1。
  74. 根据权利要求58所述的方法,其中,所述根据所述当前块的BVD符号信息和所述排序结果,确定所述当前块的BVD符号索引信息,包括:
    当所述absBvdY为0时,若所述当前块的BVD符号信息的第一分量符号与所述候选BVD列表中的第一个候选BVD的第一分量符号相同,则将所述BVD符号索引信息确定为0,否则将所述BVD符号索引信息确定为1。
  75. 根据权利要求63所述的方法,其中,所述根据所述当前块的BVD符号信息和所述排序结果,确定所述当前块的BVD符号索引信息,包括:
    当所述absBvdX和所述absBvdY均不为0时,若所述当前块的BVD符号信息的第一分量符号与所述候选BVD集合中的代价最小BVD的第一分量符号相同,则确定所述BVD符号索引信息的第一比特位取值为0;
    按照所述候选BVD集合中的代价最小BVD确定所述当前块的BVD符号索引信息的第二比特位。
  76. 根据权利要求63所述的方法,其中,所述根据所述当前块的BVD符号信息和所述排序结果,确定所述当前块的BVD符号索引信息,包括:
    当所述absBvdX和所述absBvdY均不为0时,若所述当前块的BVD符号信息的第一分量符号与所述候选BVD集合中的代价最小BVD的第一分量符号不同,则确定所述BVD符号索引信息的第一比特位取值为1;
    按照所述候选BVD集合中的代价最小BVD所在的数组以外的、另一个数组中的代价最小BVD确定所述当前块的BVD符号索引信息的第二比特位。
  77. 根据权要求75所述的方法,其中,所述方法还包括:
    若所述当前块的BVD符号信息的第二分量符号与所述候选BVD集合中的代价最小BVD的第二分量符号相同,则确定所述BVD符号索引信息的第二比特位取值为0;
    若所述当前块的BVD符号信息的第二分量符号与所述候选BVD集合中的代价最小BVD的第二分量符号不同,则确定所述BVD符号索引信息的第二比特位取值为1。
  78. 根据权要求76所述的方法,其中,所述方法还包括:
    若所述当前块的BVD符号信息的第二分量符号与所述另一个数组中的代价最小BVD的第二分量符号相同,则确定所述BVD符号索引信息的第二比特位取值为0;
    若所述当前块的BVD符号信息的第二分量符号与所述另一个数组中的代价最小BVD的第二分量符号不同,则确定所述BVD符号索引信息的第二比特位取值为1。
  79. 根据权利要求63所述的方法,其中,所述根据所述当前块的BVD符号信息和所述排序结果,确定所述当前块的BVD符号索引信息,包括:
    当所述absBvdX为0时,若所述当前块的BVD符号信息的第二分量符号与所述候选BVD集合中的代价最小BVD的第二分量符号相同,则确定所述BVD符号索引信息的取值为0;否则确定所述BVD符号索引信息的取值为1。
  80. 根据权利要求63所述的方法,其中,所述根据所述当前块的BVD符号信息和所述排序结果,确定所述当前块的BVD符号索引信息,包括:
    当所述absBvdY为0时,若所述当前块的BVD符号信息的第一分量符号与所述候选BVD集合中的代价最小BVD的第一分量符号相同,则确定所述BVD符号索引信息的取值为0;否则确定所述BVD符号索引信息的取值为1。
  81. 根据权利要求43所述的方法,其中,所述方法还包括:
    使用上下文自适应的二进制算术编码CABAC编码所述BVD绝对值和所述BVD符号索引信息。
  82. 根据权利要求43所述的方法,其中,所述方法还包括:
    使用旁路模式编码所述BVD绝对值和所述BVD符号索引信息。
  83. 一种编码器,所述编码器包括第一确定单元,编码单元;其中,
    所述第一确定单元,配置为根据当前块的BVD绝对值,对所述当前块的候选BVD进行排序处理,确定排序结果;根据所述当前块的BVD符号信息和所述排序结果,确定所述当前块的BVD符号索引信息;
    所述编码单元,配置为将所述BVD绝对值和所述BVD符号索引信息写入码流。
  84. 一种编码器,所述编码器包括第一存储器和第一处理器;其中,
    所述第一存储器,用于存储能够在所述第一处理器上运行的计算机程序;
    所述第一处理器,用于在运行所述计算机程序时,执行如权利要求41至79任一项所述的方法。
  85. 一种解码器,所述解码器包括解码单元,第二确定单元;其中,
    所述解码单元,配置为解码码流;
    所述第二确定单元,配置为确定当前块的BVD绝对值和BVD符号索引信息;
    根据当前块的BVD绝对值,对所述当前块的候选BVD进行排序处理,确定排序结果;根据所述BVD符号索引信息和所述排序结果,确定所述当前块的BVD;根据所述当前块的BVD,确定所述当前块的重建值。
  86. 一种解码器,所述解码器包括第二存储器和第二处理器;其中,
    所述第二存储器,用于存储能够在所述第二处理器上运行的计算机程序;
    所述第二处理器,用于在运行所述计算机程序时,执行如权利要求1至40任一项所述的方法。
  87. 一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序被执行时实现如权利要求1至42任一项所述的方法、或者实现如权利要求43至82任一项所述的方法。
PCT/CN2022/125219 2022-10-13 2022-10-13 编解码方法、编码器、解码器以及存储介质 WO2024077572A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/CN2022/125219 WO2024077572A1 (zh) 2022-10-13 2022-10-13 编解码方法、编码器、解码器以及存储介质

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2022/125219 WO2024077572A1 (zh) 2022-10-13 2022-10-13 编解码方法、编码器、解码器以及存储介质

Publications (1)

Publication Number Publication Date
WO2024077572A1 true WO2024077572A1 (zh) 2024-04-18

Family

ID=90668448

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/125219 WO2024077572A1 (zh) 2022-10-13 2022-10-13 编解码方法、编码器、解码器以及存储介质

Country Status (1)

Country Link
WO (1) WO2024077572A1 (zh)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106464904A (zh) * 2014-06-20 2017-02-22 高通股份有限公司 用于视频译码的帧内块复制块向量信令
US20170332097A1 (en) * 2014-11-27 2017-11-16 Kt Corporation Video signal processing method and device
CN111866515A (zh) * 2019-04-30 2020-10-30 杭州海康威视数字技术股份有限公司 一种矢量差解码方法、装置及电子设备
WO2020245391A1 (en) * 2019-06-07 2020-12-10 Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V. Region based intra block copy

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106464904A (zh) * 2014-06-20 2017-02-22 高通股份有限公司 用于视频译码的帧内块复制块向量信令
US20170332097A1 (en) * 2014-11-27 2017-11-16 Kt Corporation Video signal processing method and device
CN111866515A (zh) * 2019-04-30 2020-10-30 杭州海康威视数字技术股份有限公司 一种矢量差解码方法、装置及电子设备
WO2020245391A1 (en) * 2019-06-07 2020-12-10 Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V. Region based intra block copy

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
M. SALEHIFAR (LGE), S. PALURI (LGE), S. KIM (LGE): "CE8-Related : On MVD Coding", 14. JVET MEETING; 20190319 - 20190327; GENEVA; (THE JOINT VIDEO EXPLORATION TEAM OF ISO/IEC JTC1/SC29/WG11 AND ITU-T SG.16 ), 12 March 2019 (2019-03-12), XP030202735 *
Y. SUN (HIKVISION), F. CHEN, L. WANG (HIKVISION): "CE8-related: Simple BVD coding scheme without adding more context", 15. JVET MEETING; 20190703 - 20190712; GOTHENBURG; (THE JOINT VIDEO EXPLORATION TEAM OF ISO/IEC JTC1/SC29/WG11 AND ITU-T SG.16 ), 1 July 2019 (2019-07-01), XP030219267 *

Similar Documents

Publication Publication Date Title
CN110677669B (zh) 具有lic的lut
CN110933440B (zh) 用于视频处理的方法、装置和非暂时性计算机可读介质
CN111164978B (zh) 用于对图像进行编码/解码的方法和设备以及用于存储比特流的记录介质
US20070200737A1 (en) Entropy Coding Method For Coding Video Prediction Residual Coefficients
US11683505B2 (en) Method and a device for picture encoding and decoding
JP7439841B2 (ja) ループ内フィルタリングの方法及びループ内フィルタリングの装置
WO2021203924A1 (zh) 编码方法、解码方法、编码器、解码器以及存储介质
CN113812160A (zh) 用于屏幕内容编解码的最大可能模式列表构建
CN114827610B (zh) 视频图像编码和解码方法、设备及介质
WO2024077572A1 (zh) 编解码方法、编码器、解码器以及存储介质
WO2024000768A1 (zh) 视频编、解码方法及装置、码流、解码器、编码器、存储介质
WO2024119521A1 (zh) 编解码方法、码流、编码器、解码器以及存储介质
WO2023272517A1 (zh) 编解码方法、码流、编码器、解码器及计算机存储介质
CN114598873B (zh) 量化参数的解码方法和装置
WO2024077520A1 (zh) 编解码方法、码流、编码器、解码器以及存储介质
WO2022266971A1 (zh) 编解码方法、编码器、解码器以及计算机存储介质
WO2023193254A1 (zh) 解码方法、编码方法、解码器以及编码器
CN114175653B (zh) 用于视频编解码中的无损编解码模式的方法和装置
WO2023193253A1 (zh) 解码方法、编码方法、解码器以及编码器
WO2022188114A1 (zh) 帧内预测方法、编码器、解码器以及存储介质
WO2020258378A1 (zh) 一种视频图像处理方法、设备及存储介质
JP2024516358A (ja) 係数符号化・復号化方法、符号器、復号器及びコンピュータ記憶媒体
CN117730536A (zh) 利用基于神经网络的环路滤波器的影像编码/解码方法、装置以及对比特流的进行存储的存储介质
CN116998149A (zh) 系数的编解码方法、编码器、解码器及计算机存储介质
CN113243105A (zh) 亮度分量预测方法、编码器、解码器以及存储介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22961761

Country of ref document: EP

Kind code of ref document: A1