WO2020182103A1 - 进行编码和解码的方法、编码端和解码端 - Google Patents
进行编码和解码的方法、编码端和解码端 Download PDFInfo
- Publication number
- WO2020182103A1 WO2020182103A1 PCT/CN2020/078487 CN2020078487W WO2020182103A1 WO 2020182103 A1 WO2020182103 A1 WO 2020182103A1 CN 2020078487 W CN2020078487 W CN 2020078487W WO 2020182103 A1 WO2020182103 A1 WO 2020182103A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- block
- sub
- check
- transformation
- information
- Prior art date
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/102—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
- H04N19/103—Selection of coding mode or of prediction mode
- H04N19/11—Selection of coding mode or of prediction mode among a plurality of spatial predictive coding modes
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/102—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
- H04N19/119—Adaptive subdivision aspects, e.g. subdivision of a picture into rectangular or non-rectangular coding blocks
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/102—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
- H04N19/103—Selection of coding mode or of prediction mode
- H04N19/107—Selection of coding mode or of prediction mode between spatial and temporal predictive coding, e.g. picture refresh
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/102—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
- H04N19/12—Selection from among a plurality of transforms or standards, e.g. selection between discrete cosine transform [DCT] and sub-band transform or selection between H.263 and H.264
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/102—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
- H04N19/12—Selection from among a plurality of transforms or standards, e.g. selection between discrete cosine transform [DCT] and sub-band transform or selection between H.263 and H.264
- H04N19/122—Selection of transform size, e.g. 8x8 or 2x4x8 DCT; Selection of sub-band transforms of varying structure or type
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/102—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
- H04N19/13—Adaptive entropy coding, e.g. adaptive variable length coding [AVLC] or context adaptive binary arithmetic coding [CABAC]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/134—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/134—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
- H04N19/157—Assigned coding mode, i.e. the coding mode being predefined or preselected to be further used for selection of another element or parameter
- H04N19/159—Prediction type, e.g. intra-frame, inter-frame or bidirectional frame prediction
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/169—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
- H04N19/17—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
- H04N19/176—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a block, e.g. a macroblock
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/60—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/60—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding
- H04N19/61—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding in combination with predictive coding
Definitions
- the present disclosure relates to the field of audio and video technologies, and in particular to a method for encoding and decoding, an encoding end and a decoding end.
- General coding processing includes: intra-frame prediction (or inter-frame prediction), transformation, quantization, entropy coding, and in-loop filtering.
- intra-frame prediction or inter-frame prediction
- transformation quantization
- entropy coding and in-loop filtering.
- each sub-block of the current block may also be respectively predicted, transformed, quantized, and entropy-coded.
- RDO Rate Distortion Optimization
- a certain preset transform check is usually selected (a transform check is a transform check composed of a horizontal transform core and a vertical transform core), and the sub-block obtained by dividing the current block is transformed to obtain the transform coefficient .
- the inverse transform corresponding to the transform at the decoding end is also the preset transform check used when selecting encoding, and the sub-block obtained by dividing the current block is subjected to inverse transform processing to obtain the residual data corresponding to the sub-block.
- the embodiments of the present disclosure provide a method, an encoding end, a decoding end, and a system for encoding and decoding.
- the technical solution is as follows:
- a decoding method includes:
- the size of each sub-block is determined according to the sub-block division information of the current block Information and shape information;
- each sub-block determine the transformation check corresponding to the sub-block according to the size information and shape information of the sub-block;
- determining the transformation check corresponding to the sub-block according to the size information and shape information of the sub-block includes:
- DST7 is determined as the vertical transformation core in the transformation check of the sub-block.
- determining the transformation check corresponding to the sub-block according to the size information and shape information of the sub-block further includes:
- DCT2 determines the horizontal transformation core in the transformation check of the sub-block
- DCT2 is determined as the vertical transformation core in the transformation check of the sub-block.
- the first size restriction condition and the second size restriction condition are greater than or equal to a first value and less than or equal to a second value; the first condition is width Is less than or equal to the height, and the second condition is that the width is greater than or equal to the height; or,
- the first size restriction condition and the second size restriction condition are greater than or equal to a first value and less than or equal to a second value; the first condition is that the width is less than the height, and the second condition is that the width is greater than the height .
- the sub-block division condition is that the current block is a luminance block, the height and width of the current block are both less than or equal to a third value, and the current block is in frame
- the intra prediction is a single-line reference, and the number of pixels included in the current block is greater than the fourth value.
- a method for encoding includes:
- the current block satisfies the sub-block division condition and the intra-frame sub-block division is initiated, determine the size information and shape information of each sub-block of the current block according to the sub-block division information of the current block;
- each sub-block determine the transformation check corresponding to the sub-block according to the size information and shape information of the sub-block;
- determining the transformation check corresponding to the sub-block according to the size information and shape information of the sub-block includes:
- DST7 is determined as the vertical transformation core in the transformation check of the sub-block.
- the method further includes:
- a decoding method includes:
- the size of each sub-block is determined according to the sub-block division information of the current block Information, and determine the intra prediction mode information of each sub-block;
- For each sub-block determine the transformation check of the sub-block according to the size information of the sub-block and the intra prediction mode information of the sub-block;
- determining the transformation check of the sub-block according to the size information of the sub-block and the intra-frame prediction mode information of the sub-block includes:
- the transform check corresponding to the intra-frame prediction mode information of the sub-block is determined as the transform of the sub-block Check, wherein the size restriction condition is that the width is not within the preset numerical range, and the height is not within the preset numerical range.
- the determining the transformation check of the sub-block according to the size information of the sub-block and the intra-frame prediction mode information of the sub-block further includes :
- DCT2 is determined as the transformation check of the sub-block And determining the horizontal transformation kernel in the transformation check corresponding to the intra prediction mode information of the sub-block as the horizontal transformation kernel in the transformation check of the sub-block;
- DCT2 is determined as the horizontal transformation core in the transformation check of the sub-block Determining the vertical transformation kernel in the transformation check corresponding to the intra prediction mode information of the sub-block as the vertical transformation kernel in the transformation check of the sub-block;
- DCT2 is determined as the horizontal transform core and the vertical transform core in the transform check of the sub-block.
- determining the transform check corresponding to the intra prediction mode information of the sub-block as the transform check of the sub-block includes:
- the transform check of the sub-block is (DCT2, DCT2)
- the transform check of the sub-block is (DST7, DST7)
- the transform check of the sub-block is (DST7, DCT8 );
- the transform check of the sub-block is (DCT8, DST7 ).
- determining the transform check corresponding to the intra prediction mode information of the sub-block as the transform check of the sub-block includes:
- the transform check of the sub-block is the first transform check
- the transformation check of the sub-block is the second transformation check
- the transform check of the sub-block is the third transform check ;
- the transform check of the sub-block is the fourth transform check .
- determining the transform check corresponding to the intra prediction mode information of the sub-block as the transform check of the sub-block includes:
- the transform check of the sub-block is the first transform check
- the transform check of the sub-block is the second transform check
- the transform check of the sub-block is the third transform check ;
- the transform check of the sub-block is the fourth transform check .
- determining the transform check corresponding to the intra prediction mode information of the sub-block as the transform check of the sub-block includes:
- the transform check of the sub-block is the first transform check
- the transform check of the sub-block is the second transform check
- the transform check of the sub-block is the third transform check
- the transform check of the sub-block is the fourth transform check.
- the first transformation check is (DCT2, DCT2)
- the second transformation check is (DST7, DST7)
- the third transformation check is (DST7, DCT2)
- the fourth transformation check is (DCT2, DST7); or,
- the first conversion check is (DCT2, DCT2)
- the second conversion check is (DST7, DST7)
- the third conversion check is (DST7, DCT8)
- the fourth conversion check is (DCT8, DST7).
- the intra-frame prediction of the sub-block is determined to be the transformation check of the sub-block, including:
- the intra-prediction mode information For each sub-block, if it is determined that the sub-block does not meet the size restriction condition according to the size information of the sub-block, and the intra-prediction mode information meets the intra-prediction mode range, then the intra-prediction mode information The corresponding transformation check is determined as the transformation check of the sub-block.
- the method further includes:
- the size of the sub-block Information For each sub-block, if it is determined according to the size information of the sub-block that the sub-block does not meet the size restriction condition and the intra-frame prediction mode information does not satisfy the intra-frame prediction mode range, then according to the size of the sub-block Information to determine the ratio of the width and height of the sub-block;
- the intra-frame prediction mode range includes intra-frame prediction mode information whose mode numbers are 0, 1, 31 to 37;
- the intra-frame prediction mode range includes intra-frame prediction mode information whose mode numbers are 0 and 1.
- the intra prediction mode range includes intra prediction mode information with mode numbers of 0, 1, 3, 65, and odd numbers between 3 and 65.
- the intra-frame prediction mode range includes intra-frame prediction mode information whose mode numbers are 0, 1, 31 to 37;
- the determining the transformation check of the sub-block according to the ratio of the width and the height of the sub-block and the intra prediction mode information of the sub-block includes:
- the transformation check of the current block is (DST7, DCT2), if the ratio of the width to the height of the current block is equal to 1, and the mode number of the intra prediction mode information is 3, 5, 7 , 29, 7 to 29 are odd numbers, the transformation check of the current block is (DCT2, DST7);
- the transformation check of the current block is (DST7, DCT2), if the current block is The ratio of width to height is greater than 1, and the mode number of the intra prediction mode information is B+2, B+4, 29, 38, 40, 66, 2, 4, (B-1), B+4 to When an odd number in 29, an even number between 40 and 66, and an even number between 4 and (B-1), the transformation check of the current block is (DCT2, DST7);
- the transformation check of the current block is (DST7, DCT2), if the ratio of the width to the height of the current block is less than 1, and the mode number of the intra prediction mode information is 3, 5, 29, B, (B+2), 65, 38, 40, ( B-1), odd numbers between 5 and 29, odd numbers between (B+2) and 65, and even numbers between 40 and (B-1), the transformation check of the current block is (DCT2, DST7 );
- the intra-frame prediction mode range includes intra-frame prediction mode information whose mode numbers are 0 and 1.
- the determining the transformation check of the sub-block according to the ratio of the width and the height of the sub-block and the intra prediction mode information of the sub-block includes:
- the ratio of the width to the height of the current block is equal to 1, and the mode number of the intra prediction mode information is among 2, 4, 6, 34, 35, 37, 39, 41, 43, 65, 6 to 34
- the current block’s transformation check is (DST7, DCT2), if the ratio between the width and the height of the current block is equal to 1, and the intra prediction mode information is When the mode number is 3, 5, 7, 33, 36, 38, 40, 66, odd numbers between 7 and 33, and even numbers between 40 and 66, the transformation check of the current block is (DCT2, DST7);
- the transformation check of the current block is (DST7, DCT2), if the current The ratio of the width to the height of the block is greater than 1, and the mode numbers of the intra prediction mode information are (B+2), (B+4), 33, 2, 4, (B-1), 36, 38, 66.
- the transformation check of the current block is (DCT2, DST7);
- the transformation of the current block is checked Is (DST7, DCT2), if the ratio of the width to the height of the current block is less than 1, and the mode number of the intra prediction mode information is 3, 5, 33, B, (B+2), 65, 36 , 38, (B-1), odd numbers between 5 and 33, odd numbers between (B+2) and 65, and even numbers between 38 and (B-1), the conversion check of the current block is (DCT2, DST7);
- the intra prediction mode range includes intra prediction mode information with mode numbers of 0, 1, 3, 65, and odd numbers between 3 and 65;
- the determining the transformation check of the sub-block according to the ratio of the width and the height of the sub-block and the intra prediction mode information of the sub-block includes:
- the transformation of the current block is checked Is (DST7, DCT2), if the ratio of the width to the height of the current block is equal to 1, and the mode number of the intra prediction mode information is an even number between 36, 38, 40, 66, 40 to 66,
- the transformation check of the current block is (DCT2, DST7);
- the transform check of the current block is (DST7, DCT2), if the ratio of the width to the height of the current block is greater than 1, and the mode number of the intra prediction mode information is 36, 38, 66, 2 , 4, (B-1), an even number before 38 to 66, and an even number between 4 and (B-1), the transformation check of the current block is (DCT2, DST7);
- the transformation check of the current block is (DST7, DCT2), if the ratio of the width to the height of the current block is less than 1, and the When the mode number of the intra prediction mode information is an even number between 36, 38, (B-1), 38 to (B-1), the transform check of the current block is (DCT2, DST7);
- the method further includes:
- the transformation check of the current block is determined according to the size information and the intra prediction mode information of the current block.
- the determining the transformation check of the current block according to the size information of the current block and the intra prediction mode information includes:
- the transformation check corresponding to the intra prediction mode information is determined as the transformation check of the current block, wherein the target size restriction condition is The width is greater than or equal to the target value, and the height is greater than or equal to the target value;
- DCT2 is determined as the transformation check of the current block And determining the horizontal transformation kernel in the transformation check corresponding to the intra prediction mode information as the horizontal transformation kernel in the transformation check of the current block;
- DCT2 the level in the transformation check of the current block Transform core, and determine the vertical transform core in the transform check corresponding to the intra prediction mode information as the vertical transform core in the transform check of the current block;
- DCT2 is determined as the horizontal transformation core and the vertical transformation core in the transformation check of the current block.
- the sub-block division condition is that the current block is a luminance block, the height and width of the current block are both less than or equal to a first preset value, and the current block is The intra-frame prediction is a single-line reference, and the number of pixels included in the current block is greater than the second preset value.
- a method for encoding includes:
- the intra-frame prediction mode information of each sub-block of the current block and the current block are determined according to the sub-block division information of the current block.
- For each sub-block determine the transformation check of the sub-block according to the size information of the sub-block and the intra prediction mode information of the sub-block;
- determining the transformation check of the sub-block according to the size information of the sub-block and the intra-frame prediction mode information of the sub-block includes:
- the transform check corresponding to the intra-frame prediction mode information of the sub-block is determined as the transform of the sub-block Check, wherein the size restriction condition is that the width is not within the first preset range, and the height is not within the second preset range.
- the method further includes:
- a decoding end for decoding includes:
- the acquisition module is used to acquire the encoding data of the current block
- the size of each sub-block is determined according to the sub-block division information of the current block Information and shape information;
- each sub-block determine the transformation check corresponding to the sub-block according to the size information and shape information of the sub-block;
- a transformation module configured to perform inverse transformation on the inverse-quantized data of each sub-block according to the transformation check of each sub-block;
- the determining module is used for:
- DST7 is determined as the vertical transformation core in the transformation check of the sub-block.
- the determining module is also used for
- DCT2 determines the horizontal transformation core in the transformation check of the sub-block
- DCT2 is determined as the vertical transformation core in the transformation check of the sub-block.
- the first size restriction condition and the second size restriction condition are greater than or equal to a first value and less than or equal to a second value; the first condition is width Is less than or equal to the height, and the second condition is that the width is greater than or equal to the height; or,
- the first size restriction condition and the second size restriction condition are greater than or equal to a first value and less than or equal to a second value; the first condition is that the width is less than the height, and the second condition is that the width is greater than the height .
- the sub-block division condition is that the current block is a luminance block, the height and width of the current block are both less than or equal to a third value, and the current block is in frame
- the intra prediction is a single-line reference, and the number of pixels included in the current block is greater than the fourth value.
- an encoding end for encoding includes:
- the acquisition module is used to acquire the residual data of the current block
- the current block satisfies the sub-block division condition and the intra-frame sub-block division is initiated, determine the size information and shape information of each sub-block of the current block according to the sub-block division information of the current block;
- each sub-block determine the transformation check corresponding to the sub-block according to the size information and shape information of the sub-block;
- a transformation module configured to transform the residual data of each sub-block according to the transformation check of each sub-block
- the determining module is used for:
- DST7 is determined as the vertical transformation core in the transformation check of the sub-block.
- the acquisition module is further used for:
- a decoding end for decoding includes:
- the acquisition module is used to acquire the encoding data of the current block
- the size of each sub-block is determined according to the sub-block division information of the current block Information, and determine the intra prediction mode information of each sub-block;
- For each sub-block determine the transformation check of the sub-block according to the size information of the sub-block and the intra prediction mode information of the sub-block;
- a transformation module configured to perform inverse transformation on the inverse-quantized data of each sub-block according to the transformation check of each sub-block;
- the determining module is used for:
- the transform check corresponding to the intra-frame prediction mode information of the sub-block is determined as the transform of the sub-block Check, wherein the size restriction condition is that the width is not within the preset numerical range, and the height is not within the preset numerical range.
- the determining module is further used for:
- DCT2 is determined as the transformation check of the sub-block And determining the horizontal transformation kernel in the transformation check corresponding to the intra prediction mode information of the sub-block as the horizontal transformation kernel in the transformation check of the sub-block;
- DCT2 is determined as the horizontal transformation core in the transformation check of the sub-block Determining the vertical transformation kernel in the transformation check corresponding to the intra prediction mode information of the sub-block as the vertical transformation kernel in the transformation check of the sub-block;
- DCT2 is determined as the horizontal transform core and the vertical transform core in the transform check of the sub-block.
- the determining module is configured to:
- the transform check of the sub-block is (DCT2, DCT2)
- the transform check of the sub-block is (DST7, DST7)
- the transform check of the sub-block is (DST7, DCT8 );
- the transform check of the sub-block is (DCT8, DST7 ).
- the determining module is configured to:
- the transform check of the sub-block is the first transform check
- the transformation check of the sub-block is the second transformation check
- the transform check of the sub-block is the third transform check ;
- the transform check of the sub-block is the fourth transform check .
- the determining module is configured to:
- the transform check of the sub-block is the first transform check
- the transform check of the sub-block is the second transform check
- the transform check of the sub-block is the third transform check ;
- the transform check of the sub-block is the fourth transform check .
- the determining module is configured to:
- the transform check of the sub-block is the first transform check
- the transform check of the sub-block is the second transform check
- the transform check of the sub-block is the third transform check
- the transform check of the sub-block is the fourth transform check.
- the first transformation check is (DCT2, DCT2)
- the second transformation check is (DST7, DST7)
- the third transformation check is (DST7, DCT2)
- the fourth transformation check is (DCT2, DST7); or,
- the first conversion check is (DCT2, DCT2)
- the second conversion check is (DST7, DST7)
- the third conversion check is (DST7, DCT8)
- the fourth conversion check is (DCT8, DST7).
- the determining module is configured to:
- the intra-prediction mode information For each sub-block, if it is determined that the sub-block does not meet the size restriction condition according to the size information of the sub-block, and the intra-prediction mode information meets the intra-prediction mode range, then the intra-prediction mode information The corresponding transformation check is determined as the transformation check of the sub-block.
- the determining module is further used for:
- the size of the sub-block Information For each sub-block, if it is determined according to the size information of the sub-block that the sub-block does not meet the size restriction condition and the intra-frame prediction mode information does not satisfy the intra-frame prediction mode range, then according to the size of the sub-block Information to determine the ratio of the width and height of the sub-block;
- the intra-frame prediction mode range includes intra-frame prediction mode information whose mode numbers are 0, 1, 31 to 37;
- the intra-frame prediction mode range includes intra-frame prediction mode information whose mode numbers are 0 and 1.
- the intra prediction mode range includes intra prediction mode information with mode numbers of 0, 1, 3, 65, and odd numbers between 3 and 65.
- the intra-frame prediction mode range includes intra-frame prediction mode information whose mode numbers are 0, 1, 31 to 37;
- the determining module is also used for:
- the transformation check of the current block is (DST7, DCT2), if the ratio of the width to the height of the current block is equal to 1, and the mode number of the intra prediction mode information is 3, 5, 7 , 29, 7 to 29 are odd numbers, the transformation check of the current block is (DCT2, DST7);
- the transformation check of the current block is (DST7, DCT2), if the current block is The ratio of width to height is greater than 1, and the mode number of the intra prediction mode information is B+2, B+4, 29, 38, 40, 66, 2, 4, (B-1), B+4 to When an odd number in 29, an even number between 40 and 66, and an even number between 4 and (B-1), the transformation check of the current block is (DCT2, DST7);
- the transformation check of the current block is (DST7, DCT2), if the ratio of the width to the height of the current block is less than 1, and the mode number of the intra prediction mode information is 3, 5, 29, B, (B+2), 65, 38, 40, ( B-1), odd numbers between 5 and 29, odd numbers between (B+2) and 65, and even numbers between 40 and (B-1), the transformation check of the current block is (DCT2, DST7 );
- the intra-frame prediction mode range includes intra-frame prediction mode information whose mode numbers are 0 and 1.
- the determining module is also used for:
- the ratio of the width to the height of the current block is equal to 1, and the mode number of the intra prediction mode information is among 2, 4, 6, 34, 35, 37, 39, 41, 43, 65, 6 to 34
- the current block’s transformation check is (DST7, DCT2), if the ratio between the width and the height of the current block is equal to 1, and the intra prediction mode information is When the mode number is 3, 5, 7, 33, 36, 38, 40, 66, odd numbers between 7 and 33, and even numbers between 40 and 66, the transformation check of the current block is (DCT2, DST7);
- the transformation check of the current block is (DST7, DCT2), if the current The ratio of the width to the height of the block is greater than 1, and the mode numbers of the intra prediction mode information are (B+2), (B+4), 33, 2, 4, (B-1), 36, 38, 66.
- the transformation check of the current block is (DCT2, DST7);
- the transformation of the current block is checked Is (DST7, DCT2), if the ratio of the width to the height of the current block is less than 1, and the mode number of the intra prediction mode information is 3, 5, 33, B, (B+2), 65, 36 , 38, (B-1), odd numbers between 5 and 33, odd numbers between (B+2) and 65, and even numbers between 38 and (B-1), the conversion check of the current block is (DCT2, DST7);
- the intra prediction mode range includes intra prediction mode information with mode numbers of 0, 1, 3, 65, and odd numbers between 3 and 65;
- the determining module is also used for:
- the transformation of the current block is checked Is (DST7, DCT2), if the ratio of the width to the height of the current block is equal to 1, and the mode number of the intra prediction mode information is an even number between 36, 38, 40, 66, 40 to 66,
- the transformation check of the current block is (DCT2, DST7);
- the transform check of the current block is (DST7, DCT2), if the ratio of the width to the height of the current block is greater than 1, and the mode number of the intra prediction mode information is 36, 38, 66, 2 , 4, (B-1), an even number before 38 to 66, and an even number between 4 and (B-1), the transformation check of the current block is (DCT2, DST7);
- the transformation check of the current block is (DST7, DCT2), if the ratio of the width to the height of the current block is less than 1, and the When the mode number of the intra prediction mode information is an even number between 36, 38, (B-1), 38 to (B-1), the transform check of the current block is (DCT2, DST7);
- the determining module is further used for:
- the transformation check of the current block is determined according to the size information and the intra prediction mode information of the current block.
- the determining module is further used for:
- the transformation check corresponding to the intra prediction mode information is determined as the transformation check of the current block, wherein the target size restriction condition is The width is greater than or equal to the target value, and the height is greater than or equal to the target value;
- DCT2 is determined as the transformation check of the current block And determining the horizontal transformation kernel in the transformation check corresponding to the intra prediction mode information as the horizontal transformation kernel in the transformation check of the current block;
- DCT2 the level in the transformation check of the current block Transform core, and determine the vertical transform core in the transform check corresponding to the intra prediction mode information as the vertical transform core in the transform check of the current block;
- DCT2 is determined as the horizontal transformation core and the vertical transformation core in the transformation check of the current block.
- the sub-block division condition is that the current block is a luminance block, the height and width of the current block are both less than or equal to a first preset value, and the current block is The intra-frame prediction is a single-line reference, and the number of pixels included in the current block is greater than the second preset value.
- an encoding end for encoding includes:
- the acquisition module is used to acquire the residual data of the current block
- the intra-frame prediction mode information of each sub-block of the current block and the current block are determined according to the sub-block division information of the current block.
- For each sub-block determine the transformation check of the sub-block according to the size information of the sub-block and the intra prediction mode information of the sub-block;
- a transformation module configured to transform the residual data of each sub-block according to the transformation check of each sub-block
- the determining module is used for:
- the transform check corresponding to the intra-frame prediction mode information of the sub-block is determined as the transform of the sub-block Check, wherein the size restriction condition is that the width is not within the first preset range, and the height is not within the second preset range.
- the acquisition module is further used for:
- a decoding end for decoding including a processor and a memory, wherein the memory is used to store computer programs; the processor is used to execute the programs stored in the memory to implement The method steps described in any one of the first and third aspects above.
- an encoding terminal for encoding includes: a processor and a memory, wherein the memory is used to store a computer program; the processor is used to execute the The stored program implements the method steps of any aspect of the second aspect and the fourth aspect.
- a computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method described in any one of the first to fourth aspects is implemented step.
- a system for encoding and decoding includes an encoding end and a decoding end, wherein:
- the encoding end is the encoding end described in the sixth aspect; the decoding end is the decoding end described in the fifth aspect; or,
- the encoding end is the encoding end described in the eighth aspect; the decoding end is the decoding end described in the seventh aspect.
- the size information and shape information of each sub-block of the current block can be directly used to determine the transformation check corresponding to each sub-block, and based on the determined transformation check, the encoding process is performed.
- the size information and shape information of each sub-block of the current block can also be used directly to determine the transformation check corresponding to each sub-block, and the decoding process is performed based on the determined transformation check. In this way, since the size information and shape information of the sub-blocks are used to determine the transformation check, instead of using the same transformation check for all sub-blocks, the coding and decoding performance can be improved. And when exporting the transformation check, only the height and width are used, the export process is relatively simple, and the codec performance can be further improved.
- FIG. 1 is a schematic diagram of a block division type provided by an embodiment of the present disclosure
- FIG. 2 is a schematic diagram of a CTU divided into CU according to an embodiment of the present disclosure
- Figure 3 is a schematic diagram of three commonly used blocks provided by an embodiment of the present disclosure.
- FIG. 4 is a schematic diagram of directions when performing intra prediction according to an embodiment of the present disclosure.
- FIG. 5 is a schematic diagram of adjustment based on block shape provided by an embodiment of the present disclosure.
- FIG. 6 is a schematic diagram of encoding provided by an embodiment of the present disclosure.
- FIG. 7 is a schematic diagram of a distributed signal provided by an embodiment of the present disclosure.
- FIG. 8 is a schematic diagram of a residual data distribution provided by an embodiment of the present disclosure.
- FIG. 9 is a schematic flowchart of a decoding method provided by an embodiment of the present disclosure.
- FIG. 10 is a schematic flowchart of a method for encoding according to an embodiment of the present disclosure.
- FIG. 11 is a schematic diagram of dividing sub-blocks according to an embodiment of the present disclosure.
- FIG. 12 is a schematic flowchart of a decoding method provided by an embodiment of the present disclosure.
- FIG. 13 is a schematic flowchart of a method for encoding provided by an embodiment of the present disclosure.
- Figure 14 is a schematic structural diagram of a decoding end provided by an embodiment of the present disclosure.
- FIG. 15 is a schematic structural diagram of an encoding end provided by an embodiment of the present disclosure.
- FIG. 16 is a schematic structural diagram of a decoding end provided by an embodiment of the present disclosure.
- FIG. 17 is a schematic structural diagram of an encoding end provided by an embodiment of the present disclosure.
- FIG. 18 is a schematic structural diagram of an encoding terminal provided by an embodiment of the present disclosure.
- FIG. 19 is a schematic structural diagram of a decoding end provided by an embodiment of the present disclosure.
- the present disclosure provides a method for encoding and decoding.
- the execution subject of the encoding method is the encoding end, and the execution subject of the decoding method may be the decoding end, where the encoding end or the decoding end may be a server, a computer, A device that can encode and/or decode video data such as a mobile phone.
- the encoding end or the decoding end may be provided with a processor, a memory, a transceiver, etc.
- the processor may be used to perform encoding and/or decoding processing
- the memory may be used to store data required in the encoding and/or decoding process
- the transceiver can be used to receive and send data, such as obtaining video data.
- transformation is an indispensable stage to achieve video data compression, which can make the energy of the signal more concentrated, and based on DCT (Discrete Cosine Transform, Discrete Cosine Transform)/DST (Discrete Sine Transform, Discrete Sine Transform) transformation Technology has always been the mainstream transformation technology of video coding.
- DCT and DST are divided into multiple transformation cores according to different basis functions. Table 1 shows the basis functions of three commonly used transformation cores.
- the transformation process includes forward transformation and inverse transformation, also called forward transformation and inverse transformation.
- the forward transformation is to convert a two-dimensional residual data (residual coefficient) into a more concentrated two-dimensional energy.
- Dimensional frequency spectrum signal (transform coefficient) the transform coefficient can effectively remove the high frequency components after the quantization process, and retain the middle and low frequency components, which has the effect of compression. Expressed in matrix form as formula (1):
- M represents the width of the residual block
- N represents the height of the residual block
- f represents the original residual data of NxM dimensions
- F represents the frequency domain signal of NxM dimensions.
- a and B represent MxM and NxN-dimensional transformation matrices, both of which satisfy orthogonality.
- Inverse transformation also known as inverse transformation, is the inverse process of forward transformation, that is, the frequency domain signal F is converted into time domain residual data f through orthogonal transformation matrices A and B. Expressed in matrix form as formula (2):
- the positive transformation of a two-dimensional residual data can be realized by two one-dimensional forward transformations.
- an MxN signal X is obtained, which removes the correlation between the horizontal pixels of the two-dimensional residual data. Therefore, the first positive transformation is called the horizontal transformation, and A is called the horizontal transformation matrix.
- the second positive transformation removes the correlation between the vertical pixels of the two-dimensional residual data. Therefore, the second positive transformation is called Vertical transformation, call B the vertical transformation matrix.
- next-generation video coding standard In the next-generation video coding standard, TU (Transmission Unit) supports rectangular blocks, so M is not necessarily equal to N, so the dimensions of A and B are not necessarily equal. In addition, the next-generation video coding standard also supports A And B is not the transformation matrix produced by the same kind of transformation core, so there is a transformation check ⁇ H,V ⁇ composed of the transformation kernels corresponding to A and B in the transformation, where H is called the horizontal transformation kernel and V is called the vertical transformation kernel.
- Block Partition Technology (Block Partition)
- a 64x64 size CTU (Coding Tree Unit) is recursively divided into CU (Coding Unit, coding unit) using a quadtree.
- CU Coding Unit, coding unit
- the CU can be further divided into two or four PUs (Prediction Unit, prediction unit), and the same prediction information is used in the same PU.
- a CU can be further divided into multiple TUs.
- VVC Very Video Coding
- a mixed binary/ternary/quaternary) tree (BT/TT/QT) partition structure replaces the original partition mode, and cancels the distinction between the original concepts of CU, PU, and TU , Which supports a more flexible way of dividing CU.
- the CU can be divided into a square or a rectangle.
- the CTU first divides the quad tree, and then the leaf nodes of the quad tree can be further divided into the binary tree and the ternary tree.
- blocks usually have three shapes, as shown in Figure 3.
- Figure 3 (a) represents a block with a width greater than a height, (b) a block with a width equal to a height, and (c) a width less than a height Block.
- Intra prediction takes into account that there is a strong spatial correlation between adjacent blocks in the image. Therefore, the surrounding pixels that have been reconstructed can be used as reference pixels to predict the current uncoded block, so only the residual data ( The original signal-predicted signal) is subjected to subsequent encoding processing instead of encoding the original signal, which effectively removes the redundancy in the spatial domain and greatly improves the compression efficiency of the video signal. Moreover, in intra-frame prediction, denser angles can bring better prediction results. As shown in Figure 4, it shows a schematic diagram of the angle directions of the 67 intra-frame prediction modes given by VVC for intra-frame prediction. The number of intra prediction modes has been increased from 33 to 65 in HEVC. When the mode number is 0, it means Planar mode.
- the mode number is 1, it means DC mode (DC mode means that the prediction pixels of the current block are all reference The average value of pixels), the black solid line represents the original HEVC angle direction (2,4,6,8,...,64,66), and the dotted line is the newly added angle direction (3,5,7,9,..., 63,65), more dense angle directions can capture the boundaries of any direction in natural video more effectively, and more reference information can be used for rate-distortion cost selection, so that more suitable intra-frame prediction modes can be found to be more accurate
- the current coding block is predicted to make the prediction block closer to the original coding block, and fewer bits need to be transmitted to encode the current block, resulting in higher coding performance.
- these 67 intra-frame modes are applied to coding blocks of all sizes, including luminance and chrominance components.
- the mode number of the intra prediction mode is 2 to 34
- the angle range between the angle direction and the horizontal right direction is: -45 degrees to 45 degrees
- the mode number of the intra prediction mode is 35 to 66
- the angle The range of the angle between the direction and the horizontal right direction is: -135 degrees to -45 degrees.
- the horizontal right direction is the positive direction of the x-axis
- the vertical upward direction is the positive direction of the y-axis.
- the rays with the origin as the vertex in the first quadrant and the second quadrant
- the angle formed by (the direction of the ray away from the origin) and the positive direction of the x-axis is a positive value
- the third and fourth quadrants are the ray with the origin as the vertex (the direction of the ray away from the origin) and the positive direction of the x-axis.
- the included angle is negative.
- the angle between the horizontal right direction and the axis of symmetry in the fourth quadrant (the direction away from the origin) is -45 degrees.
- Figure 5 (a) represents a square block.
- the angle direction is just clockwise rotated from 45 degrees to -135 degrees, so no adjustment is required.
- Figure 5 (b) represents a block whose width is greater than its height, and the following adjustments need to be made, that is, the upper right corner exceeds -135 degrees to replace the lower left corner.
- Figure 5 (c) represents a block with a width smaller than a height, and the following adjustments need to be made, that is, the lower left corner is lower than 45 degrees instead of the upper right corner.
- a complete video coding method generally includes prediction, transformation, quantization, entropy coding, and in-loop filtering.
- the prediction is divided into intra-frame prediction and inter-frame prediction.
- Intra-frame prediction takes into account the strong spatial correlation between adjacent blocks in the image, so the surrounding pixels that have been reconstructed can be used as reference pixels for the current uncoded Blocks are predicted, so only the residual data (original signal-predicted signal) needs to be subjected to subsequent encoding processing instead of encoding the original signal, which effectively removes the redundancy in the spatial domain and greatly improves the compression efficiency of the video signal.
- Inter-frame prediction refers to the use of the correlation in the time domain of the video signal to predict the pixels of the current image using adjacent coded image pixels to achieve the purpose of removing video temporal redundancy.
- the image block of the current frame is often searched in the adjacent reference image to find the The block with the most matching block is used as the reference block. Since the reference block has a high similarity to the current block, and the difference between the two is very small, the code rate overhead of encoding the difference is usually much smaller than the code rate overhead caused by directly encoding the pixel value of the current block.
- DCT2 ⁇ transform core types they represent The residual distribution of TU is uniform.
- DST7, DST7 ⁇ transformation kernel type it represents that the residual distribution of TU increases from left to right and from top to bottom, mainly distributed in the lower right corner of TU, similarly , ⁇ DCT8,DST7 ⁇ represents the residuals are mainly distributed in the lower left corner of the TU, ⁇ DST7,DCT8 ⁇ represents the residuals are mainly distributed in the upper right corner of the TU, ⁇ DCT8,DCT8 ⁇ represents the residuals are mainly distributed in the upper left corner of the TU.
- the embodiment of the present disclosure provides a method for decoding, and the execution flow of the method may be as shown in FIG. 9.
- Step 901 The decoding end obtains the encoded data of the current block.
- the encoded data when the decoding end has encoded data to be decoded, the encoded data can be obtained, and then the encoded data can be subjected to entropy decoding processing, and the entropy decoding result can be dequantized to obtain the encoded data of the current block.
- Step 902 If the current block satisfies the sub-block division condition, and according to the encoding data of the current block, it is determined that the current block initiates intra-frame sub-block division, then the decoder determines the size information and shape of each sub-block according to the sub-block division information of the current block information.
- the sub-block division information is used to indicate how to divide the current block. For example, for an 8*4 current block, it may be horizontally divided into two 8*2 sub-blocks.
- the decoding end after the decoding end obtains the current block, it can determine whether the current block meets the sub-block division condition. If the current block meets the sub-block division condition, check whether the flag bit of the sub-block division in the frame is checked from the coded data of the current block. It is a preset identifier. If it is a preset identifier, it is determined that the current block initiates intra-frame sub-block division; if it is not a preset identifier, it is determined that the current block does not initiate intra-frame sub-block division.
- the decoder determines that the current block starts the intra-frame sub-block division, it can obtain the sub-block division information of the current block from the encoded data of the current block, and then use the sub-block division information of the current block to divide the current block to obtain each sub-block.
- Block determine the number of pixels in the height direction of each sub-block of the current block (that is, the height of the sub-block), and the number of pixels in the width direction (that is, the width of the sub-block). In this way, the size information of each sub-block is obtained, and then the height and width of each sub-block can be used to determine the shape information of each sub-block.
- the shape information means that the height of the sub-block is greater than the width, and the height of the sub-block is less than the width. The height is equal to the width.
- the sub-block division condition is that the current block is a luminance block, the height and width of the current block are both less than or equal to the third value, and the current block is a single-line reference and current The number of pixels contained in the block is greater than the fourth value.
- the third value can be preset and stored in the decoding end.
- the third value can be 64.
- the current block is a single-line reference when intra prediction is performed. When the current block is intra prediction, only one line is referenced.
- the fourth The value can be preset and stored in the decoder. The fourth value can be 16.
- Step 903 For each sub-block, the decoding end determines a transformation check corresponding to the sub-block according to the size information and shape information of the sub-block. Among them, for each sub-block, according to the size information and shape information of the sub-block, the transformation check corresponding to the sub-block is determined, including: if the width of the sub-block meets the first size restriction condition and the shape meets the first condition, then DST7 is determined as The horizontal transformation core in the transformation check of the sub-block; if the height of the sub-block satisfies the second size restriction condition and the shape meets the second condition, DST7 is determined as the vertical transformation kernel in the transformation check of the sub-block.
- the first size restriction condition is that the width is greater than or equal to the first value and less than or equal to the second value
- the first condition is that the width is less than or equal to the height
- the second size restriction condition is that the height is greater than or equal to the first value and less than Or equal to the second value
- the second condition is that the width is greater than or equal to the height
- the first size restriction condition is that the width is greater than or equal to the first value and less than or equal to the second value
- the second size restriction condition is that the height is greater than or equal to the first value and less than or equal to the second value
- the first condition is The width is less than the height
- the second condition is that the width is greater than the height.
- the first value and the second value can be preset and stored in the decoding end.
- the first value can be 4 and the second value can be 16.
- a transformation check includes a horizontal transformation kernel and a vertical transformation kernel.
- the decoding end can determine whether the width of the sub-block meets the first size restriction condition, and determine whether the shape of the sub-block meets the first condition, and determine whether the height of the sub-block meets the second size restriction condition, and determine the Whether the shape meets the first condition. If the width of the sub-block satisfies the first size restriction condition and the shape meets the first condition, DST7 is determined as the horizontal transformation core in the transformation check of the sub-block. If the height of the sub-block satisfies the second size restriction condition and the shape If the second condition is met, DST7 is determined as the vertical transformation core in the transformation check of the sub-block.
- DCT2 is determined as the horizontal transformation in the transformation check of the sub-block Core
- DCT2 is determined as the vertical transformation core in the transformation check of the sub-block.
- DCT2 can be determined as the horizontal transformation core in the transformation check of the sub-block. At least one of the height not satisfying the second size restriction condition and the shape not satisfying the second condition is true, then DCT2 is determined as the vertical transformation core in the transformation check of the sub-block.
- the horizontal transform core and the vertical transform core can be combined into the transform check of the sub-block, and the transform check can be determined using the above method for any sub-block. Determine the transformation check of each sub-block.
- Step 904 the decoding end performs inverse transformation on the inversely quantized data of each sub-block according to the transformation check of each sub-block.
- the corresponding transformation check can be used to perform inverse transformation processing on each sub-block to obtain the residual data corresponding to each sub-block, and then use the reconstructed area around the current block
- the pixel value of the intra pixel points constructs the prediction signal of each sub-block according to the intra prediction mode used during encoding. For each sub-block, add the residual data of the sub-block to the prediction signal to obtain the reconstruction information of the sub-block. In this way, the reconstruction information of each sub-block can be obtained, and the reconstruction information of each sub-block can be combined. Get the reconstruction information corresponding to the current block.
- each current block is processed in accordance with the process shown in Figure 9, and then a whole segment of video data can be decoded.
- the embodiment of the present disclosure also provides an encoding process, and the corresponding processing may be as follows:
- Step 1001 The encoding terminal obtains residual data of the current block.
- the encoding end when the encoding end encodes the video data, it first performs intra-frame prediction to obtain residual data (the method of obtaining residual data is consistent with the existing video coding standards, and will not be repeated), and then the residual The data is the residual data of the current block to be processed.
- Step 1002 If the current block meets the sub-block division condition and the intra-frame sub-block division is started, the encoding end determines the size information and shape information of each sub-block of the current block according to the sub-block division information of the current block.
- the sub-block division information is used to indicate how to divide the current block. For example, for an 8*4 current block, it may be horizontally divided into two 8*2 sub-blocks.
- the encoding terminal after the encoding terminal obtains the residual data of the current block, it can determine whether the current block meets the sub-block division condition. If the sub-block division condition is satisfied, it can determine whether to enable intra-frame sub-block division.
- the switch When the switch is in the on state, it means that the intra-frame sub-block division can be enabled, the current block can be divided, and the height and width of each sub-block obtained by dividing the current block can be determined.
- the width of the current block refers to the number of pixels contained in the width direction
- the height of the current block refers to the number of pixels contained in the height direction
- the width of the sub-block refers to the number of pixels contained in the width direction
- the height of the sub-block refers to the number of pixels contained in the height direction.
- the size information of the sub-block can be obtained.
- MxN M represents the width of the current block
- N represents the height of the current block.
- each sub-block can then be used to determine the shape information of each sub-block.
- the shape information means that the height of the sub-block is greater than the width, the height of the sub-block is less than the width, and the height of the sub-block is equal to the width.
- the sub-block division condition is that the current block is a luminance block, the height and width of the current block are both less than or equal to the third value, and the current block is a single-line reference and current The number of pixels contained in the block is greater than the fourth value.
- the third value can be preset and stored in the encoding end.
- the third value can be 64.
- the current block is a single-line reference when intra-frame prediction is performed. When the current block is intra-predicted, only one line is referenced.
- the value can be preset and stored to the encoding end.
- the fourth value can be 16.
- Step 1003 For each sub-block, the encoding end determines the transformation check corresponding to the sub-block according to the size information and shape information of the sub-block; wherein, for each sub-block, according to the size information and shape information of the sub-block, determine the corresponding sub-block
- the transformation check includes: if the width of the sub-block satisfies the first size restriction condition and the shape satisfies the first condition, determining DST7 as the horizontal transformation core in the transformation check of the sub-block; if the height of the sub-block satisfies the second size restriction condition and The shape meets the second condition, and DST7 is determined as the vertical transformation core in the transformation check of the sub-block.
- the encoding end can determine whether the width of the sub-block meets the first size restriction condition, determine whether the shape of the sub-block meets the first condition, and determine whether the height of the sub-block meets the second size restriction condition, and determine the Whether the shape meets the first condition. If the width of the sub-block satisfies the first size restriction condition and the shape meets the first condition, then DST7 is determined as the horizontal transformation core in the transformation check of the sub-block. If the height of the sub-block meets the second size restriction condition and the shape If the second condition is met, DST7 is determined as the vertical transformation core in the transformation check of the sub-block.
- DCT2 is determined as the horizontal transformation in the transformation check of the sub-block Core
- DCT2 is determined as the vertical transformation core in the transformation check of the sub-block.
- DCT2 can be determined as the horizontal transformation core in the transformation check of the sub-block. At least one of the height not satisfying the second size restriction condition and the shape not satisfying the second condition is true, then DCT2 is determined as the vertical transformation core in the transformation check of the sub-block.
- the horizontal transform core and the vertical transform core can be combined into the transform check of the sub-block, and the transform check can be determined using the above method for any sub-block. Determine the transformation check of each sub-block.
- Step 1004 The encoding end performs transformation on the residual data of each sub-block according to the transformation check of each sub-block.
- the sub-block can be transformed based on the transform check corresponding to the sub-block to obtain the transform coefficient corresponding to the sub-block, and then the The transform coefficient is quantized to obtain the quantized coefficient, and the quantized coefficient is subjected to entropy coding processing to obtain the coded data corresponding to the sub-block.
- each sub-block the coded data corresponding to the current block can be obtained, and the coding process of the current block is completed.
- Each current block is processed according to the flow shown in Figure 10, and a whole segment of video data can be encoded.
- the encoding end may obtain the sub-block division information corresponding to the current block, and then add the sub-block division information to the coded data of the current block. In this way, the subsequent decoding end can obtain the sub-block division information corresponding to the current block from the encoded data of the current block, and perform decoding.
- the encoder can divide a current block horizontally or vertically into several small sub-blocks. For example, for a 16x8 current block, it can be divided into 4 16x2 sub-blocks horizontally or vertically into 4 4x8 sub-blocks. Sub-block. However, for a 4x8 block, it can be divided into two 4x4 blocks or two 2x8 sub-blocks. It can be noted that the number of sub-blocks can only be two (for 4x8, 8x4 sub-blocks). And the sub-block contains at least 16 pixels, so the 4x4 block will not be divided again, and there is no need to make corresponding grammar declarations on the encoding and decoding ends.
- Table 3 The specific division rules are shown in Table 3.
- the divided intra sub-blocks share the intra prediction mode of the current block (that is, the sub-blocks obtained by dividing the current block are the same as the intra prediction mode of the current block).
- w represents the width of the sub-block
- h represents the height of the sub-block
- K represents the number of sub-blocks that can be divided
- W represents the width of the current block
- H represents the height of the current block, which can be divided horizontally according to Table 3.
- vertical division for example, as shown in FIG. 11, for a current block of 8*4, it can be divided into two 8*2 sub-blocks according to horizontal division, and it can be divided into two 4*4 sub-blocks according to vertical division.
- the process of using RDO criteria to determine sub-block division information can be as follows:
- the size information and shape information of each sub-block of the current block can be directly used to determine the transformation check corresponding to each sub-block, and based on the determined transformation check, the encoding process is performed.
- the size information and shape information of each sub-block of the current block can also be used directly to determine the transformation check corresponding to each sub-block, and the decoding process is performed based on the determined transformation check. In this way, since the size information and shape information of the sub-blocks are used to determine the transformation check, instead of using the same transformation check for all sub-blocks, the coding and decoding performance can be improved. And when exporting the transformation check, only the height and width are used, the export process is relatively simple, and the codec performance can be further improved.
- Another embodiment of the present disclosure provides a method for decoding, and the execution flow of the method may be as shown in FIG. 12.
- Step 1201 The decoder obtains the encoded data of the current block.
- the encoded data when the decoding end has encoded data to be decoded, the encoded data can be obtained, and then the encoded data can be subjected to entropy decoding processing, and the entropy decoding result can be dequantized to obtain the encoded data of the current block.
- the current block is actually residual data obtained through inverse transform processing.
- Step 1202 If the current block satisfies the sub-block division condition at the decoding end, according to the encoded data of the current block. It is determined that the current block starts the intra-frame sub-block division, and then the size information of each sub-block is determined according to the sub-block division information of the current block, and the intra-frame prediction mode information of each sub-block is determined.
- the sub-block division information is used to indicate how to divide the current block. For example, for an 8*4 current block, it may be horizontally divided into two 8*2 sub-blocks.
- the decoding end after the decoding end obtains the current block, it can determine whether the current block meets the sub-block division condition. If the current block meets the sub-block division condition, check whether the flag bit of the sub-block division in the frame is checked from the coded data of the current block. It is a preset identifier. If it is a preset identifier, it is determined that the current block starts intra-frame sub-block division; if it is not a preset identifier, it is determined that the current block does not start intra-frame sub-block division.
- the decoder determines that the current block starts the intra-frame sub-block division, it can obtain the sub-block division information of the current block from the encoded data of the current block, and then use the sub-block division information of the current block to divide the current block to obtain each sub-block Block, determine the number of pixels in the height direction of each sub-block of the current block (that is, the height of the sub-block), and the number of pixels in the width direction (that is, the width of the sub-block). In this way, the size information of each sub-block is obtained. Furthermore, the content of the identification bit can be obtained from the identification bit used to indicate the intra prediction mode information from the encoded data of the current block, that is, the intra prediction mode information of the current block can be obtained.
- the sub-block division condition is that the current block is a luminance block, the height and width of the current block are both less than or equal to the first preset value, and the current block is a single-line reference during intra-frame prediction. , The number of pixels contained in the current block is greater than the second preset value.
- the first preset value can be preset and stored in the decoding end (the same as the third value mentioned above).
- the first preset value can be 64.
- the current block is a single-line reference when performing intra prediction. When the current block performs intra-frame prediction, only one line is referenced.
- the second preset value can be preset and stored in the decoding end.
- the second preset value can be 16 (the same as the fourth value mentioned above).
- Step 1203 For each sub-block, the decoding end determines the transformation check of the sub-block according to the size information of the sub-block and the intra-frame prediction mode information of the sub-block; wherein, for each sub-block, according to the size information of the sub-block and the intra-frame of the sub-block Prediction mode information, determining the transformation check of the sub-block, including: for each sub-block, if it is determined that the sub-block does not meet the size restriction condition according to the size information of the sub-block, then the transformation check corresponding to the intra-prediction mode information of the sub-block is determined Check the transformation of sub-blocks.
- the size restriction condition is that the width is not within the preset value range, and the height is not within the preset value range.
- the preset value range is [2, 32] (excluding 2 and 32). Not within the preset value range means greater than 32 And/or less than 2.
- the decoder can determine whether the size information of the sub-block meets the size restriction conditions. If the size restriction conditions are not met (the width is not within the preset value range and the height is not within the preset value range), the current block can be used Using the intra prediction mode information to determine the corresponding transform check in the correspondence between the intra prediction mode information and the transform check, the transform check is determined as the transform check of the sub-block.
- DCT2 is determined as the transformation of the sub-block Check the vertical transformation core in the check, and determine the horizontal conversion core in the conversion check corresponding to the intra prediction mode information of the sub-block as the horizontal conversion core in the sub-block conversion check.
- DCT2 is determined as the horizontal transformation kernel in the transformation check of the sub-block, and the vertical transformation kernel in the transformation check corresponding to the intra prediction mode information of the sub-block is determined Determined as the vertical transformation core in the transformation check of the sub-block, if it is determined according to the size information of the sub-block that the width and width of the sub-block meet the size restriction conditions, then DCT2 is determined as the horizontal transformation kernel and the vertical transformation in the transformation check of the sub-block nuclear.
- DCT2 can be determined as the vertical transformation core in the transformation check of the sub-block, and the intra-frame can be directly used.
- Prediction mode information from the corresponding relationship between intra prediction mode information and transform check, determine the transform check corresponding to the intra prediction mode information of the current block, and determine the horizontal transform core in the transform check as the horizontal transform core of the current block .
- DCT2 can be determined as the horizontal transformation core in the transformation check of the sub-block, and the intra prediction mode information can be used directly, From the correspondence between the intra prediction mode information and the transform check, the transform check corresponding to the intra prediction mode information of the current block is determined, and the vertical transform core in the transform check is determined as the vertical transform core of the current block.
- DCT2 can be determined as the horizontal transformation core and the vertical transformation core in the transformation check of the sub-block.
- Step 1204 The decoding end performs inverse transformation on the inverse-quantized data of each sub-block according to the transformation check of each sub-block.
- the corresponding transformation check can be used to perform inverse transformation processing on each sub-block to obtain the residual data corresponding to each sub-block, and then use the reconstructed area around the current block
- the pixel value of the intra pixel points constructs the prediction signal of each sub-block according to the intra prediction mode used during encoding. For each sub-block, add the residual data of the sub-block and the prediction signal to obtain the reconstruction information of the sub-block. In this way, the reconstruction information of each sub-block can be obtained, and the reconstruction information of each sub-block can be combined. Get the reconstruction information corresponding to the current block.
- each current block is processed according to the flow shown in Figure 12, and then a whole segment of video data can be decoded.
- determining the transformation check corresponding to the intra prediction mode information of the sub-block as the transformation check of the sub-block may have the following types of processing:
- the transform check of the sub-block is determined to be (DCT2, DCT2), if the mode number of the intra prediction mode information of the sub-block is 0, 31, 32, 34, 36, 37, the transformation check of the sub-block is determined to be (DST7, DST7), if the mode number of the intra-frame prediction mode information of the sub-block is an even number from 2, 30, 2 to 30, 39, 65 and 39 to 65 are odd numbers, the transform check of the sub-block is determined to be (DST7, DCT8), if the mode number of the intra prediction mode information of the sub-block is odd numbers from 3, 29, 3 to 29, 38, 66 And an even number from 38 to 66, the transformation check of the sub-block is determined to be (DCT8, DST7).
- the transform check of the sub-block is the first transform check. If the mode number of the intra prediction mode information of the sub-block is 0, 31, 32, 33, 34, 35, 36, 37, the transform check of the sub-block is determined to be the second transform check, if the mode number of the intra prediction mode information of the sub-block is an even number from 2, 30, 2 to 30, 39, 65 And an odd number from 39 to 65, the transform check of the sub-block is determined to be the third transform check, if the mode number of the intra prediction mode information of the sub-block is an odd number from 3, 29, 3 to 29, 38, 66, and 38 To an even number in 66, it is determined that the transformation check of the sub-block is the fourth transformation check.
- Manner 3 If the mode number of the intra prediction mode information of the sub-block is 1, it is determined that the transform check of the sub-block is the first transform check; if the mode number of the intra prediction mode information of the sub-block is 0, the sub-block is determined
- the transformation check of is the second transformation check; if the mode number of the intra prediction mode information of the sub-block is 2, 34, an even number from 2 to 34, and an odd number from 35, 65, and 35 to 65, the transformation of the sub-block is determined
- the check is the third transform check; if the mode number of the intra prediction mode information of the sub-block is an odd number among 3, 33, 3 to 33, and an even number among 36, 66, and 36 to 66, the transform check of the sub-block is determined to be The fourth transformation check.
- Manner 4 If the mode number of the intra prediction mode information of the sub-block is 1, it is determined that the transform check of the sub-block is the first transform check; if the mode number of the intra prediction mode information of the sub-block is 0, 3, 65 and An odd number from 3 to 65, the transformation check of the sub-block is determined to be the second transformation check; if the mode number of the intra prediction mode information of the sub-block is an even number among 2, 34, and 2 to 34, the transformation of the sub-block is determined The check is the third transform check; if the mode number of the intra prediction mode information of the sub-block is an even number among 36, 66, and 36 to 66, the transform check of the sub-block is determined to be the fourth transform check.
- the first transform check is (DCT2, DCT2)
- the second transform check is (DST7, DST7)
- the third transform check is (DST7, DCT2)
- the fourth transform check is (DCT2, DST7).
- the first transform check is (DCT2, DCT2)
- the second transform check is (DST7, DST7)
- the third transform check is (DST7, DCT8)
- the fourth transform check is (DCT8, DST7).
- the transformation check corresponding to the intra prediction mode information of the sub-block is determined as the transformation check of the sub-block, and the following conditions should be met, and the corresponding processing may be as follows:
- the transform check corresponding to the intra-prediction mode information is determined as the sub-block The transformation check.
- the intra-frame prediction mode range can be preset and stored in the decoder.
- the intra-frame prediction mode range includes intra-frame prediction modes with mode numbers 0, 1, 31 to 37 (see Table 8 and Table 9); or,
- the range of intra prediction modes includes intra prediction modes with mode numbers 0 and 1 (see Table 10); or, the range of intra prediction modes includes frames with an odd number between mode numbers 0, 1, 3, 65, and 3 to 65 Intra prediction mode (see Table 11).
- the decoder after the decoder obtains the mode number of the intra prediction mode information of each sub-block from the encoded data, it can determine whether it belongs to the intra prediction mode range. If it belongs to the intra prediction mode range, it can be directly in the frame In the correspondence relationship between the prediction mode information and the transform check, the transform check corresponding to the intra prediction mode information is determined as the transform check of the sub-block.
- the size information of the sub-block determines whether the sub-block does not meet the size restriction condition, and the intra-prediction mode information does not meet the intra-prediction mode range. If according to the size information of the sub-block, determine the width and The height ratio determines the transformation check of the sub-block according to the ratio of the width to the height of the sub-block and the intra prediction mode information of the sub-block.
- the decoder can determine whether it belongs to the intra-frame prediction mode range. If it does not belong to the intra prediction mode range, the ratio of the width to the height of the sub-block can be determined. Then, the ratio of the width and height of the sub-block and the intra prediction mode information of the sub-block are used to determine the transformation check of the sub-block.
- the following processing can be performed:
- the intra prediction mode range includes the intra prediction mode information with mode numbers 0, 1, 31 to 37.
- the width of the sub-block is represented by w, and the height of the sub-block is represented by h.
- the transformation corresponding to the intra prediction mode information of the mode number 2, 4, 6, ..., 30, 39, 41, 43, ..., 65 The check is (DST7, DCT2) (the first ellipsis represents an even number between 6 and 30, and the second ellipsis represents an odd number between 43 and 65), that is, the transformation check of the sub-block is (DST7, DCT2).
- the check is (DCT2, DST7) (the first ellipsis indicates an odd number between 7 and 29, and the second ellipsis indicates an even number between 42 and 66), that is, the transformation check of the sub-block is (DCT2, DST7).
- the mode number is B+1, B+3,..., 30, 3, 5,..., B, 39, 41, 43,...
- the transformation check corresponding to the 65 intra prediction mode information is (DST7, DCT2) (the first ellipsis indicates an even number between B+3 and 30, the second ellipsis indicates an odd number between 5 and B, and the third ellipsis Represents an odd number between 43 and 65), that is, the transformation check of the sub-block is (DST7, DCT2).
- the mode number is B+2, B+4,..., 29, 38, 40,..., 66, 2, 4,..., (B -1)
- the transform check corresponding to the intra prediction mode information is (DCT2, DST7) (the first ellipsis indicates an odd number between B+4 and 29, the second ellipsis indicates an even number between 40 and 66, and the third The ellipsis indicates an even number between 4 and (B-1)), that is, the transformation check of the sub-block is (DCT2, DST7).
- the mode number is 2, 4, 6,..., 30, B+1, B+3,..., 66, 39, 41,...
- the transform check corresponding to the B-2 intra prediction mode information is (DST7, DCT2) (the first ellipsis indicates an even number between 6 and 30, and the second ellipsis indicates an even number between (B+3) and 66.
- the three ellipsis represent odd numbers between 41 and B-2), that is, the transformation check of the sub-block is (DST7, DCT2).
- the mode number is 3, 5,..., 29, B, B+2,..., 65, 38, 40,..., (B-1
- the transform check corresponding to the intra prediction mode information of) is (DCT2, DST7) (the first ellipsis indicates an odd number between 5 and 29, the second ellipsis indicates an odd number between (B+2) and 65, and the third The ellipsis indicates an even number between 40 and (B-1)), that is, the transformation check of the sub-block is (DCT2, DST7).
- the intra prediction mode range includes the intra prediction mode information with mode numbers 0, 1, 31 to 37.
- the width of the sub-block is represented by w, and the height of the sub-block is represented by h.
- the transformation corresponding to the intra prediction mode information of the mode number 2, 4, 6, ..., 30, 39, 41, 43, ..., 65 The check is (DST7, DCT2) (the first ellipsis represents an even number between 6 and 30, and the second ellipsis represents an odd number between 43 and 65), that is, the transformation check of the sub-block is (DST7, DCT2).
- the check is (DCT2, DST7) (the first ellipsis indicates an odd number between 7 and 29, and the second ellipsis indicates an even number between 42 and 66), that is, the transformation check of the sub-block is (DCT2, DST7).
- the mode number is B+1, B+3,..., 30, 3, 5,..., B, 39, 41, 43,...
- the transformation check corresponding to the 65 intra prediction mode information is (DST7, DCT2) (the first ellipsis indicates an even number between B+3 and 30, the second ellipsis indicates an odd number between 5 and B, and the third ellipsis Represents an odd number between 43 and 65), that is, the transformation check of the sub-block is (DST7, DCT2).
- the mode number is B+2, B+4,..., 29, 38, 40,..., 66, 2, 4,..., (B -1)
- the transform check corresponding to the intra prediction mode information is (DCT2, DST7) (the first ellipsis represents an odd number between B+4 and 29, the second ellipsis represents an even number between 40 and 66, and the third An ellipsis represents an even number between 4 and (B-1)), that is, the transformation check of the sub-block is (DCT2, DST7).
- the mode number is 2, 4, 6,..., 30, B+1, B+3,..., 66, 39, 41,...
- the transform check corresponding to the B-2 intra prediction mode information is (DST7, DCT2) (the first ellipsis indicates an even number between 6 and 30, and the second ellipsis indicates an even number between (B+3) and 66.
- the third ellipsis represents an odd number between 41 and B-2), that is, the transformation check of the sub-block is (DST7, DCT2).
- the mode number is 3, 5,..., 29, B, B+2,..., 65, 38, 40,..., (B-1
- the transform check corresponding to the intra prediction mode information of) is (DCT2, DST7) (the first ellipsis represents an odd number between 5 and 29, the second ellipsis represents an odd number between B+2 and 65, and the third ellipsis Represents an even number between 40 and (B-1)), that is, the transformation check of the sub-block is (DCT2, DST7).
- the intra prediction mode range includes intra prediction mode information with mode numbers 0 and 1; the width of the sub-block is represented by w, and the height of the sub-block is represented by h.
- the mode number is 2, 4, 6, ..., 34, 35, 37, 39, 41, 43, ..., 65 intra prediction modes
- the transformation check corresponding to the information is (DST7, DCT2) (the first ellipsis represents an even number between 6 and 34, and the second ellipsis represents an odd number between 43 and 65), that is, the transformation check of the sub-block is (DST7, DCT2) ).
- the check is (DCT2, DST7) (the first ellipsis indicates an odd number between 7 and 33, and the second ellipsis indicates an even number between 40 and 66), that is, the transformation check of the sub-block is (DCT2, DST7).
- the mode number is B+1, B+3,...,34,3,5,...,B,35,37,39,...
- the transformation check corresponding to the 65 intra prediction mode information is (DST7, DCT2) (the first ellipsis represents an even number between B+3 and 34, the second ellipsis represents an odd number between 5 and B, and the third ellipsis Represents an odd number between 39 and 65), that is, the transformation check of the sub-block is (DST7, DCT2).
- the mode number is B+2, B+4,..., 33, 2, 4,..., (B-1), 36, 38, ...
- the transformation check corresponding to the 66 intra-frame prediction mode information is (DCT2, DST7) (the first ellipsis indicates an odd number between (B+4) and 33, and the second ellipsis indicates a number from 4 to (B-1).
- the third ellipsis represents an even number between 38 and 66), that is, the transformation check of the sub-block is (DCT2, DST7).
- the transformation check corresponding to the intra prediction mode information of B-2 is (DST7, DCT2) (the first ellipsis indicates an even number between 6 and 34, and the second ellipsis indicates an even number between (B+3) and 66 Even, the third ellipsis represents an odd number between 39 and B-2), that is, the transformation check of the sub-block is (DST7, DCT2).
- the mode number is 3, 5,..., 33, B, B+2,..., 65, 36, 38,..., (B-1
- the transform check corresponding to the intra prediction mode information of) is (DCT2, DST7) (the first ellipsis represents an odd number between 5 and 33, the second ellipsis represents an odd number between B+2 and 65, and the third ellipsis It represents an even number between 38 and (B-1)), that is, the transformation check of the sub-block is (DCT2, DST7).
- the intra prediction mode range includes the intra prediction mode information with mode numbers of 0, 1, 3, 65, and odd numbers between 3 and 65.
- the width of the sub-block is represented by w, and the height of the sub-block is represented by h.
- the transformation check corresponding to the intra prediction mode information of the mode number 2, 4, 6, ..., 34 is (DST7, DCT2) (ellipsis Represents an even number between 6 and 34), that is, the transformation check of the sub-block is (DST7, DCT2).
- the transform check corresponding to the intra prediction mode information of the mode number 36, 38, 40, ..., 66 is (DCT2, DST7) (the ellipsis indicates An even number between 40 and 66), that is, the transformation check of the sub-block is (DCT2, DST7).
- the transformation check corresponding to the intra prediction mode information of the mode number B+1, B+3,...,34 is (DST7, DCT2) ( The ellipsis indicates an even number between (B+3) and 34), that is, the transformation check of the sub-block is (DST7, DCT2).
- the check is (DCT2, DST7) (the first ellipsis indicates an even number between 38 and 66, and the second ellipsis indicates an even number between 4 and (B-1), that is, the sub-block transformation check is (DCT2, DST7) .
- the intra prediction mode information of the mode number 2, 4, 6, ..., 34, B+1, B+3, ..., 66 corresponds to
- the transformation check of the sub-block is (DST7, DCT2) (the first ellipsis represents an even number between 6 and 34, and the second ellipsis represents an even number between (B+3) and 66), that is, the transformation check of the sub-block is (DST7 , DCT2).
- the transform check corresponding to the intra prediction mode information with mode numbers 36, 38, ..., (B-1) is (DCT2, DST7) ( The ellipsis indicates an even number between 38 and (B-1)), that is, the transformation check of the sub-block is (DCT2, DST7).
- Table 8 to Table 11 take into account the influence of the intra prediction mode being the wide angle mode, and the B of the wide angle mode is determined by the ratio of the width and height of each sub-block of the current block.
- intra prediction modes with adjacent mode numbers generally correspond to different transformation checks.
- the transformation check of the current block is determined according to the size information of the current block and the intra prediction mode information.
- the size information of the current block and the intra prediction mode information can be used to jointly determine the transformation check of the current block.
- using the size information of the current block and the intra prediction mode information to jointly determine the transformation check of the current block may be processed as follows:
- the transformation check corresponding to the intra prediction mode information is determined as the transformation check of the current block. If according to the size information, it is determined that the height of the current block meets the target size restriction condition and the current When the width of the block does not meet the target size restriction condition, DCT2 is determined as the vertical transformation core in the transformation check of the current block, and the horizontal transformation core in the transformation check corresponding to the intra prediction mode information is determined as the transformation check of the current block If, according to the size information, it is determined that the width of the current block meets the target size restriction condition and the height of the current block does not meet the target size restriction condition, DCT2 is determined as the horizontal transformation core in the transformation check of the current block, and The vertical transform core in the transform check corresponding to the intra prediction mode information is determined as the vertical transform core in the transform check of the current block. If it is determined based on the size information that the width and height of the current block meet the target size restriction conditions, DCT2 is determined It
- the target size restriction condition is that the width is greater than or equal to the target value, and the height is greater than or equal to the target value, and the target value can be 32.
- the decoder can determine whether the current block meets the target size restriction condition, if it meets the target size restriction condition (meaning that both the height and width meet the target size restriction condition), DCT2 can be determined as the horizontal transformation in the transformation check of the current block Nuclear and vertical transformation core.
- the transformation check corresponding to the intra prediction mode information can be determined in the corresponding relationship between the intra prediction mode information and the transformation check Check the transformation of the current block;
- DCT2 is determined as the vertical transformation core in the transformation check of the current block, and can be used in intra prediction mode In the correspondence between the information and the transformation check, determining the horizontal transformation core in the transformation check corresponding to the intra prediction mode information as the horizontal transformation core in the transformation check of the current block;
- DCT2 is determined as the horizontal transformation core in the transformation check of the current block and can be used in intra prediction mode
- the vertical transform core in the transform check corresponding to the intra prediction mode information is determined as the vertical transform core in the transform check of the current block.
- the transformation mode of the current block is the implicit multi-core transformation mode, and the size information and intra prediction mode of the current block can be used Information, together to determine the transformation check of the current block.
- Method 1 As shown in Table 12, the corresponding relationship between intra prediction mode information and transformation check is described. If the mode number of the intra prediction mode information of the current block is 1, 33, 35, the transformation check of the current block is The first transform check, if the mode number of the intra prediction mode information of the current block is 0, 31, 32, 34, 36, 37, the transform check of the current block is the second transform check, if the intra prediction mode of the current block When the information mode number is 2, 30, 39, 65, even numbers from 2 to 30, and odd numbers from 39 to 65, the transformation check of the current block is the third transformation check. If the mode of the intra prediction mode information of the current block is When the numbers are 3, 29, 38, 66, odd numbers from 3 to 29, and even numbers from 38 to 66, the conversion check of the current block is the fourth conversion check.
- Method 2 As shown in Table 13, if the mode number of the intra prediction mode information of the current block is 1, the transform check of the current block is the first transform check, and if the mode number of the intra prediction mode information of the current block is 0, 31, 32, 33, 34, 35, 36, 37, the transformation check of the current block is the second transformation check, if the mode number of the intra prediction mode information of the current block is 2, 30, 39, 65, 2 When the number to 30 is even and the number is 39 to 65, the transformation check of the current block is the third transformation check. If the mode number of the intra prediction mode information of the current block is 3, 29, 38, 66, 3 to 29 When the odd number of and the even number from 38 to 66, the transformation check of the current block is the fourth transformation check.
- Method three if the mode number of the intra prediction mode information of the current block is 1, the transform check of the current block is the first transform check. If the mode number of the intra prediction mode information of the current block is 0: The transform check of the current block is the second transform check. If the mode number of the intra prediction mode information of the current block is 2, 34, 35, 65, even numbers from 2 to 34, and odd numbers from 35 to 65, The transformation check of the current block is the third transformation check. If the mode number of the intra prediction mode information of the current block is 3, 33, 36, 66, odd numbers from 3 to 33, and even numbers from 36 to 66, the current block’s The conversion check is the fourth conversion check.
- Method 4 as shown in Table 15, if the mode number of the intra prediction mode information of the current block is 1, the transform check of the current block is the first transform check. If the mode number of the intra prediction mode information of the current block is 0, 3, 65, and odd numbers from 3 to 65, the transform check of the current block is the second transform check. If the mode number of the intra prediction mode information of the current block is an even number among 2, 34, and 2 to 34, The transform check of the current block is the third transform check. If the mode number of the intra prediction mode information of the current block is an even number among 36, 66, and 36 to 66, the transform check of the current block is the fourth transform check.
- the first conversion check is (DCT2, DCT2)
- the second conversion check is (DST7, DST7)
- the third conversion check is (DST7, DCT2)
- the fourth conversion check is (DCT2, DST7)
- the second transformation check is (DST7, DST7)
- the third transformation check is (DST7, DCT8)
- the fourth transformation check is (DCT8, DST7).
- the intra prediction mode range is also considered, and the corresponding processing may be as follows:
- the transform check corresponding to the intra prediction mode information is determined as the transform check of the current block.
- the intra prediction mode range can be preset and stored in the decoder.
- the intra prediction mode range includes intra prediction modes with mode numbers 0, 1, 31 to 37; or, the intra prediction mode range includes mode numbers. It is an intra prediction mode of 0 and 1; or, the range of intra prediction modes includes intra prediction modes with mode numbers of 0, 1, 3, 65, and odd numbers between 3 and 65.
- the decoder after the decoder obtains the mode number of the intra prediction mode information from the encoded data, it can determine whether it belongs to the intra prediction mode range. If it belongs to the intra prediction mode range, it can directly compare the intra prediction mode information with the intra prediction mode. In the correspondence relationship of the transformation check, the transformation check corresponding to the intra prediction mode information is determined as the transformation check of the current block.
- the following processing can be performed:
- the intra prediction mode range includes the intra prediction mode information with mode numbers 0, 1, 31 to 37.
- the width of the current block is represented by W, and the height of the current block is represented by H.
- the transformation corresponding to the intra prediction mode information of the mode number 2, 4, 6, ..., 30, 39, 41, 43, ..., 65 The check is (DST7, DCT2) (the first ellipsis represents an even number between 6 and 30, and the second ellipsis represents an odd number between 43 and 65).
- the mode number is B+1, B+3,..., 30, 3, 5,..., B, 39, 41, 43,...
- the transformation check corresponding to the 65 intra prediction mode information is (DST7, DCT2) (the first ellipsis indicates an even number between B+3 and 30, the second ellipsis indicates an odd number between 5 and B, and the third ellipsis Represents an odd number between 43 and 65).
- the mode number is B+2, B+4,...,29,38,40,...,66,2,4,...,(B -1)
- the transform check corresponding to the intra prediction mode information is (DCT2, DST7) (the first ellipsis indicates an odd number between B+4 and 29, the second ellipsis indicates an even number between 40 and 66, and the third The ellipsis indicates an even number between 4 and (B-1)).
- the mode number is 2, 4, 6, ..., 30, (B+1), (B+3), ..., 66, 39
- the transformation check corresponding to the intra prediction mode information of 41,..., (B-2) is (DST7, DCT2) (the first ellipsis indicates an even number between 6 and 30, and the second ellipsis indicates (B+3) to 66
- the third ellipsis indicates the odd number between 41 and B-2).
- the mode number is 3, 5,..., 29, B, B+2,..., 65, 38, 40,..., (B-1
- the transform check corresponding to the intra prediction mode information of) is (DCT2, DST7) (the first ellipsis indicates an odd number between 5 and 29, the second ellipsis indicates an odd number between (B+2) and 65, and the third The ellipsis indicates an even number between 40 and (B-1)).
- the range of intra prediction mode information includes the intra prediction mode information with mode numbers 0, 1, 31 to 37; the width of the current block is represented by W, and the height of the current block is represented by H .
- the transformation corresponding to the intra prediction mode information of the mode number 2, 4, 6, ..., 30, 39, 41, 43, ..., 65 The check is (DST7, DCT2) (the first ellipsis represents an even number between 6 and 30, and the second ellipsis represents an odd number between 43 and 65).
- the check is (DCT2, DST7) (the first ellipsis represents an odd number between 7 and 29, and the second ellipsis represents an even number between 42 and 66).
- the mode number is B+1, B+3,..., 30, 3, 5,..., B, 39, 41, 43,...
- the transformation check corresponding to the 65 intra prediction mode information is (DST7, DCT2) (the first ellipsis indicates an even number between B+3 and 30, the second ellipsis indicates an odd number between 5 and B, and the third ellipsis Represents an odd number between 43 and 65).
- the mode number is B+2, B+4,...,29,38,40,...,66,2,4,...,(B -1)
- the transform check corresponding to the intra prediction mode information is (DCT2, DST7) (the first ellipsis represents an odd number between B+4 and 29, the second ellipsis represents an even number between 40 and 66, and the third An ellipsis represents an even number between 4 and (B-1)).
- the mode number is 2, 4, 6,..., 30, B+1, B+3,..., 66, 39, 41,...
- the transform check corresponding to the intra prediction mode information of (B-2) is (DST7, DCT2) (the first ellipsis indicates an even number between 6 and 30, and the second ellipsis indicates a number between (B+3) and 66 Even numbers, the third ellipsis indicates odd numbers between 41 and (B-2)).
- the mode number is 3, 5,..., 29, B, (B+2),..., 65, 38, 40,..., (B).
- the transform check corresponding to the intra prediction mode information of -1) is (DCT2, DST7) (the first ellipsis represents an odd number between 5 and 29, and the second ellipsis represents an odd number between (B+2) and 65.
- the third ellipsis indicates an even number between 40 and (B-1)).
- the range of intra prediction mode information includes intra prediction mode information with mode numbers 0 and 1. As shown in Table 18, the width of the current block is represented by W, and the height of the current block is represented by H.
- the mode number is 2, 4, 6, ..., 34, 35, 37, 39, 41, 43, ..., 65 intra prediction modes
- the transformation check corresponding to the information is (DST7, DCT2) (the first ellipsis represents an even number between 6 and 34, and the second ellipsis represents an odd number between 43 and 65).
- the transformation corresponding to the intra prediction mode information of the mode number 3 5, 7,..., 33, 36, 38, 40,..., 66
- the check is (DCT2, DST7) (the first ellipsis represents an odd number between 7 and 33, and the second ellipsis represents an even number between 40 and 66).
- the mode number is (B+1), (B+3),..., 34, 3, 5,..., B, 35, 37
- the transformation check corresponding to the intra prediction mode information of 39,..., 65 is (DST7, DCT2) (the first ellipsis represents an even number between (B+3) and 34, and the second ellipsis represents an even number between 5 and B. Odd number, the third ellipsis indicates an odd number between 39 and 65).
- the mode number is B+2, B+4,..., 33, 2, 4,..., (B-1), 36, 38, ...
- the transformation check corresponding to the 66 intra-frame prediction mode information is (DCT2, DST7) (the first ellipsis indicates an odd number between (B+4) and 33, and the second ellipsis indicates a number from 4 to (B-1).
- the third ellipsis indicates an odd number between 38 and 66).
- the mode number is 2, 4, 6, ..., 34, (B+1), (B+3), ..., 66, 35
- the transform check corresponding to the intra prediction mode information of 37, 39,..., (B-2) is (DST7, DCT2) (the first ellipsis indicates an even number between 6 and 34, and the second ellipsis indicates (B+3 ) To 66, and the third ellipsis indicates an odd number from 39 to (B-2)).
- the mode number is 3, 5,..., 33, B, (B+2),..., 65, 36, 38,..., (B).
- the transform check corresponding to the intra prediction mode information of -1) is (DCT2, DST7) (the first ellipsis represents an odd number between 5 and 33, and the second ellipsis represents an odd number between (B+2) and 65.
- the third ellipsis indicates an even number between 38 and (B-1)).
- the range of intra prediction mode information includes intra prediction mode information with mode numbers of 0, 1, 3, 65, and odd numbers between 3 and 65; as shown in Table 19, the width of the current block is represented by W , The height of the current block is represented by H.
- the transformation check corresponding to the intra prediction mode information of the mode number 2, 4, 6, ..., 34 is (DST7, DCT2) (ellipsis indicates An even number between 6 and 34).
- the transform check corresponding to the intra prediction mode information of the mode number 36, 38, 40, ..., 66 is (DCT2, DST7) (the ellipsis indicates An even number between 40 and 66).
- the transformation check corresponding to the intra prediction mode information of the mode number B+1, B+3,...,34 is (DST7, DCT2) ( The ellipsis indicates an even number between (B+3) and 34).
- the check is (DCT2, DST7) (the first ellipsis represents an even number between 38 and 66, and the second ellipsis represents an even number between 4 and (B-1).
- the intra prediction mode information of the mode number 2, 4, 6, ..., 34, B+1, B+3, ..., 66 corresponds to
- the conversion check for is (DST7, DCT2) (the first ellipsis represents an even number between 6 and 34, and the second ellipsis represents an even number between (B+3) and 66).
- the transform check corresponding to the intra prediction mode information of the mode number 36, 38,..., (B-1) is (DCT2, DST7) ( The ellipsis indicates an even number between 38 and (B-1)).
- Table 16 to Table 19 take into account the influence of the intra prediction mode information being the wide angle mode, and the B of the wide angle mode is determined by the ratio of the width and height of the current block.
- the encoding process can be as follows:
- Step 1301 The encoding terminal obtains the residual data of the current block.
- the encoding end when the encoding end encodes the video data, it first performs intra-frame prediction to obtain residual data (the method of obtaining residual data is consistent with the existing video coding standards, and will not be repeated), and then the residual The data is the residual data of the current block to be processed.
- Step 1302 If the current block meets the sub-block division condition and the intra-frame sub-block division is started, the encoding end determines the intra-frame prediction mode information of each sub-block of the current block and each sub-block of the current block according to the sub-block division information of the current block. The size information of the block.
- the sub-block division information is used to indicate how to divide the current block. For example, for an 8*4 current block, it may be horizontally divided into two 8*2 sub-blocks.
- the encoding end after the encoding end obtains the residual data of the current block, it can determine whether the current block meets the sub-block division condition, and if it is determined that the current block meets the sub-block division condition, it can determine whether to enable intra-frame sub-block division. If the intra-frame sub-block division switch is turned on, it means that intra-frame sub-block division is enabled, the current block can be divided, and the height and width of each sub-block obtained by dividing the current block can be determined.
- the width of the current block refers to the number of pixels included in the width direction of the current block, and the height of the current block refers to the number of pixels included in the height direction of the current block, so that the size information of the sub-block can be obtained. Among them, for a current block of MxN, M represents the width of the current block, and N represents the height of the current block.
- the content of the identification bit can be obtained from the identification bit used to indicate the intra prediction mode information from the encoded data of the current block, that is, the intra prediction mode information of the current block can be obtained.
- the sub-block division condition is that the current block is a luminance block, the height and width of the current block are both less than or equal to the first preset value, and the current block is a single-line reference during intra-frame prediction. , The number of pixels contained in the current block is greater than the second preset value.
- the first preset value can be preset and stored in the encoding end (the same as the third value mentioned above).
- the first preset value can be 64.
- the current block is a single-line reference when performing intra-frame prediction. When the current block performs intra-frame prediction, only one line is referenced.
- the second preset value can be preset and stored in the encoding end.
- the second preset value can be 16 (the same as the fourth value mentioned above).
- Step 1303 For each sub-block, the encoding end determines the transformation check of the sub-block according to the size information of the sub-block and the intra-frame prediction mode information of the sub-block; wherein, for each sub-block, according to the size information of the sub-block and the intra-frame of the sub-block Prediction mode information, determining the transformation check of the sub-block, including: for each sub-block, if it is determined that the sub-block does not meet the size restriction condition according to the size information of the sub-block, then the transformation check corresponding to the intra-prediction mode information of the sub-block is determined
- the size restriction condition is that the width is not within the first preset range and the height is not within the second preset range.
- step 1303 is completely the same as the process of step 1203, and will not be repeated here.
- the encoding end determines the transformation check process of the sub-block according to the size information of the sub-block and the intra-frame prediction mode information of the sub-block.
- the decoding end in the embodiment shown in FIG. 12 is based on the size information of the sub-block and the sub-block.
- the intra-frame prediction mode information and the process of determining the transformation and checking of the sub-block are completely the same. You can refer to the process of FIG. 12, which will not be repeated here.
- Step 1304 The encoding end performs transformation on the residual data of each sub-block according to the transformation check of each sub-block.
- the sub-block can be transformed based on the transform check corresponding to the sub-block to obtain the transform coefficient corresponding to the sub-block, and then the The transform coefficient is quantized to obtain the quantized coefficient, and the quantized coefficient is subjected to entropy coding processing to obtain the coded data corresponding to the sub-block.
- each sub-block the coded data corresponding to the current block can be obtained, and the coding process of the current block is completed.
- Each current block is processed in accordance with the process shown in Figure 13, and a whole segment of video data can be encoded.
- the encoding end can obtain the sub-block division information corresponding to the current block, and then add the sub-block division information to the encoding data of the current block, so that the subsequent decoding end can start from the current block. From the coded data of the block, the sub-block division information corresponding to the current block is obtained and decoded.
- the encoder can use the RDO criterion to determine the intra prediction mode information of the current block.
- the process can be as follows:
- code rate and PSNR (Peak Signal to Noise Ratio, peak signal-to-noise ratio).
- PSNR Peak Signal to Noise Ratio, peak signal-to-noise ratio
- the rate-distortion cost corresponding to the mode: J(mode) D+ ⁇ *R.
- D stands for Distortion (distortion), usually measured by SSE (Sum of Squares Error, sum variance) index.
- SSE refers to the sum of squared differences between the reconstructed block and the source image
- ⁇ is the Lagrangian multiplier
- R It is the actual number of bits required for image block coding in this mode, including the sum of bits required for coding mode information, motion information, residuals, etc.
- the encoding end can use each intra prediction mode information to perform intra prediction to obtain different residuals (which can be considered as the current block), and then use the transformation check corresponding to each intra prediction mode information to transform, then quantize, and then Entropy coding is performed, and then decoding processing is performed, and then the intra prediction mode information with the least rate-distortion cost is selected and determined as the intra prediction mode information corresponding to the current block. In this way, the intra prediction mode information corresponding to the current block can be determined.
- the mode number of the intra-frame prediction mode information can be added to subsequent coded data for processing the current block.
- the divided sub-blocks share the intra prediction mode information of the current block.
- the encoder can divide a current block horizontally or vertically into several small sub-blocks. For example, for a 16x8 current block, it can be divided into 4 16x2 sub-blocks horizontally or vertically into 4 4x8 sub-blocks. Sub-block. However, a 4x8 block can be divided into 2 4x4 blocks or 2 2x8 sub-blocks. It can be noted that the number of sub-blocks can be only 2 (for 4x8, 8x4 sub-blocks). And the sub-block contains at least 16 pixels, so the 4x4 block will not be divided again, and there is no need to make corresponding grammar declarations on the encoding and decoding ends.
- the specific division rules are shown in Table 3 in the embodiment shown in FIG. 9.
- the divided intra sub-blocks share the intra prediction mode of the current block (that is, the sub-blocks obtained by dividing the current block are the same as the intra prediction mode of the current block).
- the process of using RDO criteria to determine sub-block division information can be as follows:
- the intra prediction mode of the current block and the size information of the sub-blocks can be used directly to determine the transformation check corresponding to each sub-block. Based on the determined transformation check, the encoding process is performed.
- the intra prediction mode of the current block and the size information of the sub-blocks of each sub-block are used to determine the transform check, instead of using the same transform check for all sub-blocks, the coding and decoding performance can be improved.
- the selection of transformation check based on the intra-frame prediction mode can save the selection time of the transformation check and further improve the coding and decoding performance.
- each sub-block of the current block is uniformly entropy decoded in the order from top to bottom to obtain the Quantization coefficient. Then, in the order from top to bottom, inverse quantization and inverse transformation are performed on each sub-block of the current block to obtain the residual data of each sub-block.
- the pixel value of the pixel constructs the prediction signal of each sub-block according to the intra-frame prediction mode used during encoding, obtains the prediction signal of each sub-block, and adds the residual data of each sub-block to the prediction signal to obtain the prediction signal of each sub-block
- the reconstruction information is to merge the reconstruction information of each sub-block to obtain the reconstruction information corresponding to the current block.
- each sub-block of the current block is uniformly entropy decoded to obtain the quantized coefficient of each sub-block, and then the current block is determined in the order from left to right. Inverse quantization and inverse transformation are performed on each sub-block to obtain the residual data of each sub-block. Finally, in the order from left to right, the pixel values of the pixels in the reconstructed area around the current sub-block are used in accordance with the encoding used
- the intra prediction mode constructs the prediction signal of each sub-block, obtains the preset signal of each sub-block, adds the residual data of each sub-block to the prediction signal, and obtains the reconstruction information of each sub-block. Merge, you can get the reconstruction information corresponding to the current block.
- the sub-blocks in the first row of the current block are respectively predicted, transformed, quantized, and entropy encoded in the order of rows.
- the sub-blocks of the second row are respectively predicted, transformed, quantized, and entropy coded in the order of the rows, and the third sub-block, the fourth sub-block, etc. are processed sequentially from top to bottom.
- the reason for encoding in this way is that the reference pixels of the intra prediction of the next sub-block depend on the reconstruction information of the previous sub-block, so when the next sub-block is predicted, the previous sub-block has already been predicted and transformed.
- the process of quantization and entropy coding obtains the reconstruction information.
- the current block is divided vertically, first perform prediction, transformation, quantization, and entropy coding on the first sub-block on the far left of the current block in the order of columns, and then perform the prediction, transformation, quantization, and entropy coding on the sub-blocks in the second column from the left in the order of columns Carry out prediction, transformation, quantization and entropy coding respectively, and process the third sub-block and the fourth sub-block from left to right in turn.
- the reason for encoding in this way is that the reference pixels of the intra-frame prediction of the right sub-block depend on the reconstruction information of the previous sub-block, so when the right sub-block is being predicted, the left sub-block has already been predicted and transformed.
- the process of quantization and entropy coding obtains the reconstruction information.
- the encoding end embodiments shown in FIG. 10 and FIG. 13 are all improvements to the transformation step.
- the entire current block is used for intra prediction, and after the residual data is obtained, The current block is divided into sub-blocks, and the residual data of each sub-block is transformed.
- it is directly divided into sub-blocks for intra-frame prediction, the residual data of each sub-block is obtained, and the residual data of each sub-block is transformed.
- the encoding terminal of the foregoing embodiment of the present disclosure can be applied to the foregoing two methods.
- the same understanding of the inverse transformation processing of the code end can also be applied to the above two methods.
- the activation of intra-frame sub-block division refers to activation of the intra-frame sub-block division mode.
- the sub-block division information may be a sub-block division manner, that is, a sub-block division manner determined in the candidate sub-block division supported by the current block.
- the above sub-block division information may also not be added to the encoded data, that is, it does not occupy flag bits. For example, when only horizontal division is enabled, when the decoder determines to perform sub-block division, it determines to perform horizontal division. Similarly, when only vertical division is enabled, Then the decoding end determines to perform sub-block partitioning, and then determines to perform vertical partitioning. Only when both horizontal partitioning and vertical partitioning are enabled, an additional indication will be given in the encoded data, which can save network resources.
- the embodiments of the present disclosure also provide a decoding end.
- the decoding end includes:
- the obtaining module 1410 is used to obtain the coded data of the current block
- the determination module 1420 is used to:
- the size of each sub-block is determined according to the sub-block division information of the current block Information and shape information;
- each sub-block determine the transformation check corresponding to the sub-block according to the size information and shape information of the sub-block;
- the transformation module 1430 is configured to perform inverse transformation on the dequantized data of each sub-block according to the transformation check of each sub-block;
- the determining module 1420 is used for:
- DST7 is determined as the vertical transformation core in the transformation check of the sub-block.
- the determining module 1420 is further used for
- DCT2 determines the horizontal transformation core in the transformation check of the sub-block
- DCT2 is determined as the vertical transformation core in the transformation check of the sub-block.
- the first size restriction condition and the second size restriction condition are greater than or equal to a first value and less than or equal to a second value; the first condition is width Is less than or equal to the height, and the second condition is that the width is greater than or equal to the height; or,
- the first size restriction condition and the second size restriction condition are greater than or equal to a first value and less than or equal to a second value; the first condition is that the width is less than the height, and the second condition is that the width is greater than the height .
- the sub-block division condition is that the current block is a luminance block, the height and width of the current block are both less than or equal to a third value, and the current block is in frame
- the intra prediction is a single-line reference, and the number of pixels included in the current block is greater than the fourth value.
- the embodiments of the present disclosure also provide an encoding terminal.
- the encoding terminal includes:
- the obtaining module 1510 is used to obtain residual data of the current block
- the determination module 1520 is used to:
- the current block satisfies the sub-block division condition and the intra-frame sub-block division is initiated, determine the size information and shape information of each sub-block of the current block according to the sub-block division information of the current block;
- each sub-block determine the transformation check corresponding to the sub-block according to the size information and shape information of the sub-block;
- the transformation module 1530 is configured to transform the residual data of each sub-block according to the transformation check of each sub-block;
- the determining module 1520 is used for:
- DST7 is determined as the vertical transformation core in the transformation check of the sub-block.
- the obtaining module 1510 is further configured to:
- the size information and shape information of each sub-block of the current block can be directly used to determine the transformation check corresponding to each sub-block, and based on the determined transformation check, the encoding process is performed.
- the size information and shape information of each sub-block of the current block can also be used directly to determine the transformation check corresponding to each sub-block, and the decoding process is performed based on the determined transformation check. In this way, since the size information and shape information of the sub-blocks are used to determine the transformation check, instead of using the same transformation check for each sub-block, the coding and decoding performance can be improved. And when exporting the transformation check, only the height and width are used, the export process is relatively simple, and the codec performance can be further improved.
- the embodiments of the present disclosure also provide a decoding terminal.
- the decoding terminal includes:
- the obtaining module 1610 is used to obtain the coded data of the current block
- the determination module 1620 is used for:
- the size of each sub-block is determined according to the sub-block division information of the current block Information, and determine the intra prediction mode information of each sub-block;
- For each sub-block determine the transformation check of the sub-block according to the size information of the sub-block and the intra prediction mode information of the sub-block;
- the transformation module 1630 is configured to perform inverse transformation on the inverse-quantized data of each sub-block according to the transformation check of each sub-block;
- the determining module 1620 is used for:
- the transform check corresponding to the intra-frame prediction mode information of the sub-block is determined as the transform of the sub-block Check, wherein the size restriction condition is that the width is not within the preset numerical range, and the height is not within the preset numerical range.
- the determining module 1620 is further configured to:
- DCT2 is determined as the transformation check of the sub-block And determining the horizontal transformation kernel in the transformation check corresponding to the intra prediction mode information of the sub-block as the horizontal transformation kernel in the transformation check of the sub-block;
- DCT2 is determined as the horizontal transformation core in the transformation check of the sub-block Determining the vertical transformation kernel in the transformation check corresponding to the intra prediction mode information of the sub-block as the vertical transformation kernel in the transformation check of the sub-block;
- DCT2 is determined as the horizontal transform core and the vertical transform core in the transform check of the sub-block.
- the determining module 1620 is configured to:
- the transform check of the sub-block is (DCT2, DCT2)
- the transform check of the sub-block is (DST7, DST7)
- the transform check of the sub-block is (DST7, DCT8 );
- the transform check of the sub-block is (DCT8, DST7 ).
- the determining module 1620 is configured to:
- the transform check of the sub-block is the first transform check
- the transformation check of the sub-block is the second transformation check
- the transform check of the sub-block is the third transform check ;
- the transform check of the sub-block is the fourth transform check .
- the determining module 1620 is configured to:
- the transform check of the sub-block is the first transform check
- the transform check of the sub-block is the second transform check
- the transform check of the sub-block is the third transform check ;
- the transform check of the sub-block is the fourth transform check .
- the determining module 1620 is configured to:
- the transform check of the sub-block is the first transform check
- the transform check of the sub-block is the second transform check
- the transform check of the sub-block is the third transform check
- the transform check of the sub-block is the fourth transform check.
- the first transformation check is (DCT2, DCT2)
- the second transformation check is (DST7, DST7)
- the third transformation check is (DST7, DCT2)
- the fourth transformation check is (DCT2, DST7); or,
- the first conversion check is (DCT2, DCT2)
- the second conversion check is (DST7, DST7)
- the third conversion check is (DST7, DCT8)
- the fourth conversion check is (DCT8, DST7).
- the determining module 1620 is configured to:
- the intra-prediction mode information For each sub-block, if it is determined that the sub-block does not meet the size restriction condition according to the size information of the sub-block, and the intra-prediction mode information meets the intra-prediction mode range, then the intra-prediction mode information The corresponding transformation check is determined as the transformation check of the sub-block.
- the determining module 1620 is further configured to:
- the size of the sub-block Information For each sub-block, if it is determined according to the size information of the sub-block that the sub-block does not meet the size restriction condition and the intra-frame prediction mode information does not satisfy the intra-frame prediction mode range, then according to the size of the sub-block Information to determine the ratio of the width and height of the sub-block;
- the intra-frame prediction mode range includes intra-frame prediction mode information whose mode numbers are 0, 1, 31 to 37;
- the intra-frame prediction mode range includes intra-frame prediction mode information whose mode numbers are 0 and 1.
- the intra prediction mode range includes intra prediction mode information with mode numbers of 0, 1, 3, 65, and odd numbers between 3 and 65.
- the intra-frame prediction mode range includes intra-frame prediction mode information whose mode numbers are 0, 1, 31 to 37;
- the determining module 1620 is also used for:
- the transformation check of the current block is (DST7, DCT2), if the ratio of the width to the height of the current block is equal to 1, and the mode number of the intra prediction mode information is 3, 5, 7 , 29, 7 to 29 are odd numbers, the transformation check of the current block is (DCT2, DST7);
- the transformation check of the current block is (DST7, DCT2), if the current block is The ratio of width to height is greater than 1, and the mode number of the intra prediction mode information is B+2, B+4, 29, 38, 40, 66, 2, 4, (B-1), B+4 to When an odd number in 29, an even number between 40 and 66, and an even number between 4 and (B-1), the transformation check of the current block is (DCT2, DST7);
- the transformation check of the current block is (DST7, DCT2), if the ratio of the width to the height of the current block is less than 1, and the mode number of the intra prediction mode information is 3, 5, 29, B, (B+2), 65, 38, 40, ( B-1), odd numbers between 5 and 29, odd numbers between (B+2) and 65, and even numbers between 40 and (B-1), the transformation check of the current block is (DCT2, DST7 );
- the intra-frame prediction mode range includes intra-frame prediction mode information whose mode numbers are 0 and 1.
- the determining module 1620 is also used for:
- the ratio of the width to the height of the current block is equal to 1, and the mode number of the intra prediction mode information is among 2, 4, 6, 34, 35, 37, 39, 41, 43, 65, 6 to 34
- the current block’s transformation check is (DST7, DCT2), if the ratio between the width and the height of the current block is equal to 1, and the intra prediction mode information is When the mode number is 3, 5, 7, 33, 36, 38, 40, 66, odd numbers between 7 and 33, and even numbers between 40 and 66, the transformation check of the current block is (DCT2, DST7);
- the transformation check of the current block is (DST7, DCT2), if the current The ratio of the width to the height of the block is greater than 1, and the mode numbers of the intra prediction mode information are (B+2), (B+4), 33, 2, 4, (B-1), 36, 38, 66.
- the transformation check of the current block is (DCT2, DST7);
- the transformation of the current block is checked Is (DST7, DCT2), if the ratio of the width to the height of the current block is less than 1, and the mode number of the intra prediction mode information is 3, 5, 33, B, (B+2), 65, 36 , 38, (B-1), odd numbers between 5 and 33, odd numbers between (B+2) and 65, and even numbers between 38 and (B-1), the conversion check of the current block is (DCT2, DST7);
- the intra prediction mode range includes intra prediction mode information with mode numbers of 0, 1, 3, 65, and odd numbers between 3 and 65;
- the determining module 1620 is also used for:
- the transformation of the current block is checked Is (DST7, DCT2), if the ratio of the width to the height of the current block is equal to 1, and the mode number of the intra prediction mode information is an even number between 36, 38, 40, 66, 40 to 66,
- the transformation check of the current block is (DCT2, DST7);
- the transform check of the current block is (DST7, DCT2), if the ratio of the width to the height of the current block is greater than 1, and the mode number of the intra prediction mode information is 36, 38, 66, 2 , 4, (B-1), an even number before 38 to 66, and an even number between 4 and (B-1), the transformation check of the current block is (DCT2, DST7);
- the transformation check of the current block is (DST7, DCT2), if the ratio of the width to the height of the current block is less than 1, and the When the mode number of the intra prediction mode information is an even number between 36, 38, (B-1), 38 to (B-1), the transform check of the current block is (DCT2, DST7);
- the determining module 1620 is further configured to:
- the transformation check of the current block is determined according to the size information and the intra prediction mode information of the current block.
- the determining module 1620 is further configured to:
- the transformation check corresponding to the intra prediction mode information is determined as the transformation check of the current block, wherein the target size restriction condition is The width is greater than or equal to the target value, and the height is greater than or equal to the target value;
- DCT2 is determined as the transformation check of the current block And determining the horizontal transformation kernel in the transformation check corresponding to the intra prediction mode information as the horizontal transformation kernel in the transformation check of the current block;
- DCT2 the level in the transformation check of the current block Transform core, and determine the vertical transform core in the transform check corresponding to the intra prediction mode information as the vertical transform core in the transform check of the current block;
- DCT2 is determined as the horizontal transformation core and the vertical transformation core in the transformation check of the current block.
- the sub-block division condition is that the current block is a luminance block, the height and width of the current block are both less than or equal to a first preset value, and the current block is The intra-frame prediction is a single-line reference, and the number of pixels included in the current block is greater than the second preset value.
- the embodiments of the present disclosure also provide an encoding terminal.
- the encoding terminal includes:
- the obtaining module 1710 is used to obtain residual data of the current block
- the determination module 1720 is used to:
- the intra-frame prediction mode information of each sub-block of the current block and the current block are determined according to the sub-block division information of the current block.
- For each sub-block determine the transformation check of the sub-block according to the size information of the sub-block and the intra prediction mode information of the sub-block;
- the transformation module 1730 is configured to transform the residual data of each sub-block according to the transformation check of each sub-block;
- the determining module 1720 is used for:
- the transform check corresponding to the intra-frame prediction mode information of the sub-block is determined as the transform of the sub-block Check, wherein the size restriction condition is that the width is not within the first preset range, and the height is not within the second preset range.
- the obtaining module 1710 is further configured to:
- the intra prediction mode of the current block and the size information of the sub-blocks can be used directly to determine the transformation check corresponding to each sub-block. Based on the determined transformation check, the encoding process is performed.
- the intra prediction mode of the current block and the size information of the sub-blocks of each sub-block are used to determine the transform check, instead of using the same transform check for each sub-block, the coding and decoding performance can be improved.
- the selection of transformation check based on the intra-frame prediction mode can save the selection time of the transformation check and further improve the coding and decoding performance.
- the decoding terminal provided in the above embodiment performs decoding
- only the division of the above functional modules is used as an example.
- the above functions can be allocated by different functional modules as needed, that is, decoding
- the internal structure of the terminal is divided into different functional modules to complete all or part of the functions described above.
- the decoding terminal provided in the foregoing embodiment and the method embodiment for decoding belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.
- the encoding terminal provided in the above embodiment performs encoding
- only the division of the above functional modules is used as an example.
- the above functions can be allocated by different functional modules as needed, that is, encoding
- the internal structure of the terminal is divided into different functional modules to complete all or part of the functions described above.
- the encoding terminal provided in the foregoing embodiment and the encoding method embodiment belong to the same concept. For the specific implementation process, please refer to the method embodiment, which will not be repeated here.
- FIG. 18 is a schematic structural diagram of an encoding terminal provided by an embodiment of the present invention.
- the encoding terminal 1800 may have relatively large differences due to different configurations or performance, and may include one or more processors (central processing units, CPU) 1801 and One or more memories 1802, wherein the memory 1802 stores at least one instruction, and the at least one instruction is loaded and executed by the processor 1801 to implement the steps of the encoding method described above.
- processors central processing units, CPU
- memories 1802 wherein the memory 1802 stores at least one instruction, and the at least one instruction is loaded and executed by the processor 1801 to implement the steps of the encoding method described above.
- FIG. 19 is a schematic structural diagram of a decoding terminal provided by an embodiment of the present invention.
- the decoding terminal 1900 may have relatively large differences due to different configurations or performance, and may include one or more processors 1901 and one or more memories 1902 , Wherein at least one instruction is stored in the memory 1902, and the at least one instruction is loaded and executed by the processor 1901 to implement the steps of the foregoing decoding method.
- the embodiments of the present disclosure also provide a computer-readable storage medium in which a computer program is stored, and when the computer program is executed by a processor, the above-mentioned method steps of encoding and decoding are realized.
- the embodiment of the present disclosure also provides an encoding terminal, including a processor and a memory, wherein the memory is used to store a computer program; the processor is used to execute the program stored in the memory to implement the foregoing The method steps for encoding.
- the embodiment of the present disclosure also provides a decoding terminal, including a processor and a memory, wherein the memory is used to store a computer program; the processor is used to execute the program stored in the memory to realize the above Describe the method steps for decoding.
- the embodiments of the present disclosure also provide an encoding and decoding system.
- the system includes an encoding end and a decoding end, wherein:
- the encoding end is an encoding end that performs encoding processing as described above;
- the decoding end is the decoding end that performs decoding processing as described above.
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Physics & Mathematics (AREA)
- Discrete Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Compression Or Coding Systems Of Tv Signals (AREA)
Abstract
本公开提供了一种进行编码和解码的方法、编码端、解码端和系统,属于音视频技术领域。所述方法包括:解码端可以获取当前块的编码数据,如果当前块满足子块划分条件,且根据当前块的编码数据确定当前块启动帧内子块划分,则根据当前块的子块划分信息,确定各个子块的尺寸信息和形状信息;针对每个子块,如果子块的宽度满足第一尺寸限制条件且形状满足第一条件,则将DST7确定为子块的变换核对中的水平变换核;如果子块的高度满足第二尺寸限制条件且形状满足第二条件,则将DST7确定为子块的变换核对中的垂直变换核,根据各个子块的变换核对,对各个子块反量化后的数据进行反变换。采用本公开,可以提升编解码性能。
Description
本申请要求于2019年03月09日提交的申请号为201910177528.9、发明名称为“进行编码和解码的方法、编码端、解码端和系统”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
本公开涉及音视频技术领域,特别涉及一种进行编码和解码的方法、编码端和解码端。
随着互联网技术和计算机技术的发展,视频应用程序越来越多,用户对视频应用程序中高清视频的需求越来越大,但是由于高清视频的数据量比较大,想要高清视频在有限的网络带宽中传输,需要对高清视频进行编码处理。一般编码处理包括:帧内预测(或帧间预测)、变换、量化、熵编码、环内滤波等环节。在进行编码处理时,如果当前块满足帧内子块划分条件,也可以对当前块的各个子块分别进行预测、变换、量化和熵编码。编码端通过RDO(Rate Distortion Optimization,率失真优化)准则来决定是基于当前块还是基于当前块的子块进行预测、变换、量化和熵编码。
相关技术中,在变换时,通常是选择某个预设变换核对(变换核对是由水平变换核和垂直变换核组成的变换核对),对当前块划分得到的子块进行变换处理,得到变换系数。相应的,解码端在变换对应的逆变换,也是选择编码时使用的预设变换核对,对当前块划分得到的子块进行逆变换处理,得到子块对应的残差数据。
这样,由于同一子块采用不同的变换核对进行变换,压缩效果大不相同,所以使用同一个预设变换核对,对所有子块进行变换处理,有可能会导致编解码性能较差。
发明内容
为了解决相关技术的问题,本公开实施例提供了一种进行编码和解码的方法、编码端、解码端和系统。所述技术方案如下:
第一方面,提供了一种进行解码的方法,所述方法包括:
获取当前块的编码数据;
如果所述当前块满足子块划分条件,且根据所述当前块的编码数据,确定所述当前块启动帧内子块划分,则根据所述当前块的子块划分信息,确定各个子块的尺寸信息和形状信息;
针对每个子块,根据所述子块的尺寸信息和形状信息,确定所述子块对应的变换核对;
根据各个子块的变换核对,对所述各个子块反量化后的数据进行反变换;
其中,针对每个子块,根据所述子块的尺寸信息和形状信息,确定所述子块对应的变换核对,包括:
如果所述子块的宽度满足第一尺寸限制条件且形状满足第一条件,则将DST7确定为所述子块的变换核对中的水平变换核;
如果所述子块的高度满足第二尺寸限制条件且形状满足第二条件,则将DST7确定为所述子块的变换核对中的垂直变换核。
在本公开的一种可能的实施方式中,所述针对每个子块,根据所述子块的尺寸信息和形状信息,确定所述子块对应的变换核对,还包括:
如果所述子块的宽度不满足所述第一尺寸限制条件和/或形状不满足所述第一条件,则将DCT2确定为所述子块的变换核对中的水平变换核;
如果所述子块的高度不满足所述第二尺寸限制条件和/或形状不满足所述第二条件,则将DCT2确定为所述子块的变换核对中的垂直变换核。
在本公开的一种可能的实施方式中,所述第一尺寸限制条件和所述第二尺寸限制条件为大于或等于第一数值,且小于或等于第二数值;所述第一条件为宽度小于或等于高度,所述第二条件为宽度大于或等于高度;或者,
所述第一尺寸限制条件和所述第二尺寸限制条件为大于或等于第一数值,且小于或等于第二数值;所述第一条件为宽度小于高度,所述第二条件为宽度大于高度。
在本公开的一种可能的实施方式中,所述子块划分条件为所述当前块为亮度块、所述当前块的高度和宽度均小于或等于第三数值,所述当前块在进行帧内预测时为单行参考、所述当前块包含的像素点的数目大于第四数值。
第二方面,提供了一种进行编码的方法,所述方法包括:
获取当前块的残差数据;
如果所述当前块满足子块划分条件,且启动帧内子块划分,则根据所述当前块的子块划分信息,确定所述当前块的各个子块的尺寸信息和形状信息;
针对每个子块,根据所述子块的尺寸信息和形状信息,确定所述子块对应的变换核对;
根据各个子块的变换核对,对所述各个子块的残差数据进行变换;
其中,针对每个子块,根据所述子块的尺寸信息和形状信息,确定所述子块对应的变换核对,包括:
如果所述子块的宽度满足第一尺寸限制条件且形状满足第一条件,将DST7确定为所述子块的变换核对中的水平变换核;
如果所述子块的高度满足第二尺寸限制条件且形状满足第二条件,将DST7确定为所述子块的变换核对中的垂直变换核。
在本公开的一种可能的实施方式中,所述方法还包括:
如果所述当前块满足子块划分条件,则获取所述当前块对应的子块划分信息;
将所述子块划分信息添加至所述当前块的编码数据中。
第三方面,提供了一种进行解码的方法,所述方法包括:
获取当前块的编码数据;
如果所述当前块满足子块划分条件,且根据所述当前块的编码数据,确定所述当前块启动帧内子块划分,则根据所述当前块的子块划分信息,确定各个子块的尺寸信息,并确定所述各个子块的帧内预测模式信息;
针对每个子块,根据所述子块的尺寸信息和所述子块的帧内预测模式信息,确定所述子块的变换核对;
根据各个子块的变换核对,对所述各个子块反量化后的数据进行反变换;
其中,所述针对每个子块,根据所述子块的尺寸信息和所述子块的帧内预测模式信息, 确定所述子块的变换核对,包括:
针对每个子块,如果根据所述子块的尺寸信息,确定所述子块不满足尺寸限制条件,则将所述子块的帧内预测模式信息对应的变换核对确定为所述子块的变换核对,其中,所述尺寸限制条件是宽度不在预设数值范围内,且高度不在所述预设数值范围内。
在本公开的一种可能的实施方式中,所述针对每个子块,根据所述子块的尺寸信息和所述子块的帧内预测模式信息,确定所述子块的变换核对,还包括:
如果根据所述子块的尺寸信息确定所述子块的高度满足所述尺寸限制条件且所述子块的宽度不满足所述尺寸限制条件,则将DCT2确定为所述子块的变换核对中的垂直变换核,并将所述子块的帧内预测模式信息对应的变换核对中的水平变换核确定为所述子块的变换核对中的水平变换核;
如果根据子块的尺寸信息确定子块的宽度满足所述尺寸限制条件且所述子块的高度不满足所述尺寸限制条件,则将DCT2确定为所述子块的变换核对中的水平变换核,将所述子块的帧内预测模式信息对应的变换核对中的垂直变换核确定为所述子块的变换核对中的垂直变换核;
如果根据子块的尺寸信息确定子块的宽度和宽度满足所述尺寸限制条件,则将DCT2确定为所述子块的变换核对中的水平变换核和垂直变换核。
在本公开的一种可能的实施方式中,将所述子块的帧内预测模式信息对应的变换核对确定为所述子块的变换核对,包括:
如果所述子块的帧内预测模式信息的模式号为1、33、35,则所述子块的变换核对为(DCT2,DCT2);
如果所述子块的帧内预测模式信息的模式号为0、31、32、34、36、37,则所述子块的变换核对为(DST7,DST7);
如果所述子块的帧内预测模式信息的模式号为2、30、2至30中的偶数、39、65和39至65中的奇数,则所述子块的变换核对为(DST7,DCT8);
如果所述子块的帧内预测模式信息的模式号为3、29、3至29中的奇数、38、66和38至66中的偶数,则所述子块的变换核对为(DCT8,DST7)。
在本公开的一种可能的实施方式中,将所述子块的帧内预测模式信息对应的变换核对确定为所述子块的变换核对,包括:
如果所述子块的帧内预测模式信息的模式号为1,则所述子块的变换核对为第一变换核对;
如果所述子块的帧内预测模式信息的模式号为0、31、32、33、34、35、36、37,则所述子块的变换核对为第二变换核对;
如果所述子块的帧内预测模式信息的模式号为2、30、2至30中的偶数、39、65和39至65中的奇数,则所述子块的变换核对为第三变换核对;
如果所述子块的帧内预测模式信息的模式号为3、29、3至29中的奇数、38、66和38至66中的偶数,则所述子块的变换核对为第四变换核对。
在本公开的一种可能的实施方式中,将所述子块的帧内预测模式信息对应的变换核对确定为所述子块的变换核对,包括:
如果所述子块的帧内预测模式信息的模式号为1,则所述子块的变换核对为第一变换核对;
如果所述子块的帧内预测模式信息的模式号为0,则所述子块的变换核对为第二变换核对;
如果所述子块的帧内预测模式信息的模式号为2、34、2至34中的偶数、35、65和35至65中的奇数,则所述子块的变换核对为第三变换核对;
如果所述子块的帧内预测模式信息的模式号为3、33、3至33中的奇数、36、66和36至66中的偶数,则所述子块的变换核对为第四变换核对。
在本公开的一种可能的实施方式中,将所述子块的帧内预测模式信息对应的变换核对确定为所述子块的变换核对,包括:
如果所述子块的帧内预测模式信息的模式号为1,则所述子块的变换核对为第一变换核对;
如果所述子块的帧内预测模式信息的模式号为0、3、65和3至65中的奇数,则所述子块的变换核对为第二变换核对;
如果所述子块的帧内预测模式信息的模式号为2、34、2至34中的偶数,则所述子块的变换核对为第三变换核对;
如果所述子块的帧内预测模式信息的模式号为36、66和36至66中的偶数,则所述子块的变换核对为第四变换核对。
在本公开的一种可能的实施方式中,所述第一变换核对为(DCT2,DCT2),所述第二变换核对为(DST7,DST7),所述第三变换核对为(DST7,DCT2),所述第四变换核对为(DCT2,DST7);或者,
所述第一变换核对为(DCT2,DCT2),所述第二变换核对为(DST7,DST7),所述第三变换核对为(DST7,DCT8),所述第四变换核对为(DCT8,DST7)。
在本公开的一种可能的实施方式中,所述针对每个子块,如果根据所述子块的尺寸信息,确定所述子块不满足尺寸限制条件,则将所述子块的帧内预测模式信息对应的变换核对确定为所述子块的变换核对,包括:
针对每个子块,如果根据所述子块的尺寸信息,确定所述子块不满足尺寸限制条件,且所述帧内预测模式信息满足帧内预测模式范围,则将所述帧内预测模式信息对应的变换核对确定为所述子块的变换核对。
在本公开的一种可能的实施方式中,所述方法还包括:
针对每个子块,如果根据所述子块的尺寸信息,确定所述子块不满足尺寸限制条件,且所述帧内预测模式信息不满足帧内预测模式范围,则根据所述子块的尺寸信息,确定所述子块的宽度和高度的比值;
根据所述子块的宽度和高度的比值、所述子块的帧内预测模式信息,确定所述子块的变换核对。
在本公开的一种可能的实施方式中,所述帧内预测模式范围包括模式号是0、1、31至37的帧内预测模式信息;
或者,所述帧内预测模式范围包括模式号是0和1的帧内预测模式信息;
或者,所述帧内预测模式范围包括模式号为0、1、3、65以及3至65中间的奇数的帧内预测模式信息。
在本公开的一种可能的实施方式中,所述帧内预测模式范围包括模式号是0、1、31至37的帧内预测模式信息;
所述根据所述子块的宽度和高度的比值、所述子块的帧内预测模式信息,确定所述子块的变换核对,包括:
如果所述当前块的宽度和高度的比值等于1,且所述帧内预测模式信息的模式号为2、4、6、30、39、41、43、65、6至30中的偶数、43至65中的奇数时,所述当前块的变换核对为(DST7,DCT2),如果当前块的宽度和高度的比值等于1,且所述帧内预测模式信息的模式号为3、5、7、29、7至29中的奇数时,所述当前块的变换核对为(DCT2,DST7);
如果所述当前块的宽度和高度的比值大于1,且所述帧内预测模式信息的模式号为(B+1)、(B+3)、30、3、5、B、39、41、43、65、(B+3)至30中的偶数、5至B中的奇数、43至65中的奇数时,所述当前块的变换核对为(DST7,DCT2),如果所述当前块的宽度和高度的比值大于1,且所述帧内预测模式信息的模式号为B+2、B+4、29、38、40、66、2、4、(B-1)、B+4至29中奇数、40至66之间的偶数、4至(B-1)之间的偶数时,所述当前块的变换核对为(DCT2,DST7);
如果当前块的宽度和高度的比值小于1,且所述帧内预测模式信息的模式号为2、4、6、30、(B+1)、(B+3)、66、39、41、(B-2)、6至30之间的偶数、(B+3)至66之间的偶数、41至(B-2)之间的奇数时,所述当前块的变换核对为(DST7,DCT2),如果所述当前块的宽度和高度的比值小于1,且所述帧内预测模式信息的模式号为3、5、29、B、(B+2)、65、38、40、(B-1)、5至29之间的奇数、(B+2)至65之间的奇数、40至(B-1)之间的偶数时,所述当前块的变换核对为(DCT2,DST7);
其中,当所述当前块的宽度与高度的比值为2、4、8、16时,B分别为7、11、13、15,当所述当前块的宽度与高度的比值为1/2、1/4、1/8、1/16时,B分别为61、57、55、53。
在本公开的一种可能的实施方式中,所述帧内预测模式范围包括模式号是0和1的帧内预测模式信息;
所述根据所述子块的宽度和高度的比值、所述子块的帧内预测模式信息,确定所述子块的变换核对,包括:
如果所述当前块的宽度和高度的比值等于1,且所述帧内预测模式信息的模式号为2、4、6、34、35、37、39、41、43、65、6至34之间的偶数、43至65之间的奇数时,所述当前块的变换核对为(DST7,DCT2),如果所述当前块的宽度和高度的比值等于1,且所述帧内预测模式信息的模式号为3、5、7、33、36、38、40、66、7至33之间的奇数、40至66之间的偶数时,所述当前块的变换核对为(DCT2,DST7);
如果所述当前块的宽度和高度的比值大于1,且所述帧内预测模式信息的模式号为(B+1)、(B+3)、34、3、5、B、35、37、39、65、(B+3)至34之前的偶数、5至B之间的奇数、39至65之间的奇数时,所述当前块的变换核对为(DST7,DCT2),如果所述当前块的宽度和高度的比值大于1,且所述帧内预测模式信息的模式号为(B+2)、(B+4)、33、2、4、(B-1)、36、38、66、(B+4)至33之间的奇数、4至(B-1)之间的偶数、38至66之间的偶数时,所述当前块的变换核对为(DCT2,DST7);
如果所述当前块的宽度和高度的比值小于1,且所述帧内预测模式信息的模式号为2、4、6、34、(B+1)、(B+3)、66、35、37、39、(B-2)、6至34之间的偶数、(B+3)至66之间的奇数、39至(B-2)之间的奇数时,所述当前块的变换核对为(DST7,DCT2),如果所述当前块的宽度和高度的比值小于1,且所述帧内预测模式信息的模式号为3、5、33、B、(B+2)、65、36、38、(B-1)、5至33之间的奇数、(B+2)至65之间的奇数、38至(B-1)之间的偶数时, 所述当前块的变换核对为(DCT2,DST7);
其中,当所述当前块的宽度与高度的比值为2、4、8、16时,B分别为7、11、13、15,当所述当前块的宽度与高度的比值为1/2、1/4、1/8、1/16时,B分别为61、57、55、53。
在本公开的一种可能的实施方式中,所述帧内预测模式范围包括模式号为0、1、3、65以及3至65中间的奇数的帧内预测模式信息;
所述根据所述子块的宽度和高度的比值、所述子块的帧内预测模式信息,确定所述子块的变换核对,包括:
如果所述当前块的宽度和高度的比值等于1,且所述帧内预测模式信息的模式号为2、4、6、34、6至34之间的偶数时,所述当前块的变换核对为(DST7,DCT2),如果所述当前块的宽度和高度的比值等于1,且所述帧内预测模式信息的模式号为36、38、40、66、40至66之间的偶数时,所述当前块的变换核对为(DCT2,DST7);
如果所述当前块的宽度和高度的比值大于1,且所述帧内预测模式信息的模式号为(B+1)、(B+3)、34、(B+3)至34之间的偶数时,所述当前块的变换核对为(DST7,DCT2),如果所述当前块的宽度和高度的比值大于1,且所述帧内预测模式信息的模式号为36、38、66、2、4、(B-1)、38至66之前的偶数、4至(B-1)之间的偶数时,所述当前块的变换核对为(DCT2,DST7);
如果所述当前块的宽度和高度的比值小于1,且所述帧内预测模式信息的模式号为2、4、6、34、(B+1)、(B+3)、66、6至34之间的偶数、(B+3)至66之间的偶数时,所述当前块的变换核对为(DST7,DCT2),如果所述当前块的宽度和高度的比值小于1,且所述帧内预测模式信息的模式号为36、38、(B-1)、38至(B-1)之间的偶数时,所述当前块的变换核对为(DCT2,DST7);
其中,当所述当前块的宽度与高度的比值为2、4、8、16时,B分别为7、11、13、15,当所述当前块的宽度与高度的比值为1/2、1/4、1/8、1/16时,B分别为61、57、55、53。
在本公开的一种可能的实施方式中,所述方法还包括:
如果所述当前块未启动帧内子块划分,则根据所述当前块的尺寸信息和帧内预测模式信息确定所述当前块的变换核对。
在本公开的一种可能的实施方式中,所述根据所述当前块的尺寸信息和帧内预测模式信息确定所述当前块的变换核对,包括:
如果根据所述尺寸信息确定所述当前块不满足目标尺寸限制条件时,将所述帧内预测模式信息对应的变换核对确定为所述当前块的变换核对,其中,所述目标尺寸限制条件是所述宽度大于或等于目标数值,且高度大于或等于所述目标数值;
如果根据所述尺寸信息,确定所述当前块的高度满足所述目标尺寸限制条件且所述当前块的宽度不满足所述目标尺寸限制条件时,将DCT2确定为所述当前块的变换核对中的垂直变换核,并将所述帧内预测模式信息对应的变换核对中的水平变换核确定为所述当前块的变换核对中的水平变换核;
如果根据所述尺寸信息,确定所述当前块的宽度满足所述目标尺寸限制条件且所述当前块的高度不满足目标尺寸限制条件时,将DCT2确定为所述当前块的变换核对中的水平变换核,并将所述帧内预测模式信息对应的变换核对中的垂直变换核确定为所述当前块的变换核对中的垂直变换核;
如果根据所述尺寸信息,确定所述当前块的宽度和高度均满足所述目标尺寸限制条件时, 将DCT2确定为所述当前块的变换核对中的水平变换核和垂直变换核。
在本公开的一种可能的实施方式中,所述子块划分条件为所述当前块为亮度块、所述当前块的高度和宽度均小于或等于第一预设数值,所述当前块在进行帧内预测时为单行参考、所述当前块包含的像素点的数目大于第二预设数值。
第四方面,提供了一种进行编码的方法,所述方法包括:
获取当前块的残差数据;
如果所述当前块满足子块划分条件,且启动帧内子块划分,则根据所述当前块的子块划分信息,确定所述当前块的各个子块的帧内预测模式信息、所述当前块的各个子块的尺寸信息;
针对每个子块,根据所述子块的尺寸信息和所述子块的帧内预测模式信息,确定所述子块的变换核对;
根据各个子块的变换核对,对所述各个子块的残差数据进行变换;
其中,所述针对每个子块,根据所述子块的尺寸信息和所述子块的帧内预测模式信息,确定所述子块的变换核对,包括:
针对每个子块,如果根据所述子块的尺寸信息,确定所述子块不满足尺寸限制条件,则将所述子块的帧内预测模式信息对应的变换核对确定为所述子块的变换核对,其中,所述尺寸限制条件是宽度不在第一预设范围内,且高度不在第二预设范围内。
在本公开的一种可能的实施方式中,所述方法还包括:
如果所述当前块满足子块划分条件,则获取所述当前块的对应的子块划分信息;
将所述子块划分信息添加至所述当前块的编码数据中。
第五方面,提供了一种进行解码的解码端,所述解码端包括:
获取模块,用于获取当前块的编码数据;
确定模块,用于:
如果所述当前块满足子块划分条件,且根据所述当前块的编码数据,确定所述当前块启动帧内子块划分,则根据所述当前块的子块划分信息,确定各个子块的尺寸信息和形状信息;
针对每个子块,根据所述子块的尺寸信息和形状信息,确定所述子块对应的变换核对;
变换模块,用于根据各个子块的变换核对,对所述各个子块反量化后的数据进行反变换;
其中,所述确定模块,用于:
如果所述子块的宽度满足第一尺寸限制条件且形状满足第一条件,则将DST7确定为所述子块的变换核对中的水平变换核;
如果所述子块的高度满足第二尺寸限制条件且形状满足第二条件,则将DST7确定为所述子块的变换核对中的垂直变换核。
在本公开的一种可能的实施方式中,所述确定模块,还用于
如果所述子块的宽度不满足所述第一尺寸限制条件和/或形状不满足所述第一条件,则将DCT2确定为所述子块的变换核对中的水平变换核;
如果所述子块的高度不满足所述第二尺寸限制条件和/或形状不满足所述第二条件,则将DCT2确定为所述子块的变换核对中的垂直变换核。
在本公开的一种可能的实施方式中,所述第一尺寸限制条件和所述第二尺寸限制条件为大于或等于第一数值,且小于或等于第二数值;所述第一条件为宽度小于或等于高度,所述第二条件为宽度大于或等于高度;或者,
所述第一尺寸限制条件和所述第二尺寸限制条件为大于或等于第一数值,且小于或等于第二数值;所述第一条件为宽度小于高度,所述第二条件为宽度大于高度。
在本公开的一种可能的实施方式中,所述子块划分条件为所述当前块为亮度块、所述当前块的高度和宽度均小于或等于第三数值,所述当前块在进行帧内预测时为单行参考、所述当前块包含的像素点的数目大于第四数值。
第六方面,提供了一种进行编码的编码端,所述编码端包括:
获取模块,用于获取当前块的残差数据;
确定模块,用于:
如果所述当前块满足子块划分条件,且启动帧内子块划分,则根据所述当前块的子块划分信息,确定所述当前块的各个子块的尺寸信息和形状信息;
针对每个子块,根据所述子块的尺寸信息和形状信息,确定所述子块对应的变换核对;
变换模块,用于根据各个子块的变换核对,对所述各个子块的残差数据进行变换;
其中,所述确定模块,用于:
如果所述子块的宽度满足第一尺寸限制条件且形状满足第一条件,将DST7确定为所述子块的变换核对中的水平变换核;
如果所述子块的高度满足第二尺寸限制条件且形状满足第二条件,将DST7确定为所述子块的变换核对中的垂直变换核。
在本公开的一种可能的实施方式中,所述获取模块,还用于:
如果所述当前块满足子块划分条件,则获取所述当前块对应的子块划分信息;
将所述子块划分信息添加至所述当前块的编码数据中。
第七方面,提供了一种进行解码的解码端,所述解码端包括:
获取模块,用于获取当前块的编码数据;
确定模块,用于:
如果所述当前块满足子块划分条件,且根据所述当前块的编码数据,确定所述当前块启动帧内子块划分,则根据所述当前块的子块划分信息,确定各个子块的尺寸信息,并确定所述各个子块的帧内预测模式信息;
针对每个子块,根据所述子块的尺寸信息和所述子块的帧内预测模式信息,确定所述子块的变换核对;
变换模块,用于根据各个子块的变换核对,对所述各个子块反量化后的数据进行反变换;
其中,所述确定模块,用于:
针对每个子块,如果根据所述子块的尺寸信息,确定所述子块不满足尺寸限制条件,则将所述子块的帧内预测模式信息对应的变换核对确定为所述子块的变换核对,其中,所述尺寸限制条件是宽度不在预设数值范围内,且高度不在所述预设数值范围内。
在本公开的一种可能的实施方式中,所述确定模块,还用于:
如果根据所述子块的尺寸信息确定所述子块的高度满足所述尺寸限制条件且所述子块的宽度不满足所述尺寸限制条件,则将DCT2确定为所述子块的变换核对中的垂直变换核,并将所述子块的帧内预测模式信息对应的变换核对中的水平变换核确定为所述子块的变换核对中的水平变换核;
如果根据子块的尺寸信息确定子块的宽度满足所述尺寸限制条件且所述子块的高度不满足所述尺寸限制条件,则将DCT2确定为所述子块的变换核对中的水平变换核,将所述子块 的帧内预测模式信息对应的变换核对中的垂直变换核确定为所述子块的变换核对中的垂直变换核;
如果根据子块的尺寸信息确定子块的宽度和宽度满足所述尺寸限制条件,则将DCT2确定为所述子块的变换核对中的水平变换核和垂直变换核。
在本公开的一种可能的实施方式中,所述确定模块,用于:
如果所述子块的帧内预测模式信息的模式号为1、33、35,则所述子块的变换核对为(DCT2,DCT2);
如果所述子块的帧内预测模式信息的模式号为0、31、32、34、36、37,则所述子块的变换核对为(DST7,DST7);
如果所述子块的帧内预测模式信息的模式号为2、30、2至30中的偶数、39、65和39至65中的奇数,则所述子块的变换核对为(DST7,DCT8);
如果所述子块的帧内预测模式信息的模式号为3、29、3至29中的奇数、38、66和38至66中的偶数,则所述子块的变换核对为(DCT8,DST7)。
在本公开的一种可能的实施方式中,所述确定模块,用于:
如果所述子块的帧内预测模式信息的模式号为1,则所述子块的变换核对为第一变换核对;
如果所述子块的帧内预测模式信息的模式号为0、31、32、33、34、35、36、37,则所述子块的变换核对为第二变换核对;
如果所述子块的帧内预测模式信息的模式号为2、30、2至30中的偶数、39、65和39至65中的奇数,则所述子块的变换核对为第三变换核对;
如果所述子块的帧内预测模式信息的模式号为3、29、3至29中的奇数、38、66和38至66中的偶数,则所述子块的变换核对为第四变换核对。
在本公开的一种可能的实施方式中,所述确定模块,用于:
如果所述子块的帧内预测模式信息的模式号为1,则所述子块的变换核对为第一变换核对;
如果所述子块的帧内预测模式信息的模式号为0,则所述子块的变换核对为第二变换核对;
如果所述子块的帧内预测模式信息的模式号为2、34、2至34中的偶数、35、65和35至65中的奇数,则所述子块的变换核对为第三变换核对;
如果所述子块的帧内预测模式信息的模式号为3、33、3至33中的奇数、36、66和36至66中的偶数,则所述子块的变换核对为第四变换核对。
在本公开的一种可能的实施方式中,所述确定模块,用于:
如果所述子块的帧内预测模式信息的模式号为1,则所述子块的变换核对为第一变换核对;
如果所述子块的帧内预测模式信息的模式号为0、3、65和3至65中的奇数,则所述子块的变换核对为第二变换核对;
如果所述子块的帧内预测模式信息的模式号为2、34、2至34中的偶数,则所述子块的变换核对为第三变换核对;
如果所述子块的帧内预测模式信息的模式号为36、66和36至66中的偶数,则所述子块的变换核对为第四变换核对。
在本公开的一种可能的实施方式中,所述第一变换核对为(DCT2,DCT2),所述第二变换核对为(DST7,DST7),所述第三变换核对为(DST7,DCT2),所述第四变换核对为(DCT2,DST7);或者,
所述第一变换核对为(DCT2,DCT2),所述第二变换核对为(DST7,DST7),所述第三变换核对为(DST7,DCT8),所述第四变换核对为(DCT8,DST7)。
在本公开的一种可能的实施方式中,所述确定模块,用于:
针对每个子块,如果根据所述子块的尺寸信息,确定所述子块不满足尺寸限制条件,且所述帧内预测模式信息满足帧内预测模式范围,则将所述帧内预测模式信息对应的变换核对确定为所述子块的变换核对。
在本公开的一种可能的实施方式中,所述确定模块,还用于:
针对每个子块,如果根据所述子块的尺寸信息,确定所述子块不满足尺寸限制条件,且所述帧内预测模式信息不满足帧内预测模式范围,则根据所述子块的尺寸信息,确定所述子块的宽度和高度的比值;
根据所述子块的宽度和高度的比值、所述子块的帧内预测模式信息,确定所述子块的变换核对。
在本公开的一种可能的实施方式中,所述帧内预测模式范围包括模式号是0、1、31至37的帧内预测模式信息;
或者,所述帧内预测模式范围包括模式号是0和1的帧内预测模式信息;
或者,所述帧内预测模式范围包括模式号为0、1、3、65以及3至65中间的奇数的帧内预测模式信息。
在本公开的一种可能的实施方式中,所述帧内预测模式范围包括模式号是0、1、31至37的帧内预测模式信息;
所述确定模块,还用于:
如果所述当前块的宽度和高度的比值等于1,且所述帧内预测模式信息的模式号为2、4、6、30、39、41、43、65、6至30中的偶数、43至65中的奇数时,所述当前块的变换核对为(DST7,DCT2),如果当前块的宽度和高度的比值等于1,且所述帧内预测模式信息的模式号为3、5、7、29、7至29中的奇数时,所述当前块的变换核对为(DCT2,DST7);
如果所述当前块的宽度和高度的比值大于1,且所述帧内预测模式信息的模式号为(B+1)、(B+3)、30、3、5、B、39、41、43、65、(B+3)至30中的偶数、5至B中的奇数、43至65中的奇数时,所述当前块的变换核对为(DST7,DCT2),如果所述当前块的宽度和高度的比值大于1,且所述帧内预测模式信息的模式号为B+2、B+4、29、38、40、66、2、4、(B-1)、B+4至29中奇数、40至66之间的偶数、4至(B-1)之间的偶数时,所述当前块的变换核对为(DCT2,DST7);
如果当前块的宽度和高度的比值小于1,且所述帧内预测模式信息的模式号为2、4、6、30、(B+1)、(B+3)、66、39、41、(B-2)、6至30之间的偶数、(B+3)至66之间的偶数、41至(B-2)之间的奇数时,所述当前块的变换核对为(DST7,DCT2),如果所述当前块的宽度和高度的比值小于1,且所述帧内预测模式信息的模式号为3、5、29、B、(B+2)、65、38、40、(B-1)、5至29之间的奇数、(B+2)至65之间的奇数、40至(B-1)之间的偶数时,所述当前块的变换核对为(DCT2,DST7);
其中,当所述当前块的宽度与高度的比值为2、4、8、16时,B分别为7、11、13、15, 当所述当前块的宽度与高度的比值为1/2、1/4、1/8、1/16时,B分别为61、57、55、53。
在本公开的一种可能的实施方式中,所述帧内预测模式范围包括模式号是0和1的帧内预测模式信息;
所述确定模块,还用于:
如果所述当前块的宽度和高度的比值等于1,且所述帧内预测模式信息的模式号为2、4、6、34、35、37、39、41、43、65、6至34之间的偶数、43至65之间的奇数时,所述当前块的变换核对为(DST7,DCT2),如果所述当前块的宽度和高度的比值等于1,且所述帧内预测模式信息的模式号为3、5、7、33、36、38、40、66、7至33之间的奇数、40至66之间的偶数时,所述当前块的变换核对为(DCT2,DST7);
如果所述当前块的宽度和高度的比值大于1,且所述帧内预测模式信息的模式号为(B+1)、(B+3)、34、3、5、B、35、37、39、65、(B+3)至34之前的偶数、5至B之间的奇数、39至65之间的奇数时,所述当前块的变换核对为(DST7,DCT2),如果所述当前块的宽度和高度的比值大于1,且所述帧内预测模式信息的模式号为(B+2)、(B+4)、33、2、4、(B-1)、36、38、66、(B+4)至33之间的奇数、4至(B-1)之间的偶数、38至66之间的偶数时,所述当前块的变换核对为(DCT2,DST7);
如果所述当前块的宽度和高度的比值小于1,且所述帧内预测模式信息的模式号为2、4、6、34、(B+1)、(B+3)、66、35、37、39、(B-2)、6至34之间的偶数、(B+3)至66之间的奇数、39至(B-2)之间的奇数时,所述当前块的变换核对为(DST7,DCT2),如果所述当前块的宽度和高度的比值小于1,且所述帧内预测模式信息的模式号为3、5、33、B、(B+2)、65、36、38、(B-1)、5至33之间的奇数、(B+2)至65之间的奇数、38至(B-1)之间的偶数时,所述当前块的变换核对为(DCT2,DST7);
其中,当所述当前块的宽度与高度的比值为2、4、8、16时,B分别为7、11、13、15,当所述当前块的宽度与高度的比值为1/2、1/4、1/8、1/16时,B分别为61、57、55、53。
在本公开的一种可能的实施方式中,所述帧内预测模式范围包括模式号为0、1、3、65以及3至65中间的奇数的帧内预测模式信息;
所述确定模块,还用于:
如果所述当前块的宽度和高度的比值等于1,且所述帧内预测模式信息的模式号为2、4、6、34、6至34之间的偶数时,所述当前块的变换核对为(DST7,DCT2),如果所述当前块的宽度和高度的比值等于1,且所述帧内预测模式信息的模式号为36、38、40、66、40至66之间的偶数时,所述当前块的变换核对为(DCT2,DST7);
如果所述当前块的宽度和高度的比值大于1,且所述帧内预测模式信息的模式号为(B+1)、(B+3)、34、(B+3)至34之间的偶数时,所述当前块的变换核对为(DST7,DCT2),如果所述当前块的宽度和高度的比值大于1,且所述帧内预测模式信息的模式号为36、38、66、2、4、(B-1)、38至66之前的偶数、4至(B-1)之间的偶数时,所述当前块的变换核对为(DCT2,DST7);
如果所述当前块的宽度和高度的比值小于1,且所述帧内预测模式信息的模式号为2、4、6、34、(B+1)、(B+3)、66、6至34之间的偶数、(B+3)至66之间的偶数时,所述当前块的变换核对为(DST7,DCT2),如果所述当前块的宽度和高度的比值小于1,且所述帧内预测模式信息的模式号为36、38、(B-1)、38至(B-1)之间的偶数时,所述当前块的变换核对为(DCT2,DST7);
其中,当所述当前块的宽度与高度的比值为2、4、8、16时,B分别为7、11、13、15,当所述当前块的宽度与高度的比值为1/2、1/4、1/8、1/16时,B分别为61、57、55、53。
在本公开的一种可能的实施方式中,所述确定模块,还用于:
如果所述当前块未启动帧内子块划分,则根据所述当前块的尺寸信息和帧内预测模式信息确定所述当前块的变换核对。
在本公开的一种可能的实施方式中,所述确定模块,还用于:
如果根据所述尺寸信息确定所述当前块不满足目标尺寸限制条件时,将所述帧内预测模式信息对应的变换核对确定为所述当前块的变换核对,其中,所述目标尺寸限制条件是所述宽度大于或等于目标数值,且高度大于或等于所述目标数值;
如果根据所述尺寸信息,确定所述当前块的高度满足所述目标尺寸限制条件且所述当前块的宽度不满足所述目标尺寸限制条件时,将DCT2确定为所述当前块的变换核对中的垂直变换核,并将所述帧内预测模式信息对应的变换核对中的水平变换核确定为所述当前块的变换核对中的水平变换核;
如果根据所述尺寸信息,确定所述当前块的宽度满足所述目标尺寸限制条件且所述当前块的高度不满足目标尺寸限制条件时,将DCT2确定为所述当前块的变换核对中的水平变换核,并将所述帧内预测模式信息对应的变换核对中的垂直变换核确定为所述当前块的变换核对中的垂直变换核;
如果根据所述尺寸信息,确定所述当前块的宽度和高度均满足所述目标尺寸限制条件时,将DCT2确定为所述当前块的变换核对中的水平变换核和垂直变换核。
在本公开的一种可能的实施方式中,所述子块划分条件为所述当前块为亮度块、所述当前块的高度和宽度均小于或等于第一预设数值,所述当前块在进行帧内预测时为单行参考、所述当前块包含的像素点的数目大于第二预设数值。
第八方面,提供了一种进行编码的编码端,所述编码端包括:
获取模块,用于获取当前块的残差数据;
确定模块,用于:
如果所述当前块满足子块划分条件,且启动帧内子块划分,则根据所述当前块的子块划分信息,确定所述当前块的各个子块的帧内预测模式信息、所述当前块的各个子块的尺寸信息;
针对每个子块,根据所述子块的尺寸信息和所述子块的帧内预测模式信息,确定所述子块的变换核对;
变换模块,用于根据各个子块的变换核对,对所述各个子块的残差数据进行变换;
其中,所述确定模块,用于:
针对每个子块,如果根据所述子块的尺寸信息,确定所述子块不满足尺寸限制条件,则将所述子块的帧内预测模式信息对应的变换核对确定为所述子块的变换核对,其中,所述尺寸限制条件是宽度不在第一预设范围内,且高度不在第二预设范围内。
在本公开的一种可能的实施方式中,所述获取模块,还用于:
如果所述当前块满足子块划分条件,则获取所述当前块的对应的子块划分信息;
将所述子块划分信息添加至所述当前块的编码数据中。
第九方面,提供了一种进行解码的解码端,包括处理器和存储器,其中,所述存储器,用于存放计算机程序;所述处理器,用于执行所述存储器上所存放的程序,实现上述第一方 面、第三方面任一方面所述的方法步骤。
第十方面,提供了一种进行编码的编码端,所述编码端包括:包括处理器和存储器,其中,所述存储器,用于存放计算机程序;所述处理器,用于执行所述存储器上所存放的程序,实现上述第二方面、第四方面任一方面的方法步骤。
第十一方面,提供了一种计算机可读存储介质,所述存储介质内存储有计算机程序,所述计算机程序被处理器执行时实现上述第一方面至第四方面任一方面所述的方法步骤。
第十二方面,提供了一种进行编码的和解码的系统,所述系统包括编码端和解码端,其中:
所述编码端,如上述第六方面所述的编码端;所述解码端,如上述第五方面所述的解码端;或者,
所述编码端,如上述第八方面所述的编码端;所述解码端,如上述第七方面所述的解码端。
本公开实施例提供的技术方案带来的有益效果至少包括:
本公开实施例中,在编码端,直接使用当前块的各个子块的尺寸信息和形状信息,即可确定出各个子块对应的变换核对,基于确定出的变换核对,进行编码处理,同理在解码端,也可以直接使用当前块的各个子块的尺寸信息和形状信息,即可确定出各个子块对应的变换核对,基于确定出的变换核对,进行解码处理。这样,由于使用了子块的尺寸信息和形状信息,确定变换核对,而不是对所有子块使用相同的变换核对,所以可以提升编解码性能。而且在导出变换核对时,仅使用了高度和宽度,导出过程比较简单,也可以进一步提升编解码性能。
图1是本公开实施例提供的一种块的划分类型示意图;
图2是本公开实施例提供的一种CTU划分成CU的示意图;
图3是本公开实施例提供的常用的三种块的示意图;
图4是本公开实施例提供的进行帧内预测时的方向示意图;
图5是本公开实施例提供的基于块形状进行调整的示意图;
图6是本公开实施例提供的一种进行编码的示意图;
图7是本公开实施例提供的一种分布信号的示意图;
图8是本公开实施例提供的一种残差数据分布的示意图;
图9是本公开实施例提供的一种进行解码的方法流程示意图;
图10是本公开实施例提供的一种进行编码的方法流程示意图;
图11是本公开实施例提供的一种划分子块的示意图;
图12是本公开实施例提供的一种进行解码的方法流程示意图;
图13是本公开实施例提供的一种进行编码的方法流程示意图;
图14是本公开实施例提供的一种解码端的结构示意图;
图15是本公开实施例提供的一种编码端的结构示意图;
图16是本公开实施例提供的一种解码端的结构示意图;
图17是本公开实施例提供的一种编码端的结构示意图;
图18是本公开实施例提供的一种编码端的结构示意图;
图19是本公开实施例提供的一种解码端的结构示意图。
为使本公开的目的、技术方案和优点更加清楚,下面将结合附图对本公开实施方式作进一步地详细描述。
本公开提供了一种进行编码和进行解码的方法,进行编码的方法的执行主体为编码端,进行解码的方法的执行主体可以是解码端,其中,编码端或解码端可以是服务器、电脑、手机等能对视频数据进行编码和/或解码的设备。
其中,编码端或解码端中可以设置有处理器、存储器和收发器等,处理器可以用于进行编码和/或解码的处理,存储器可以用于存储进行编码和/或解码过程中需要的数据以及产生的数据,收发器可以用于接收以及发送数据,如获取视频数据等。
在进行实施前,首先对本公开实施例可能涉及的概念进行解释:
变换核(transform kernel):
在视频编码中,变换是实现视频数据压缩必不可少的阶段,能够使信号的能量更加集中,而基于DCT(Discrete Cosine Transform,离散余弦变换)/DST(Discrete Sine Transform,离散正弦变换)的变换技术一直是视频编码主流的变换技术。DCT和DST根据基函数的不同又具体分为多种变换核,表一给出了常用的三种变换核的基函数。
表一
正变换(forward transform)和逆变换(inverse transform):
在视频编码过程中,变换过程包含了正变换和逆变换过程,又叫前向变换和反向变换,其中正变换是将一个二维残差数据(残差系数)转换成能量更加集中的二维频谱信号(变换系数),变换系数再经过量化过程可以有效去除高频成分,保留中低频成分,起到了压缩的作用。用矩阵形式表示如公式(1):
F=B·f·A
T (1)
其中,M表示残差块宽度,N表示残差块高度,f表示NxM维的原始残差数据,F表示NxM维的频域信号。A和B表示MxM和NxN维的变换矩阵,它们均满足正交性。
逆变换又称反变换,是正变换的逆过程,即通过正交变换矩阵A和B,将频域信号F转 换成时域残差数据f。用矩阵形式表示为公式(2):
f=B
T·F·A (2)
水平变换(Horizental transform)和垂直变换(Vertical transform):
在视频编码的变换阶段,输入的是一个二维残差数据,如公式(3)所示,X=A·f
T,则F=B·X
T。
F=B·f·A
T=B·(A·f
T)
T (3)
因此一个二维残差数据的正变换可以通过两次一维的正变换方式实现,第一次正变换后得到一个MxN的信号X,去除了二维残差数据的水平方向像素之间的相关性,因此第一次正变换称为水平变换,称A为水平变换矩阵,第二次正变换去除了二维残差数据的垂直方向像素之间的相关性,因此第二次正变换称为垂直变换,称B为垂直变换矩阵。
变换核对(Transform pair):
在下一代视频编码标准中,TU(Transmission Unit,变换单元)支持矩形块,因此M不一定等于N,因此A和B的维度不一定相等,除此之外,下一代视频编码标准还支持A和B不是同一种变换核生产的变换矩阵,因此在变换中存在A和B对应的变换核组成的变换核对{H,V},其中H称为水平变换核,V称为垂直变换核。
块划分技术(Block Partition)
在HEVC(High Efficiency Video Coding,高效率的视频压缩)中,一个64x64大小的CTU(Coding Tree Unit,编码树单元)使用四叉树递归划分成CU(Coding Unit,编码单元)。在叶子节点CU级确定是否使用帧内编码或者帧间编码。CU可以进一步划分成两个或者四个PU(Prediction Unit,预测单元),同一个PU内使用相同的预测信息。在预测完成后得到残差数据后,一个CU可以进一步四叉划分成多个TU。
但是在新提出的VVC(Versatile Video Coding,通用视频编码)中的块划分技术有了较大变化。一种混合了二叉树/三叉树/四叉树((binary/ternary/quaternary)tree(BT/TT/QT))划分结构取代了原先的划分模式,取消了原先CU,PU,TU的概念的区分,支持了CU的更灵活的划分方式。CU可以是正方形也可以是矩形划分,CTU首先进行四叉树的划分,然后四叉树划分的叶子节点可以进一步进行二叉树和三叉树的划分。也就是说总共有五种划分类型,四叉树划分,水平二叉树划分,垂直二叉树划分,水平三叉树划分和垂直三叉树划分,如图1所示,表示了五种划分类型,在图1中,(a)表示不划分,(b)表示四叉树划分,(c)水平二叉树划分,(d)垂直二叉树划分,(e)水平三叉树划分,(f)垂直三叉树划分。如图2所示,提供一个CTU划分成CU的示例图。
因此,基于上述划分方式,块通常存在三种形状,如图3所示,在图3中,(a)表示宽大于高的块,(b)宽等于高的块,(c)宽小于高的块。
帧内预测:
帧内预测是考虑到在图像中,相邻块之间存在很强的空域相关性,因此可以利用周围已经重建的像素作为参考像素对当前未编码块进行预测,因此只需要对残差数据(原始信号-预测信号)进行后续编码处理,而不是对原始信号进行编码,有效去除了空域上的冗余,大大提高了视频信号的压缩效率。而且在帧内预测中,更加密集的角度可以带来更好的预测效果,如图4所示,示出了VVC给出的67种帧内预测模式进行帧内预测时的角度方向示意图,帧内预测模式数量从HEVC的33种增加到65种,当模式号为0时,表示Planar(平面)模式,当模式号为1时,表示DC模式(DC模式指当前块的预测像素均为参考像素的平均值), 黑色实线表示原来HEVC的角度方向(2,4,6,8,…,64,66),虚线是新增的角度方向(3,5,7,9,..,63,65),更加密集的角度方向能够更加有效地捕捉到自然视频中任意方向的边界,可以利用更多的参考信息进行率失真代价选择,从而可以找到更加适合的帧内预测模式来更加准确地预测当前编码块,使得预测块更加接近原始编码块,编码当前块所需要传输的比特更少,从而编码性能更高。在进行帧内预测编码时,这67种帧内模式运用在所有尺寸的编码块上,包括亮度分量和色度分量。
在图4中,帧内预测模式的模式号为2~34,角度方向与水平向右方向的夹角范围为:-45度~45度,帧内预测模式的模式号为35~66,角度方向与水平向右方向的夹角范围为:-135度~-45度。
需要说明的是,在一个平面直角坐标系中,水平向右方向为x轴的正方向,竖直向上为y轴的正方向,这样,第一象限与第二象限中以原点为顶点的射线(射线远离原点的方向)与x轴的正方向构成的夹角为正值,第三象限与第四象限为中以原点为顶点的射线(射线远离原点的方向)与x轴的正方向构成的夹角为负值。例如,水平向右方向与第四象限中的对称轴(远离原点的方向)的夹角为-45度。
宽角度(wide-angle)帧内预测:
对于矩形块来说,引入了基于块形状的宽角度预测模式,来替代一些传统的帧内预测模式,替代的模式仍然使用原来的模式号,这样整体一共还是65种角度模式,但是基于不同形状,会有所调整。具体如图5所示:
在图5中(a)表示正方形块,对于正方形块而言,角度方向刚好从45度顺时针旋转到-135度,因此不需要做任何调整。
在图5中(b)表示宽大于高的块,需要做以下调整,即使用右上角超过-135度的若干角度来替代左下角的若干角度。
在图5中(c)表示宽小于高的块,需要做以下调整,即使用左下角低于45度的若干角度来替代右上角的若干角度。
具体的宽角度预测模式的映射关系如表二所示:
表二
宽(W)高(H)比值 | 需要替代的帧内预测模式(模式号) |
W/H==16 | Modes(模式)12,13,14,15 |
W/H==8 | Modes 12,13 |
W/H==4 | Modes 2,3,4,5,6,7,8,9,10,11 |
W/H==2 | Modes 2,3,4,5,6,7, |
W/H==1 | None |
W/H==1/2 | Modes 61,62,63,64,65,66 |
W/H==1/4 | Mode 57,58,59,60,61,62,63,64,65,66 |
W/H==1/8 | Modes 55,56 |
W/H==1/16 | Modes 53,54,55,56 |
本公开实施例提供了一种常见的编码框架,如图6所示,完整的视频编码方法一般包括预测、变换、量化、熵编码、环内滤波等环节。其中预测分为帧内预测和帧间预测,帧内预测是考虑到在图像中,相邻块之间存在很强的空域相关性,因此可以利用周围已经重建的像素作为参考像素对当前未编码块进行预测,因此只需要对残差数据(原始信号-预测信号)进 行后续编码处理,而不是对原始信号进行编码,有效去除了空域上的冗余,大大提高了视频信号的压缩效率。帧间预测是指利用视频信号时间域上的相关性,使用邻近已编码图像像素预测当前图像的像素,以达到去除视频时域冗余的目的。在帧间预测时,由于视频存在很强的时域相关性,即时域相邻的两帧图像有很多相似图像块,当前帧的图像块往往在相邻参考图像中进行运动搜索,找到与当前块最匹配的块作为参考块。由于参考块与当前块相似度高,两者的差值非常小,因此编码差值的码率开销通常远小于直接编码当前块像素值带来的码率开销。
在上述的变换过程中,对于同一TU(也可以称为是残差块)采用不同的变换核对对残差块进行压缩,压缩的效果大不相同。这是由变换核本身基函数所决定的,如图7所示,对应DCT2、DST7和DCT8三种变换核基函数,输入信号位为64点。从图中的零阶基函数可以看出,DCT2对均匀分布的信号具有较强的能量集中效果,并且形成的直流分量是输入信号均值的倍数,DST7对幅值递增的输入信号具有较强的能量集中效果,DCT8对幅值递减的输入信号具有较强的能量集中效果。
为了更直观感受不同变换核与残差特性的关系,如图8所示,5种不同的水平垂直变换核对代表的是不同类型的残差分布情况,对于{DCT2,DCT2}变换核类型,代表的是TU的残差分布均匀,对于{DST7,DST7}变换核类型,代表的是TU的残差分布从左到右,从上到下依次变大,主要分布在TU的右下角,类似地,{DCT8,DST7}代表残差主要分布在TU的左下角,{DST7,DCT8}代表残差主要分布在TU的右上角,{DCT8,DCT8}代表残差主要分布在TU的左上角。
本公开实施例提供了一种进行解码的方法,该方法的执行流程可以如图9所示。
步骤901,解码端获取当前块的编码数据。
在实施中,解码端有编码数据要进行解码时,可以获取编码数据,然后对编码数据进行熵解码处理,对熵解码结果进行反量化处理,得到当前块的编码数据。
步骤902,如果当前块满足子块划分条件,且根据当前块的编码数据,确定当前块启动帧内子块划分,则解码端根据当前块的子块划分信息,确定各个子块的尺寸信息和形状信息。
其中,子块划分信息用于指示如何划分当前块,例如,对于8*4的当前块,可以是水平划分为两个8*2的子块。
在实施中,解码端获取到当前块之后,可以判断当前块是否满足子块划分条件,如果当前块满足子块划分条件,则从当前块的编码数据中,查看帧内子块划分的标识位是否为预设标识,如果为预设标识,则确定当前块启动帧内子块划分,如果不是预设标识,则确定当前块未启动帧内子块划分。
解码端在确定当前块启动帧内子块划分时,可以从当前块的编码数据中,获取当前块的子块划分信息,然后使用当前块的子块划分信息,对当前块进行划分,得到各个子块,确定当前块的各个子块在高度方向的像素点的数目(即子块的高度),以及在宽度方向的像素点的数目(即子块的宽度)。这样,即得到各个子块的尺寸信息,然后可以使用各个子块的高度和宽度,确定各个子块的形状信息,形状信息指子块的高度大于宽度、子块的高度小于宽度、子块的高度等于宽度。
在本公开的一种可能的实施方式中,子块划分条件为当前块为亮度块、当前块的高度和宽度均小于或等于第三数值,当前块在进行帧内预测时为单行参考、当前块包含的像素点的数目大于第四数值。
其中,第三数值可以预设,并且存储至解码端,第三数值可以为64,当前块在进行帧内预测时为单行参考指在当前块进行帧内预测时,仅参考了一行,第四数值可以预设,并且存储至解码端,第四数值可以为16。
步骤903,解码端针对每个子块,根据子块的尺寸信息和形状信息,确定子块对应的变换核对。其中,针对每个子块,根据子块的尺寸信息和形状信息,确定子块对应的变换核对,包括:如果子块的宽度满足第一尺寸限制条件且形状满足第一条件,则将DST7确定为子块的变换核对中的水平变换核;如果子块的高度满足第二尺寸限制条件且形状满足第二条件,则将DST7确定为子块的变换核对中的垂直变换核。
其中,第一尺寸限制条件为宽度大于或等于第一数值,且小于或等于第二数值,第一条件为宽度小于或等于高度,第二尺寸限制条件为高度大于或等于第一数值,且小于或等于第二数值,第二条件为宽度大于或等于高度。或者,第一尺寸限制条件为宽度大于或等于第一数值,且小于或等于第二数值,第二尺寸限制条件为高度大于或等于第一数值,且小于或等于第二数值,第一条件为宽度小于高度,第二条件为宽度大于高度,第一数值和第二数值可以预设,并且存储至解码端,第一数值可以为4,第二数值可以为16。一个变换核对包括一个水平变换核和一个垂直变换核。
在实施中,对于当前块的每个子块进行下述处理:
解码端可以确定子块的宽度是否满足第一尺寸限制条件,并确定该子块的形状是否满足第一条件,并判断该子块的高度是否满足第二尺寸限制条件,并确定该子块的形状是否满足第一条件。如果该子块的宽度满足第一尺寸限制条件且形状满足第一条件,则将DST7确定为该子块的变换核对中的水平变换核,如果该子块的高度满足第二尺寸限制条件且形状满足第二条件,则将DST7确定为子块的变换核对中的垂直变换核。
另外,在本公开的一种可能的实施方式中,如果子块的宽度不满足第一尺寸限制条件和/或形状不满足第一条件,则将DCT2确定为子块的变换核对中的水平变换核,如果子块的高度不满足第二尺寸限制条件和/或形状不满足第二条件,则将DCT2确定为子块的变换核对中的垂直变换核。
在实施中,如果子块的宽度不满足第一尺寸限制条件和形状不满足第一条件中至少有一个成立,可以将DCT2确定为该子块的变换核对中的水平变换核,如果子块的高度不满足第二尺寸限制条件和形状不满足第二条件中至少有一个成立,则将DCT2确定为该子块的变换核对中的垂直变换核。
这样,在确定出该子块的水平变换核和垂直变换核后,可以将水平变换核和垂直变换核组成该子块的变换核对,对于任一子块都使用上述方式确定变换核对,即可确定出各个子块的变换核对。
步骤904,解码端根据各个子块的变换核对,对各个子块反量化后的数据进行反变换。
在实施中,在确定出各个子块对应的变换核对后,可以使用对应的变换核对,对各个子块进行反变换处理,得到各个子块对应的残差数据,然后利用当前块周围已重建区域内像素点的像素值按照编码时所使用的帧内预测模式构建各个子块的预测信号。对于每个子块,将该子块的残差数据与预测信号相加,得到该子块的重建信息,这样,就可以得到各个子块的重建信息,将各个子块的重建信息合并,即可得到当前块对应的重建信息。
这样,就完成了当前块的解码处理。每个当前块都按照图9所示的流程进行处理,即可解码一整段的视频数据。
需要说明的是,在上述实施例中,当前块经过划分后,各个子块的宽度相同,各个子块的高度相同。
针对图9所示的解码方式,如图10所示,本公开实施例还提供了编码流程,相应的处理可以如下:
步骤1001,编码端获取当前块的残差数据。
在实施中,编码端在对视频数据进行编码时,首先进行帧内预测,得到残差数据(得到残差数据的方式与现有的视频编码标准中一致,不再赘述),然后将残差数据作为当前要进行处理的当前块的残差数据。
步骤1002,如果当前块满足子块划分条件,且启动帧内子块划分,则编码端根据当前块的子块划分信息,确定当前块的各个子块的尺寸信息和形状信息。
其中,子块划分信息用于指示如何划分当前块,例如,对于8*4的当前块,可以是水平划分为两个8*2的子块。
在实施中,编码端获取到当前块的残差数据之后,可以确定当前块是否满足子块划分条件,如果满足子块划分条件,则可以判断是否启用帧内子块划分,如果帧内子块划分的开关处于开启状态,则说明可以启用帧内子块划分,可以对当前块进行划分,确定对当前块划分得到的各个子块的高度和宽度。当前块的宽度指宽度方向包含的像素点的数目,当前块的高度指高度方向包含的像素点的数目,子块的宽度指宽度方向包含的像素点的数目,子块的高度指高度方向包含的像素点的数目,这样,即可以获取到子块的尺寸信息。其中,对于一个MxN的当前块,M表示当前块的宽度,N表示当前块的高度。
然后可以使用各个子块的高度和宽度,确定各个子块的形状信息,形状信息指子块的高度大于宽度、子块的高度小于宽度、子块的高度等于宽度。
在本公开的一种可能的实施方式中,子块划分条件为当前块为亮度块、当前块的高度和宽度均小于或等于第三数值,当前块在进行帧内预测时为单行参考、当前块包含的像素点的数目大于第四数值。
其中,第三数值可以预设,并且存储至编码端,第三数值可以为64,当前块在进行帧内预测时为单行参考指在当前块进行帧内预测时,仅参考了一行,第四数值可以预设,并且存储至编码端,第四数值可以为16。
步骤1003,编码端针对每个子块,根据子块的尺寸信息和形状信息,确定子块对应的变换核对;其中,针对每个子块,根据子块的尺寸信息和形状信息,确定子块对应的变换核对,包括:如果子块的宽度满足第一尺寸限制条件且形状满足第一条件,将DST7确定为子块的变换核对中的水平变换核;如果子块的高度满足第二尺寸限制条件且形状满足第二条件,将DST7确定为子块的变换核对中的垂直变换核。
对于当前块的每个子块进行下述处理:
编码端可以确定子块的宽度是否满足第一尺寸限制条件,并确定该子块的形状是否满足第一条件,并判断该子块的高度是否满足第二尺寸限制条件,并确定该子块的形状是否满足第一条件。如果该子块的宽度足第一尺寸限制条件且形状满足第一条件,则将DST7确定为该子块的变换核对中的水平变换核,如果该子块的高度满足第二尺寸限制条件且形状满足第二条件,则将DST7确定为子块的变换核对中的垂直变换核。
另外,在本公开的一种可能的实施方式中,如果子块的宽度不满足第一尺寸限制条件和/ 或形状不满足第一条件,则将DCT2确定为子块的变换核对中的水平变换核,如果子块的高度不满足第二尺寸限制条件和/或形状不满足第二条件,则将DCT2确定为子块的变换核对中的垂直变换核。
在实施中,如果子块的宽度不满足第一尺寸限制条件和形状不满足第一条件中至少有一个成立,可以将DCT2确定为该子块的变换核对中的水平变换核,如果子块的高度不满足第二尺寸限制条件和形状不满足第二条件中至少有一个成立,则将DCT2确定为该子块的变换核对中的垂直变换核。
这样,在确定出该子块的水平变换核和垂直变换核后,可以将水平变换核和垂直变换核组成该子块的变换核对,对于任一子块都使用上述方式确定变换核对,即可确定出各个子块的变换核对。
步骤1004,编码端根据各个子块的变换核对,对各个子块的残差数据进行变换。
在实施中,编码端确定出各个子块对应的变换核对后,对于每个子块,可以基于该子块对应的变换核对,对该子块进行变换,得到该子块对应的变换系数,然后对变换系数进行量化处理,得到量化系数,对量化系数进行熵编码处理,得到该子块对应的编码数据。
这样,基于对每个子块的上述处理,就可以得到当前块对应的编码数据,就完成了当前块的编码处理。每个当前块都按照图10所示的流程进行处理,即可编码一整段的视频数据。
在本公开的一种可能的实施方式中,为了解码端可以快速的对当前块进行子块划分处理,可以进行如下处理:
如果当前块满足子块划分条件,则获取当前块对应的子块划分信息;将子块划分信息添加至当前块的编码数据中。
在实施中,如果确定当前块满足子块划分条件,编码端可以获取当前块对应的子块划分信息,然后将子块划分信息添加至当前块的编码数据中。这样,后续解码端可以从当前块的编码数据中,获取到当前块对应的子块划分信息,进行解码。
另外,本公开实施例中,还给出了编码端获取子块划分信息的处理过程:
编码端可以将一个当前块水平或者垂直的划分成若干个小的子块,例如,对于一个16x8的当前块来说,可以水平被划分成4个16x2的子块,或者垂直划分成4个4x8子块。然而,对于一个4x8块来说,可以被划分成2个4X4块或者2个2x8的子块,可以注意到,子块的数目可以仅为2个(4x8,8x4的子块来说)。并且子块至少包含16个像素点,所以4x4块不会再被划分,也不需要在编码端和解码端进行相应的语法申明。具体划分规则如表三所示,至于是水平划分还是垂直划分,需要经过编码端RDO准则决策。为了节省编码时间,被划分的帧内子块的共享当前块的帧内预测模式(也即当前块划分得到的子块与当前块的帧内预测模式相同)。
表三
在表三中,w表示子块的宽度,h表示子块的高度,K表示可以划分的子块的数目,W表示当前块的宽度,H表示当前块的高度,可以按照表三进行水平划分和垂直划分,例如,如图11所示,对于8*4的当前块,按照水平划分可以划分为两个8*2的子块,按照垂直划分可以划分为两个4*4的子块。
使用RDO准则确定子块划分信息的过程可以如下:
首先使用表三确定出当前块的多种划分方式,然后按照每一种划分方式,进行编码,然后进行解码,确定出率失真代价最小的划分方式,确定为当前块的最终划分方式。这样,就得到了当前块的子块划分信息。
本公开实施例中,在编码端,直接使用当前块的各个子块的尺寸信息和形状信息,即可确定出各个子块对应的变换核对,基于确定出的变换核对,进行编码处理,同理在解码端,也可以直接使用当前块的各个子块的尺寸信息和形状信息,即可确定出各个子块对应的变换核对,基于确定出的变换核对,进行解码处理。这样,由于使用了子块的尺寸信息和形状信息,确定变换核对,而不是对所有子块使用相同变换核对,所以可以提升编解码性能。而且在导出变换核对时,仅使用了高度和宽度,导出过程比较简单,也可以进一步提升编解码性能。
本公开另一实施例提供了一种进行解码的方法,该方法的执行流程可以如图12所示。
步骤1201,解码端获取当前块的编码数据。
在实施中,解码端有编码数据要进行解码时,可以获取编码数据,然后对编码数据进行熵解码处理,对熵解码结果进行反量化处理,得到当前块的编码数据。该当前块实际上是经过反变换处理得到的残差数据。
步骤1202,解码端如果当前块满足子块划分条件,且根据当前块的编码数据。确定当前块启动帧内子块划分,则根据当前块的子块划分信息,确定各个子块的尺寸信息,并确定各个子块的帧内预测模式信息。
其中,子块划分信息用于指示如何划分当前块,例如,对于8*4的当前块,可以是水平划分为两个8*2的子块。
在实施中,解码端获取到当前块之后,可以判断当前块是否满足子块划分条件,如果当前块满足子块划分条件,则从当前块的编码数据中,查看帧内子块划分的标识位是否为预设标识,如果是预设标识,则确定当前块启动帧内子块划分,如果不是预设标识,则确定当前块未启动帧内子块划分。
解码端在确定当前块启动帧内子块划分时,可以从当前块的编码数据中,获取当前块的子块划分信息,然后使用当前块的子块划分信息,对当前块进行划分,得到各个子块,确定当前块的各个子块在高度方向的像素点的数目(即子块的高度),以及在宽度方向的像素点的数目(即子块的宽度)。这样,即得到各个子块的尺寸信息。并且可以从当前块的编码数据中, 用于指示帧内预测模式信息的标识位,获取标识位的内容,即得到当前块的帧内预测模式信息。
在本公开的一种可能的实施方式中,子块划分条件为当前块为亮度块、当前块的高度和宽度均小于或等于第一预设数值,当前块在进行帧内预测时为单行参考、当前块包含的像素点的数目大于第二预设数值。
其中,第一预设数值可以预设,并且存储至解码端(与前面提到的第三数值相同),第一预设数值可以为64,当前块在进行帧内预测时为单行参考指在当前块进行帧内预测时,仅参考了一行,第二预设数值可以预设,并且存储至解码端,第二预设数值可以为16(与前面提提到的第四数值相同)。
步骤1203,解码端针对每个子块,根据子块的尺寸信息和子块的帧内预测模式信息,确定子块的变换核对;其中,针对每个子块,根据子块的尺寸信息和子块的帧内预测模式信息,确定子块的变换核对,包括:针对每个子块,如果根据子块的尺寸信息,确定子块不满足尺寸限制条件,则将子块的帧内预测模式信息对应的变换核对确定为子块的变换核对。
其中,尺寸限制条件是宽度不在预设数值范围内,且高度不在预设数值范围内,预设数值范围为[2,32](不包括2和32),不在预设数值范围内指大于32和/或小于2。
在实施中,对于当前块的每个子块进行下述处理:
对于任一子块,解码端可以判断子块的尺寸信息是否满足尺寸限制条件,如果不满足尺寸限制条件(宽度不在预设数值范围,且高度不在预设数值范围内),则可以使用当前块的帧内预测模式信息,使用该帧内预测模式信息,在帧内预测模式信息与变换核对的对应关系中,确定出对应的变换核对,将该变换核对,确定为该子块的变换核对。
另外,在本公开的一种可能的实施方式中,如果根据子块的尺寸信息确定子块的高度满足尺寸限制条件且子块的宽度不满足尺寸限制条件,则将DCT2确定为子块的变换核对中的垂直变换核,并将子块的帧内预测模式信息对应的变换核对中的水平变换核确定为子块的变换核对中的水平变换核,如果根据子块的尺寸信息确定子块的宽度满足尺寸限制条件且子块的高度不满足尺寸限制条件,则将DCT2确定为子块的变换核对中的水平变换核,将子块的帧内预测模式信息对应的变换核对中的垂直变换核确定为子块的变换核对中的垂直变换核,如果根据子块的尺寸信息确定子块的宽度和宽度满足尺寸限制条件,则将DCT2确定为子块的变换核对中的水平变换核和垂直变换核。
在实施中,在子块的高度满足尺寸限制条件,且子块的宽度不满足尺寸限制条件时,可以将DCT2确定为该子块的变换核对中的垂直变换核,并且可以直接将使用帧内预测模式信息,从帧内预测模式信息与变换核对的对应关系中,确定出当前块的帧内预测模式信息对应的变换核对,将该变换核对中的水平变换核确定为当前块的水平变换核。
在子块的宽度满足尺寸限制条件,且子块的高度不满足尺寸限制条件时,可以将DCT2确定为该子块的变换核对中的水平变换核,并且可以直接将使用帧内预测模式信息,从帧内预测模式信息与变换核对的对应关系中,确定出当前块的帧内预测模式信息对应的变换核对,将该变换核对中的垂直变换核确定为当前块的垂直变换核。
在子块的宽度满足尺寸限制条件,且子块的高度满足尺寸限制条件时,可以将DCT2确定为子块的变换核对中的水平变换核和垂直变换核。
这样,按照上述方式即可确定出各个子块的变换核对。
步骤1204,解码端根据各个子块的变换核对,对各个子块反量化后的数据进行反变换。
在实施中,在确定出各个子块对应的变换核对后,可以使用对应的变换核对,对各个子块进行反变换处理,得到各个子块对应的残差数据,然后利用当前块周围已重建区域内像素点的像素值按照编码时所使用的帧内预测模式构建各个子块的预测信号。对于每个子块,将该子块的残差数据与预测信号相加,得到该子块的重建信息,这样,就可以得到各个子块的重建信息,将各个子块的重建信息合并,即可得到当前块对应的重建信息。
这样,就完成了当前块的解码处理。每个当前块都按照图12所示的流程进行处理,即可解码一整段的视频数据。
需要说明的是,在上述实施例中,当前块经过划分后,各个子块的宽度相同,各个子块的高度相同。
在步骤1203中,在本公开的一种可能的实施方式中,将子块的帧内预测模式信息对应的变换核对确定为子块的变换核对可以有以下几种处理:
方式一,如果子块的帧内预测模式信息的模式号为1、33、35,则确定子块的变换核对为(DCT2,DCT2),如果子块的帧内预测模式信息的模式号0、31、32、34、36、37,则确定子块的变换核对为(DST7,DST7),如果子块的帧内预测模式信息的模式号为2、30、2至30中的偶数、39、65和39至65中的奇数,则确定子块的变换核对为(DST7,DCT8),如果子块的帧内预测模式信息的模式号为3、29、3至29中的奇数、38、66和38至66中的偶数,则确定子块的变换核对为(DCT8,DST7)。
在实施中,如表四所示,为帧内预测模式信息与变换核对的对应关系:
表四
方式二,如果子块的帧内预测模式信息的模式号为1,则确定子块的变换核对为第一变换核对,如果子块的帧内预测模式信息的模式号为0、31、32、33、34、35、36、37,则确定子块的变换核对为第二变换核对,如果子块的帧内预测模式信息的模式号为2、30、2至30中的偶数、39、65和39至65中的奇数,则确定子块的变换核对为第三变换核对,如果子块的帧内预测模式信息的模式号为3、29、3至29中的奇数、38、66和38至66中的偶数,则确定子块的变换核对为第四变换核对。
在实施中,如表五所示,为帧内预测模式信息与变换核对的对应关系:
表五
方式三,如果子块的帧内预测模式信息的模式号为1,则确定子块的变换核对为第一变换核对;如果子块的帧内预测模式信息的模式号为0,则确定子块的变换核对为第二变换核对;如果子块的帧内预测模式信息的模式号为2、34、2至34中的偶数、35、65和35至65中的奇数,则确定子块的变换核对为第三变换核对;如果子块的帧内预测模式信息的模式号为3、33、3至33中的奇数、36、66和36至66中的偶数,则确定子块的变换核对为第四变换核对。
在实施中,如表六所示,为帧内预测模式信息与变换核对的对应关系:
表六
方式四,如果子块的帧内预测模式信息的模式号为1,则确定子块的变换核对为第一变换核对;如果子块的帧内预测模式信息的模式号为0、3、65和3至65中的奇数,则确定子块的变换核对为第二变换核对;如果子块的帧内预测模式信息的模式号为2、34、2至34中的偶数,则确定子块的变换核对为第三变换核对;如果子块的帧内预测模式信息的模式号为36、66和36至66中的偶数,则确定子块的变换核对为第四变换核对。
在实施中,如表七所示,为帧内预测模式信息与变换核对的对应关系:
表七
需要说明的是,上述表四至表七中,模式号相邻的帧内预测模式的角度方向差不多,进而残差特性差不多,使用两种不同的变换核对进行变换,既可以节约编码时长,也可以选取出适合的变换核对。
在本公开的一种可能的实施方式中,第一变换核对、第二变换核对、第三变换核对和第四变换核有多种组合,以下给出两种可行的组合:
组合一,第一变换核对为(DCT2,DCT2),第二变换核对为(DST7,DST7),第三变换核对为(DST7,DCT2),第四变换核对为(DCT2,DST7)。
组合二,第一变换核对为(DCT2,DCT2),第二变换核对为(DST7,DST7),第三变换核对为(DST7,DCT8),第四变换核对为(DCT8,DST7)。
在本公开的一种可能的实施方式中,将子块的帧内预测模式信息对应的变换核对确定为子块的变换核对,应满足以下条件,相应的处理可以如下:
针对每个子块,如果根据子块的尺寸信息,确定子块不满足尺寸限制条件,且帧内预测模式信息满足帧内预测模式范围,则将帧内预测模式信息对应的变换核对确定为子块的变换核对。
其中,帧内预测模式范围可以预设,并且存储至解码端中,帧内预测模式范围包括模式号是0、1、31至37的帧内预测模式(见表八和表九);或者,帧内预测模式范围包括模式号是0和1的帧内预测模式(见表十);或者,帧内预测模式范围包括模式号为0、1、3、65以及3至65中间的奇数的帧内预测模式(见表十一)。
在实施中,解码端从编码数据中获取到各个子块的帧内预测模式信息的模式号后,可以确定是否属于帧内预测模式范围,如果属于帧内预测模式范围,则可以直接在帧内预测模式信息与变换核对的对应关系中,将帧内预测模式信息对应的变换核对确定为该子块的变换核对。
在本公开的一种可能的实施方式中,如果当前块的帧内预测模式信息的模式号不属于帧内预测模式范围,可以进行几种处理:
针对每个子块,如果根据子块的尺寸信息,确定子块不满足尺寸限制条件,且帧内预测模式信息不满足帧内预测模式范围,则根据子块的尺寸信息,确定子块的宽度和高度的比值,根据子块的宽度和高度的比值、子块的帧内预测模式信息,确定子块的变换核对。
在实施中,对于任一子块,解码端从编码数据中获取到该子块的帧内预测模式信息的模式号后,可以确定是否属于帧内预测模式范围。如果不属于帧内预测模式范围,则可以确定该子块的宽度和高度的比值。然后使用该子块的宽度和高度的比值、该子块的帧内预测模式信息,确定该子块的变换核对。
在本公开的一种可能的实施方式中,如果当前块的帧内预测模式信息的模式号不属于帧内预测模式范围,可以进行如下几种处理:
方式一,如表八所示,帧内预测模式范围包括模式号是0、1、31至37的帧内预测模式信息。
子块的宽度使用w表示,子块的高度使用h表示。
在子块的宽度与高度的比值为1时(即w=h),模式号为2、4、6、…、30、39、41、43、…、65的帧内预测模式信息对应的变换核对为(DST7,DCT2)(第一个省略号表示6至30之间的偶数,第二个省略号表示43至65之间的奇数),即子块的变换核对为(DST7,DCT2)。
在子块的宽度与高度的比值为1时(即w=h),模式号为3、5、7、…、29、38、40、42、…、 66的帧内预测模式信息对应的变换核对为(DCT2,DST7)(第一个省略号表示7至29之间的奇数,第二个省略号表示42至66之间的偶数),即子块的变换核对为(DCT2,DST7)。
在子块的宽度与高度的比值大于1时(即w>h),模式号为B+1、B+3、…、30、3、5、…、B、39、41、43、…、65的帧内预测模式信息对应的变换核对为(DST7,DCT2)(第一个省略号表示B+3至30之间的偶数,第二个省略号表示5至B之间的奇数,第三个省略号表示43至65之间的奇数),即子块的变换核对为(DST7,DCT2)。
在子块的宽度与高度的比值大于1时(即w>h),模式号为B+2、B+4、…、29、38、40、…、66、2、4、…、(B-1)的帧内预测模式信息对应的变换核对为(DCT2,DST7)(第一个省略号表示B+4至29之间奇数,第二个省略号表示40至66之间的偶数,第三个省略号表示4至(B-1)之间的偶数),即子块的变换核对为(DCT2,DST7)。
在子块的宽度与高度的比值小于1时(即w<h),模式号为2、4、6、…、30、B+1、B+3、…、66、39、41、…、B-2的帧内预测模式信息对应的变换核对为(DST7,DCT2)(第一个省略号表示6至30之间偶数,第二个省略号表示(B+3)至66之间的偶数,第三个省略号表示41至B-2之间的奇数),即子块的变换核对为(DST7,DCT2)。
在子块的宽度与高度的比值小于1时(即w<h),模式号为3、5、…、29、B、B+2、…、65、38、40、…、(B-1)的帧内预测模式信息对应的变换核对为(DCT2,DST7)(第一个省略号表示5至29之间奇数,第二个省略号表示(B+2)至65之间的奇数,第三个省略号表示40至(B-1)之间的偶数),即子块的变换核对为(DCT2,DST7)。
表八
方式二,如表九所示,帧内预测模式范围包括模式号是0、1、31至37的帧内预测模式信息。子块的宽度使用w表示,子块的高度使用h表示。
在子块的宽度与高度的比值为1时(即w=h),模式号为2、4、6、…、30、39、41、43、…、65的帧内预测模式信息对应的变换核对为(DST7,DCT2)(第一个省略号表示6至30之间的偶数,第二个省略号表示43至65之间的奇数),即子块的变换核对为(DST7,DCT2)。
在子块的宽度与高度的比值为1时(即w=h),模式号为3、5、7、…、29、38、40、42、…、66的帧内预测模式信息对应的变换核对为(DCT2,DST7)(第一个省略号表示7至29之间的奇数,第二个省略号表示42至66之间的偶数),即子块的变换核对为(DCT2,DST7)。
在子块的宽度与高度的比值大于1时(即w>h),模式号为B+1、B+3、…、30、3、5、…、B、39、41、43、…、65的帧内预测模式信息对应的变换核对为(DST7,DCT2)(第一个省略号表示B+3至30之间的偶数,第二个省略号表示5至B之间的奇数,第三个省略号表示43至65之间的奇数),即子块的变换核对为(DST7,DCT2)。
在子块的宽度与高度的比值大于1时(即w>h),模式号为B+2、B+4、…、29、38、40、…、66、2、4、…、(B-1)的帧内预测模式信息对应的变换核对为(DCT2,DST7)(第一个省略号表示B+4至29之间的奇数,第二个省略号表示40至66之间的偶数,第三个省略号表示4至(B-1)之间的偶数),即子块的变换核对为(DCT2,DST7)。
在子块的宽度与高度的比值小于1时(即w<h),模式号为2、4、6、…、30、B+1、B+3、…、66、39、41、…、B-2的帧内预测模式信息对应的变换核对为(DST7,DCT2)(第一个省略号表示6至30之间的偶数,第二个省略号表示(B+3)至66之间的偶数,第三个省略号表示41至B-2之间的奇数),即子块的变换核对为(DST7,DCT2)。
在子块的宽度与高度的比值小于1时(即w<h),模式号为3、5、…、29、B、B+2、…、65、38、40、…、(B-1)的帧内预测模式信息对应的变换核对为(DCT2,DST7)(第一个省略号表示5至29之间的奇数,第二个省略号表示B+2至65之间的奇数,第三个省略号表示40至(B-1)之间的偶数),即子块的变换核对为(DCT2,DST7)。
表九
方式三:如表十所示,帧内预测模式范围包括模式号是0和1的帧内预测模式信息;子块的宽度使用w表示,子块的高度使用h表示。
在子块的宽度与高度的比值为1时(即w=h),模式号为2、4、6、…、34、35、37、39、41、43、…、65的帧内预测模式信息对应的变换核对为(DST7,DCT2)(第一个省略号表示6至34之间的偶数,第二个省略号表示43至65之间的奇数),即子块的变换核对为(DST7,DCT2)。
在子块的宽度与高度的比值为1时(即w=h),模式号为3、5、7、…、33、36、38、40、…、66的帧内预测模式信息对应的变换核对为(DCT2,DST7)(第一个省略号表示7至33之间的奇数,第二个省略号表示40至66之间的偶数),即子块的变换核对为(DCT2,DST7)。
在子块的宽度与高度的比值大于1时(即w>h),模式号为B+1、B+3、…、34、3、5、…、B、35、37、39、…、65的帧内预测模式信息对应的变换核对为(DST7,DCT2)(第一个省略号表示B+3至34之间的偶数,第二个省略号表示5至B之间的奇数,第三个省略号表示39至65之间的奇数),即子块的变换核对为(DST7,DCT2)。
在子块的宽度与高度的比值大于1时(即w>h),模式号为B+2、B+4、…、33、2、4、…、(B-1)、36、38、…、66的帧内预测模式信息对应的变换核对为(DCT2,DST7)(第一个省略号表示(B+4)至33之间的奇数,第二个省略号表示4至(B-1)之间的偶数,第三个省略号表示38至66之间的偶数),即子块的变换核对为(DCT2,DST7)。
在子块的宽度与高度的比值小于1时(即w<h),模式号为2、4、6、…、34、B+1、B+3、…、66、35、37、39、…、B-2的帧内预测模式信息对应的变换核对为(DST7,DCT2)(第一个省略号表示6至34之间的偶数,第二个省略号表示(B+3)至66之间的偶数,第三个省略号表示39至B-2之间的奇数),即子块的变换核对为(DST7,DCT2)。
在子块的宽度与高度的比值小于1时(即w<h),模式号为3、5、…、33、B、B+2、…、65、36、38、…、(B-1)的帧内预测模式信息对应的变换核对为(DCT2,DST7)(第一个省略号表示5至33之间的奇数,第二个省略号表示B+2至65之间的奇数,第三个省略号表示38至(B-1)之间的偶数),即子块的变换核对为(DCT2,DST7)。
表十
方式四:如表十一所示,帧内预测模式范围包括模式号为0、1、3、65以及3至65中间的奇数的帧内预测模式信息。子块的宽度使用w表示,子块的高度使用h表示。
在子块的宽度与高度的比值为1时(即w=h),模式号为2、4、6、…、34、的帧内预测模式信息对应的变换核对为(DST7,DCT2)(省略号表示6至34之间的偶数),即子块的变换核对为(DST7,DCT2)。
在子块的宽度与高度的比值为1时(即w=h),模式号为36、38、40、…、66的帧内预测模式信息对应的变换核对为(DCT2,DST7)(省略号表示40至66之间的偶数),即子块的变换核对为(DCT2,DST7)。
在子块的宽度与高度的比值大于1时(即w>h),模式号为B+1、B+3、…、34的帧内预测模式信息对应的变换核对为(DST7,DCT2)(省略号表示(B+3)至34之间的偶数),即子块的变换核对为(DST7,DCT2)。
在子块的宽度与高度的比值大于1时(即w>h),模式号为36、38、…、66、2、4、…、(B-1)的帧内预测模式信息对应的变换核对为(DCT2,DST7)(第一个省略号表示38至66之间的偶数,第二个省略号表示4至(B-1)之间的偶数,即子块的变换核对为(DCT2,DST7)。
在子块的宽度与高度的比值小于1时(即w<h),模式号为2、4、6、…、34、B+1、B+3、…、66的帧内预测模式信息对应的变换核对为(DST7,DCT2)(第一个省略号表示6至34之间的偶数,第二个省略号表示(B+3)至66之间的偶数),即子块的变换核对为(DST7,DCT2)。
在子块的宽度与高度的比值小于1时(即w<h),模式号为36、38、…、(B-1)的帧内预测模式信息对应的变换核对为(DCT2,DST7)(省略号表示38至(B-1)之间的偶数),即子块的变换核对为(DCT2,DST7)。
表十一
需要说明的是,表八至表十一是考虑了帧内预测模式为宽角度模式的影响,宽角度模式的B是由当前块的各个子块的宽度和高度的比值确定。在表八至表十一中,当w/h=2、4、6、8时,对应的B分别为7、11、13、15,当w/h=1/2、1/4、1/6、1/8时,对应的B分别为61、57、55、53。
还需要说明的是,上述表八至表十一中,模式号相邻的帧内预测模式一般对应有不同的变换核对。
在本公开的一种可能的实施方式中,在当前块未启动帧内子块划分时,可以进行如下处理:
如果当前块未启动帧内子块划分,则根据当前块的尺寸信息和帧内预测模式信息确定当前块的变换核对。
在实施中,在当前块未启动帧内子块划分时,可以使用当前块的尺寸信息和帧内预测模式信息,共同确定当前块的变换核对。
在本公开的一种可能的实施方式中,使用当前块的尺寸信息和帧内预测模式信息,共同确定当前块的变换核对的处理可以如下:
如果根据尺寸信息确定当前块不满足目标尺寸限制条件时,将帧内预测模式信息对应的变换核对确定为当前块的变换核对,如果根据尺寸信息,确定当前块的高度满足目标尺寸限制条件且当前块的宽度不满足目标尺寸限制条件时,将DCT2确定为当前块的变换核对中的垂直变换核,并将帧内预测模式信息对应的变换核对中的水平变换核确定为当前块的变换核对中的水平变换核,如果根据尺寸信息,确定当前块的宽度满足目标尺寸限制条件且当前块的高度不满足目标尺寸限制条件时,将DCT2确定为当前块的变换核对中的水平变换核,并将帧内预测模式信息对应的变换核对中的垂直变换核确定为当前块的变换核对中的垂直变换核,如果根据尺寸信息,确定当前块的宽度和高度均满足目标尺寸限制条件时,将DCT2确定为当前块的变换核对中的水平变换核和垂直变换核。
其中,目标尺寸限制条件是宽度大于或等于目标数值,且高度大于或等于目标数值,目标数值可以为32。
在实施中,解码端可以确定当前块是否满足目标尺寸限制条件,如果满足目标尺寸限制条件(指高度和宽度均满足目标尺寸限制条件),可以将DCT2确定为当前块的变换核对中的水平变换核和垂直变换核。
如果当前块不满足目标尺寸限制条件(指高度和宽度均不满足目标尺寸限制条件)时,可以在帧内预测模式信息与变换核对的对应关系中,将帧内预测模式信息对应的变换核对确定为当前块的变换核对;
如果根据尺寸信息,确定当前块的高度满足目标尺寸限制条件且当前块的宽度不满足目标尺寸限制条件时,将DCT2确定为当前块的变换核对中的垂直变换核,并可以在帧内预测 模式信息与变换核对的对应关系中,将帧内预测模式信息对应的变换核对中的水平变换核确定为当前块的变换核对中的水平变换核;
如果根据尺寸信息,确定当前块的宽度满足目标尺寸限制条件且当前块的高度不满足目标尺寸限制条件时,将DCT2确定为当前块的变换核对中的水平变换核,并可以在帧内预测模式信息与变换核对的对应关系中,将帧内预测模式信息对应的变换核对中的垂直变换核确定为当前块的变换核对中的垂直变换核。
在本公开的一种可能的实施方式中,在当前块的编码数据中存在目标标识时,可以确定当前块的变换模式为隐式多核变换模式,可以使用当前块的尺寸信息和帧内预测模式信息,共同确定当前块的变换核对。
在本公开的一种可能的实施方式中,将帧内预测模式信息对应的变换核对确定为当前块的变换核对有多种方式,以下给出几种可行的实施方式:
方式一:如表十二所示,描述了帧内预测模式信息与变换核对的对应关系,如果当前块的帧内预测模式信息的模式号为1、33、35时,当前块的变换核对为第一变换核对,如果当前块的帧内预测模式信息的模式号为0、31、32、34、36、37时,当前块的变换核对为第二变换核对,如果当前块的帧内预测模式信息的模式号为2、30、39、65、2至30中的偶数和39至65中的奇数时,当前块的变换核对为第三变换核对,如果当前块的帧内预测模式信息的模式号为3、29、38、66、3至29中的奇数和38至66中的偶数时,当前块的变换核对为第四变换核对。
表十二
在方式一中,在确定当前块的变换核对时,可以通过查找上述表十二得到。
方式二:如表十三所示,如果当前块的帧内预测模式信息的模式号为1时,当前块的变换核对为第一变换核对,如果当前块的帧内预测模式信息的模式号为0、31、32、33、34、35、36、37时,当前块的变换核对为第二变换核对,如果当前块的帧内预测模式信息的模式号为2、30、39、65、2至30中的偶数和39至65中的奇数时,当前块的变换核对为第三变换核对,如果当前块的帧内预测模式信息的模式号为3、29、38、66、3至29中的奇数和38至66中的偶数时,当前块的变换核对为第四变换核对。
表十三
在方式二中,在确定当前块的变换核对时,可以通过查找上述表十三得到。
方式三,如表十四所示,如果当前块的帧内预测模式信息的模式号为1时,当前块的变换核对为第一变换核对,如果当前块的帧内预测模式信息的模式号为0时,当前块的变换核对为第二变换核对,如果当前块的帧内预测模式信息的模式号为2、34、35、65、2至34中的偶数和35至65中的奇数时,当前块的变换核对为第三变换核对,如果当前块的帧内预测模式信息的模式号为3、33、36、66、3至33中的奇数和36至66中的偶数时,当前块的变换核对为第四变换核对。
表十四
方式四,如表十五所示,如果当前块的帧内预测模式信息的模式号为1时,当前块的变换核对为第一变换核对,如果当前块的帧内预测模式信息的模式号为0、3、65和3至65中的奇数时,当前块的变换核对为第二变换核对,如果当前块的帧内预测模式信息的模式号为2、34和2至34中的偶数时,当前块的变换核对为第三变换核对,如果当前块的帧内预测模式信息的模式号为36、66和36至66中的偶数时,当前块的变换核对为第四变换核对。
表十五
在本公开的一种可能的实施方式中,上述第一变换核对至第四变换核对有两种组合,相应的描述可以如下:
第一变换核对为(DCT2,DCT2),第二变换核对为(DST7,DST7),第三变换核对为 (DST7,DCT2),第四变换核对为(DCT2,DST7);或者,第一变换核对为(DCT2,DCT2),第二变换核对为(DST7,DST7),第三变换核对为(DST7,DCT8),第四变换核对为(DCT8,DST7)。
在本公开的一种可能的实施方式中,在使用帧内预测模式信息确定变换核对时,还考虑了帧内预测模式范围,相应的处理可以如下:
如果根据尺寸信息确定当前块不满足目标尺寸限制条件且帧内预测模式信息满足帧内预测模式范围时,将帧内预测模式信息对应的变换核对确定为当前块的变换核对。
其中,帧内预测模式范围可以预设,并且存储至解码端中,帧内预测模式范围包括模式号是0、1、31至37的帧内预测模式;或者,帧内预测模式范围包括模式号是0和1的帧内预测模式;或者,帧内预测模式范围包括模式号为0、1、3、65以及3至65之间的奇数的帧内预测模式。
在实施中,解码端从编码数据中获取到帧内预测模式信息的模式号后,可以确定是否属于帧内预测模式范围,如果属于帧内预测模式范围,则可以直接在帧内预测模式信息与变换核对的对应关系中,将帧内预测模式信息对应的变换核对确定为当前块的变换核对。
在本公开的一种可能的实施方式中,如果当前块的帧内预测模式信息的模式号不属于帧内预测模式范围,可以进行如下几种处理:
方式一,如表十六所示,帧内预测模式范围包括模式号是0、1、31至37的帧内预测模式信息。当前块的宽度使用W表示,当前块的高度使用H表示。
在当前块的宽度与高度的比值为1时(即W=H),模式号为2、4、6、…、30、39、41、43、…、65的帧内预测模式信息对应的变换核对为(DST7,DCT2)(第一个省略号表示6至30之间的偶数,第二个省略号表示43至65之间的奇数)。
在当前块的宽度与高度的比值为1时(即W=H),模式号为3、5、7、…、29、38、40、42、…、66的帧内预测模式信息对应的变换核对为(DCT2,DST7)(第一个省略号表示7至29之间的奇数,第二个省略号表示42至66之间的偶数)
在当前块的宽度与高度的比值大于1时(即W>H),模式号为B+1、B+3、…、30、3、5、…、B、39、41、43、…、65的帧内预测模式信息对应的变换核对为(DST7,DCT2)(第一个省略号表示B+3至30之间的偶数,第二个省略号表示5至B之间的奇数,第三个省略号表示43至65之间的奇数)。
在当前块的宽度与高度的比值大于1时(即W>H),模式号为B+2、B+4、…、29、38、40、…、66、2、4、…、(B-1)的帧内预测模式信息对应的变换核对为(DCT2,DST7)(第一个省略号表示B+4至29之间奇数,第二个省略号表示40至66之间的偶数,第三个省略号表示4至(B-1)之间的偶数)。
在当前块的宽度与高度的比值小于1时(即W<H),模式号为2、4、6、…、30、(B+1)、(B+3)、…、66、39、41、…、(B-2)的帧内预测模式信息对应的变换核对为(DST7,DCT2)(第一个省略号表示6至30之间偶数,第二个省略号表示(B+3)至66之间的偶数,第三个省略号表示41至B-2之间的奇数)。
在当前块的宽度与高度的比值小于1时(即W<H),模式号为3、5、…、29、B、B+2、…、65、38、40、…、(B-1)的帧内预测模式信息对应的变换核对为(DCT2,DST7)(第一个省略号表示5至29之间奇数,第二个省略号表示(B+2)至65之间的奇数,第三个省略号表示40至(B-1)之间的偶数)。
表十六
方式二,如表十七所示,帧内预测模式信息范围包括模式号是0、1、31至37的帧内预测模式信息信息;当前块的宽度使用W表示,当前块的高度使用H表示。
在当前块的宽度与高度的比值为1时(即W=H),模式号为2、4、6、…、30、39、41、43、…、65的帧内预测模式信息对应的变换核对为(DST7,DCT2)(第一个省略号表示6至30之间的偶数,第二个省略号表示43至65之间的奇数)。
在当前块的宽度与高度的比值为1时(即W=H),模式号为3、5、7、…、29、38、40、42、…、66的帧内预测模式信息对应的变换核对为(DCT2,DST7)(第一个省略号表示7至29之间的奇数,第二个省略号表示42至66之间的偶数)。
在当前块的宽度与高度的比值大于1时(即W>H),模式号为B+1、B+3、…、30、3、5、…、B、39、41、43、…、65的帧内预测模式信息对应的变换核对为(DST7,DCT2)(第一个省略号表示B+3至30之间的偶数,第二个省略号表示5至B之间的奇数,第三个省略号表示43至65之间的奇数)。
在当前块的宽度与高度的比值大于1时(即W>H),模式号为B+2、B+4、…、29、38、40、…、66、2、4、…、(B-1)的帧内预测模式信息对应的变换核对为(DCT2,DST7)(第一个省略号表示B+4至29之间的奇数,第二个省略号表示40至66之间的偶数,第三个省略号表示4至(B-1)之间的偶数)。
在当前块的宽度与高度的比值小于1时(即W<H),模式号为2、4、6、…、30、B+1、B+3、…、66、39、41、…、(B-2)的帧内预测模式信息对应的变换核对为(DST7,DCT2) (第一个省略号表示6至30之间的偶数,第二个省略号表示(B+3)至66之间的偶数,第三个省略号表示41至(B-2)之间的奇数)。
在当前块的宽度与高度的比值小于1时(即W<H),模式号为3、5、…、29、B、(B+2)、…、65、38、40、…、(B-1)的帧内预测模式信息对应的变换核对为(DCT2,DST7)(第一个省略号表示5至29之间的奇数,第二个省略号表示(B+2)至65之间的奇数,第三个省略号表示40至(B-1)之间的偶数)。
表十七
方式三,帧内预测模式信息范围包括模式号是0和1的帧内预测模式信息信息,如表十八所示,当前块的宽度使用W表示,当前块的高度使用H表示。
在当前块的宽度与高度的比值为1时(即W=H),模式号为2、4、6、…、34、35、37、39、41、43、…、65的帧内预测模式信息对应的变换核对为(DST7,DCT2)(第一个省略号表示6至34之间的偶数,第二个省略号表示43至65之间的奇数)。
在当前块的宽度与高度的比值为1时(即W=H),模式号为3、5、7、…、33、36、38、40、…、66的帧内预测模式信息对应的变换核对为(DCT2,DST7)(第一个省略号表示7至33之间的奇数,第二个省略号表示40至66之间的偶数)。
在当前块的宽度与高度的比值大于1时(即W>H),模式号为(B+1)、(B+3)、…、34、3、5、…、B、35、37、39、…、65的帧内预测模式信息对应的变换核对为(DST7,DCT2)(第一个省略号表示(B+3)至34之间的偶数,第二个省略号表示5至B之间的奇数,第三个省略号表示39至65之间的奇数)。
在当前块的宽度与高度的比值大于1时(即W>H),模式号为B+2、B+4、…、33、2、4、…、(B-1)、36、38、…、66的帧内预测模式信息对应的变换核对为(DCT2,DST7)(第一个省略号表示(B+4)至33之间的奇数,第二个省略号表示4至(B-1)之间的偶数,第三个省略号表示38至66之间的奇数)。
在当前块的宽度与高度的比值小于1时(即W<H),模式号为2、4、6、…、34、(B+1)、(B+3)、…、66、35、37、39、…、(B-2)的帧内预测模式信息对应的变换核对为(DST7,DCT2)(第一个省略号表示6至34之间的偶数,第二个省略号表示(B+3)至66之间的偶数,第三个省略号表示39至(B-2)之间的奇数)。
在当前块的宽度与高度的比值小于1时(即W<H),模式号为3、5、…、33、B、(B+2)、…、65、36、38、…、(B-1)的帧内预测模式信息对应的变换核对为(DCT2,DST7)(第一个省略号表示5至33之间的奇数,第二个省略号表示(B+2)至65之间的奇数,第三个省略号表示38至(B-1)之间的偶数)。
表十八
方式四,帧内预测模式信息范围包括模式号为0、1、3、65以及3至65之间的奇数的帧内预测模式信息信息;如表十九所示,当前块的宽度使用W表示,当前块的高度使用H表示。
在当前块的宽度与高度的比值为1时(即W=H),模式号为2、4、6、…、34的帧内预测模式信息对应的变换核对为(DST7,DCT2)(省略号表示6至34之间的偶数)。
在当前块的宽度与高度的比值为1时(即W=H),模式号为36、38、40、…、66的帧内 预测模式信息对应的变换核对为(DCT2,DST7)(省略号表示40至66之间的偶数)。
在当前块的宽度与高度的比值大于1时(即W>H),模式号为B+1、B+3、…、34的帧内预测模式信息对应的变换核对为(DST7,DCT2)(省略号表示(B+3)至34之间的偶数)。
在当前块的宽度与高度的比值大于1时(即W>H),模式号为36、38、…、66、2、4、…、(B-1)的帧内预测模式信息对应的变换核对为(DCT2,DST7)(第一个省略号表示38至66之间的偶数,第二个省略号表示4至(B-1)之间的偶数。
在当前块的宽度与高度的比值小于1时(即W<H),模式号为2、4、6、…、34、B+1、B+3、…、66的帧内预测模式信息对应的变换核对为(DST7,DCT2)(第一个省略号表示6至34之间的偶数,第二个省略号表示(B+3)至66之间的偶数)。
在当前块的宽度与高度的比值小于1时(即W<H),模式号为36、38、…、(B-1)的帧内预测模式信息对应的变换核对为(DCT2,DST7)(省略号表示38至(B-1)之间的偶数)。
表十九
需要说明的是,表十六至表十九是考虑了帧内预测模式信息为宽角度模式的影响,宽角度模式的B是由当前块的宽度和高度的比值确定。在表七至表十中,当W/H=2、4、6、8时,对应的B分别为7、11、13、15,当W/H=1/2、1/4、1/6、1/8时,对应的B分别为61、57、55、53。
还需要说明的是,上述表七至表十中,模式号相邻的帧内预测模式信息一般对应有不同的变换核对。
对应于图12所示的解码过程,如图13所示,编码过程可以如下:
步骤1301,编码端获取当前块的残差数据。
在实施中,编码端在对视频数据进行编码时,首先进行帧内预测,得到残差数据(得到残差数据的方式与现有的视频编码标准中一致,不再赘述),然后将残差数据作为当前要进行处理的当前块的残差数据。
步骤1302,如果当前块满足子块划分条件,且启动帧内子块划分,则编码端根据当前块的子块划分信息,确定当前块的各个子块的帧内预测模式信息、当前块的各个子块的尺寸信息。
其中,子块划分信息用于指示如何划分当前块,例如,对于8*4的当前块,可以是水平划分为两个8*2的子块。
在实施中,编码端获取到当前块的残差数据之后,可以确定当前块是否满足子块划分条件,如果确定当前块满足子块划分条件,则可以判断是否启用帧内子块划分。如果帧内子块划分的开关处于开启状态,则说明启用帧内子块划分,可以对当前块进行划分,确定对当前块划分得到的各个子块的高度和宽度。当前块的宽度指当前块的宽度方向包含的像素点的数目,当前块的高度指当前块的高度方向包含的像素点的数目,这样,即可以获取到子块的尺寸信息。其中,对于一个MxN的当前块,M表示当前块的宽度,N表示当前块的高度。
并且可以从当前块的编码数据中,用于指示帧内预测模式信息的标识位,获取标识位的内容,即得到当前块的帧内预测模式信息。
在本公开的一种可能的实施方式中,子块划分条件为当前块为亮度块、当前块的高度和宽度均小于或等于第一预设数值,当前块在进行帧内预测时为单行参考、当前块包含的像素点的数目大于第二预设数值。
其中,第一预设数值可以预设,并且存储至编码端(与前面提到的第三数值相同),第一预设数值可以为64,当前块在进行帧内预测时为单行参考指在当前块进行帧内预测时,仅参考了一行,第二预设数值可以预设,并且存储至编码端,第二预设数值可以为16(与前面提提到的第四数值相同)。
步骤1303,编码端针对每个子块,根据子块的尺寸信息和子块的帧内预测模式信息,确定子块的变换核对;其中,针对每个子块,根据子块的尺寸信息和子块的帧内预测模式信息,确定子块的变换核对,包括:针对每个子块,如果根据子块的尺寸信息,确定子块不满足尺寸限制条件,则将子块的帧内预测模式信息对应的变换核对确定为子块的变换核对,其中,尺寸限制条件是宽度不在第一预设范围内,且高度不在第二预设范围内。
在实施中,步骤1303的过程与步骤1203的过程完全相同,此处不再赘述。
需要说明的是,编码端根据子块的尺寸信息和子块的帧内预测模式信息,确定子块的变换核对的过程与图12所示的实施例中的解码端根据子块的尺寸信息和子块的帧内预测模式信息,确定子块的变换核对的过程处理完全相同,可以参见图12的处理,此处不再赘述。
步骤1304,编码端根据各个子块的变换核对,对各个子块的残差数据进行变换。
在实施中,编码端确定出各个子块对应的变换核对后,对于每个子块,可以基于该子块对应的变换核对,对该子块进行变换,得到该子块对应的变换系数,然后对变换系数进行量化处理,得到量化系数,对量化系数进行熵编码处理,得到该子块对应的编码数据。
这样,基于对每个子块的上述处理,就可以得到当前块对应的编码数据,就完成了当前块的编码处理。每个当前块都按照图13所示的流程进行处理,即可编码一整段的视频数据。
在本公开的一种可能的实施方式中,为了解码端可以快速的对当前块进行子块划分处理,可以进行如下处理:
如果当前块满足子块划分条件,则获取当前块对应的子块划分信息;将子块划分信息添加至当前块的编码数据中。
在实施中,如果确定当前块满足子块划分条件,编码端可以获取当前块对应的子块划分信息,然后将子块划分信息添加至当前块的编码数据中,这样,后续解码端可以从当前块的编码数据中,获取到当前块对应的子块划分信息,进行解码。
编码端在获取到当前块后,可以使用RDO准则确定当前块的帧内预测模式信息,过程可 以如下:
一般评价编码效率的有两大指标:码率和PSNR(Peak Signal to Noise Ratio,峰值信噪比)。一般比特流越小,则压缩率越大;PSNR越大,重建图像质量越好。在进行模式选择的时候,判别公式实质上也就是对这二者的综合评价。
模式对应的率失真代价:J(mode)=D+λ*R。其中,D表示Distortion(失真),通常使用SSE(Sum of Squares Error,和方差)指标来衡量,SSE是指重建块与源图像的差值均方和,λ是拉格朗日乘子,R就是该模式下图像块编码所需的实际比特数,包括编码模式信息、运动信息、残差等所需的比特总和。
编码端可以使用每种帧内预测模式信息进行帧内预测,得到不同的残差(可以认为是当前块),然后使用每种帧内预测模式信息对应的变换核对进行变换,再进行量化,再进行熵编码,再进行解码处理,然后选择率失真代价最小的帧内预测模式信息,确定为当前块对应的帧内预测模式信息。这样,就可以确定当前块对应的帧内预测模式信息。
另外,在得到当前块的帧内预测模式信息之后,可以将帧内预测模式信息的模式号添加至后续的编码数据中,用于对当前块的处理。
需要说明的是,为了节约编码时间,所以被划分的子块共享当前块的帧内预测模式信息。
另外,本公开实施例中,还给出了编码端获取子块划分信息的处理过程:
编码端可以将一个当前块水平或者垂直的划分成若干个小的子块,例如,对于一个16x8的当前块来说,可以水平被划分成4个16x2的子块,或者垂直划分成4个4x8子块。然而,对于一个4x8块来说可以被划分成2个4X4块或者2个2x8的子块。可以注意到,子块的数目可以仅为2个(4x8,8x4的子块来说)。并且子块至少包含16个像素点,所以4x4块不会再被划分,也不需要在编码端和解码端进行相应的语法申明。具体划分规则如图9所示的实施例中表三所示,至于是水平划分还是垂直划分,需要经过编码端RDO准则决策。为了节省编码时间,被划分的帧内子块的共享当前块的帧内预测模式(也即当前块划分得到的子块与当前块的帧内预测模式相同)。
可以按照表三进行水平划分和垂直划分,例如,如图11所示,对于8*4的当前块,按照水平划分可以划分为两个8*2的子块,按照垂直划分可以划分为两个4*4的子块。
使用RDO准则确定子块划分信息的过程可以如下:
首先使用表三确定出当前块的多种划分方式,然后按照每一种划分方式,进行编码,然后进行解码,确定出率失真代价最小的划分方式,确定为当前块的最终划分方式。这样,就得到了当前块的子块划分信息。后续将当前块的子块划分信息添加至当前块的编码数据中。
需要说明的是,在上述实施例中,当前块经过划分后,各个子块的宽度相同,各个子块的高度相同,帧内预测模式信息也相同,所以确定出的变换核对也相同。
本公开实施例中,在编码端,直接使用当前块的帧内预测模式、子块的尺寸信息,即可确定出各个子块对应的变换核对,基于确定出的变换核对,进行编码处理,同理在解码端,也可以直接使用当前块的帧内预测模式,以及各个子块的子块的尺寸信息,即可确定出各个子块对应的变换核对,基于确定出的变换核对,进行解码处理。这样,由于使用了当前块的帧内预测模式、各个子块的子块的尺寸信息,确定变换核对,而不是对于所有子块使用相同变换核对,所以可以提升编解码性能。而且基于帧内预测模式选取变换核对,可以节约变换核对的选取时长,进一步可以提升编解码性能。
需要说明的是,针对上述两个解码处理的实施例,如果当前块是按照水平划分的,则按 照从上到下的顺序,对当前块的各个子块统一进行熵解码,得到各个子块的量化系数。然后按照从上到下的顺序,对当前块的各个子块进行反量化和反变换,得到各个子块的残差数据,最后按照从上到下的顺序,利用当前子块周围已重建区域内像素点的像素值按照编码时所使用的帧内预测模式构建各个子块的预测信号,得到各个子块的预测信号,将各个子块的残差数据与预测信号相加,得到各个子块的重建信息,将各个子块的重建信息合并,即可得到当前块对应的重建信息。
如果当前块是按照垂直划分的,则按照从左到右的顺序,对当前块的各个子块统一进行熵解码,得到各个子块的量化系数,然后按照从左到右的顺序,对当前块的各个子块进行反量化和反变换,得到各个子块的残差数据,最后按照从左到右的顺序,利用当前子块块周围已重建区域内像素点的像素值按照编码时所使用的帧内预测模式构建各个子块的预测信号,得到各个子块的预设信号,将各个子块的残差数据与预测信号相加,得到各个子块的重建信息,将各个子块的重建信息合并,即可得到当前块对应的重建信息。
还需要说明的是,针对上述两个编码处理的实施例,如果对当前块是水平划分,则首先对当前块第一行的子块按照行的顺序分别进行预测、变换、量化和熵编码,然后对第二行的子块按照行的顺序分别进行预测、变换、量化和熵编码,依次从上到下处理第三个子块、第四个子块等。采用这种方式进行编码的原因是:下一个子块的帧内预测的参考像素依赖于上一个子块的重建信息,因此下一个子块在进行预测时,上一个子块已经完成预测、变换、量化和熵编码的过程,得到了重建信息。
如果对当前块是垂直划分,首先对当前块最左边的第一个子块按照列的顺序进行预测、变换、量化和熵编码,然后对从左边开始的第二列的子块按照列的顺序分别进行预测、变换、量化和熵编码,依次从左到右处理第三个子块、第四个子块等。采用这种方式进行编码的原因是:右边一个子块的帧内预测的参考像素依赖于前一个子块的重建信息,因此右边一个子块在进行预测时,左边那个子块已经完成预测、变换、量化和熵编码的过程,得到了重建信息。
还需要说明的是,上述图10、图13所示的编码端实施例,均是对变换步骤的改进,在进行帧内预测时,使用当前块整个进行帧内预测,得到残差数据后,将当前块划分为子块,将各个子块的残差数据进行变换处理。也可以是在进行帧内预测时,就直接划分为子块进行帧内预测,得到各个子块的残差数据,将各个子块的残差数据进行变换处理。本公开上述实施例编码端可以应用于上述两种方式。同理解码端的反变换处理也可以应用于述两种方式。
还需要说明的是,上述几个实施例中,启动帧内子块划分是指启动帧内子块划分模式。子块划分信息可以是子块划分方式,也即当前块支持的候选子块划分中确定的一种子块划分方式。上述子块划分信息也可以不添加在编码数据中,即不占用标记位,比如仅启用水平划分,则解码端确定进行子块划分时,就确定进行水平划分,同理仅启用垂直划分时,则解码端确定进行子块划分,就确定进行垂直划分,只有在水平划分和垂直划分均启用时,才会额外在编码数据中进行指示,这样,可以节约网络资源。
基于相同的技术构思,本公开实施例还提供了一种解码端,如图14所示,该解码端包括:
获取模块1410,用于获取当前块的编码数据;
确定模块1420,用于:
如果所述当前块满足子块划分条件,且根据所述当前块的编码数据,确定所述当前块启 动帧内子块划分,则根据所述当前块的子块划分信息,确定各个子块的尺寸信息和形状信息;
针对每个子块,根据所述子块的尺寸信息和形状信息,确定所述子块对应的变换核对;
变换模块1430,用于根据各个子块的变换核对,对所述各个子块反量化后的数据进行反变换;
其中,所述确定模块1420,用于:
如果所述子块的宽度满足第一尺寸限制条件且形状满足第一条件,则将DST7确定为所述子块的变换核对中的水平变换核;
如果所述子块的高度满足第二尺寸限制条件且形状满足第二条件,则将DST7确定为所述子块的变换核对中的垂直变换核。
在本公开的一种可能的实施方式中,所述确定模块1420,还用于
如果所述子块的宽度不满足所述第一尺寸限制条件和/或形状不满足所述第一条件,则将DCT2确定为所述子块的变换核对中的水平变换核;
如果所述子块的高度不满足所述第二尺寸限制条件和/或形状不满足所述第二条件,则将DCT2确定为所述子块的变换核对中的垂直变换核。
在本公开的一种可能的实施方式中,所述第一尺寸限制条件和所述第二尺寸限制条件为大于或等于第一数值,且小于或等于第二数值;所述第一条件为宽度小于或等于高度,所述第二条件为宽度大于或等于高度;或者,
所述第一尺寸限制条件和所述第二尺寸限制条件为大于或等于第一数值,且小于或等于第二数值;所述第一条件为宽度小于高度,所述第二条件为宽度大于高度。
在本公开的一种可能的实施方式中,所述子块划分条件为所述当前块为亮度块、所述当前块的高度和宽度均小于或等于第三数值,所述当前块在进行帧内预测时为单行参考、所述当前块包含的像素点的数目大于第四数值。
基于相同的技术构思,本公开实施例还提供了一种编码端,如图15所示,该编码端包括:
获取模块1510,用于获取当前块的残差数据;
确定模块1520,用于:
如果所述当前块满足子块划分条件,且启动帧内子块划分,则根据所述当前块的子块划分信息,确定所述当前块的各个子块的尺寸信息和形状信息;
针对每个子块,根据所述子块的尺寸信息和形状信息,确定所述子块对应的变换核对;
变换模块1530,用于根据各个子块的变换核对,对所述各个子块的残差数据进行变换;
其中,所述确定模块1520,用于:
如果所述子块的宽度满足第一尺寸限制条件且形状满足第一条件,将DST7确定为所述子块的变换核对中的水平变换核;
如果所述子块的高度满足第二尺寸限制条件且形状满足第二条件,将DST7确定为所述子块的变换核对中的垂直变换核。
在本公开的一种可能的实施方式中,所述获取模块1510,还用于:
如果所述当前块满足子块划分条件,则获取所述当前块对应的子块划分信息;
将所述子块划分信息添加至所述当前块的编码数据中。
本公开实施例中,在编码端,直接使用当前块的各个子块的尺寸信息和形状信息,即可确定出各个子块对应的变换核对,基于确定出的变换核对,进行编码处理,同理在解码端,也可以直接使用当前块的各个子块的尺寸信息和形状信息,即可确定出各个子块对应的变换 核对,基于确定出的变换核对,进行解码处理。这样,由于使用了子块的尺寸信息和形状信息,确定变换核对,而不是对于每个子块使用相同变换核对,所以可以提升编解码性能。而且在导出变换核对时,仅使用了高度和宽度,导出过程比较简单,也可以进一步提升编解码性能。
基于相同的技术构思,本公开实施例还提供了一种解码端,如图16所示,该解码端包括:
获取模块1610,用于获取当前块的编码数据;
确定模块1620,用于:
如果所述当前块满足子块划分条件,且根据所述当前块的编码数据,确定所述当前块启动帧内子块划分,则根据所述当前块的子块划分信息,确定各个子块的尺寸信息,并确定所述各个子块的帧内预测模式信息;
针对每个子块,根据所述子块的尺寸信息和所述子块的帧内预测模式信息,确定所述子块的变换核对;
变换模块1630,用于根据各个子块的变换核对,对所述各个子块反量化后的数据进行反变换;
其中,所述确定模块1620,用于:
针对每个子块,如果根据所述子块的尺寸信息,确定所述子块不满足尺寸限制条件,则将所述子块的帧内预测模式信息对应的变换核对确定为所述子块的变换核对,其中,所述尺寸限制条件是宽度不在预设数值范围内,且高度不在所述预设数值范围内。
在本公开的一种可能的实施方式中,所述确定模块1620,还用于:
如果根据所述子块的尺寸信息确定所述子块的高度满足所述尺寸限制条件且所述子块的宽度不满足所述尺寸限制条件,则将DCT2确定为所述子块的变换核对中的垂直变换核,并将所述子块的帧内预测模式信息对应的变换核对中的水平变换核确定为所述子块的变换核对中的水平变换核;
如果根据子块的尺寸信息确定子块的宽度满足所述尺寸限制条件且所述子块的高度不满足所述尺寸限制条件,则将DCT2确定为所述子块的变换核对中的水平变换核,将所述子块的帧内预测模式信息对应的变换核对中的垂直变换核确定为所述子块的变换核对中的垂直变换核;
如果根据子块的尺寸信息确定子块的宽度和宽度满足所述尺寸限制条件,则将DCT2确定为所述子块的变换核对中的水平变换核和垂直变换核。
在本公开的一种可能的实施方式中,所述确定模块1620,用于:
如果所述子块的帧内预测模式信息的模式号为1、33、35,则所述子块的变换核对为(DCT2,DCT2);
如果所述子块的帧内预测模式信息的模式号为0、31、32、34、36、37,则所述子块的变换核对为(DST7,DST7);
如果所述子块的帧内预测模式信息的模式号为2、30、2至30中的偶数、39、65和39至65中的奇数,则所述子块的变换核对为(DST7,DCT8);
如果所述子块的帧内预测模式信息的模式号为3、29、3至29中的奇数、38、66和38至66中的偶数,则所述子块的变换核对为(DCT8,DST7)。
在本公开的一种可能的实施方式中,所述确定模块1620,用于:
如果所述子块的帧内预测模式信息的模式号为1,则所述子块的变换核对为第一变换核对;
如果所述子块的帧内预测模式信息的模式号为0、31、32、33、34、35、36、37,则所述子块的变换核对为第二变换核对;
如果所述子块的帧内预测模式信息的模式号为2、30、2至30中的偶数、39、65和39至65中的奇数,则所述子块的变换核对为第三变换核对;
如果所述子块的帧内预测模式信息的模式号为3、29、3至29中的奇数、38、66和38至66中的偶数,则所述子块的变换核对为第四变换核对。
在本公开的一种可能的实施方式中,所述确定模块1620,用于:
如果所述子块的帧内预测模式信息的模式号为1,则所述子块的变换核对为第一变换核对;
如果所述子块的帧内预测模式信息的模式号为0,则所述子块的变换核对为第二变换核对;
如果所述子块的帧内预测模式信息的模式号为2、34、2至34中的偶数、35、65和35至65中的奇数,则所述子块的变换核对为第三变换核对;
如果所述子块的帧内预测模式信息的模式号为3、33、3至33中的奇数、36、66和36至66中的偶数,则所述子块的变换核对为第四变换核对。
在本公开的一种可能的实施方式中,所述确定模块1620,用于:
如果所述子块的帧内预测模式信息的模式号为1,则所述子块的变换核对为第一变换核对;
如果所述子块的帧内预测模式信息的模式号为0、3、65和3至65中的奇数,则所述子块的变换核对为第二变换核对;
如果所述子块的帧内预测模式信息的模式号为2、34、2至34中的偶数,则所述子块的变换核对为第三变换核对;
如果所述子块的帧内预测模式信息的模式号为36、66和36至66中的偶数,则所述子块的变换核对为第四变换核对。
在本公开的一种可能的实施方式中,所述第一变换核对为(DCT2,DCT2),所述第二变换核对为(DST7,DST7),所述第三变换核对为(DST7,DCT2),所述第四变换核对为(DCT2,DST7);或者,
所述第一变换核对为(DCT2,DCT2),所述第二变换核对为(DST7,DST7),所述第三变换核对为(DST7,DCT8),所述第四变换核对为(DCT8,DST7)。
在本公开的一种可能的实施方式中,所述确定模块1620,用于:
针对每个子块,如果根据所述子块的尺寸信息,确定所述子块不满足尺寸限制条件,且所述帧内预测模式信息满足帧内预测模式范围,则将所述帧内预测模式信息对应的变换核对确定为所述子块的变换核对。
在本公开的一种可能的实施方式中,所述确定模块1620,还用于:
针对每个子块,如果根据所述子块的尺寸信息,确定所述子块不满足尺寸限制条件,且所述帧内预测模式信息不满足帧内预测模式范围,则根据所述子块的尺寸信息,确定所述子块的宽度和高度的比值;
根据所述子块的宽度和高度的比值、所述子块的帧内预测模式信息,确定所述子块的变 换核对。
在本公开的一种可能的实施方式中,所述帧内预测模式范围包括模式号是0、1、31至37的帧内预测模式信息;
或者,所述帧内预测模式范围包括模式号是0和1的帧内预测模式信息;
或者,所述帧内预测模式范围包括模式号为0、1、3、65以及3至65中间的奇数的帧内预测模式信息。
在本公开的一种可能的实施方式中,所述帧内预测模式范围包括模式号是0、1、31至37的帧内预测模式信息;
所述确定模块1620,还用于:
如果所述当前块的宽度和高度的比值等于1,且所述帧内预测模式信息的模式号为2、4、6、30、39、41、43、65、6至30中的偶数、43至65中的奇数时,所述当前块的变换核对为(DST7,DCT2),如果当前块的宽度和高度的比值等于1,且所述帧内预测模式信息的模式号为3、5、7、29、7至29中的奇数时,所述当前块的变换核对为(DCT2,DST7);
如果所述当前块的宽度和高度的比值大于1,且所述帧内预测模式信息的模式号为(B+1)、(B+3)、30、3、5、B、39、41、43、65、(B+3)至30中的偶数、5至B中的奇数、43至65中的奇数时,所述当前块的变换核对为(DST7,DCT2),如果所述当前块的宽度和高度的比值大于1,且所述帧内预测模式信息的模式号为B+2、B+4、29、38、40、66、2、4、(B-1)、B+4至29中奇数、40至66之间的偶数、4至(B-1)之间的偶数时,所述当前块的变换核对为(DCT2,DST7);
如果当前块的宽度和高度的比值小于1,且所述帧内预测模式信息的模式号为2、4、6、30、(B+1)、(B+3)、66、39、41、(B-2)、6至30之间的偶数、(B+3)至66之间的偶数、41至(B-2)之间的奇数时,所述当前块的变换核对为(DST7,DCT2),如果所述当前块的宽度和高度的比值小于1,且所述帧内预测模式信息的模式号为3、5、29、B、(B+2)、65、38、40、(B-1)、5至29之间的奇数、(B+2)至65之间的奇数、40至(B-1)之间的偶数时,所述当前块的变换核对为(DCT2,DST7);
其中,当所述当前块的宽度与高度的比值为2、4、8、16时,B分别为7、11、13、15,当所述当前块的宽度与高度的比值为1/2、1/4、1/8、1/16时,B分别为61、57、55、53。
在本公开的一种可能的实施方式中,所述帧内预测模式范围包括模式号是0和1的帧内预测模式信息;
所述确定模块1620,还用于:
如果所述当前块的宽度和高度的比值等于1,且所述帧内预测模式信息的模式号为2、4、6、34、35、37、39、41、43、65、6至34之间的偶数、43至65之间的奇数时,所述当前块的变换核对为(DST7,DCT2),如果所述当前块的宽度和高度的比值等于1,且所述帧内预测模式信息的模式号为3、5、7、33、36、38、40、66、7至33之间的奇数、40至66之间的偶数时,所述当前块的变换核对为(DCT2,DST7);
如果所述当前块的宽度和高度的比值大于1,且所述帧内预测模式信息的模式号为(B+1)、(B+3)、34、3、5、B、35、37、39、65、(B+3)至34之前的偶数、5至B之间的奇数、39至65之间的奇数时,所述当前块的变换核对为(DST7,DCT2),如果所述当前块的宽度和高度的比值大于1,且所述帧内预测模式信息的模式号为(B+2)、(B+4)、33、2、4、(B-1)、36、38、66、(B+4)至33之间的奇数、4至(B-1)之间的偶数、38至66之间的偶 数时,所述当前块的变换核对为(DCT2,DST7);
如果所述当前块的宽度和高度的比值小于1,且所述帧内预测模式信息的模式号为2、4、6、34、(B+1)、(B+3)、66、35、37、39、(B-2)、6至34之间的偶数、(B+3)至66之间的奇数、39至(B-2)之间的奇数时,所述当前块的变换核对为(DST7,DCT2),如果所述当前块的宽度和高度的比值小于1,且所述帧内预测模式信息的模式号为3、5、33、B、(B+2)、65、36、38、(B-1)、5至33之间的奇数、(B+2)至65之间的奇数、38至(B-1)之间的偶数时,所述当前块的变换核对为(DCT2,DST7);
其中,当所述当前块的宽度与高度的比值为2、4、8、16时,B分别为7、11、13、15,当所述当前块的宽度与高度的比值为1/2、1/4、1/8、1/16时,B分别为61、57、55、53。
在本公开的一种可能的实施方式中,所述帧内预测模式范围包括模式号为0、1、3、65以及3至65中间的奇数的帧内预测模式信息;
所述确定模块1620,还用于:
如果所述当前块的宽度和高度的比值等于1,且所述帧内预测模式信息的模式号为2、4、6、34、6至34之间的偶数时,所述当前块的变换核对为(DST7,DCT2),如果所述当前块的宽度和高度的比值等于1,且所述帧内预测模式信息的模式号为36、38、40、66、40至66之间的偶数时,所述当前块的变换核对为(DCT2,DST7);
如果所述当前块的宽度和高度的比值大于1,且所述帧内预测模式信息的模式号为(B+1)、(B+3)、34、(B+3)至34之间的偶数时,所述当前块的变换核对为(DST7,DCT2),如果所述当前块的宽度和高度的比值大于1,且所述帧内预测模式信息的模式号为36、38、66、2、4、(B-1)、38至66之前的偶数、4至(B-1)之间的偶数时,所述当前块的变换核对为(DCT2,DST7);
如果所述当前块的宽度和高度的比值小于1,且所述帧内预测模式信息的模式号为2、4、6、34、(B+1)、(B+3)、66、6至34之间的偶数、(B+3)至66之间的偶数时,所述当前块的变换核对为(DST7,DCT2),如果所述当前块的宽度和高度的比值小于1,且所述帧内预测模式信息的模式号为36、38、(B-1)、38至(B-1)之间的偶数时,所述当前块的变换核对为(DCT2,DST7);
其中,当所述当前块的宽度与高度的比值为2、4、8、16时,B分别为7、11、13、15,当所述当前块的宽度与高度的比值为1/2、1/4、1/8、1/16时,B分别为61、57、55、53。
在本公开的一种可能的实施方式中,所述确定模块1620,还用于:
如果所述当前块未启动帧内子块划分,则根据所述当前块的尺寸信息和帧内预测模式信息确定所述当前块的变换核对。
在本公开的一种可能的实施方式中,所述确定模块1620,还用于:
如果根据所述尺寸信息确定所述当前块不满足目标尺寸限制条件时,将所述帧内预测模式信息对应的变换核对确定为所述当前块的变换核对,其中,所述目标尺寸限制条件是所述宽度大于或等于目标数值,且高度大于或等于所述目标数值;
如果根据所述尺寸信息,确定所述当前块的高度满足所述目标尺寸限制条件且所述当前块的宽度不满足所述目标尺寸限制条件时,将DCT2确定为所述当前块的变换核对中的垂直变换核,并将所述帧内预测模式信息对应的变换核对中的水平变换核确定为所述当前块的变换核对中的水平变换核;
如果根据所述尺寸信息,确定所述当前块的宽度满足所述目标尺寸限制条件且所述当前 块的高度不满足目标尺寸限制条件时,将DCT2确定为所述当前块的变换核对中的水平变换核,并将所述帧内预测模式信息对应的变换核对中的垂直变换核确定为所述当前块的变换核对中的垂直变换核;
如果根据所述尺寸信息,确定所述当前块的宽度和高度均满足所述目标尺寸限制条件时,将DCT2确定为所述当前块的变换核对中的水平变换核和垂直变换核。
在本公开的一种可能的实施方式中,所述子块划分条件为所述当前块为亮度块、所述当前块的高度和宽度均小于或等于第一预设数值,所述当前块在进行帧内预测时为单行参考、所述当前块包含的像素点的数目大于第二预设数值。
基于相同的技术构思,本公开实施例还提供了一种编码端,如图17所示,该编码端包括:
获取模块1710,用于获取当前块的残差数据;
确定模块1720,用于:
如果所述当前块满足子块划分条件,且启动帧内子块划分,则根据所述当前块的子块划分信息,确定所述当前块的各个子块的帧内预测模式信息、所述当前块的各个子块的尺寸信息;
针对每个子块,根据所述子块的尺寸信息和所述子块的帧内预测模式信息,确定所述子块的变换核对;
变换模块1730,用于根据各个子块的变换核对,对所述各个子块的残差数据进行变换;
其中,所述确定模块1720,用于:
针对每个子块,如果根据所述子块的尺寸信息,确定所述子块不满足尺寸限制条件,则将所述子块的帧内预测模式信息对应的变换核对确定为所述子块的变换核对,其中,所述尺寸限制条件是宽度不在第一预设范围内,且高度不在第二预设范围内。
在本公开的一种可能的实施方式中,所述获取模块1710,还用于:
如果所述当前块满足子块划分条件,则获取所述当前块的对应的子块划分信息;
将所述子块划分信息添加至所述当前块的编码数据中。
本公开实施例中,在编码端,直接使用当前块的帧内预测模式、子块的尺寸信息,即可确定出各个子块对应的变换核对,基于确定出的变换核对,进行编码处理,同理在解码端,也可以直接使用当前块的帧内预测模式,以及各个子块的子块的尺寸信息,即可确定出各个子块对应的变换核对,基于确定出的变换核对,进行解码处理。这样,由于使用了当前块的帧内预测模式、各个子块的子块的尺寸信息,确定变换核对,而不是对于每个子块使用相同变换核对,所以可以提升编解码性能。而且基于帧内预测模式选取变换核对,可以节约变换核对的选取时长,进一步可以提升编解码性能。
需要说明的是:上述实施例提供的解码端在进行解码时,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将解码端的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。另外,上述实施例提供的解码端与进行解码的方法实施例属于同一构思,其具体实现过程详见方法实施例,这里不再赘述。
需要说明的是:上述实施例提供的编码端在进行编码时,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将编码端的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。另外,上述实施例提供的编码端与进行编码的方法实施例属于同一构思,其具体实现过程详见方法实施 例,这里不再赘述。
图18是本发明实施例提供的一种编码端的结构示意图,该编码端1800可因配置或性能不同而产生比较大的差异,可以包括一个或一个以上处理器(central processing units,CPU)1801和一个或一个以上的存储器1802,其中,所述存储器1802中存储有至少一条指令,所述至少一条指令由所述处理器1801加载并执行以实现上述进行编码的方法的步骤。
图19是本发明实施例提供的一种解码端的结构示意图,该解码端1900可因配置或性能不同而产生比较大的差异,可以包括一个或一个以上处理器1901和一个或一个以上的存储器1902,其中,所述存储器1902中存储有至少一条指令,所述至少一条指令由所述处理器1901加载并执行以实现上述进行解码的方法的步骤。
本公开实施例还提供了一种计算机可读存储介质,所述存储介质内存储有计算机程序,所述计算机程序被处理器执行时实现上述所述的进行编码和进行解码的方法步骤。
本公开实施例还提供了一种编码端,包括处理器和存储器,其中,所述存储器,用于存放计算机程序;所述处理器,用于执行所述存储器上所存放的程序,实现上述所述的进行编码的方法步骤。
本公开实施例还提供了一种解码端,包括处理器和存储器,其中,所述存储器,用于存放计算机程序;所述处理器,用于执行所述存储器上所存放的程序,实现上述所述的进行解码的方法步骤。
本公开实施例还提供了一种编码和解码的系统,所述系统包括编码端和解码端,其中:
所述编码端,如上述进行编码处理的编码端;
所述解码端,如上述进行解码处理的解码端。
本领域普通技术人员可以理解实现上述实施例的全部或部分步骤可以通过硬件来完成,也可以通过程序来指令相关的硬件完成,所述的程序可以存储于一种计算机可读存储介质中,上述提到的存储介质可以是只读存储器,磁盘或光盘等。
以上所述仅为本公开的较佳实施例,并不用以限制本公开,凡在本公开的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本公开的保护范围之内。
Claims (24)
- 一种进行解码的方法,其特征在于,所述方法包括:获取当前块的编码数据;如果所述当前块满足子块划分条件,且根据所述当前块的编码数据,确定所述当前块启动帧内子块划分,则根据所述当前块的子块划分信息,确定各个子块的尺寸信息和形状信息;针对每个子块,根据所述子块的尺寸信息和形状信息,确定所述子块对应的变换核对;根据各个子块的变换核对,对所述各个子块反量化后的数据进行反变换;其中,针对每个子块,根据所述子块的尺寸信息和形状信息,确定所述子块对应的变换核对,包括:如果所述子块的宽度满足第一尺寸限制条件且形状满足第一条件,则将DST7确定为所述子块的变换核对中的水平变换核;如果所述子块的高度满足第二尺寸限制条件且形状满足第二条件,则将DST7确定为所述子块的变换核对中的垂直变换核。
- 根据权利要求1所述的方法,其特征在于,所述针对每个子块,根据所述子块的尺寸信息和形状信息,确定所述子块对应的变换核对,还包括:如果所述子块的宽度不满足所述第一尺寸限制条件和/或形状不满足所述第一条件,则将DCT2确定为所述子块的变换核对中的水平变换核;如果所述子块的高度不满足所述第二尺寸限制条件和/或形状不满足所述第二条件,则将DCT2确定为所述子块的变换核对中的垂直变换核。
- 根据权利要求1或2所述的方法,其特征在于,所述第一尺寸限制条件和所述第二尺寸限制条件为大于或等于第一数值,且小于或等于第二数值;所述第一条件为宽度小于或等于高度,所述第二条件为宽度大于或等于高度;或者,所述第一尺寸限制条件和所述第二尺寸限制条件为大于或等于第一数值,且小于或等于第二数值;所述第一条件为宽度小于高度,所述第二条件为宽度大于高度。
- 根据权利要求1或2所述的方法,其特征在于,所述子块划分条件为所述当前块为亮度块、所述当前块的高度和宽度均小于或等于第三数值,所述当前块在进行帧内预测时为单行参考、所述当前块包含的像素点的数目大于第四数值。
- 一种进行编码的方法,其特征在于,所述方法包括:获取当前块的残差数据;如果所述当前块满足子块划分条件,且启动帧内子块划分,则根据所述当前块的子块划分信息,确定所述当前块的各个子块的尺寸信息和形状信息;针对每个子块,根据所述子块的尺寸信息和形状信息,确定所述子块对应的变换核对;根据各个子块的变换核对,对所述各个子块的残差数据进行变换;其中,针对每个子块,根据所述子块的尺寸信息和形状信息,确定所述子块对应的变换核对,包括:如果所述子块的宽度满足第一尺寸限制条件且形状满足第一条件,将DST7确定为所述子块的变换核对中的水平变换核;如果所述子块的高度满足第二尺寸限制条件且形状满足第二条件,将DST7确定为所述子块的变换核对中的垂直变换核。
- 根据权利要求5所述的方法,其特征在于,所述方法还包括:如果所述当前块满足子块划分条件,则获取所述当前块对应的子块划分信息;将所述子块划分信息添加至所述当前块的编码数据中。
- 一种进行解码的方法,其特征在于,所述方法包括:获取当前块的编码数据;如果所述当前块满足子块划分条件,且根据所述当前块的编码数据,确定所述当前块启动帧内子块划分,则根据所述当前块的子块划分信息,确定各个子块的尺寸信息,并确定所述各个子块的帧内预测模式信息;针对每个子块,根据所述子块的尺寸信息和所述子块的帧内预测模式信息,确定所述子块的变换核对;根据各个子块的变换核对,对所述各个子块反量化后的数据进行反变换;其中,所述针对每个子块,根据所述子块的尺寸信息和所述子块的帧内预测模式信息,确定所述子块的变换核对,包括:针对每个子块,如果根据所述子块的尺寸信息,确定所述子块不满足尺寸限制条件,则将所述子块的帧内预测模式信息对应的变换核对确定为所述子块的变换核对,其中,所述尺寸限制条件是宽度不在预设数值范围内,且高度不在所述预设数值范围内。
- 根据权利要求7所述的方法,其特征在于,所述针对每个子块,根据所述子块的尺寸信息和所述子块的帧内预测模式信息,确定所述子块的变换核对,还包括:如果根据所述子块的尺寸信息确定所述子块的高度满足所述尺寸限制条件且所述子块的宽度不满足所述尺寸限制条件,则将DCT2确定为所述子块的变换核对中的垂直变换核,并将所述子块的帧内预测模式信息对应的变换核对中的水平变换核确定为所述子块的变换核对中的水平变换核;如果根据子块的尺寸信息确定子块的宽度满足所述尺寸限制条件且所述子块的高度不满足所述尺寸限制条件,则将DCT2确定为所述子块的变换核对中的水平变换核,将所述子块的帧内预测模式信息对应的变换核对中的垂直变换核确定为所述子块的变换核对中的垂直变换核;如果根据子块的尺寸信息确定子块的宽度和宽度满足所述尺寸限制条件,则将DCT2确定为所述子块的变换核对中的水平变换核和垂直变换核。
- 根据权利要求7所述的方法,其特征在于,所述将所述子块的帧内预测模式信息对应的变换核对确定为所述子块的变换核对,包括:如果所述子块的帧内预测模式信息的模式号为1、33、35,则所述子块的变换核对为(DCT2,DCT2);如果所述子块的帧内预测模式信息的模式号为0、31、32、34、36、37,则所述子块的变换核对为(DST7,DST7);如果所述子块的帧内预测模式信息的模式号为2、30、2至30中的偶数、39、65和39至65中的奇数,则所述子块的变换核对为(DST7,DCT8);如果所述子块的帧内预测模式信息的模式号为3、29、3至29中的奇数、38、66和38至66中的偶数,则所述子块的变换核对为(DCT8,DST7)。
- 根据权利要求7所述的方法,其特征在于,所述将所述子块的帧内预测模式信息对应的变换核对确定为所述子块的变换核对,包括:如果所述子块的帧内预测模式信息的模式号为1,则所述子块的变换核对为第一变换核对;如果所述子块的帧内预测模式信息的模式号为0、31、32、33、34、35、36、37,则所述子块的变换核对为第二变换核对;如果所述子块的帧内预测模式信息的模式号为2、30、2至30中的偶数、39、65和39至65中的奇数,则所述子块的变换核对为第三变换核对;如果所述子块的帧内预测模式信息的模式号为3、29、3至29中的奇数、38、66和38至66中的偶数,则所述子块的变换核对为第四变换核对。
- 根据权利要求7所述的方法,其特征在于,所述将所述子块的帧内预测模式信息对应的变换核对确定为所述子块的变换核对,包括:如果所述子块的帧内预测模式信息的模式号为1,则所述子块的变换核对为第一变换核对;如果所述子块的帧内预测模式信息的模式号为0,则所述子块的变换核对为第二变换核对;如果所述子块的帧内预测模式信息的模式号为2、34、2至34中的偶数、35、65和35至65中的奇数,则所述子块的变换核对为第三变换核对;如果所述子块的帧内预测模式信息的模式号为3、33、3至33中的奇数、36、66和36至66中的偶数,则所述子块的变换核对为第四变换核对。
- 根据权利要求7所述的方法,其特征在于,所述将所述子块的帧内预测模式信息对应的变换核对确定为所述子块的变换核对,包括:如果所述子块的帧内预测模式信息的模式号为1,则所述子块的变换核对为第一变换核对;如果所述子块的帧内预测模式信息的模式号为0、3、65和3至65中的奇数,则所述子块的变换核对为第二变换核对;如果所述子块的帧内预测模式信息的模式号为2、34、2至34中的偶数,则所述子块的变换核对为第三变换核对;如果所述子块的帧内预测模式信息的模式号为36、66和36至66中的偶数,则所述子块的变换核对为第四变换核对。
- 根据权利要求10至12任一所述的方法,其特征在于,所述第一变换核对为(DCT2,DCT2),所述第二变换核对为(DST7,DST7),所述第三变换核对为(DST7,DCT2),所述第四变换核对为(DCT2,DST7);或者,所述第一变换核对为(DCT2,DCT2),所述第二变换核对为(DST7,DST7),所述第三变换核对为(DST7,DCT8),所述第四变换核对为(DCT8,DST7)。
- 根据权利要求7所述的方法,其特征在于,所述针对每个子块,如果根据所述子块的尺寸信息,确定所述子块不满足尺寸限制条件,则将所述子块的帧内预测模式信息对应的 变换核对确定为所述子块的变换核对,包括:针对每个子块,如果根据所述子块的尺寸信息,确定所述子块不满足尺寸限制条件,且所述帧内预测模式信息满足帧内预测模式范围,则将所述帧内预测模式信息对应的变换核对确定为所述子块的变换核对。
- 根据权利要求14所述的方法,其特征在于,所述方法还包括:针对每个子块,如果根据所述子块的尺寸信息,确定所述子块不满足尺寸限制条件,且所述帧内预测模式信息不满足帧内预测模式范围,则根据所述子块的尺寸信息,确定所述子块的宽度和高度的比值;根据所述子块的宽度和高度的比值、所述子块的帧内预测模式信息,确定所述子块的变换核对。
- 根据权利要求7所述的方法,其特征在于,所述方法还包括:如果所述当前块未启动帧内子块划分,则根据所述当前块的尺寸信息和帧内预测模式信息确定所述当前块的变换核对。
- 根据权利要求16所述的方法,其特征在于,所述根据所述当前块的尺寸信息和帧内预测模式信息确定所述当前块的变换核对,包括:如果根据所述尺寸信息确定所述当前块不满足目标尺寸限制条件时,将所述帧内预测模式信息对应的变换核对确定为所述当前块的变换核对,其中,所述目标尺寸限制条件是所述宽度大于或等于目标数值,且高度大于或等于所述目标数值;如果根据所述尺寸信息,确定所述当前块的高度满足所述目标尺寸限制条件且所述当前块的宽度不满足所述目标尺寸限制条件时,将DCT2确定为所述当前块的变换核对中的垂直变换核,并将所述帧内预测模式信息对应的变换核对中的水平变换核确定为所述当前块的变换核对中的水平变换核;如果根据所述尺寸信息,确定所述当前块的宽度满足所述目标尺寸限制条件且所述当前块的高度不满足目标尺寸限制条件时,将DCT2确定为所述当前块的变换核对中的水平变换核,并将所述帧内预测模式信息对应的变换核对中的垂直变换核确定为所述当前块的变换核对中的垂直变换核;如果根据所述尺寸信息,确定所述当前块的宽度和高度均满足所述目标尺寸限制条件时,将DCT2确定为所述当前块的变换核对中的水平变换核和垂直变换核。
- 根据权利要求7至12任一所述的方法,其特征在于,所述子块划分条件为所述当前块为亮度块、所述当前块的高度和宽度均小于或等于第一预设数值,所述当前块在进行帧内预测时为单行参考、所述当前块包含的像素点的数目大于第二预设数值。
- 一种进行编码的方法,其特征在于,所述方法包括:获取当前块的残差数据;如果所述当前块满足子块划分条件,且启动帧内子块划分,则根据所述当前块的子块划分信息,确定所述当前块的各个子块的帧内预测模式信息、所述当前块的各个子块的尺寸信息;针对每个子块,根据所述子块的尺寸信息和所述子块的帧内预测模式信息,确定所述子块的变换核对;根据各个子块的变换核对,对所述各个子块的残差数据进行变换;其中,所述针对每个子块,根据所述子块的尺寸信息和所述子块的帧内预测模式信息,确定所述子块的变换核对,包括:针对每个子块,如果根据所述子块的尺寸信息,确定所述子块不满足尺寸限制条件,则将所述子块的帧内预测模式信息对应的变换核对确定为所述子块的变换核对,其中,所述尺寸限制条件是宽度不在第一预设范围内,且高度不在第二预设范围内。
- 根据权利要求19所述的方法,其特征在于,所述方法还包括:如果所述当前块满足子块划分条件,则获取所述当前块的对应的子块划分信息;将所述子块划分信息添加至所述当前块的编码数据中。
- 一种进行解码的解码端,其特征在于,所述解码端包括:获取模块,用于获取当前块的编码数据;确定模块,用于:如果所述当前块满足子块划分条件,且根据所述当前块的编码数据,确定所述当前块启动帧内子块划分,则根据所述当前块的子块划分信息,确定各个子块的尺寸信息和形状信息;针对每个子块,根据所述子块的尺寸信息和形状信息,确定所述子块对应的变换核对;变换模块,用于根据各个子块的变换核对,对所述各个子块反量化后的数据进行反变换;其中,所述确定模块,用于:如果所述子块的宽度满足第一尺寸限制条件且形状满足第一条件,则将DST7确定为所述子块的变换核对中的水平变换核;如果所述子块的高度满足第二尺寸限制条件且形状满足第二条件,则将DST7确定为所述子块的变换核对中的垂直变换核。
- 一种进行编码的编码端,其特征在于,所述编码端包括:获取模块,用于获取当前块的残差数据;确定模块,用于:如果所述当前块满足子块划分条件,且启动帧内子块划分,则根据所述当前块的子块划分信息,确定所述当前块的各个子块的尺寸信息和形状信息;针对每个子块,根据所述子块的尺寸信息和形状信息,确定所述子块对应的变换核对;变换模块,用于根据各个子块的变换核对,对所述各个子块的残差数据进行变换;其中,所述确定模块,用于:如果所述子块的宽度满足第一尺寸限制条件且形状满足第一条件,将DST7确定为所述子块的变换核对中的水平变换核;如果所述子块的高度满足第二尺寸限制条件且形状满足第二条件,将DST7确定为所述子块的变换核对中的垂直变换核。
- 一种进行解码的解码端,其特征在于,所述解码端包括:获取模块,用于获取当前块的编码数据;确定模块,用于:如果所述当前块满足子块划分条件,且根据所述当前块的编码数据,确定所述当前块启动帧内子块划分,则根据所述当前块的子块划分信息,确定各个子块的尺寸信息,并确定所述各个子块的帧内预测模式信息;针对每个子块,根据所述子块的尺寸信息和所述子块的帧内预测模式信息,确定所述子块的变换核对;变换模块,用于根据各个子块的变换核对,对所述各个子块反量化后的数据进行反变换;其中,所述确定模块,用于:针对每个子块,如果根据所述子块的尺寸信息,确定所述子块不满足尺寸限制条件,则将所述子块的帧内预测模式信息对应的变换核对确定为所述子块的变换核对,其中,所述尺寸限制条件是宽度不在预设数值范围内,且高度不在所述预设数值范围内。
- 一种进行编码的编码端,其特征在于,所述编码端包括:获取模块,用于获取当前块的残差数据;确定模块,用于:如果所述当前块满足子块划分条件,且启动帧内子块划分,则根据所述当前块的子块划分信息,确定所述当前块的各个子块的帧内预测模式信息、所述当前块的各个子块的尺寸信息;针对每个子块,根据所述子块的尺寸信息和所述子块的帧内预测模式信息,确定所述子块的变换核对;变换模块,用于根据各个子块的变换核对,对所述各个子块的残差数据进行变换;其中,所述确定模块,用于:针对每个子块,如果根据所述子块的尺寸信息,确定所述子块不满足尺寸限制条件,则将所述子块的帧内预测模式信息对应的变换核对确定为所述子块的变换核对,其中,所述尺寸限制条件是宽度不在第一预设范围内,且高度不在第二预设范围内。
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
EP20770441.2A EP3923575A4 (en) | 2019-03-09 | 2020-03-09 | METHODS FOR PERFORMING CODING AND DECODING, CODING END AND DECODED END |
US17/437,391 US11825082B2 (en) | 2019-03-09 | 2020-03-09 | Coding and decoding methods, coding and decoding device |
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910177528.9 | 2019-03-09 | ||
CN201910177528.9A CN111669582B (zh) | 2019-03-09 | 2019-03-09 | 进行编码和解码的方法、编码端、解码端和系统 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2020182103A1 true WO2020182103A1 (zh) | 2020-09-17 |
Family
ID=68289760
Family Applications (2)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2020/078487 WO2020182103A1 (zh) | 2019-03-09 | 2020-03-09 | 进行编码和解码的方法、编码端和解码端 |
PCT/CN2020/078489 WO2020182105A1 (zh) | 2019-03-09 | 2020-03-09 | 进行编码和解码的方法、解码端和编码端 |
Family Applications After (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2020/078489 WO2020182105A1 (zh) | 2019-03-09 | 2020-03-09 | 进行编码和解码的方法、解码端和编码端 |
Country Status (4)
Country | Link |
---|---|
US (1) | US11825082B2 (zh) |
EP (1) | EP3923575A4 (zh) |
CN (2) | CN111669582B (zh) |
WO (2) | WO2020182103A1 (zh) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US11539952B2 (en) | 2019-03-12 | 2022-12-27 | Qualcomm Incorporated | Implicit transform selection in video coding |
Families Citing this family (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20200288130A1 (en) * | 2019-03-07 | 2020-09-10 | Qualcomm Incorporated | Simplification of sub-block transforms in video coding |
CN111669582B (zh) | 2019-03-09 | 2022-05-20 | 杭州海康威视数字技术股份有限公司 | 进行编码和解码的方法、编码端、解码端和系统 |
CN112887734B (zh) * | 2019-11-29 | 2024-10-15 | 北京三星通信技术研究有限公司 | 视频图像编解码中进行变换的方法及装置 |
WO2022222985A1 (en) * | 2021-04-22 | 2022-10-27 | Beijing Bytedance Network Technology Co., Ltd. | Feature based transform selection |
CN115379217A (zh) * | 2022-07-14 | 2022-11-22 | 百果园技术(新加坡)有限公司 | 一种视频编码处理方法、装置、设备及存储介质 |
CN116233420B (zh) * | 2023-03-24 | 2024-05-14 | 深圳市博锐高科科技有限公司 | 一种基于vvc的帧内快速编码方法 |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106101705A (zh) * | 2009-02-23 | 2016-11-09 | 韩国科学技术院 | 用于对分割块进行编码的视频编码方法、用于对分割块进行解码的视频解码方法以及用于实施上述方法的记录媒体 |
WO2018026166A1 (ko) * | 2016-08-01 | 2018-02-08 | 한국전자통신연구원 | 영상 부호화/복호화 방법, 장치 및 비트스트림을 저장한 기록 매체 |
US20180249179A1 (en) * | 2017-02-28 | 2018-08-30 | Google Inc. | Transform Kernel Selection and Entropy Coding |
WO2019009584A1 (ko) * | 2017-07-04 | 2019-01-10 | 삼성전자 주식회사 | 다중 코어 변환에 의한 비디오 복호화 방법 및 장치, 다중 코어 변환에 의한 비디오 부호화 방법 및 장치 |
Family Cites Families (17)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7760950B2 (en) * | 2002-09-26 | 2010-07-20 | Ntt Docomo, Inc. | Low complexity and unified transforms for video coding |
KR101487687B1 (ko) * | 2010-01-14 | 2015-01-29 | 삼성전자주식회사 | 큰 크기의 변환 단위를 이용한 영상 부호화, 복호화 방법 및 장치 |
US8885701B2 (en) * | 2010-09-08 | 2014-11-11 | Samsung Electronics Co., Ltd. | Low complexity transform coding using adaptive DCT/DST for intra-prediction |
KR20120035096A (ko) * | 2010-10-04 | 2012-04-13 | 한국전자통신연구원 | 쿼드 트리 변환 구조에서 부가 정보의 시그널링 방법 및 장치 |
FR2972588A1 (fr) * | 2011-03-07 | 2012-09-14 | France Telecom | Procede de codage et decodage d'images, dispositif de codage et decodage et programmes d'ordinateur correspondants |
CN102843560B (zh) * | 2011-06-21 | 2015-01-21 | 华为技术有限公司 | 图像变换处理方法、设备和系统 |
KR101845074B1 (ko) * | 2011-10-19 | 2018-04-03 | 주식회사 케이티 | 영상 부호화/복호화 방법 및 그 장치 |
US11323699B2 (en) * | 2012-04-16 | 2022-05-03 | Electronics And Telecommunications Research Institute | Encoding method and decoding method, and device using same |
JP2014036278A (ja) * | 2012-08-07 | 2014-02-24 | Nippon Hoso Kyokai <Nhk> | 画像符号化装置、画像復号装置及びプログラム |
US10742988B2 (en) * | 2015-02-12 | 2020-08-11 | Lg Electronics Inc. | Method and apparatus for processing video signal using graph-based transform |
KR102365964B1 (ko) * | 2016-03-28 | 2022-02-22 | 주식회사 케이티 | 비디오 신호 처리 방법 및 장치 |
CN114422796A (zh) * | 2016-06-24 | 2022-04-29 | 韩国电子通信研究院 | 用于基于变换的图像编码/解码的方法和设备 |
US10972733B2 (en) * | 2016-07-15 | 2021-04-06 | Qualcomm Incorporated | Look-up table for enhanced multiple transform |
EP3567858A4 (en) * | 2017-01-03 | 2020-06-17 | LG Electronics Inc. -1- | VIDEO SIGNAL ENCODING / DECODING METHOD AND DEVICE USING A SECONDARY TRANSFORM |
US11218694B2 (en) * | 2018-09-24 | 2022-01-04 | Qualcomm Incorporated | Adaptive multiple transform coding |
KR102475963B1 (ko) | 2019-03-03 | 2022-12-08 | 후아웨이 테크놀러지 컴퍼니 리미티드 | 변환 프로세스를 위해 사용되는 인코더, 디코더 및 대응하는 방법 |
CN111669582B (zh) | 2019-03-09 | 2022-05-20 | 杭州海康威视数字技术股份有限公司 | 进行编码和解码的方法、编码端、解码端和系统 |
-
2019
- 2019-03-09 CN CN201910177528.9A patent/CN111669582B/zh active Active
- 2019-03-09 CN CN201910570214.5A patent/CN110392256B/zh active Active
-
2020
- 2020-03-09 EP EP20770441.2A patent/EP3923575A4/en active Pending
- 2020-03-09 WO PCT/CN2020/078487 patent/WO2020182103A1/zh unknown
- 2020-03-09 US US17/437,391 patent/US11825082B2/en active Active
- 2020-03-09 WO PCT/CN2020/078489 patent/WO2020182105A1/zh active Application Filing
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106101705A (zh) * | 2009-02-23 | 2016-11-09 | 韩国科学技术院 | 用于对分割块进行编码的视频编码方法、用于对分割块进行解码的视频解码方法以及用于实施上述方法的记录媒体 |
WO2018026166A1 (ko) * | 2016-08-01 | 2018-02-08 | 한국전자통신연구원 | 영상 부호화/복호화 방법, 장치 및 비트스트림을 저장한 기록 매체 |
US20180249179A1 (en) * | 2017-02-28 | 2018-08-30 | Google Inc. | Transform Kernel Selection and Entropy Coding |
WO2019009584A1 (ko) * | 2017-07-04 | 2019-01-10 | 삼성전자 주식회사 | 다중 코어 변환에 의한 비디오 복호화 방법 및 장치, 다중 코어 변환에 의한 비디오 부호화 방법 및 장치 |
Non-Patent Citations (3)
Title |
---|
CHOI, K. ET AL.: "CE6-Related: Simplification on MTS Kernel Derivation", JOINT VIDEO EXPERTS TEAM (JVET) OF ITU-T SG 16 WP 3 AND ISO/IEC JTC 1/SC 29/WG 11 12TH MEETING: MACAO, CN (JVET-L0059), 3 October 2018 (2018-10-03), XP030194380 * |
See also references of EP3923575A4 |
SHRESTHA, S. ET AL.: "CE6-Related: DST-3 Based Transform Kernels Derivation", JOINT VIDEO EXPERTS TEAM (JVET) OF ITU-T SG 16 WP 3 AND ISO/IEC JTC 1/SC 29/WG 11 13TH MEETING: MARRAKECH, MA ( JVET-M0397), 10 January 2019 (2019-01-10), XP030201356 * |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US11539952B2 (en) | 2019-03-12 | 2022-12-27 | Qualcomm Incorporated | Implicit transform selection in video coding |
Also Published As
Publication number | Publication date |
---|---|
CN111669582A (zh) | 2020-09-15 |
CN110392256A (zh) | 2019-10-29 |
US20220182624A1 (en) | 2022-06-09 |
CN111669582B (zh) | 2022-05-20 |
EP3923575A4 (en) | 2022-06-08 |
WO2020182105A1 (zh) | 2020-09-17 |
CN110392256B (zh) | 2020-12-11 |
US11825082B2 (en) | 2023-11-21 |
EP3923575A1 (en) | 2021-12-15 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2020182103A1 (zh) | 进行编码和解码的方法、编码端和解码端 | |
WO2020182102A1 (zh) | 进行编码和解码的方法、解码端和编码端 | |
CN111385584B (zh) | 进行编码、解码的方法、装置和系统 | |
CN111669579B (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: 20770441 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
ENP | Entry into the national phase |
Ref document number: 2020770441 Country of ref document: EP Effective date: 20210910 |