WO2020000487A1 - Transformation method, inverse transformation method and apparatus - Google Patents

Transformation method, inverse transformation method and apparatus Download PDF

Info

Publication number
WO2020000487A1
WO2020000487A1 PCT/CN2018/093923 CN2018093923W WO2020000487A1 WO 2020000487 A1 WO2020000487 A1 WO 2020000487A1 CN 2018093923 W CN2018093923 W CN 2018093923W WO 2020000487 A1 WO2020000487 A1 WO 2020000487A1
Authority
WO
WIPO (PCT)
Prior art keywords
transformation
transformation check
check
target
dst
Prior art date
Application number
PCT/CN2018/093923
Other languages
French (fr)
Chinese (zh)
Inventor
朱策
曹小强
林永兵
郑建铧
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Priority to PCT/CN2018/093923 priority Critical patent/WO2020000487A1/en
Publication of WO2020000487A1 publication Critical patent/WO2020000487A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods 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/18Methods 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 a set of transform coefficients

Definitions

  • the present application relates to the technical field of video encoding and decoding, and more particularly, to a transform method, an inverse transform method, and a device.
  • Digital video capabilities can be incorporated into a wide variety of devices, including digital television, digital live broadcast systems, wireless broadcast systems, personal digital assistants (PDAs), laptop or desktop computers, tablet computers, electronics Book readers, digital cameras, digital recording devices, digital media players, video game devices, video game consoles, cellular or satellite radio phones (so-called "smart phones"), video teleconferencing devices, video streaming devices And similar.
  • Digital video devices implement video compression technology, for example, in standards defined by MPEG-2, MPEG-4, ITU-T H.263, ITU-T H.264 / MPEG-4 Part 10 Advanced Video Coding (AVC), Video coding standard H.265 / High Efficiency Video Coding (HEVC) standard and the video compression technology described in the extension of such standards.
  • Video devices can implement such video compression techniques to more efficiently transmit, receive, encode, decode, and / or store digital video information.
  • Video compression techniques perform spatial (intra-image) prediction and / or temporal (inter-image) prediction to reduce or remove redundancy inherent in video sequences.
  • a video slice ie, a video frame or a portion of a video frame
  • image blocks can also be referred to as tree blocks, coding units (CU), and / Or coding nodes.
  • Spatial predictions about reference samples in neighboring blocks in the same image are used to encode image blocks in the to-be-encoded (I) slice of the image.
  • the image blocks in the to-be-intercoded (P or B) slice of the image may use spatial prediction relative to reference samples in neighboring blocks in the same image or temporal prediction relative to reference samples in other reference images.
  • An image may be referred to as a frame, and a reference image may be referred to as a reference frame.
  • an inter prediction mode or an intra prediction mode is often used for prediction.
  • an optimal transform check is selected from a variety of transform checks based on the rate distortion, and then the residual block is performed according to the optimal transform check. Transform to get the transform coefficient.
  • the present application provides a transform method, an inverse transform method, and a device to implement an inverse transform on a residual coefficient.
  • an inverse transform method includes: parsing a bitstream to obtain a residual coefficient of a current block, an intra prediction mode, and a target transform check to determine parameters; a first transform check, a second transform check, And a third transformation kernel determines a target transformation check corresponding to the target transformation check determination parameter; wherein the second transformation check is a first candidate transformation check or a second transformation candidate transformation check, the first candidate transformation check and the second transformation candidate
  • the transformation check includes the transformation kernel DST-VII, the first candidate transformation check and the second transformation candidate check correspond to the intra prediction mode corresponding to the current block; according to the target transformation check, the residual coefficient is inversely transformed to obtain the residual block.
  • parsing the bitstream to obtain the residual coefficient of the current block may specifically refer to firstly parsing the quantized coefficient from the bitstream and then dequantizing the quantized coefficient to obtain the residual coefficient, which can be used for inverse transformation .
  • the target transformation check can be determined through the determined target transformation check determination parameters, and the inverse transformation of the residual coefficient can be realized according to the target transformation check.
  • first candidate transformation check and the second transformation check both include a transformation kernel DST-VII, it is possible to increase the possibility of including the transformation kernel DST-VII in the final target transformation check, so that in the target transformation check, A better inverse transform effect may be obtained when inverse transforming the residual coefficients.
  • the intra prediction mode uses the top and right reference pixels of the current block to predict the current block, and the prediction error tends to gradually increase from top to bottom from left to right, the base of DST-VII The function is gradually increasing. Therefore, the DST-VII transformation kernel is suitable for this gradually increasing characteristic. Using DST-VII for transformation and inverse transformation can achieve better results.
  • the target transformation check determination parameter includes a first flag bit, or the target transformation check determination parameter includes a first flag bit and a transformation index value.
  • determining the target transformation check corresponding to the determination parameter corresponding to the target transformation check determination from the first transformation check, the second transformation check, and the third transformation check includes: when the first flag bit is the first value, The target transformation check corresponding to the target transformation check determination parameter is determined to be the first transformation check; when the first flag bit is the second value and the transformation index value is the first transformation index value, the target corresponding to the target transformation check determination parameter is determined The transformation check is the second transformation check; when the first flag bit is the second value and the transformation index value is the second transformation index value, the target transformation check corresponding to the target transformation check determination parameter is determined to be the third transformation check.
  • the total number of types of the transformation kernels included in the first transformation check, the first candidate transformation check, the second candidate transformation check, and the third transformation check is less than 5.
  • the storage space occupied by storing the transformation kernel can be reduced.
  • the transformation kernels included in the first transformation check, the first candidate transformation check, the second candidate transformation check, and the third transformation check include DCT-II, DCT-VIII, and DST-VII.
  • the parameter value of the target transformation check determination parameter may also have a direct mapping relationship with the transformation check, so that the target transformation kernel may be directly determined according to the parameter value of the target transformation check determination parameter.
  • determining a target transformation check corresponding to the target transformation check determination parameter from the first transformation check, the second transformation check, and the third transformation check includes: determining the parameter value of the parameter and the target transformation according to the target transformation check. The mapping relationship between the parameter value of the determined parameter and the transformation check is checked, and the target transformation check is determined.
  • the first transformation check to the third transformation check are respectively corresponding. Then, when the decoding end resolves that the target transformation check determination parameter is the first parameter value, it can directly determine that the target transformation check is the first transformation check.
  • the first flag bit is an explicit multi-core transform EMT flag bit.
  • the above-mentioned EMT flag can also be called an EMT encoding flag.
  • the first value is 0, and the second value is 1.
  • the value of the EMT flag when the value of the EMT flag is 0, it means that a single-core inverse transformation is used when inversely transforming the residual coefficient (correspondingly, the single-core transformation is also used when the encoding end is transformed); when the EMT flag is set, A value of 1 indicates that a multi-core inverse transform is used when inverse transforming the residual coefficient (correspondingly, the multi-core transform is also used when the encoding end performs the transform).
  • the first transformation check is a transformation check composed of the same transformation kernel.
  • the first transformation check is (DCT-II, DCT-II).
  • the first candidate transformation check is (DST-VII, DCT-VIII), and the second candidate transformation check is (DCT-VIII, DST-VII); within a frame corresponding to the current block
  • the second transformation check is the first candidate transformation check; when the mode number of the intra prediction mode corresponding to the current block is greater than the preset threshold, the first transformation check is the second candidate. Transform check.
  • the preset threshold is N.
  • N 18.
  • the third transformation check is (DST-VII, DST-VII).
  • the first transformation check is (DCT-II, DTC-II).
  • the first transformation index value is 0, the second transformation index value is 1, or the first transformation index value is 1 and the second transformation index value is 0.
  • the lengths of the codewords corresponding to the first transformation index value and the second transformation index value are both 1.
  • the lengths of the codewords corresponding to the transformation index value are all 1, which can reduce the number of occupied bits required to indicate the transformation index value.
  • the codeword corresponding to the first transformation index value is 0, and the codeword corresponding to the second transformation index value is 1.
  • the codeword corresponding to the first transformation index value is 1, and the codeword corresponding to the second transformation index value is 0.
  • the above method before the target transformation check is determined, further includes: determining an intra prediction mode corresponding to the current block as a directional prediction mode.
  • the above method before determining the target transformation check, further includes: determining that the width and height of the current block are both less than or equal to M.
  • the value of M is 64.
  • the above method further includes: when the intra prediction mode corresponding to the current block is a DC mode, determining transformation check (DCT-II, DTC-II) as a target transformation check.
  • the above method further includes: when the intra prediction mode corresponding to the current block is a planar mode, determining a transformation check (DST-VII, DST-VII) as a target transformation check.
  • a transformation check DST-VII, DST-VII
  • the intra prediction mode is a DC mode or a planar mode
  • the process of determining the target transformation kernel can be simplified and the time required for the inverse transformation can be reduced.
  • a transformation check (DST-VII, DST-VII) is determined as the target transformation check.
  • N can be 4, 8, and 16 and so on.
  • an inverse transform method includes: parsing a bitstream to obtain a residual coefficient of a current block and a target transform check determination parameter; a first transform check, a second transform check, a third transform check, and A target transformation check corresponding to the target transformation check determination parameter is determined in the fourth transformation check; wherein the second transformation check, the third transformation check, and the fourth transformation check all include a transformation kernel DST-VII, so The second transformation check, at least one of the third transformation check and the fourth transformation check includes a transformation kernel DCT-VIII; according to the target transformation check, performing an inverse transformation on the residual coefficient to obtain a residual Bad block.
  • parsing the bitstream to obtain the residual coefficient of the current block may specifically refer to firstly parsing the quantized coefficient from the bitstream, and then dequantizing the quantized coefficient to obtain the residual coefficient, which can be used for inverse transformation .
  • the target transformation check can be determined through the determined target transformation check determination parameters, and the inverse transformation of the residual coefficient can be realized according to the target transformation check.
  • first candidate transformation check and the second transformation check both include a transformation kernel DST-VII, it is possible to increase the possibility of including the transformation kernel DST-VII in the final target transformation check, so that in the target transformation check, A better inverse transform effect may be obtained when inverse transforming the residual coefficients.
  • the intra prediction mode uses the top and right reference pixels of the current block to predict the current block, and the prediction error tends to gradually increase from top to bottom from left to right, the base of DST-VII The function is gradually increasing. Therefore, the DST-VII transformation kernel is suitable for this gradually increasing characteristic. Using DST-VII for transformation and inverse transformation can achieve better results.
  • the target transformation check determination parameter includes a first flag bit, or the target transformation check determination parameter includes a first flag bit and a transformation index value.
  • determining a target transformation check corresponding to the target transformation check determination parameter from the first transformation check, the second transformation check, the third transformation check, and the fourth transformation check includes: when the first flag bit is When it is the first value, it is determined that the target transformation check corresponding to the target transformation check determination parameter is the first transformation check; when the first flag bit is the second value and the transformation index value is the first transformation index value To determine a target transformation check corresponding to the target transformation check determination parameter as a second transformation check; when the first flag bit is a second value and the transformation index value is a second transformation index value, determine the target transformation
  • the target transformation check corresponding to the transformation check determination parameter is a third transformation check; when the first flag bit has a second value and the transformation index value is a third transformation index value, determining a parameter corresponding to the target transformation check determination parameter
  • the target transformation check is a fourth transformation check.
  • the total number of types of transformation kernels included in the first transformation check, the second transformation check, the third transformation check, and the fourth transformation check is less than 5.
  • the storage space occupied by storing the transformation kernel can be reduced.
  • the transformation kernels included in the first transformation check, the first candidate transformation check, the second candidate transformation check, and the third transformation check include DCT-II, DCT-VIII, and DST-VII.
  • determining, from the first transformation check, the second transformation check, the third transformation check, and the fourth transformation check, a target transformation check corresponding to the determined and target transformation check determination parameter includes: determining the parameter according to the target transformation check.
  • the parameter value and the target transformation check determine the mapping relationship between the parameter value of the parameter and the transformation check to determine the target transformation check.
  • the target transformation check determination parameters are respectively the first parameter value to the fourth parameter value, they correspond to the first transformation check to the fourth transformation check, respectively.
  • the decoding end resolves that the target transformation check determination parameter is the first parameter value, it can directly determine that the target transformation check is the first transformation check.
  • the first flag bit is an explicit multi-core transform EMT flag bit.
  • the first value is 0, and the second value is 1.
  • the value of the EMT flag when the value of the EMT flag is 0, it means that a single-core inverse transformation is used when the inverse transformation is performed on the residual coefficient (correspondingly, the single-core transformation is also used when the encoding end is transformed); A value of 1 indicates that a multi-core inverse transform is used when inverse transforming the residual coefficient (correspondingly, the multi-core transform is also used when the encoding end performs the transform).
  • the first transformation check is a transformation check composed of the same transformation kernel.
  • the length of the codeword corresponding to the first transformation index value is 1, and the length of the codeword corresponding to the second transformation index value and the third transformation index value are both 2.
  • the first to third transformation index values are 0, 1, and 2, respectively.
  • the codeword corresponding to the first transformation index value is 0, the codeword corresponding to the second transformation index value is 10, and the codeword corresponding to the third transformation index value is 11.
  • the codewords corresponding to the second transformation index value and the third transformation index value are 10 and 01, respectively.
  • the first transformation check is (DCT-II, DTC-II)
  • the second transformation check is (DST-VII, DST-VII)
  • the third transformation check is (DCT-VIII , DST-VII)
  • the fourth transformation check is (DST-VII, DCT-VIII).
  • the above method before determining the target transformation check, further includes: determining an intra prediction mode corresponding to the current block as a directional prediction mode.
  • the above method before the target transformation check is determined, further includes: determining that a width and a height of the current block are both less than or equal to M.
  • the value of M is 64.
  • the above method further includes: when the intra prediction mode corresponding to the current block is a DC mode, determining a transformation check (DCT-II, DTC-II) as a target transformation check.
  • a transformation check DCT-II, DTC-II
  • the above method further includes: when the intra prediction mode corresponding to the current block is a planar mode, determining a transformation check (DST-VII, DST-VII) as a target transformation check.
  • a transformation check DST-VII, DST-VII
  • the inverse transformation can be simplified by directly using a preset transformation check, which can simplify the process of determining the target transformation kernel and reduce the time required for the inverse transformation.
  • a transformation check (DST-VII, DST-VII) is determined as the target transformation check.
  • N can be 4, 8, and 16 and so on.
  • a transformation method includes: obtaining a residual block of an image block to be processed; obtaining a candidate transformation check of the residual block according to preset first mapping relationship information; and selecting from the candidate transformation check The transformation check with the lowest rate distortion is used as the target transformation check. According to the target transformation check, the residual block is transformed to obtain the transformation coefficient of the image block to be processed. The corresponding transformation index value of the target transformation check is written into the code stream.
  • the first mapping relationship information includes a mapping relationship of a first flag bit, a first transformation index value and a second transformation index value, and a variety of transformation checks.
  • first flag bit is the first value
  • second transformation index value a mapping relationship of a first flag bit, a first transformation index value and a second transformation index value, and a variety of transformation checks.
  • first flag bit is the first value
  • Multi-core transformation is used when the flag is the second value
  • the first flag bit when the first flag bit is the first value, it corresponds to the first transformation check.
  • the first transformation index value corresponds to the second transformation check.
  • the first transformation bit is checked.
  • the second transformation index value corresponds to the third transformation check, and the second transformation check is selected from the first candidate transformation check and the second candidate transformation check according to the intra prediction mode corresponding to the residual block, where the first candidate transformation check and The second transformation candidate transformation check all includes DST-VII.
  • the first mapping relationship information includes only three transformation checkups, the number of traversals can be reduced in the process of selecting a target transformation checkup, thereby reducing the time required for encoding.
  • the first flag bit is an explicit multi-core transform EMT flag bit.
  • the first value is 0, and the second value is 1.
  • the first mapping relationship information includes an EMT flag bit.
  • EMT flag bit When the value of the EMT flag bit is 0, it means that single-core transformation is used when transforming the residual block; when the value of the EMT flag bit is 1, it means that Multi-core transform is used to transform the residual block.
  • the first transformation check is a transformation check composed of the same transformation kernel.
  • the first transformation check is (DCT-II, DCT-II).
  • the first transformation index value is 0, and the second transformation index value is 1.
  • the first candidate transformation check is (DST-VII, DCT-VIII), and the second candidate transformation check is (DCT-VIII, DST-VII); when the frame corresponding to the residual block is When the mode number of the intra prediction mode is less than or equal to a preset threshold, the second transformation check is the first candidate transformation check; when the mode number of the intra prediction mode corresponding to the residual block is greater than the preset threshold, the first transformation check is the first Two candidate transformation checks.
  • the preset threshold is N.
  • the third transformation check is (DST-VII, DST-VII).
  • the first transformation index value is 0, the second transformation index value is 1, or the first transformation index value is 1 and the second transformation index value is 0.
  • the lengths of the codewords corresponding to the first transformation index value and the second transformation index value are both 1.
  • the lengths of the codewords corresponding to the transformation index value are all 1, which can reduce the number of occupied bits required to indicate the transformation index value.
  • the codeword corresponding to the first transformation index value is 0, and the codeword corresponding to the second transformation index value is 1.
  • the codeword corresponding to the first transformation index value is 1, and the codeword corresponding to the second transformation index value is 0.
  • the method before obtaining candidate transformation check of the residual block according to the preset first mapping relationship information, the method further includes: determining an intra prediction mode corresponding to the residual block as a directional prediction mode.
  • the method before obtaining candidate transformation check of the residual block according to the preset first mapping relationship information, the method further includes: determining that the width and height of the residual block are both less than or equal to M.
  • the value of M is 64.
  • the target transformation check when the size of the residual block is large, (DCT-II, DTC-II) is directly used as the target transformation check to perform the transformation, and when the size of the residual block is small, the target transformation is finally determined according to the first mapping relationship information.
  • the kernel can achieve better transformation of residual blocks of different sizes.
  • the above method further includes: when the intra prediction mode corresponding to the residual block is a DC mode, determining transformation check (DCT-II, DTC-II) as a target transformation check.
  • the above method further includes: when the intra prediction mode corresponding to the residual block is a planar mode, determining a transformation check (DST-VII, DST-VII) as a target transformation check.
  • a transformation check DST-VII, DST-VII
  • a preset transformation check can be directly used for quantization, which can save the traversal process and further reduce the time required for encoding.
  • a transformation check (DST-VII, DST-VII) is determined as the target transformation check .
  • N can be 4, 8, and 16 and so on.
  • a transformation method includes: obtaining a residual block of an image block to be processed; obtaining a candidate transformation check of the residual block according to preset first mapping relationship information; and selecting from the candidate transformation check The transformation check with the lowest rate distortion is used as the target transformation check. According to the target transformation check, the residual block is transformed to obtain the transformation coefficient of the image block to be processed. The corresponding transformation index value of the target transformation check is written into the code stream.
  • the first mapping relationship information includes a mapping relationship of a first flag bit, a first transformation index value, a second transformation index value, a third transformation index value, and four transformation checklists.
  • the first flag bit is a first value and a first mapping bit. Single-core transformation and multi-core transformation are used when the two values are taken.
  • the first flag bit corresponds to the first transformation check when the first value is the first value.
  • the first flag bit is the second value
  • the first transformation index value and the second transformation index value are used.
  • the third transformation index value corresponds to the second transformation check, the third transformation check, and the fourth transformation check.
  • Any one of the second transformation check to the fourth transformation check includes the transformation kernel DST-VII
  • the second transformation check to At least one transformation check in the fourth transformation check includes a transformation kernel DCT-VIII.
  • the first mapping relationship information includes only four transformation checkups, the number of traversals can be reduced in the process of selecting a target transformation checkup, thereby reducing the time required for encoding.
  • the transformation kernel DST-VII is included in each transformation check corresponding to the first flag bit being the second value, and DST-VII has a higher usage rate in intra prediction transformation, therefore, according to the A mapping relationship information can select a transformation check with a higher usage rate for transformation, which can improve the transformation effect.
  • the intra prediction mode uses the top and right reference pixels of the current block to predict the current block, and the prediction error tends to gradually increase from top to bottom from left to right, the base of DST-VII The function is gradually increasing. Therefore, the DST-VII transformation kernel is suitable for this gradually increasing characteristic. Using DST-VII for transformation and inverse transformation can achieve better results.
  • the first flag bit is an explicit multiple core (EMT) flag.
  • EMT explicit multiple core
  • the first value is 0, and the second value is 1.
  • the first mapping relationship information includes an EMT flag bit.
  • EMT flag bit When the value of the EMT flag bit is 0, it means that single-core transformation is used when transforming the residual block; when the value of the EMT flag bit is 1, it means that Multi-core transform is used to transform the residual block.
  • the first transformation check is a transformation check composed of the same transformation kernel.
  • the length of the codeword corresponding to the first transformation index value is 1, and the length of the codeword corresponding to the second transformation index value and the third transformation index value are both 2.
  • the first to third transformation index values are 0, 1, and 2, respectively.
  • the codeword corresponding to the first transformation index value is 0, the codeword corresponding to the second transformation index value is 10, and the codeword corresponding to the third transformation index value is 11.
  • the codewords corresponding to the second transformation index value and the third transformation index value are 10 and 01, respectively.
  • the first transformation check is (DCT-II, DTC-II)
  • the second transformation check is (DST-VII, DST-VII)
  • the third transformation check is (DCT-VIII , DST-VII)
  • the fourth transformation check is (DST-VII, DCT-VIII).
  • the method before obtaining candidate transformation check of the residual block according to the preset first mapping relationship information, the method further includes: determining an intra prediction mode corresponding to the residual block as a directional prediction mode.
  • the method before obtaining candidate transformation check of the residual block according to the preset first mapping relationship information, the method further includes: determining that the width and height of the residual block are both less than or equal to M.
  • the value of M is 64.
  • the target transformation check when the size of the residual block is large, (DCT-II, DTC-II) is directly used as the target transformation check to perform the transformation, and when the size of the residual block is small, the target transformation is finally determined according to the first mapping relationship information.
  • the kernel can achieve better transformation of residual blocks of different sizes.
  • the above method further includes: when the intra prediction mode corresponding to the residual block is a DC mode, determining a transform check (DCT-II, DTC-II) as a target transform check.
  • DCT-II transform check
  • DTC-II transform check
  • the above method further includes: determining a transformation check (DST-VII, DST-VII) as a target transformation check when the intra prediction mode corresponding to the residual block is a plane mode.
  • a preset transformation check can be directly used for quantization, which can save the traversal process and further reduce the time required for encoding.
  • a transformation check (DST-VII, DST-VII) is determined as the target transformation check .
  • N can be 4, 8, and 16 and so on.
  • an inverse transform apparatus includes a module for performing a method in any one of the foregoing implementation manners of the first aspect or the second aspect.
  • a transformation apparatus includes a module for executing a method in any one of the foregoing third or fourth aspects.
  • a decoder including: a non-volatile memory and a processor coupled to each other, the processor calling program code stored in the memory to execute any of the first aspect or the second aspect Some or all steps of a method in one implementation.
  • an encoder including: a non-volatile memory and a processor coupled to each other, the processor invoking program code stored in the memory to execute any of the third aspect or the fourth aspect Some or all steps of a method in one implementation.
  • a computer-readable storage medium stores program code, where the program code includes a program for executing the first aspect, the second aspect, the third aspect, and the fourth aspect. An instruction in some or all of the steps of a method in any of the implementations.
  • a computer program product is provided, and when the computer program product runs on a computer, the computer is caused to execute any one of the first aspect, the second aspect, the third aspect, and the fourth aspect. Instructions in some or all steps of the method.
  • FIG. 1 is a schematic flowchart of an intra coding process
  • FIG. 2 is a schematic flowchart of an intra decoding process
  • 3 is a schematic diagram of various intra prediction modes
  • FIG. 4 is a schematic flowchart of an inverse transform method according to an embodiment of the present application.
  • FIG. 5 is a schematic flowchart of an inverse transform method according to an embodiment of the present application.
  • FIG. 6 is a schematic flowchart of an inverse transform method according to an embodiment of the present application.
  • FIG. 7 is a schematic flowchart of a conversion method according to an embodiment of the present application.
  • FIG. 8 is a schematic flowchart of a conversion method according to an embodiment of the present application.
  • FIG. 9 is a schematic flowchart of a conversion method according to an embodiment of the present application.
  • FIG. 10 is a schematic block diagram of an inverse transform device according to an embodiment of the present application.
  • FIG. 11 is a schematic block diagram of a video decoder according to an embodiment of the present application.
  • FIG. 12 is a schematic block diagram of a video encoder according to an embodiment of the present application.
  • intra-frame video coding here means that the prediction mode used in the process of encoding the video image is the intra prediction mode
  • intra video decoding means that the prediction mode used in the process of decoding the video image is the frame Intra prediction mode.
  • a prediction block of the image block to be processed can be obtained, and by making a difference between the image block to be processed and the prediction block (also called a prediction signal), a residual block can be obtained. (Can also be a residual signal) to remove redundancy between images.
  • transform / quantize the residual block to obtain a quantized coefficient, and perform entropy coding on the quantized coefficient to obtain a code stream.
  • the quantization coefficients need to be inverse quantized / inverse transformed to obtain the residual block.
  • the residual block and the prediction block are added to obtain a reconstructed block (a loop can be performed before the reconstructed block is obtained Road filtering).
  • intra-frame prediction can be performed from different directions using the encoded reconstruction block (reconstruction information) as reference information, and then the residual signal is transformed so that the energy of the residual signal is further concentrated, and then quantized Use a larger quantization step size for high-frequency signals and a smaller quantization step size for low-frequency signals to ensure that there is no loss of basic image information.
  • encoding information such as quantization coefficients and coding modes is obtained by entropy decoding the code stream (binary code stream information), and the residual blocks are obtained after inverse quantization / inverse transformation of the quantized coefficients.
  • the residual block is added to the intra prediction block and then loop filtered to obtain the final reconstruction speed.
  • the generated reconstruction block will also be used in the subsequent intra prediction process of other image blocks.
  • a direction diagram is shown for intra prediction using 67 intra-angle modes, as shown in FIG. 3. More dense angles can bring better prediction results.
  • the number of angle modes for intra prediction has increased from 33 to 65 in HEVC.
  • the mode number When the mode number is 0, it indicates a planar mode; when the mode number is 1, , Indicates the DC mode; the plane mode and the DC mode do not involve the prediction direction, and are called non-directional prediction modes; when the mode number is 2-66, it represents the angle prediction mode (also known as the directional prediction mode), and different mode numbers represent Different prediction angles are shown.
  • the prediction angle corresponding to the prediction mode of the mode number 2-66 is indicated by a solid line or a dotted line.
  • the denser angular directions can more effectively capture the texture boundaries in any direction in natural video, and can use more reference information for rate distortion cost selection, so that more suitable intra prediction modes can be found to more accurately predict the current encoding.
  • Block which makes the predicted block closer to the original coded block, and fewer bits need to be transmitted to encode the current block, resulting in higher coding performance.
  • these 67 intra-modes are used on coding blocks of all sizes, including luminance components and chrominance components.
  • FIG. 4 is a schematic flowchart of an inverse transform method according to an embodiment of the present application.
  • the method shown in FIG. 4 may be executed by a decoding device.
  • the method shown in FIG. 4 includes steps 110 to 130.
  • the steps 110 to 130 are described in detail below.
  • operations such as entropy decoding on the code stream can be used to obtain the residual coefficient of the current block, the intra prediction mode, and the target transformation check and determination parameters.
  • the above-mentioned target transformation check determination parameter is information used to determine the target transformation check of the residual coefficient of the current block.
  • the target transformation check determination parameter can directly indicate only the target transformation check through a single message, or the target transformation check determination parameter can also The multiple parameters are used to collectively indicate the target transformation check.
  • the above parsing the bitstream to obtain the residual coefficient of the current block may specifically refer to firstly parsing the quantized coefficient from the bitstream, and then dequantizing the quantized coefficient to obtain the residual coefficient, which can be used for inverse transformation.
  • the second transformation check is the first candidate transformation check or the second change candidate transformation check.
  • the first candidate transformation check and the second change candidate transformation check both include a transformation kernel DST-VII.
  • the candidate transformation check corresponds to the intra prediction mode corresponding to the current block.
  • the first candidate transformation check is (DST-VII, DCT-VIII), and the second candidate transformation check is (DCT-VIII, DST-VII); when the mode of the intra prediction mode corresponding to the residual block is When the number is less than or equal to a preset threshold, the second transformation check is a first candidate transformation check; when the mode number of the intra prediction mode corresponding to the residual block is greater than the preset threshold, the first transformation The collation is a second candidate transformation collation.
  • the preset threshold is N.
  • the target transformation check may be determined through a mapping relationship or a corresponding relationship between the parameter value of the target transformation check determination parameter and the transformation check.
  • determining a target transformation check corresponding to the target transformation check determination parameter from the first transformation check, the second transformation check, and the third transformation check includes: determining the parameter value of the parameter and the target transformation according to the target transformation check. The mapping relationship between the parameter value of the determined parameter and the transformation check is checked, and the target transformation check is determined.
  • the target transformation check determination parameters are respectively the first parameter value to the third parameter value, they correspond to the first transformation check to the third transformation check, respectively. Then, when the decoding end resolves that the target transformation check determination parameter is the first parameter value, it can directly determine that the target transformation check is the first transformation check.
  • the corresponding relationship between the parameter values of the target transformation check determination parameters and the transformation check can be shown in Table 1.
  • Table 1 after the decoder obtains the parameter values of the target transformation check determination parameters, it can directly map according to Table 1. Relationship determination target transformation check.
  • the mapping relationship shown in Table 1 can be stored at the encoding end and the decoding end. After the encoding end determines the target transformation check, the parameter value of the target transformation check corresponding to the target transformation check can be written into the code stream. The decoding end can determine the target transformation check through the parsed target transformation check to determine the parameter values of the determined parameters and the mapping relationship shown in Table 1.
  • the target transformation checks the parameter values of the determined parameters Target transformation check First parameter value First transformation check Second parameter value Second transformation check Third parameter value Third transformation check
  • the correspondence between the parameter values of the target transformation check determination parameter and the transformation check can be shown in Table 2. As shown in Table 2, when the parameter values of the target transformation check determination parameter value are 0, 10 and 11, respectively, the corresponding target transformations are The checks are (DCT-II, DCT-II), (DST-VII, DCT-VIII), and (DST-VII, DST-VII).
  • the target transformation checks the parameter values of the determined parameters Target transformation check 0 DCT-II, DCT-II 10 DST-VII, DCT-VIII 11 DST-VII, DST-VII
  • Tables 1 and 2 are merely examples of a manifestation of the correspondence between the parameter values of the target transformation check determination parameters and the transformation check.
  • the specific form is not limited, as long as there is a certain correspondence between the parameter values of the parameters determined by the target transformation check and the transformation check.
  • the target transformation check determination parameter includes a first flag bit, or the target transformation check determination parameter includes a first flag bit and a transformation index value.
  • determining, from the first transformation check, the second transformation check, and the third transformation check, the target transformation check corresponding to the determination parameter corresponding to the target transformation check specifically includes the following process:
  • the first flag bit is an explicit multiple core transform (EMT) flag bit.
  • EMT explicit multiple core transform
  • the first value is 0, and the second value is 1.
  • the value of the EMT flag when the value of the EMT flag is 0, it means that a single-core inverse transformation is used when the inverse transformation is performed on the residual coefficient (correspondingly, the single-core transformation is also used when the encoding end is transformed); A value of 1 indicates that a multi-core inverse transform is used when inverse transforming the residual coefficient (correspondingly, the multi-core transform is also used when the encoding end performs the transform).
  • the first transformation check is a transformation check composed of the same transformation kernel.
  • the types of the transformation kernels included in the first transformation check, the first candidate transformation check, the second candidate transformation check, and the third transformation check may be a part of the five transformation kernels defined in the JEM.
  • the group of transform kernels are specifically DCT-II, DCT-V, DCT-VIII, DST-1 and DST-VII.
  • the basic information of the five sets of transformation kernels is shown in Table 3.
  • the total number of types of the transformation kernels included in the first transformation check, the first candidate transformation check, the second candidate transformation check, and the third transformation check is less than 5.
  • the storage space occupied by storing the transformation kernel can be reduced.
  • the transformation kernels included in the first transformation check, the first candidate transformation check, the second candidate transformation check, and the third transformation check include DCT-II, DCT-VIII, and DST-VII.
  • mapping relationship between the first flag bit, the transformation index value, and the target transformation check
  • specific form of the correspondence relationship may be a table
  • the correspondence between the first flag bit, the transformation index value, and the target transformation check may be shown in Table 4.
  • the first transformation index value is 0, and the second transformation index value is 1.
  • first transformation index value and the second transformation index value may also be 1 and 0, respectively, and the first and second values may also be 1 and 0, respectively.
  • the length of the codeword corresponding to the first transformation index value and the second transformation index value is both 1.
  • the codeword corresponding to the first transformation index value is 0, and the codeword corresponding to the second transformation index value is 1.
  • Table 6 is obtained by adding the codewords corresponding to the first transformation index value and the second transformation index value to Table 5.
  • the lengths of the codewords corresponding to the transformation index value are all 1, which can reduce the number of occupied bits required to indicate the transformation index value.
  • codewords corresponding to the first transformation index value and the second transformation index value may also be 1 and 0, respectively.
  • the third transformation check is (DST-VII, DST-VII), and the first transformation check is (DCT-II, DTC-II).
  • the second transformation check may be determined according to the intra prediction mode corresponding to the current block. Specifically, when the mode number of the intra prediction mode is less than or equal to 34, the second transformation check in Table 7 is (DST-VII, DCT-VIII); when the mode number of the intra prediction mode is greater than 34, Table 7 The second transformation check in (DST-VII, DCT-VIII).
  • the second transformation check corresponding to each intra prediction mode can also be determined by looking up the table. For example, after the intra prediction mode corresponding to the current block is known, the foregoing second transformation check may be determined according to the correspondence between the prediction mode number of the intra prediction mode and the index number of the transformation check in Table 8 below.
  • Table 8 contains a total of 35 intra prediction modes.
  • the mode number of the intra prediction mode is 0-34.
  • Table 7 contains three kinds of transformation checks. These three kinds of transformation checks are represented by the numbers 0-2, which are represented by 0-2. The transformation check is as follows:
  • transform check 0 (DST-VII, DCT-VIII);
  • transformation check 1 transformation check 1, ie (DCT-VIII, DST-VII);
  • the former transformation kernel represents a horizontal transformation kernel
  • the latter transformation kernel represents a vertical transformation kernel
  • the former may represent a vertical transformation kernel
  • the latter may represent a horizontal transformation kernel
  • the second transformation check in Table 7 can be determined according to the relationship in Table 8.
  • the first transformation check to the third transformation check use 4 kinds of transformation check (including DCT-II, DCT-II), but for each prediction mode, there are only 3 transformation check options available, and only 3 RDOs are required when encoding at the encoding end, thereby reducing encoding time Overhead.
  • the mapping relationship between the transformation check and the prediction mode is more flexible (as can be seen from Table 7, for the angle prediction mode, 0 and 1 alternately appear), you can Achieve better performance with the same encoding time overhead.
  • the mirror DST-VII can also be used to replace DCT-VIII in this scheme.
  • the types of transformation kernels used have been reduced from three to two, namely DCT-II and DST-VII.
  • the types of transform kernels are reduced, the memory occupied by the encoding kernel and the decoder to store the transform kernels can be reduced.
  • the method shown in FIG. 4 further includes: determining an intra prediction mode corresponding to the residual block as a directional prediction mode.
  • the candidate transformation check of the residual block is obtained according to step 120.
  • the method shown in FIG. 4 further includes: determining that the width and height of the residual block are both less than or equal to M.
  • M can be set according to the situation during the transformation, for example, M can be 64.
  • the transformation effect can be improved.
  • (DCT-II, DTC-II) is determined as the target transformation check.
  • the method shown in FIG. 4 may be applicable to any intra prediction mode, that is, in the directional prediction mode or the non-directional prediction mode, the candidate transformation check of the residual block may be directly obtained according to step 120.
  • the method of determining the candidate transformation check of the residual block in step 120 may only be applicable to the directional prediction mode, and for the non-directional prediction mode, a preset transformation check may be directly adopted as the target transformation check.
  • the method shown in FIG. 4 further includes: when the intra prediction mode corresponding to the residual block is a DC mode, determining a transformation check (DCT-II, DTC-II) as a target transformation check.
  • a transformation check DCT-II, DTC-II
  • the method shown in FIG. 4 further includes: when the intra prediction mode corresponding to the residual block is a planar mode, determining a transformation check (DST-VII, DST-VII) as a target transformation check.
  • a transformation check DST-VII, DST-VII
  • the intra prediction mode is a DC mode or a planar mode
  • the process of determining the target transformation kernel can be simplified and the time required for the inverse transformation can be reduced.
  • a transformation check (DST-VII, DST-VII) is determined as the target transformation check.
  • N can be 4, 8, and 16, etc. Further, the value of N can be a multiple of 4.
  • the intra prediction mode is a planar mode
  • other preset transformation checks can be used as the target transformation check, for example, the transformation check (DCT- II, DTC-II) is determined as the target transformation check.
  • FIG. 5 is a schematic flowchart of an inverse transform method according to an embodiment of the present application.
  • the method shown in FIG. 5 may be executed by a decoding device.
  • the method shown in FIG. 5 includes steps 210 to 230.
  • the steps 210 to 230 are described in detail below.
  • information such as the residual coefficient of the current block and the target transformation check and determination parameters can be obtained by performing entropy decoding on the code stream.
  • the above-mentioned target transformation check determination parameter is information used to determine the target transformation check of the residual coefficient of the current block.
  • the target transformation check determination parameter can directly indicate only the target transformation check through a single message, or the target transformation check determination parameter can also The multiple parameters are used to collectively indicate the target transformation check.
  • the above parsing the bitstream to obtain the residual coefficient of the current block may specifically refer to firstly parsing the quantized coefficient from the bitstream, and then dequantizing the quantized coefficient to obtain the residual coefficient, which can be used for inverse transformation.
  • the second transformation check, the third transformation check, and the fourth transformation check each include a transformation kernel DST-VII, the second transformation check, the third transformation check, and the fourth transformation check.
  • a transformation check includes the transformation kernel DCT-VIII.
  • the target transformation check may be determined through a mapping relationship or a corresponding relationship between the parameter value of the target transformation check determination parameter and the transformation check.
  • determining a target transformation check corresponding to the target transformation check determination parameter from the first transformation check, the second transformation check, the third transformation check, and the fourth transformation check includes: determining the parameter according to the target transformation check.
  • the parameter value and the target transformation check determine the mapping relationship between the parameter value of the parameter and the transformation check to determine the target transformation check.
  • the target transformation check determination parameters are respectively the first parameter value to the fourth parameter value, they correspond to the first transformation check to the fourth transformation check, respectively. Then, when the decoding end resolves that the target transformation check determination parameter is the second parameter value, it can directly determine that the target transformation check is the second transformation check.
  • the corresponding relationship between the parameter values of the target transformation check determination parameters and the transformation check can be shown in Table 9.
  • the mapping relationship shown in Table 9 can be stored at the encoding end and the decoding end. After the encoding end determines the target transformation check, the parameter value of the target transformation check corresponding to the target transformation check can be written into the code stream. The decoding end can determine the target transformation check through the parsed target transformation check to determine the parameter values of the determined parameters and the mapping relationship shown in Table 9.
  • the target transformation checks the parameter values of the determined parameters Target transformation check First parameter value First transformation check Second parameter value Second transformation check Third parameter value Third transformation check Fourth parameter value Fourth transformation check
  • the first transformation check is (DCT-II, DTC-II)
  • the second transformation check is (DST-VII, DST-VII)
  • the third transformation check is (DCT-VIII, DST-VII).
  • the four transform checks are (DST-VII, DCT-VIII).
  • the target transformation checks the parameter values of the determined parameters Target transformation check 0 DCT-II, DTC-II 01 DST-VII, DST-VII 10 DCT-VIII, DST-VII 11 DST-VII, DCT-VIII
  • Tables 9 and 10 are merely examples of a manifestation of the correspondence between the parameter values of the target transformation check determination parameters and the transformation check.
  • the specific form is not limited, as long as there is a certain correspondence between the parameter values of the parameters determined by the target transformation check and the transformation check.
  • the target transformation check determination parameter When the target transformation check determination parameter collectively indicates the target transformation check through multiple parameters, the multiple parameters in the target transformation check determination parameter may be obtained first, and then the target transformation is determined according to the correspondence between the multiple parameters and the target transformation check. Check.
  • the target transformation check determination parameter includes a first flag bit, or the target transformation check determination parameter includes a first flag bit and a transformation index value.
  • determining a target transformation check corresponding to the target transformation check determination parameter from the first transformation check, the second transformation check, the third transformation check, and the fourth transformation check specifically includes the following process:
  • the total number of types of transformation kernels included in the first transformation check, the second transformation check, the third transformation check, and the fourth transformation check is less than 5.
  • the storage space occupied by storing the transformation kernel can be reduced.
  • the transformation kernels included in the first transformation check, the first candidate transformation check, the second candidate transformation check, and the third transformation check include DCT-II, DCT-VIII, and DST-VII.
  • mapping relationship between the first flag bit, the transformation index value, and the target transformation check
  • specific form of the correspondence relationship may be a table
  • the correspondence between the first flag bit, the transformation index value, and the target transformation check may be shown in Table 11.
  • the target transformation check when the first flag bit is the first value, the target transformation check only has a corresponding relationship with the first flag bit, and the target transformation check is the first transformation check.
  • the first flag bit is the second value, there is a corresponding relationship between the target transformation check and the first flag bit and the transformation index value.
  • the first flag bit is the second value and the transformation index value is the first
  • the target transformation check corresponding to the transformation index value, the second transformation index value, and the third transformation index value are respectively a second transformation check, a third transformation check, and a fourth transformation check.
  • first value and the second value may also be 1 and 0, respectively, and the first transformation index value to the third transformation index value may also be other values.
  • the first flag is an EMT flag.
  • the value of the EMT flag when the value of the EMT flag is 0, it means that a single-core inverse transformation is used when the inverse transformation is performed on the residual coefficient (correspondingly, the single-core transformation is also used when the encoding end is transformed); A value of 1 indicates that a multi-core inverse transform is used when inverse transforming the residual coefficient (correspondingly, the multi-core transform is also used when the encoding end performs the transform).
  • the first transformation check is a transformation check composed of the same transformation kernel.
  • the length of the codeword corresponding to the first transformation index value is 1, and the length of the codeword corresponding to the second transformation index value and the third transformation index value are both 2.
  • the codeword corresponding to the first transformation index value is 0, the codeword corresponding to the second transformation index value is 10, and the codeword corresponding to the third transformation index value is 11.
  • the first flag bit is the EMT flag bit
  • the first to third transformation index values are 0, 1, 2
  • the codewords of the three index values are 0, 10, and 11, respectively
  • the first flag bit is The correspondence between the transformation index value and the target transformation check.
  • codewords corresponding to the second transformation index value and the third transformation index value may also be 10 and 01, respectively.
  • the first transformation check is (DCT-II, DTC-II)
  • the second transformation check is (DST-VII, DST-VII)
  • the third transformation check is (DCT-VIII, DST-VII).
  • the four transform checks are (DST-VII, DCT-VIII).
  • Table 14 can be obtained by filling the first transformation check and the fourth transformation check into Table 13.
  • the target transformation check can be determined through the determined target transformation check determination parameters, and the inverse transformation of the residual coefficient can be realized according to the target transformation check.
  • first candidate transformation check and the second transformation check both include a transformation kernel DST-VII, it is possible to increase the possibility of including the transformation kernel DST-VII in the final target transformation check, so that in the target transformation check, A better inverse transform effect may be obtained when inverse transforming the residual coefficients.
  • the intra prediction mode uses the top and right reference pixels of the current block to predict the current block, and the prediction error tends to gradually increase from top to bottom from left to right, the base of DST-VII The function is gradually increasing. Therefore, the DST-VII transformation kernel is suitable for this gradually increasing characteristic. Using DST-VII for transformation and inverse transformation can achieve better results.
  • the method shown in FIG. 5 further includes: determining an intra prediction mode corresponding to the current block as a directional prediction mode.
  • the method shown in FIG. 5 further includes: determining that the width and height of the residual block are both less than or equal to M.
  • (DCT-II, DTC-II) is determined as the target transformation check.
  • the value of M is 64.
  • the method shown in FIG. 5 further includes: when the intra prediction mode corresponding to the current block is a DC mode, determining a transform check (DCT-II, DTC-II) as the target transform Check.
  • DCT-II transform check
  • DTC-II transform check
  • the above method further includes: determining a transformation check (DST-VII, DST-VII) as the target transformation check if the intra prediction mode corresponding to the current fast mode is a plane mode.
  • the inverse transformation can be simplified by directly using a preset transformation check, which can simplify the process of determining the target transformation kernel and reduce the time required for the inverse transformation.
  • a transformation check (DST-VII, DST-VII) is determined as the target transformation Check.
  • N can be 4, 8, and 16 and so on.
  • the horizontal and vertical transformation kernels corresponding to the index values 0,1,2 both use at least one DST-VII transformation kernel, and the index value 3 indicates that neither the horizontal or vertical transformation kernels use DST-VII transformation kernels.
  • the index value 0 corresponds to the (DST-VII, DST-VII) transform kernel, and its proportion is obviously higher than the index values 1,2,3. This is because intra prediction uses the top and left reference pixels to predict the current block. The prediction error tends to gradually increase from top to bottom from left to right.
  • the DST-VII transform kernel is suitable for this type of residual signal. .
  • this application provides a new mapping relationship.
  • the candidate transformation kernel corresponding to the EMT flag of 0 is still a transformation check (DCT-II, DCT-II), and a new transformation check is added.
  • the number of types is reduced to three, as shown in Table 17.
  • Table 17 for the newly added transform kernels, at least one DST-VII transform kernel is used for the horizontal and vertical transform kernels according to the proportion of the transform kernels.
  • the transformation index value is 0, the codeword is 0, and the index values of 1 and 2 correspond to the codewords of 10 and 11, respectively.
  • the horizontal and vertical transformation kernels are both DST-VII transformation kernels; for an index value of 1, the horizontal transformation kernel is DST-VII, and the vertical transformation kernel is not a DST-VII transformation kernel; for an index value of 2, horizontal transformation The kernel is not a DST-VII transformation kernel, and the vertical transformation kernel is DST-VII; for a combination of transformation kernels with an index value of 3, the traversal process with an index value of 3 is skipped because it has the lowest ratio.
  • the number of traversals can be reduced and the coding time can be reduced by using the table shown in Table 17.
  • some transformation index values can correspond to one codeword, which can save the occupation of the transformation index value. Bits.
  • the newly added transformation kernel in Table 17 above can be selected by querying the relationship between the residual block and the corresponding candidate transformation kernel.
  • the above-mentioned newly added transform kernels can be selected according to Tables 18 and 19.
  • Transform candidate set Candidate transformation kernel 0 DST-VII, DCT-VIII 1 DST-VII, DST-I 2 DST-VII, DCT-V
  • transformation candidate set 0 contains candidate transformation kernels DST-VII, DCT-VIII
  • transformation candidate set 2 contains candidate transformation kernels DST-VII, DCT-V.
  • transformations can be selected from transformation candidate set 0
  • a transformation kernel DCT-V is selected from the transformation candidate set 2 to form a new transformation kernel.
  • transform kernels there may be three types of transform kernels, namely, DCT-II, DCT-VIII, and DST-VII.
  • the use of the transform kernel can only depend on the transform index value, and has nothing to do with the intra prediction mode, as shown in Table 20.
  • DCT-VIII in the above table 20 can also be replaced with other transformation kernels with similar characteristics, such as DCT-V, or a variant based on DST-VII, such as DST-VII after flipping. (This is because the characteristics of the DST-VII transformation kernel after mirror transformation are similar to those of DCT-VIII. It should be understood that the mirror transformation here can be used to do left-right mirroring or up-down mirroring.
  • transformation kernels can also be reduced to two.
  • the two transformation kernels are DCT-II and DST-VII, as shown in Table 21.
  • FIG. 6 is a schematic flowchart of an inverse transform method according to an embodiment of the present application.
  • the method shown in FIG. 6 can be executed by a decoding device.
  • the method shown in FIG. 6 includes steps 1001 to 1010. Steps 1001 to 1010 are described in detail below.
  • Step 1001 indicates that after the residual coefficients of the current block are obtained, the target transformation check corresponding to the residual coefficients is started, so as to perform inverse transformation on the residual coefficients according to the target transformation check.
  • the residual coefficient of the current block can be obtained by analyzing the code stream.
  • the value of N can be set to 64 or other values.
  • step 1003 When at least one of W and H of the residual block is greater than N, step 1003 is performed, and when both of W and H of the residual block are less than or equal to N, step 1004 is performed.
  • the intra prediction mode here is the intra prediction mode corresponding to the current block, and specifically refers to the intra prediction mode corresponding to the encoding end when performing intra prediction.
  • Step 1005 is performed when the intra prediction mode is a directional prediction mode; step 1007 is performed when the intra prediction mode is a non-directional prediction mode.
  • step 1003 is performed to determine (DCT-II, DCT-II) as the target conversion check; when the EMT flag is 1, step 1006 is performed.
  • step 1006 the target transformation check may be specifically determined according to steps 120 and 220 in the method shown in FIG. 4 and FIG. 5, and the specific process is not described repeatedly.
  • Step 1008 is performed when the intra prediction mode is a DC mode, and step 1009 is performed when the intra prediction mode is not a DC mode (the intra prediction mode is a planar mode at this time).
  • the prediction value of the coded block is obtained by averaging the reference pixel values, the DC mode is suitable for a large area with a flat area, and the DCT-II transform kernel is suitable for such residual signals. Therefore, when the intra prediction mode is the DC mode , Determining (DCT-II, DTC-II) as the target transformation check can improve the transformation effect, and can reduce the number of bits required to indicate the target transformation check in the DC mode.
  • the number of non-zero coefficients may also be comprehensively considered to determine the target transformation check.
  • process shown in FIG. 6 may only be an example of a process of inverse transform performed by a decoder, and the process shown in FIG. 6 may include only a part of a process performed by an encoder.
  • the inverse transform method of the embodiment of the present application is described in detail above with reference to FIGS. 4 to 6.
  • the transform method of the embodiment of the present application is described below with reference to FIGS. 7 to 9. It should be understood that the The transformation method corresponds to the inverse transformation method shown in FIGS. 4 to 6.
  • the transformation method according to the embodiment of the present application will be described in detail below with reference to FIGS. 7 to 9.
  • FIG. 7 is a schematic flowchart of a conversion method according to an embodiment of the present application.
  • the method shown in FIG. 7 may be executed by a coding end device.
  • the method shown in FIG. 7 includes steps 310 to 350.
  • the steps 310 to 350 are described in detail below.
  • the above residual block may be obtained by making a difference between the current block (current image block) and the prediction block of the current block according to the process shown in FIG. 1.
  • intra prediction is used. mode. Specifically, when the prediction block of the current block is obtained, and then the residual block of the current block is obtained, various intra prediction modes as shown in FIG. 3 may be adopted.
  • the first mapping relationship information includes a mapping relationship of a first flag bit, a first transformation index value and a second transformation index value, and a variety of transformation checks.
  • first flag bit is the first value
  • second transformation index value a mapping relationship of a first flag bit, a first transformation index value and a second transformation index value, and a variety of transformation checks.
  • first flag bit is the first value
  • Multi-core transformation is used when the flag is the second value
  • the first flag bit when the first flag bit is the first value, it corresponds to the first transformation check.
  • the first transformation index value corresponds to the second transformation check.
  • the first transformation bit is checked.
  • the second transformation index value corresponds to the third transformation check, and the second transformation check is selected from the first candidate transformation check and the second candidate transformation check according to the intra prediction mode corresponding to the residual block, where the first candidate transformation check and The second transformation candidate transformation check all includes DST-VII.
  • the transformation check in the first mapping relationship information may include at least a part of five sets of transformation kernels.
  • the five sets of transformation kernels are DCT-II, DCT-V, DCT-VIII, and DST-1. And DST-VII.
  • the first flag bit is an explicit multi-core transform EMT flag bit.
  • the first value is 0, and the second value is 1.
  • the first mapping relationship information includes an EMT flag bit.
  • EMT flag bit When the value of the EMT flag bit is 0, it means that single-core transformation is used when transforming the residual block; when the value of the EMT flag bit is 1, it means that Multi-core transform is used to transform the residual block.
  • the first transformation check is a transformation check composed of the same transformation kernel.
  • the specific expression form of the first mapping relationship information is a table.
  • the foregoing first mapping relationship information may be shown in Table 22.
  • the first flag bit when the first flag bit is the first value, the first flag bit corresponds to the first transformation check, and when the first flag bit is the second value, the first flag bit corresponds to the two transformation check, and These two transformation checks correspond to the first transformation index value and the second transformation index value, respectively.
  • the first transformation check may include only one kind of transformation kernel, for example, the first transformation check is (DCT-II, DCT-II).
  • the third transformation check is (DST-VII, DST-VII).
  • the first transformation index value is 0, the second transformation index value is 1, or the first transformation index value is 1 and the second transformation index value is 0.
  • the length of the codeword corresponding to the first transformation index value and the second transformation index value is both 1.
  • the lengths of the codewords corresponding to the transformation index value are all 1, which can reduce the number of occupied bits required to indicate the transformation index value.
  • the codeword corresponding to the first transformation index value is 0, and the codeword corresponding to the second transformation index value is 1.
  • the codeword corresponding to the first transformation index value is 1, and the codeword corresponding to the second transformation index value is 0.
  • the foregoing first mapping relationship information may also be specifically shown in Table 23.
  • the second transformation check in Table 2 is (DST-VII, DCT-VIII); when the mode number of the intra prediction mode is When it is greater than 34, the second transformation check in Table 2 is (DST-VII, DCT-VIII).
  • the second transformation check needs to be selected according to the intra prediction mode corresponding to the residual block.
  • the number of intra prediction modes is 35, including 2 non-directional prediction modes (that is, planar mode and DC mode) and 33 directional prediction modes.
  • the number of intra prediction modes may be 67, including 2 non-directional prediction modes (planar mode and DC mode) and 65 directional prediction modes.
  • the intra prediction modes can be divided into two or three groups, and each group of intra prediction modes corresponds to a different transformation check.
  • Transform check 0 (DST-VII, DCT-VIII): when the intra prediction mode is less than or equal to N;
  • Transform check 1 (DCT-VIII, DST-VII): When the intra prediction mode is greater than N.
  • N is related to the number of intra prediction modes.
  • transformation check 0 and transformation check 1 correspond to the first candidate transformation check and the second candidate transformation check respectively.
  • the intra prediction mode may also be divided into three or more groups, each group corresponding to a kind of transformation check, and the number of the divided groups of the intra prediction mode in this application. And the correspondence relationship with the conversion check is not limited.
  • each transformation kernel may be used to transform the residual block in turn and perform rate-distortion optimization (RDO) to obtain the rate distortion corresponding to each transformation check for transformation, and then check the transformation with the smallest rate distortion RDO Determined as the target transformation check.
  • RDO rate-distortion optimization
  • the flag information corresponding to the target transformation check may include a first flag bit and a transformation index value corresponding to the target transformation check.
  • the flag information corresponding to the target transformation check includes only the first flag bit, and the value of the first flag bit is the first value; when the target transformation check is the second transformation check Or in the third transformation check, the corresponding flag information of the target transformation check includes only the first flag bit and the transformation index value.
  • the target transformation check is the second transformation check
  • the value of the first flag bit is the second value and the transformation is performed.
  • the index value is the first transformation index value.
  • the target transformation check is the third transformation check
  • the value of the first flag bit is the second value and the transformation index value is the second transformation index value.
  • the first mapping relationship information includes only three transformation checkups, the number of traversals can be reduced in the process of selecting a target transformation checkup, thereby reducing the time required for encoding.
  • the method shown in FIG. 7 further includes: determining an intra prediction mode corresponding to the residual block as a directional prediction mode.
  • the candidate transformation check of the residual block is obtained according to step 320.
  • the method shown in FIG. 7 further includes: determining that the width and height of the residual block are both less than or equal to M.
  • M can be set according to the situation during the transformation, for example, M can be 64.
  • the transformation effect can be improved.
  • (DCT-II, DTC-II) is determined as the target transformation check.
  • the target transformation check when the size of the residual block is large, (DCT-II, DTC-II) is directly used as the target transformation check to perform the transformation, and when the size of the residual block is small, the target transformation is finally determined according to the first mapping relationship information.
  • the kernel can achieve better transformation of residual blocks of different sizes.
  • the method shown in FIG. 7 may be applicable to any intra prediction mode, that is, in the directional prediction mode or the non-directional prediction mode, the candidate transformation check of the residual block may be directly obtained according to step 320.
  • the method for determining candidate transformation check of the residual block in step 320 may only be applicable to the directional prediction mode, and for the non-directional prediction mode, a preset transformation check may be directly adopted as the target transformation check.
  • the method shown in FIG. 7 further includes: when the intra prediction mode corresponding to the residual block is a DC mode, determining a transformation check (DCT-II, DTC-II) as the target transformation check .
  • a transformation check DCT-II, DTC-II
  • the method shown in FIG. 7 further includes: when the intra prediction mode corresponding to the residual block is a planar mode, determining a transformation check (DST-VII, DST-VII) as the target transformation check .
  • a transformation check DST-VII, DST-VII
  • a preset transformation check can be directly used for quantization, which can save the traversal process and further reduce the time required for encoding.
  • a transformation check (DST-VII, DST-VII) is determined as The target transformation check is described.
  • N can be 4, 8, and 16 and so on.
  • the intra prediction mode is a planar mode
  • other preset transformation check may be used as the target transformation check.
  • a DCT -II, DTC-II is determined as the target transformation check.
  • FIG. 8 is a schematic flowchart of a conversion method according to an embodiment of the present application.
  • the method shown in FIG. 8 may be executed by a coding-end device.
  • the method shown in FIG. 8 includes steps 410 to 450. Steps 410 to 450 are described in detail below.
  • the first mapping relationship information includes a mapping relationship of a first flag bit, a first transformation index value, a second transformation index value, a third transformation index value, and four transformation checklists.
  • the first flag bit is a first value.
  • Single-core transformation and multi-core transformation are respectively used for the second value and the second value.
  • the first flag bit corresponds to the first transformation check when the first value is the first value, and the first transformation index value is the first flag bit when the second value is the second value.
  • the second transformation index value and the third transformation index value correspond to the second transformation check, the third transformation check, and the fourth transformation check, respectively, and any one of the second to fourth transformation check includes a transformation Kernel DST-VII, at least one of the second to fourth transformation checkups includes a transformation kernel DCT-VIII.
  • the first flag bit is an explicit multi-core transform EMT flag bit.
  • the first value is 0, and the second value is 1.
  • the first mapping relationship information includes an EMT flag bit.
  • EMT flag bit When the value of the EMT flag bit is 0, it means that single-core transformation is used when transforming the residual block; when the value of the EMT flag bit is 1, it means that Multi-core transform is used to transform the residual block.
  • the first transformation check is a transformation check composed of the same transformation kernel.
  • the length of the codeword corresponding to the first transformation index value is 1, and the length of the codeword corresponding to the second transformation index value and the third transformation index value are both 2.
  • the first to third transformation index values are 0, 1, and 2, respectively.
  • the codeword corresponding to the first transformation index value is 0, the codeword corresponding to the second transformation index value is 10, and the codeword corresponding to the third transformation index value is 11.
  • the codewords corresponding to the second transformation index value and the third transformation index value are 10 and 01, respectively.
  • the flag information corresponding to the target transformation check may include a first flag bit and a transformation index value corresponding to the target transformation check.
  • the flag information corresponding to the target transformation check includes only the first flag bit, and the value of the first flag bit is the first value; when the target transformation check is the second transformation check Or in the third transformation check, the corresponding flag information of the target transformation check includes only the first flag bit and the transformation index value.
  • the target transformation check is the second transformation check
  • the value of the first flag bit is the second value and the transformation is performed.
  • the index value is the first transformation index value.
  • the target transformation check is the third transformation check
  • the value of the first flag bit is the second value and the transformation index value is the second transformation index value.
  • the first mapping relationship information includes only four transformation checkups, the number of traversals can be reduced in the process of selecting a target transformation checkup, thereby reducing the time required for encoding.
  • the transformation kernel DST-VII is included in each transformation check corresponding to the first flag bit being the second value, and DST-VII has a higher usage rate in intra prediction transformation, therefore, according to the A mapping relationship information can select a transformation check with a higher usage rate for transformation, which can improve the transformation effect.
  • the intra-prediction mode uses the top and right reference pixels of the current block to predict the current block, and the prediction error gradually increases from top to bottom from left to right, the base of DST-VII The function is gradually increasing. Therefore, the DST-VII transformation kernel is suitable for this gradually increasing characteristic. The transformation using DST-VII can achieve better results.
  • the first flag bit is an explicit multi-core transform EMT flag bit.
  • the first value is 0, and the second value is 1.
  • the first mapping relationship information includes an EMT flag bit.
  • EMT flag bit When the value of the EMT flag bit is 0, it means that single-core transformation is used when transforming the residual block; when the value of the EMT flag bit is 1, it means that Multi-core transform is used to transform the residual block.
  • the first transformation check is a transformation check composed of the same transformation kernel.
  • the length of the codeword corresponding to the first transformation index value is 1, and the length of the codeword corresponding to the second transformation index value and the third transformation index value are both 2.
  • the first to third transformation index values are 0, 1, and 2, respectively.
  • the codeword corresponding to the first transformation index value is 0, the codeword corresponding to the second transformation index value is 10, and the codeword corresponding to the third transformation index value is 11.
  • the codewords corresponding to the second transformation index value and the third transformation index value are 10 and 01, respectively.
  • the first transformation check is (DCT-II, DTC-II)
  • the second transformation check is (DST-VII, DST-VII)
  • the third transformation check is (DCT-VIII, DST-VII)
  • the fourth transformation check is (DST-VII, DCT-VIII).
  • the method before obtaining the candidate transformation check of the residual block according to preset first mapping relationship information, the method further includes: determining an intra prediction mode corresponding to the residual block as Direction prediction mode.
  • the method before obtaining candidate transformation check of the residual block according to preset first mapping relationship information, the method further includes: determining that the width and height of the residual block are both smaller than or Is equal to M.
  • (DCT-II, DTC-II) is determined as the target transformation check.
  • the value of M is 64.
  • the target transformation check when the size of the residual block is large, (DCT-II, DTC-II) is directly used as the target transformation check to perform the transformation, and when the size of the residual block is small, the target transformation is finally determined according to the first mapping relationship information.
  • the kernel can achieve better transformation of residual blocks of different sizes.
  • the method further includes: in a case where an intra prediction mode corresponding to the residual block is a DC mode, determining a transform check (DCT-II, DTC-II) as the target transform Check.
  • DCT-II transform check
  • the above method further includes: determining a transformation check (DST-VII, DST-VII) as the target transformation when the intra prediction mode corresponding to the residual block is a planar mode. Check.
  • a preset transformation check can be directly used for quantization, which can save the traversal process and further reduce the time required for encoding.
  • a transformation check (DST-VII, DST-VII) is determined as The target transformation check is described.
  • N can be 4, 8, and 16 and so on.
  • FIG. 9 is a schematic flowchart of a conversion method according to an embodiment of the present application.
  • the method shown in FIG. 9 can be executed by a coding end device.
  • the method shown in FIG. 9 includes steps 2001 to 2009, and steps 2001 to 2009 are described in detail below.
  • the transformation method in the embodiment of the present application is described in detail below with reference to FIG. 9.
  • the method shown in FIG. 9 includes:
  • Step 2001 represents the start of performing a transform operation on the residual block.
  • a prediction block of the current block may be obtained through intra prediction, and then a residual block of the current block may be obtained according to the current block and the prediction block of the current block.
  • the value of N can be set to 64 or other values.
  • step 2003 When at least one of W and H of the residual block is greater than N, step 2003 is performed, and when both of W and H of the residual block are less than or equal to N, step 2004 is performed.
  • DCT-II DCT-II
  • DCT-II DCT-II
  • the intra prediction mode corresponding to the residual block may be the intra prediction mode used in the process of obtaining the residual block. Specifically, the intra prediction mode corresponding to the residual block is to obtain the predicted block of the current block. The intra prediction mode used in the process.
  • EMT flag can be determined before step 2004. If the EMT flag is 0, then (DCT-II, DCT-II) is directly determined as the target transformation check; when the EMT flag is 1, Go to step 2004.
  • candidate transformation checks can be obtained according to the first mapping relationship information in the methods shown in FIG. 7 and FIG. 8, and then these candidate transformation checks are traversed in order to determine the transformation check with the lowest rate distortion as the target transformation Check.
  • Step 2007 is performed when the intra prediction mode is the DC mode
  • step 2008 is performed when the intra prediction mode is not the DC mode (the intra prediction mode is the planar mode at this time).
  • the prediction value of the coded block is obtained by averaging the reference pixel values, the DC mode is suitable for a large area with a flat area, and the DCT-II transform kernel is suitable for such residual signals. Therefore, when the intra prediction mode is the DC mode , Determining (DCT-II, DTC-II) as the target transformation check can improve the transformation effect, and can reduce the number of bits required to indicate the target transformation check in the DC mode.
  • the number of non-zero coefficients may be comprehensively considered to determine the target transformation check.
  • process shown in FIG. 9 may only be an example of a process of transforming the encoding end, and the process shown in FIG. 9 may only include a part of the process of transforming the encoding end.
  • the inverse transform method and transform method of the embodiment of the present application are described in detail above with reference to FIGS. 1 to 9.
  • the inverse transform device of the embodiment of the present application is described below with reference to FIG. 10.
  • the inverse transform device shown in FIG. For each step in the inverse transform method of the embodiment of the application, the limitation on the inverse transform method of the embodiment of the present application also applies to the inverse transform device shown in FIG. 10. In order to avoid unnecessary repetition, the following describes the The inverse conversion device will be described.
  • FIG. 10 is a schematic block diagram of an inverse transform apparatus according to an embodiment of the present application.
  • the inverse transforming apparatus 500 shown in FIG. 10 includes:
  • An obtaining module 510 is configured to parse a code stream to obtain a residual coefficient, an intra prediction mode, and a target transformation check determination parameter of a current block, where the target transformation check determination parameter includes a first flag bit or the target transformation check Determining parameters include a first flag bit and a transformation index value;
  • a determining module 520 is configured to:
  • the transformation check is a first candidate transformation check or a second transformation candidate transformation check
  • the first candidate transformation check and the second transformation candidate check include a transformation kernel DST-VII, and the first candidate transformation check and the A second change candidate transformation check corresponding to an intra prediction mode corresponding to the current block;
  • An inverse transform module 530 is configured to perform inverse transform on the residual coefficient according to the target transform check to obtain a residual block.
  • the target transformation check can be determined through the determined target transformation check determination parameters, and the inverse transformation of the residual coefficient can be realized according to the target transformation check.
  • first candidate transformation check and the second transformation check both include a transformation kernel DST-VII, it is possible to increase the possibility of including the transformation kernel DST-VII in the final target transformation check, so that in the target transformation check, A better inverse transform effect may be obtained when inverse transforming the residual coefficients.
  • the intra prediction mode uses the top and right reference pixels of the current block to predict the current block, and the prediction error tends to gradually increase from top to bottom from left to right, the base of DST-VII The function is gradually increasing. Therefore, the DST-VII transformation kernel is suitable for this gradually increasing characteristic. Using DST-VII for transformation and inverse transformation can achieve better results.
  • the inverse transforming apparatus 500 may be configured to perform steps 110 to 130 in the method shown in FIG. 4.
  • the inverse transforming apparatus 500 may also be used to execute steps 210 to 230 in the method shown in FIG. 5.
  • the functions of the modules in the inverse transforming apparatus 500 are as follows:
  • An obtaining module 510 is configured to parse a bitstream to obtain a residual coefficient of a current block and a target transformation check determination parameter, wherein the target transformation check determination parameter includes a first flag bit, or the target transformation check determination parameter includes a first flag Flag bit and transform index value;
  • a determining module 520 is configured to:
  • the second transformation check, the third transformation check, and the fourth transformation check each include a transformation kernel DST-VII, the second transformation check, the third transformation check, and the fourth transformation check.
  • a transformation check includes the transformation kernel DCT-VIII;
  • An inverse transform module 530 is configured to perform inverse transform on the residual coefficient according to the target transform check to obtain a residual block.
  • the target transformation check can be determined through the determined target transformation check determination parameters, and the inverse transformation of the residual coefficient can be realized according to the target transformation check.
  • first candidate transformation check and the second transformation check both include a transformation kernel DST-VII, it is possible to increase the possibility of including the transformation kernel DST-VII in the final target transformation check, so that in the target transformation check, A better inverse transform effect may be obtained when inverse transforming the residual coefficients.
  • the intra prediction mode uses the top and right reference pixels of the current block to predict the current block, and the prediction error tends to gradually increase from top to bottom from left to right, the base of DST-VII The function is gradually increasing. Therefore, the DST-VII transformation kernel is suitable for this gradually increasing characteristic. Using DST-VII for transformation and inverse transformation can achieve better results.
  • FIG. 11 is a schematic block diagram of a video decoder according to an embodiment of the present application.
  • the video decoder 600 shown in FIG. 11 includes: an entropy decoding module 610, an inverse transform and inverse quantization module 620, a decoding end prediction module 630, a decoding reconstruction module 640, and a decoding end filtering module 650.
  • the inverse transforming device 500 corresponds to the video decoder 600, and the inverse transforming device 500 may specifically be a decoder.
  • the corresponding relationship between the inverse transforming device 500 and each module in the video decoder 600 is as follows:
  • the obtaining module 510 is equivalent to the entropy decoding module 610, and is configured to obtain information such as a residual coefficient and a first flag bit;
  • the determination module 520 and the inverse transform module 530 are equivalent to the inverse transform and inverse quantization module 620, and are configured to perform inverse transform on the residual coefficients to obtain residual blocks.
  • FIG. 12 is a schematic block diagram of a video encoder according to an embodiment of the present application.
  • the video encoder 700 shown in FIG. 12 includes an encoding end prediction module 710, a transform quantization module 720, an entropy encoding module 730, an encoding reconstruction module 740, and an encoding end filtering module 750.
  • the video encoder shown in FIG. 12 can execute the transformation method in the embodiment of the present application.
  • the disclosed systems, devices, and methods may be implemented in other ways.
  • the device embodiments described above are only schematic.
  • the division of the unit is only a logical function division.
  • multiple units or components may be combined or Can be integrated into another system, or some features can be ignored or not implemented.
  • the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, which may be electrical, mechanical or other forms.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the objective of the solution of this embodiment.
  • each functional unit in each embodiment of the present application may be integrated into one processing unit, or each of the units may exist separately physically, or two or more units may be integrated into one unit.
  • the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium.
  • the technical solution of the present application is essentially a part that contributes to the existing technology or a part of the technical solution can be embodied in the form of a software product.
  • the computer software product is stored in a storage medium, including Several instructions are used to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in the embodiments of the present application.
  • the aforementioned storage media include: U disks, mobile hard disks, read-only memories (ROM), random access memories (RAM), magnetic disks or optical disks, and other media that can store program codes .

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

Provided in the present application are an inverse transformation method and apparatus. The method comprises: parsing a code stream to acquire a residual coefficient of a current block, an intra-frame prediction mode, and a target transformation kernel pair determination parameter, wherein the target transformation kernel pair determination parameter comprises a first flag bit, or the target transformation kernel pair determination parameter comprises a first flag bit and a transformation index value; determining a target transformation kernel pair corresponding to the target transformation kernel pair determination parameter; and according to the target transformation kernel pair, carrying out inverse transformation on the residual coefficient to obtain a residual block. According to the present application, the target transformation kernel pair can be determined according to the target transformation kernel pair determination parameter, so that inverse transformation of the residual coefficient is realized.

Description

变换方法、反变换方法及装置Transformation method, inverse transformation method and device 技术领域Technical field
本申请涉及视频编解码技术领域,并且更具体地,涉及一种变换方法、反变换方法及装置。The present application relates to the technical field of video encoding and decoding, and more particularly, to a transform method, an inverse transform method, and a device.
背景技术Background technique
数字视频能力可并入到多种多样的装置中,包含数字电视、数字直播系统、无线广播系统、个人数字助理(personal digital assistant,PDA)、膝上型或桌上型计算机、平板计算机、电子图书阅读器、数码相机、数字记录装置、数字媒体播放器、视频游戏装置、视频游戏控制台、蜂窝式或卫星无线电电话(所谓的“智能电话”)、视频电话会议装置、视频流式传输装置及其类似者。数字视频装置实施视频压缩技术,例如,在由MPEG-2、MPEG-4、ITU-T H.263、ITU-T H.264/MPEG-4第10部分高级视频编码(AVC)定义的标准、视频编码标准H.265/高效视频编码(high efficiency video coding,HEVC)标准以及此类标准的扩展中所描述的视频压缩技术。视频装置可通过实施此类视频压缩技术来更有效率地发射、接收、编码、解码和/或存储数字视频信息。Digital video capabilities can be incorporated into a wide variety of devices, including digital television, digital live broadcast systems, wireless broadcast systems, personal digital assistants (PDAs), laptop or desktop computers, tablet computers, electronics Book readers, digital cameras, digital recording devices, digital media players, video game devices, video game consoles, cellular or satellite radio phones (so-called "smart phones"), video teleconferencing devices, video streaming devices And similar. Digital video devices implement video compression technology, for example, in standards defined by MPEG-2, MPEG-4, ITU-T H.263, ITU-T H.264 / MPEG-4 Part 10 Advanced Video Coding (AVC), Video coding standard H.265 / High Efficiency Video Coding (HEVC) standard and the video compression technology described in the extension of such standards. Video devices can implement such video compression techniques to more efficiently transmit, receive, encode, decode, and / or store digital video information.
视频压缩技术执行空间(图像内)预测和/或时间(图像间)预测以减少或去除视频序列中固有的冗余。对于基于块的视频编码,视频条带(即,视频帧或视频帧的一部分)可分割成若干图像块,所述图像块也可被称作树块、编码单元(coding unit,CU)和/或编码节点。使用关于同一图像中的相邻块中的参考样本的空间预测来编码图像的待帧内编码(I)条带中的图像块。图像的待帧间编码(P或B)条带中的图像块可使用相对于同一图像中的相邻块中的参考样本的空间预测或相对于其它参考图像中的参考样本的时间预测。图像可被称作帧,且参考图像可被称作参考帧。Video compression techniques perform spatial (intra-image) prediction and / or temporal (inter-image) prediction to reduce or remove redundancy inherent in video sequences. For block-based video coding, a video slice (ie, a video frame or a portion of a video frame) can be partitioned into image blocks, which can also be referred to as tree blocks, coding units (CU), and / Or coding nodes. Spatial predictions about reference samples in neighboring blocks in the same image are used to encode image blocks in the to-be-encoded (I) slice of the image. The image blocks in the to-be-intercoded (P or B) slice of the image may use spatial prediction relative to reference samples in neighboring blocks in the same image or temporal prediction relative to reference samples in other reference images. An image may be referred to as a frame, and a reference image may be referred to as a reference frame.
在对图像块进行编码的过程中,需要对图像块进行预测、变换、量化以及熵编码,以得到编码码流。在对图像块进行预测的过程中常采用帧间预测模式或者帧内预测模式进行预测。当采用帧内预测模式进行预测时,在得到图像块的残差块之后,要根据率失真从多种变换核对中选择出最优变换核对,然后根据该最优变换核对,对残差块进行变换,得到变换系数。In the process of encoding an image block, it is necessary to perform prediction, transformation, quantization, and entropy encoding on the image block to obtain an encoded code stream. In the process of predicting an image block, an inter prediction mode or an intra prediction mode is often used for prediction. When the intra prediction mode is used for prediction, after obtaining the residual block of the image block, an optimal transform check is selected from a variety of transform checks based on the rate distortion, and then the residual block is performed according to the optimal transform check. Transform to get the transform coefficient.
因此,在对图像块进行编解码的过程中如何确定出目标变换核对,进而根据目标变换核对实现变换和反变换是一个需要解决的问题。Therefore, how to determine the target transformation check in the process of encoding and decoding the image block, and then realize the transformation and inverse transformation according to the target transformation check is a problem to be solved.
发明内容Summary of the invention
本申请提供一种变换方法、反变换方法及装置,以实现对残差系数的反变换。The present application provides a transform method, an inverse transform method, and a device to implement an inverse transform on a residual coefficient.
第一方面,提供了一种反变换方法,该方法包括:解析码流以获取当前块的残差系数、帧内预测模式和目标变换核对确定参数;从第一变换核对、第二变换核对、以及第三变换核中确定出与目标变换核对确定参数对应的目标变换核对;其中,第二变换核对为第一候 选变换核对或第二变候选变换核对,第一候选变换核对和第二变候选变换核对均包含变换核DST-VII,第一候选变换核对和第二变候选变换核对与当前块对应的帧内预测模式对应;根据目标变换核对,对残差系数进行反变换,得到残差块。In a first aspect, an inverse transform method is provided. The method includes: parsing a bitstream to obtain a residual coefficient of a current block, an intra prediction mode, and a target transform check to determine parameters; a first transform check, a second transform check, And a third transformation kernel determines a target transformation check corresponding to the target transformation check determination parameter; wherein the second transformation check is a first candidate transformation check or a second transformation candidate transformation check, the first candidate transformation check and the second transformation candidate The transformation check includes the transformation kernel DST-VII, the first candidate transformation check and the second transformation candidate check correspond to the intra prediction mode corresponding to the current block; according to the target transformation check, the residual coefficient is inversely transformed to obtain the residual block. .
应理解,解析码流以获取当前块的残差系数具体可以是指先从码流中解析得到量化系数,然后再对量化系数进行反量化从而得到残差系数,该残差系数可以用于反变换。It should be understood that parsing the bitstream to obtain the residual coefficient of the current block may specifically refer to firstly parsing the quantized coefficient from the bitstream and then dequantizing the quantized coefficient to obtain the residual coefficient, which can be used for inverse transformation .
本申请中,通过解析到的目标变换核对确定参数就可以确定目标变换核对,进而可以根据该目标变换核对实现对残差系数的反变换。In this application, the target transformation check can be determined through the determined target transformation check determination parameters, and the inverse transformation of the residual coefficient can be realized according to the target transformation check.
进一步的,由于第一候选变换核对和第二变换核对中均包含变换核DST-VII,可以使得最终确定的目标变换核对中包含变换核DST-VII的可能性增加,使得在根据目标变换核对,对残差系数进行反变换时可能会得到更好的反变换效果。Further, since the first candidate transformation check and the second transformation check both include a transformation kernel DST-VII, it is possible to increase the possibility of including the transformation kernel DST-VII in the final target transformation check, so that in the target transformation check, A better inverse transform effect may be obtained when inverse transforming the residual coefficients.
具体地,由于帧内预测模式时利用当前块的上边和右边的参考像素对当前块进行预测,并且预测误差有从上到下从左到右依次逐渐增大的趋势,而DST-VII的基函数是逐渐增大的,因此,DST-VII变换核适合这种逐渐增大的特性,采用DST-VII进行变换和反变换能够取得较好的效果。Specifically, because the intra prediction mode uses the top and right reference pixels of the current block to predict the current block, and the prediction error tends to gradually increase from top to bottom from left to right, the base of DST-VII The function is gradually increasing. Therefore, the DST-VII transformation kernel is suitable for this gradually increasing characteristic. Using DST-VII for transformation and inverse transformation can achieve better results.
可选地,目标变换核对确定参数包括第一标志位,或目标变换核对确定参数包括第一标志位和变换索引值。Optionally, the target transformation check determination parameter includes a first flag bit, or the target transformation check determination parameter includes a first flag bit and a transformation index value.
可选地,从第一变换核对、第二变换核对以及第三变换核对中确定出与确定与目标变换核对确定参数对应的目标变换核对,包括:当第一标志位为第一取值时,确定与目标变换核对确定参数对应的目标变换核对为第一变换核对;当第一标志位为第二取值且变换索引值为第一变换索引值时,确定与目标变换核对确定参数对应的目标变换核对为第二变换核对;当第一标志位为第二取值且变换索引值为第二变换索引值时,确定与目标变换核对确定参数对应的目标变换核对为第三变换核对。Optionally, determining the target transformation check corresponding to the determination parameter corresponding to the target transformation check determination from the first transformation check, the second transformation check, and the third transformation check includes: when the first flag bit is the first value, The target transformation check corresponding to the target transformation check determination parameter is determined to be the first transformation check; when the first flag bit is the second value and the transformation index value is the first transformation index value, the target corresponding to the target transformation check determination parameter is determined The transformation check is the second transformation check; when the first flag bit is the second value and the transformation index value is the second transformation index value, the target transformation check corresponding to the target transformation check determination parameter is determined to be the third transformation check.
可选地,上述第一变换核对、第一候选变换核对、第二候选变换核对以及第三变换核对中包含的变换核的种类的总数小于5。Optionally, the total number of types of the transformation kernels included in the first transformation check, the first candidate transformation check, the second candidate transformation check, and the third transformation check is less than 5.
本申请中,变换核的种类小于5时,能够减少由于存储变换核所占用的存储空间。In the present application, when the type of the transformation kernel is less than 5, the storage space occupied by storing the transformation kernel can be reduced.
可选地,上述第一变换核对、第一候选变换核对、第二候选变换核对以及第三变换核对中包含的变换核包括DCT-II,DCT-VIII和DST-VII。Optionally, the transformation kernels included in the first transformation check, the first candidate transformation check, the second candidate transformation check, and the third transformation check include DCT-II, DCT-VIII, and DST-VII.
可选地,目标变换核对确定参数的参数值也可以与变换核对之间有直接映射关系,这样就可以根据目标变换核对确定参数的参数值可以直接确定目标变换核。Optionally, the parameter value of the target transformation check determination parameter may also have a direct mapping relationship with the transformation check, so that the target transformation kernel may be directly determined according to the parameter value of the target transformation check determination parameter.
可选地,从第一变换核对、第二变换核对以及第三变换核对中确定出与确定与目标变换核对确定参数对应的目标变换核对,包括:根据目标变换核对确定参数的参数值以及目标变换核对确定参数的参数值与变换核对之间的映射关系,确定目标变换核对。Optionally, determining a target transformation check corresponding to the target transformation check determination parameter from the first transformation check, the second transformation check, and the third transformation check includes: determining the parameter value of the parameter and the target transformation according to the target transformation check. The mapping relationship between the parameter value of the determined parameter and the transformation check is checked, and the target transformation check is determined.
具体地,根据目标变换核对确定参数分别为第一参数值至第三参数值时,分别对应第一变换核对至第三变换核对。那么当解码端解析到目标变换核对确定参数为第一参数值时,可以直接确定目标变换核对为第一变换核对。Specifically, when the parameters determined according to the target transformation check are respectively the first parameter value to the third parameter value, the first transformation check to the third transformation check are respectively corresponding. Then, when the decoding end resolves that the target transformation check determination parameter is the first parameter value, it can directly determine that the target transformation check is the first transformation check.
可选地,上述第一标志位为显式多核变换EMT标志位。Optionally, the first flag bit is an explicit multi-core transform EMT flag bit.
上述EMT标志位也可以称为EMT编码标志位。The above-mentioned EMT flag can also be called an EMT encoding flag.
可选地,上述第一取值为0,第二取值为1。Optionally, the first value is 0, and the second value is 1.
具体地,当EMT标志位的取值为0时表示在对残差系数进行反变换时要采用单核反 变换(相应的,编码端进行变换时采用的也是单核变换);当EMT标志位的取值为1时表示在对残差系数进行反变换时要采用多核反变换(相应的,编码端进行变换时采用的也是多核变换)。Specifically, when the value of the EMT flag is 0, it means that a single-core inverse transformation is used when inversely transforming the residual coefficient (correspondingly, the single-core transformation is also used when the encoding end is transformed); when the EMT flag is set, A value of 1 indicates that a multi-core inverse transform is used when inverse transforming the residual coefficient (correspondingly, the multi-core transform is also used when the encoding end performs the transform).
可选地,第一变换核对为相同变换核组成的变换核对。Optionally, the first transformation check is a transformation check composed of the same transformation kernel.
例如,第一变换核对为(DCT-II,DCT-II)。For example, the first transformation check is (DCT-II, DCT-II).
在第一方面的某些实现方式中,第一候选变换核对为(DST-VII,DCT-VIII),第二候选变换核对为(DCT-VIII,DST-VII);在当前块对应的帧内预测模式的模式号小于或者等于预设阈值时,第二变换核对为第一候选变换核对;在当前块对应的帧内预测模式的模式号大于预设阈值时,第一变换核对为第二候选变换核对。In some implementations of the first aspect, the first candidate transformation check is (DST-VII, DCT-VIII), and the second candidate transformation check is (DCT-VIII, DST-VII); within a frame corresponding to the current block When the mode number of the prediction mode is less than or equal to the preset threshold, the second transformation check is the first candidate transformation check; when the mode number of the intra prediction mode corresponding to the current block is greater than the preset threshold, the first transformation check is the second candidate. Transform check.
可选地,上述预设阈值为N,当采用H.265标准时,N=18,当采用是H.266标准时,N=34。Optionally, the preset threshold is N. When the H.265 standard is adopted, N = 18, and when the H.266 standard is adopted, N = 34.
在第一方面的某些实现方式中,第三变换核对为(DST-VII,DST-VII)。In some implementations of the first aspect, the third transformation check is (DST-VII, DST-VII).
在第一方面的某些实现方式中,第一变换核对为(DCT-II,DTC-II)。In some implementations of the first aspect, the first transformation check is (DCT-II, DTC-II).
在第一方面的某些实现方式中,第一变换索引值为0,第二变换索引值为1,或者,第一变换索引值为1,第二变换索引值为0。In some implementations of the first aspect, the first transformation index value is 0, the second transformation index value is 1, or the first transformation index value is 1 and the second transformation index value is 0.
在第一方面的某些实现方式中,第一变换索引值和第二变换索引值对应的码字的长度均为1。In some implementations of the first aspect, the lengths of the codewords corresponding to the first transformation index value and the second transformation index value are both 1.
本申请中,变换索引值对应的码字的长度均为1,能够减少由于指示变换索引值所需要的占用的比特数。In this application, the lengths of the codewords corresponding to the transformation index value are all 1, which can reduce the number of occupied bits required to indicate the transformation index value.
可选地,第一变换索引值对应的码字为0,第二变换索引值对应的码字为1。Optionally, the codeword corresponding to the first transformation index value is 0, and the codeword corresponding to the second transformation index value is 1.
可选地,第一变换索引值对应的码字为1,第二变换索引值对应的码字为0。Optionally, the codeword corresponding to the first transformation index value is 1, and the codeword corresponding to the second transformation index value is 0.
在第一方面的某些实现方式中,在确定目标变换核对之前,上述方法还包括:确定当前块对应的帧内预测模式为方向预测模式。In some implementation manners of the first aspect, before the target transformation check is determined, the above method further includes: determining an intra prediction mode corresponding to the current block as a directional prediction mode.
在第一方面的某些实现方式中,在确定目标变换核对之前,上述方法还包括:确定当前块的宽和高均小于或者等于M。In some implementation manners of the first aspect, before determining the target transformation check, the above method further includes: determining that the width and height of the current block are both less than or equal to M.
在第一方面的某些实现方式中,在当前块的宽和高至少有一个大于M的情况下,确定(DCT-II,DTC-II)为目标变换核对。In some implementations of the first aspect, when at least one of the width and height of the current block is greater than M, (DCT-II, DTC-II) is determined as the target transformation check.
可选地,上述M的数值为64。Optionally, the value of M is 64.
本申请中,在当前块的尺寸较大的情况下直接采用(DCT-II,DTC-II)作为目标变换核对进行反变换,在当前块的尺寸较小时再根据目标变换核对确定参数最终确定目标变换核,能够灵活处理不同大小的图像块。In this application, when the size of the current block is large, (DCT-II, DTC-II) is directly used as the target transformation check to perform inverse transformation. When the size of the current block is small, the parameters are finally determined according to the target transformation check to determine the target. The transformation kernel can flexibly process image blocks of different sizes.
在第一方面的某些实现方式中,上述方法还包括:在当前块对应的帧内预测模式为DC模式的情况下,确定变换核对(DCT-II,DTC-II)为目标变换核对。In some implementation manners of the first aspect, the above method further includes: when the intra prediction mode corresponding to the current block is a DC mode, determining transformation check (DCT-II, DTC-II) as a target transformation check.
在第一方面的某些实现方式中,上述方法还包括:在当前块对应的帧内预测模式为平面模式的情况下,确定变换核对(DST-VII,DST-VII)为目标变换核对。In some implementation manners of the first aspect, the above method further includes: when the intra prediction mode corresponding to the current block is a planar mode, determining a transformation check (DST-VII, DST-VII) as a target transformation check.
本申请中,当帧内预测模式为DC模式或者平面模式时,通过直接采用预设的变换核对进行反变换,能够简化确定目标变换核的过程,减少反变换所需要的时间。In the present application, when the intra prediction mode is a DC mode or a planar mode, by using a preset transformation check directly to perform inverse transformation, the process of determining the target transformation kernel can be simplified and the time required for the inverse transformation can be reduced.
可选地,在当前块对应的帧内预测模式为平面模式且当前块的宽和高均小于或者等于N的情况下,确定变换核对(DST-VII,DST-VII)为目标变换核对。Optionally, when the intra prediction mode corresponding to the current block is a planar mode and the width and height of the current block are both less than or equal to N, a transformation check (DST-VII, DST-VII) is determined as the target transformation check.
上述N的数值可以为4,8和16等。The value of N can be 4, 8, and 16 and so on.
由于平面模式下出现的残差呈现从左到右、从上到下依次增加的趋势,这类信号适合采用DST-VII,因此,在平面模式下采用(DST-VII,DST-VII)作为目标变换核对能够提高反变换的效果。Since the residuals appearing in the planar mode tend to increase from left to right and from top to bottom, this type of signal is suitable for DST-VII. Therefore, (DST-VII, DST-VII) is used as the target in the planar mode. Transform check can improve the effect of inverse transform.
第二方面,提供了一种反变换方法,该方法包括:解析码流以获取当前块的残差系数和目标变换核对确定参数;从第一变换核对、第二变换核对、第三变换核对以及第四变换核对中确定出与所述目标变换核对确定参数对应的目标变换核对;其中,所述第二变换核对,所述第三变换核对和第四变换核对均包括变换核DST-VII,所述第二变换核对,所述第三变换核对和所述第四变换核对中至少一个变换核对包括变换核DCT-VIII;根据所述目标变换核对,对所述残差系数进行反变换,得到残差块。In a second aspect, an inverse transform method is provided. The method includes: parsing a bitstream to obtain a residual coefficient of a current block and a target transform check determination parameter; a first transform check, a second transform check, a third transform check, and A target transformation check corresponding to the target transformation check determination parameter is determined in the fourth transformation check; wherein the second transformation check, the third transformation check, and the fourth transformation check all include a transformation kernel DST-VII, so The second transformation check, at least one of the third transformation check and the fourth transformation check includes a transformation kernel DCT-VIII; according to the target transformation check, performing an inverse transformation on the residual coefficient to obtain a residual Bad block.
应理解,解析码流以获取当前块的残差系数具体可以是指先从码流中解析得到量化系数,然后再对量化系数进行反量化从而得到残差系数,该残差系数可以用于反变换。It should be understood that parsing the bitstream to obtain the residual coefficient of the current block may specifically refer to firstly parsing the quantized coefficient from the bitstream, and then dequantizing the quantized coefficient to obtain the residual coefficient, which can be used for inverse transformation .
本申请中,通过解析到的目标变换核对确定参数就可以确定目标变换核对,进而可以根据该目标变换核对实现对残差系数的反变换。In this application, the target transformation check can be determined through the determined target transformation check determination parameters, and the inverse transformation of the residual coefficient can be realized according to the target transformation check.
进一步的,由于第一候选变换核对和第二变换核对中均包含变换核DST-VII,可以使得最终确定的目标变换核对中包含变换核DST-VII的可能性增加,使得在根据目标变换核对,对残差系数进行反变换时可能会得到更好的反变换效果。Further, since the first candidate transformation check and the second transformation check both include a transformation kernel DST-VII, it is possible to increase the possibility of including the transformation kernel DST-VII in the final target transformation check, so that in the target transformation check, A better inverse transform effect may be obtained when inverse transforming the residual coefficients.
具体地,由于帧内预测模式时利用当前块的上边和右边的参考像素对当前块进行预测,并且预测误差有从上到下从左到右依次逐渐增大的趋势,而DST-VII的基函数是逐渐增大的,因此,DST-VII变换核适合这种逐渐增大的特性,采用DST-VII进行变换和反变换能够取得较好的效果。Specifically, because the intra prediction mode uses the top and right reference pixels of the current block to predict the current block, and the prediction error tends to gradually increase from top to bottom from left to right, the base of DST-VII The function is gradually increasing. Therefore, the DST-VII transformation kernel is suitable for this gradually increasing characteristic. Using DST-VII for transformation and inverse transformation can achieve better results.
可选地,上述目标变换核对确定参数包括第一标志位,或所述目标变换核对确定参数包括第一标志位和变换索引值。Optionally, the target transformation check determination parameter includes a first flag bit, or the target transformation check determination parameter includes a first flag bit and a transformation index value.
可选地,从第一变换核对、第二变换核对、第三变换核对以及第四变换核对中确定出与所述目标变换核对确定参数对应的目标变换核对,包括:当所述第一标志位为第一取值时,确定与所述目标变换核对确定参数对应的目标变换核对为第一变换核对;当第一标志位为第二取值并且所述变换索引值为第一变换索引值时,确定与所述目标变换核对确定参数对应的目标变换核对为第二变换核对;当第一标志位为第二取值并且所述变换索引值为第二变换索引值时,确定与所述目标变换核对确定参数对应的目标变换核对为第三变换核对;当第一标志位为第二取值并且所述变换索引值为第三变换索引值时,确定与所述目标变换核对确定参数对应的目标变换核对为第四变换核对。Optionally, determining a target transformation check corresponding to the target transformation check determination parameter from the first transformation check, the second transformation check, the third transformation check, and the fourth transformation check includes: when the first flag bit is When it is the first value, it is determined that the target transformation check corresponding to the target transformation check determination parameter is the first transformation check; when the first flag bit is the second value and the transformation index value is the first transformation index value To determine a target transformation check corresponding to the target transformation check determination parameter as a second transformation check; when the first flag bit is a second value and the transformation index value is a second transformation index value, determine the target transformation The target transformation check corresponding to the transformation check determination parameter is a third transformation check; when the first flag bit has a second value and the transformation index value is a third transformation index value, determining a parameter corresponding to the target transformation check determination parameter The target transformation check is a fourth transformation check.
可选地,上述第一变换核对、第二变换核对、第三变换核对以及第四变换核对中包含的变换核的种类的总数小于5。Optionally, the total number of types of transformation kernels included in the first transformation check, the second transformation check, the third transformation check, and the fourth transformation check is less than 5.
本申请中,变换核的种类小于5时,能够减少由于存储变换核所占用的存储空间。In the present application, when the type of the transformation kernel is less than 5, the storage space occupied by storing the transformation kernel can be reduced.
可选地,上述第一变换核对、第一候选变换核对、第二候选变换核对以及第三变换核对中包含的变换核包括DCT-II,DCT-VIII和DST-VII。Optionally, the transformation kernels included in the first transformation check, the first candidate transformation check, the second candidate transformation check, and the third transformation check include DCT-II, DCT-VIII, and DST-VII.
可选地,从第一变换核对、第二变换核对、第三变换核对以及第四变换核对中确定出与确定与目标变换核对确定参数对应的目标变换核对,包括:根据目标变换核对确定参数的参数值以及目标变换核对确定参数的参数值与变换核对之间的映射关系,确定目标变换 核对。Optionally, determining, from the first transformation check, the second transformation check, the third transformation check, and the fourth transformation check, a target transformation check corresponding to the determined and target transformation check determination parameter includes: determining the parameter according to the target transformation check. The parameter value and the target transformation check determine the mapping relationship between the parameter value of the parameter and the transformation check to determine the target transformation check.
具体地,目标变换核对确定参数分别为第一参数值至第四参数值时,分别对应第一变换核对至第四变换核对。这样,当解码端解析到目标变换核对确定参数为第一参数值时,可以直接确定目标变换核对为第一变换核对。Specifically, when the target transformation check determination parameters are respectively the first parameter value to the fourth parameter value, they correspond to the first transformation check to the fourth transformation check, respectively. In this way, when the decoding end resolves that the target transformation check determination parameter is the first parameter value, it can directly determine that the target transformation check is the first transformation check.
可选地,上述第一标志位为显式多核变换EMT标志位。Optionally, the first flag bit is an explicit multi-core transform EMT flag bit.
可选地,上述第一取值为0,第二取值为1。Optionally, the first value is 0, and the second value is 1.
具体地,当EMT标志位的取值为0时表示在对残差系数进行反变换时要采用单核反变换(相应的,编码端进行变换时采用的也是单核变换);当EMT标志位的取值为1时表示在对残差系数进行反变换时要采用多核反变换(相应的,编码端进行变换时采用的也是多核变换)。Specifically, when the value of the EMT flag is 0, it means that a single-core inverse transformation is used when the inverse transformation is performed on the residual coefficient (correspondingly, the single-core transformation is also used when the encoding end is transformed); A value of 1 indicates that a multi-core inverse transform is used when inverse transforming the residual coefficient (correspondingly, the multi-core transform is also used when the encoding end performs the transform).
可选地,第一变换核对为相同变换核组成的变换核对。Optionally, the first transformation check is a transformation check composed of the same transformation kernel.
采用第一变换核对进行反变换时进行的就是单核反变换。When the first transform check is used to perform the inverse transform, a single-core inverse transform is performed.
在第二方面的某些实现方式中,第一变换索引值对应的码字的长度为1,第二变换索引值和第三变换索引值对应的码字的长度均为2。In some implementations of the second aspect, the length of the codeword corresponding to the first transformation index value is 1, and the length of the codeword corresponding to the second transformation index value and the third transformation index value are both 2.
通过将第一变换索引值的码字的长度设置为1,能够减少指示变换索引值时需要的比特位。By setting the length of the codeword of the first transformation index value to 1, the number of bits required to indicate the transformation index value can be reduced.
可选地,上述第一变换索引值至第三变换索引值分别为0,1,2。Optionally, the first to third transformation index values are 0, 1, and 2, respectively.
可选地,上述第一变换索引值对应的码字为0,上述第二变换索引值对应的码字为10,上述第三变换索引值对应的码字为11。Optionally, the codeword corresponding to the first transformation index value is 0, the codeword corresponding to the second transformation index value is 10, and the codeword corresponding to the third transformation index value is 11.
可选地,上述第二变换索引值和第三变换索引值对应的码字分别为10和01。Optionally, the codewords corresponding to the second transformation index value and the third transformation index value are 10 and 01, respectively.
在第二方面的某些实现方式中,第一变换核对为(DCT-II,DTC-II),第二变换核对为(DST-VII,DST-VII),第三变换核对为(DCT-VIII,DST-VII),第四变换核对为(DST-VII,DCT-VIII)。In some implementations of the second aspect, the first transformation check is (DCT-II, DTC-II), the second transformation check is (DST-VII, DST-VII), and the third transformation check is (DCT-VIII , DST-VII), and the fourth transformation check is (DST-VII, DCT-VIII).
本申请中,第一变换核对至第四变换核对中包含的变换核的种类为4种,小于现有JEM(H.266的参考软件模型)标准中的5种,可以减少存储变换核时占用的比特。In this application, there are four types of transformation kernels included in the first to fourth transformation verifications, which are smaller than five in the existing JEM (H.266 reference software model) standard, which can reduce the occupation of storing the transformation kernels. Of bits.
在第二方面的某些实现方式中,在确定所述目标变换核对之前,上述方法还包括:确定当前块对应的帧内预测模式为方向预测模式。In some implementation manners of the second aspect, before determining the target transformation check, the above method further includes: determining an intra prediction mode corresponding to the current block as a directional prediction mode.
在第二方面的某些实现方式中在确定所述目标变换核对之前,上述方法还包括:确定当前块的宽和高均小于或者等于M。In some implementations of the second aspect, before the target transformation check is determined, the above method further includes: determining that a width and a height of the current block are both less than or equal to M.
在第二方面的某些实现方式中,在当前块的宽和高至少有一个大于M时,确定(DCT-II,DTC-II)为目标变换核对。In some implementations of the second aspect, when at least one of the width and height of the current block is greater than M, (DCT-II, DTC-II) is determined as the target transformation check.
可选地,上述M的数值为64。Optionally, the value of M is 64.
在当前块的尺寸较大的情况下直接采用(DCT-II,DTC-II)作为目标变换核对进行变换,在当前块的尺寸较小时再根据目标变换核对确定参数最终确定目标变换核,能够灵活处理不同大小的图像块。When the size of the current block is large, (DCT-II, DTC-II) is directly used as the target transformation check to perform the transformation, and when the current block size is small, the target transformation kernel is finally determined according to the determination parameters of the target transformation check, which can be flexible Process image blocks of different sizes.
在第二方面的某些实现方式中,上述方法还包括:在当前块对应的帧内预测模式为DC模式的情况下,确定变换核对(DCT-II,DTC-II)为目标变换核对。In some implementation manners of the second aspect, the above method further includes: when the intra prediction mode corresponding to the current block is a DC mode, determining a transformation check (DCT-II, DTC-II) as a target transformation check.
在第二方面的某些实现方式中,上述方法还包括:在当前块对应的帧内预测模式为平面模式的情况下,确定变换核对(DST-VII,DST-VII)为目标变换核对。In some implementation manners of the second aspect, the above method further includes: when the intra prediction mode corresponding to the current block is a planar mode, determining a transformation check (DST-VII, DST-VII) as a target transformation check.
当帧内预测模式为DC模式或者平面模式对时,通过直接采用预设的变换核对进行反变换,能够简化确定目标变换核的过程,减少反变换所需要的时间。When the intra prediction mode is a DC mode or a plane mode pair, the inverse transformation can be simplified by directly using a preset transformation check, which can simplify the process of determining the target transformation kernel and reduce the time required for the inverse transformation.
可选地,在当前块对应的帧内预测模式为平面模式且当前块的宽和高均小于或者等于N的情况下,确定变换核对(DST-VII,DST-VII)为目标变换核对。Optionally, when the intra prediction mode corresponding to the current block is a planar mode and the width and height of the current block are both less than or equal to N, a transformation check (DST-VII, DST-VII) is determined as the target transformation check.
上述N的数值可以为4,8和16等。The value of N can be 4, 8, and 16 and so on.
在平面模式下出现的残差呈现从左到右、从上到下依次增加的趋势,这类信号适合采用DST-VII,因此,在平面模式下采用(DST-VII,DST-VII)作为目标变换核对能够提高反变换的效果。The residuals appearing in the flat mode show an increasing trend from left to right and from top to bottom. This type of signal is suitable for DST-VII. Therefore, (DST-VII, DST-VII) is used as the target in the flat mode. Transform check can improve the effect of inverse transform.
第三方面,提供了一种变换方法,该方法包括:获取待处理图像块的残差块;根据预设的第一映射关系信息获取残差块的候选变换核对;从候选变换核对中选择出率失真最小的变换核对作为目标变换核对;根据目标变换核对,对残差块进行变换,得到待处理图像块的变换系数;将目标变换核对对应的变换索引值写入码流。According to a third aspect, a transformation method is provided. The method includes: obtaining a residual block of an image block to be processed; obtaining a candidate transformation check of the residual block according to preset first mapping relationship information; and selecting from the candidate transformation check The transformation check with the lowest rate distortion is used as the target transformation check. According to the target transformation check, the residual block is transformed to obtain the transformation coefficient of the image block to be processed. The corresponding transformation index value of the target transformation check is written into the code stream.
其中,第一映射关系信息包括第一标志位、第一变换索引值和第二变换索引值以及多种变换核对的映射关系,第一标志位为第一取值时采用单核变换,第一标志位为第二取值时采用多核变换;The first mapping relationship information includes a mapping relationship of a first flag bit, a first transformation index value and a second transformation index value, and a variety of transformation checks. When the first flag bit is the first value, a single-core transformation is used. Multi-core transformation is used when the flag is the second value;
此外,第一标志位为第一取值时对应第一变换核对,第一标志位为第二取值时第一变换索引值对应第二变换核对,第一标志位为第二取值时第二变换索引值对应第三变换核对,第二变换核对是根据残差块对应的帧内预测模式从第一候选变换核对和第二候选变换核对中选择得到的,其中,第一候选变换核对和第二变候选变换核对均包含DST-VII。In addition, when the first flag bit is the first value, it corresponds to the first transformation check. When the first flag bit is the second value, the first transformation index value corresponds to the second transformation check. When the first flag bit is the second value, the first transformation bit is checked. The second transformation index value corresponds to the third transformation check, and the second transformation check is selected from the first candidate transformation check and the second candidate transformation check according to the intra prediction mode corresponding to the residual block, where the first candidate transformation check and The second transformation candidate transformation check all includes DST-VII.
本申请中,由于第一映射关系信息中仅包含三个变换核对,因此,能够在选择目标变换核对的过程中减少遍历次数,从而可以减少编码所需要的时间。In this application, because the first mapping relationship information includes only three transformation checkups, the number of traversals can be reduced in the process of selecting a target transformation checkup, thereby reducing the time required for encoding.
可选地,上述第一标志位为显式多核变换EMT标志位。Optionally, the first flag bit is an explicit multi-core transform EMT flag bit.
可选地,上述第一取值为0,第二取值为1。Optionally, the first value is 0, and the second value is 1.
具体地,第一映射关系信息包括EMT标志位,当EMT标志位的取值为0时表示在对残差块进行变换时要采用单核变换;当EMT标志位的取值为1时表示在对残差块进行变换时要采用多核变换。Specifically, the first mapping relationship information includes an EMT flag bit. When the value of the EMT flag bit is 0, it means that single-core transformation is used when transforming the residual block; when the value of the EMT flag bit is 1, it means that Multi-core transform is used to transform the residual block.
可选地,第一变换核对为相同变换核组成的变换核对。Optionally, the first transformation check is a transformation check composed of the same transformation kernel.
例如,第一变换核对为(DCT-II,DCT-II)。For example, the first transformation check is (DCT-II, DCT-II).
可选地,上述第一变换索引值为0,第二变换索引值为1。Optionally, the first transformation index value is 0, and the second transformation index value is 1.
在第三方面的某些实现方式中,第一候选变换核对为(DST-VII,DCT-VIII),第二候选变换核对为(DCT-VIII,DST-VII);当残差块对应的帧内预测模式的模式号小于或者等于预设阈值时,第二变换核对为第一候选变换核对;当残差块对应的帧内预测模式的模式号大于预设阈值时,第一变换核对为第二候选变换核对。In some implementations of the third aspect, the first candidate transformation check is (DST-VII, DCT-VIII), and the second candidate transformation check is (DCT-VIII, DST-VII); when the frame corresponding to the residual block is When the mode number of the intra prediction mode is less than or equal to a preset threshold, the second transformation check is the first candidate transformation check; when the mode number of the intra prediction mode corresponding to the residual block is greater than the preset threshold, the first transformation check is the first Two candidate transformation checks.
可选地,上述预设阈值为N,当编码时采用的是H.265标准时,N=18,当编码时采用的是H.266标准时,N=34。Optionally, the preset threshold is N. When the H.265 standard is used for encoding, N = 18, and when the H.266 standard is used for encoding, N = 34.
在第三方面的某些实现方式中,第三变换核对为(DST-VII,DST-VII)。In some implementations of the third aspect, the third transformation check is (DST-VII, DST-VII).
在第三方面的某些实现方式中,第一变换索引值为0,第二变换索引值为1,或者,第一变换索引值为1,第二变换索引值为0。In some implementations of the third aspect, the first transformation index value is 0, the second transformation index value is 1, or the first transformation index value is 1 and the second transformation index value is 0.
在第三方面的某些实现方式中,第一变换索引值和第二变换索引值对应的码字的长度 均为1。In some implementations of the third aspect, the lengths of the codewords corresponding to the first transformation index value and the second transformation index value are both 1.
本申请中,变换索引值对应的码字的长度均为1,能够减少由于指示变换索引值所需要的占用的比特数。In this application, the lengths of the codewords corresponding to the transformation index value are all 1, which can reduce the number of occupied bits required to indicate the transformation index value.
可选地,第一变换索引值对应的码字为0,第二变换索引值对应的码字为1。Optionally, the codeword corresponding to the first transformation index value is 0, and the codeword corresponding to the second transformation index value is 1.
可选地,第一变换索引值对应的码字为1,第二变换索引值对应的码字为0。Optionally, the codeword corresponding to the first transformation index value is 1, and the codeword corresponding to the second transformation index value is 0.
在第三方面的某些实现方式中,根据预设的第一映射关系信息获取残差块的候选变换核对之前,方法还包括:确定残差块对应的帧内预测模式为方向预测模式。In some implementations of the third aspect, before obtaining candidate transformation check of the residual block according to the preset first mapping relationship information, the method further includes: determining an intra prediction mode corresponding to the residual block as a directional prediction mode.
在第三方面的某些实现方式中,根据预设的第一映射关系信息获取残差块的候选变换核对之前,方法还包括:确定残差块的宽和高均小于或者等于M。In some implementations of the third aspect, before obtaining candidate transformation check of the residual block according to the preset first mapping relationship information, the method further includes: determining that the width and height of the residual block are both less than or equal to M.
在第三方面的某些实现方式中,当残差块的宽和高至少有一个大于M时,确定(DCT-II,DTC-II)为目标变换核对。In some implementations of the third aspect, when at least one of the width and height of the residual block is greater than M, (DCT-II, DTC-II) is determined as the target transformation check.
可选地,上述M的数值为64。Optionally, the value of M is 64.
本申请中,当残差块的尺寸较大时直接采用(DCT-II,DTC-II)作为目标变换核对进行变换,当残差块的尺寸较小时再根据第一映射关系信息最终确定目标变换核,能够实现对不同大小的残差块进行更好的变换。In this application, when the size of the residual block is large, (DCT-II, DTC-II) is directly used as the target transformation check to perform the transformation, and when the size of the residual block is small, the target transformation is finally determined according to the first mapping relationship information. The kernel can achieve better transformation of residual blocks of different sizes.
在第三方面的某些实现方式中,上述方法还包括:在残差块对应的帧内预测模式为DC模式的情况下,确定变换核对(DCT-II,DTC-II)为目标变换核对。In some implementation manners of the third aspect, the above method further includes: when the intra prediction mode corresponding to the residual block is a DC mode, determining transformation check (DCT-II, DTC-II) as a target transformation check.
在第三方面的某些实现方式中,上述方法还包括:在残差块对应的帧内预测模式为平面模式的情况下,确定变换核对(DST-VII,DST-VII)为目标变换核对。In some implementation manners of the third aspect, the above method further includes: when the intra prediction mode corresponding to the residual block is a planar mode, determining a transformation check (DST-VII, DST-VII) as a target transformation check.
本申请中,当采用DC模式和平面模式对残差块进行量化时,可以直接采用预设的变换核对进行量化,能够节省遍历过程,进而减少编码所需要的时间。In this application, when the DC mode and the plane mode are used to quantize the residual block, a preset transformation check can be directly used for quantization, which can save the traversal process and further reduce the time required for encoding.
可选地,在残差块对应的帧内预测模式为平面模式且残差块的宽和高均小于或者等于N的情况下,确定变换核对(DST-VII,DST-VII)为目标变换核对。Optionally, when the intra prediction mode corresponding to the residual block is a planar mode and the width and height of the residual block are both less than or equal to N, a transformation check (DST-VII, DST-VII) is determined as the target transformation check .
上述N的数值可以为4,8和16等。The value of N can be 4, 8, and 16 and so on.
第四方面,提供了一种变换方法,该方法包括:获取待处理图像块的残差块;根据预设的第一映射关系信息获取残差块的候选变换核对;从候选变换核对中选择出率失真最小的变换核对作为目标变换核对;根据目标变换核对,对残差块进行变换,得到待处理图像块的变换系数;将目标变换核对对应的变换索引值写入码流。According to a fourth aspect, a transformation method is provided. The method includes: obtaining a residual block of an image block to be processed; obtaining a candidate transformation check of the residual block according to preset first mapping relationship information; and selecting from the candidate transformation check The transformation check with the lowest rate distortion is used as the target transformation check. According to the target transformation check, the residual block is transformed to obtain the transformation coefficient of the image block to be processed. The corresponding transformation index value of the target transformation check is written into the code stream.
其中,第一映射关系信息包括第一标志位、第一变换索引值、第二变换索引值、第三变换索引值以及四种变换核对的映射关系,第一标志位为第一取值和第二取值时分别采用单核变换和多核变换,第一标志位为第一取值时对应第一变换核对,第一标志位为第二取值时第一变换索引值、第二变换索引值以及第三变换索引值分别对应第二变换核对、第三变换核对和第四变换核对,第二变换核对至第四变换核对中的任意一个变换核对包括变换核DST-VII,第二变换核对至第四变换核对中至少一个变换核对包括变换核DCT-VIII。The first mapping relationship information includes a mapping relationship of a first flag bit, a first transformation index value, a second transformation index value, a third transformation index value, and four transformation checklists. The first flag bit is a first value and a first mapping bit. Single-core transformation and multi-core transformation are used when the two values are taken. The first flag bit corresponds to the first transformation check when the first value is the first value. When the first flag bit is the second value, the first transformation index value and the second transformation index value are used. And the third transformation index value corresponds to the second transformation check, the third transformation check, and the fourth transformation check. Any one of the second transformation check to the fourth transformation check includes the transformation kernel DST-VII, and the second transformation check to At least one transformation check in the fourth transformation check includes a transformation kernel DCT-VIII.
本申请中,由于第一映射关系信息中仅包含四个变换核对,因此,能够在选择目标变换核对的过程中减少遍历次数,从而可以减少编码所需要的时间。In the present application, since the first mapping relationship information includes only four transformation checkups, the number of traversals can be reduced in the process of selecting a target transformation checkup, thereby reducing the time required for encoding.
进一步的,由于第一标志位为第二取值时对应的每个变换核对中都包含变换核DST-VII,而DST-VII的在帧内预测变换时的使用率较高,因此,根据第一映射关系信息能够选择使用率较高的变换核对进行变换,可以提高变换效果。Further, since the transformation kernel DST-VII is included in each transformation check corresponding to the first flag bit being the second value, and DST-VII has a higher usage rate in intra prediction transformation, therefore, according to the A mapping relationship information can select a transformation check with a higher usage rate for transformation, which can improve the transformation effect.
具体地,由于帧内预测模式时利用当前块的上边和右边的参考像素对当前块进行预测,并且预测误差有从上到下从左到右依次逐渐增大的趋势,而DST-VII的基函数是逐渐增大的,因此,DST-VII变换核适合这种逐渐增大的特性,采用DST-VII进行变换和反变换能够取得较好的效果。Specifically, because the intra prediction mode uses the top and right reference pixels of the current block to predict the current block, and the prediction error tends to gradually increase from top to bottom from left to right, the base of DST-VII The function is gradually increasing. Therefore, the DST-VII transformation kernel is suitable for this gradually increasing characteristic. Using DST-VII for transformation and inverse transformation can achieve better results.
可选地,上述第一标志位为显式多核变换(EMT:Explicit multiple core transform)标志位。Optionally, the first flag bit is an explicit multiple core (EMT) flag.
可选地,上述第一取值为0,第二取值为1。Optionally, the first value is 0, and the second value is 1.
具体地,第一映射关系信息包括EMT标志位,当EMT标志位的取值为0时表示在对残差块进行变换时要采用单核变换;当EMT标志位的取值为1时表示在对残差块进行变换时要采用多核变换。Specifically, the first mapping relationship information includes an EMT flag bit. When the value of the EMT flag bit is 0, it means that single-core transformation is used when transforming the residual block; when the value of the EMT flag bit is 1, it means that Multi-core transform is used to transform the residual block.
可选地,第一变换核对为相同变换核组成的变换核对。Optionally, the first transformation check is a transformation check composed of the same transformation kernel.
在第四方面的某些实现方式中,第一变换索引值对应的码字的长度为1,第二变换索引值和第三变换索引值对应的码字的长度均为2。In some implementations of the fourth aspect, the length of the codeword corresponding to the first transformation index value is 1, and the length of the codeword corresponding to the second transformation index value and the third transformation index value are both 2.
可选地,上述第一变换索引值至第三变换索引值分别为0,1,2。Optionally, the first to third transformation index values are 0, 1, and 2, respectively.
可选地,上述第一变换索引值对应的码字为0,上述第二变换索引值对应的码字为10,上述第三变换索引值对应的码字为11。Optionally, the codeword corresponding to the first transformation index value is 0, the codeword corresponding to the second transformation index value is 10, and the codeword corresponding to the third transformation index value is 11.
可选地,上述第二变换索引值和第三变换索引值对应的码字分别为10和01。Optionally, the codewords corresponding to the second transformation index value and the third transformation index value are 10 and 01, respectively.
在第四方面的某些实现方式中,第一变换核对为(DCT-II,DTC-II),第二变换核对为(DST-VII,DST-VII),第三变换核对为(DCT-VIII,DST-VII),第四变换核对为(DST-VII,DCT-VIII)。In some implementations of the fourth aspect, the first transformation check is (DCT-II, DTC-II), the second transformation check is (DST-VII, DST-VII), and the third transformation check is (DCT-VIII , DST-VII), and the fourth transformation check is (DST-VII, DCT-VIII).
在第四方面的某些实现方式中,在根据预设的第一映射关系信息获取残差块的候选变换核对之前,方法还包括:确定残差块对应的帧内预测模式为方向预测模式。In some implementations of the fourth aspect, before obtaining candidate transformation check of the residual block according to the preset first mapping relationship information, the method further includes: determining an intra prediction mode corresponding to the residual block as a directional prediction mode.
在第四方面的某些实现方式中,在根据预设的第一映射关系信息获取残差块的候选变换核对之前,方法还包括:确定残差块的宽和高均小于或者等于M。In some implementations of the fourth aspect, before obtaining candidate transformation check of the residual block according to the preset first mapping relationship information, the method further includes: determining that the width and height of the residual block are both less than or equal to M.
在第四方面的某些实现方式中,当残差块的宽和高至少有一个大于M时,确定(DCT-II,DTC-II)为目标变换核对。In some implementations of the fourth aspect, when at least one of the width and height of the residual block is greater than M, (DCT-II, DTC-II) is determined as the target transformation check.
可选地,上述M的数值为64。Optionally, the value of M is 64.
本申请中,当残差块的尺寸较大时直接采用(DCT-II,DTC-II)作为目标变换核对进行变换,当残差块的尺寸较小时再根据第一映射关系信息最终确定目标变换核,能够实现对不同大小的残差块进行更好的变换。In this application, when the size of the residual block is large, (DCT-II, DTC-II) is directly used as the target transformation check to perform the transformation, and when the size of the residual block is small, the target transformation is finally determined according to the first mapping relationship information. The kernel can achieve better transformation of residual blocks of different sizes.
在第四方面的某些实现方式中,上述方法还包括:在残差块对应的帧内预测模式为DC模式的情况下,确定变换核对(DCT-II,DTC-II)为目标变换核对。In some implementation manners of the fourth aspect, the above method further includes: when the intra prediction mode corresponding to the residual block is a DC mode, determining a transform check (DCT-II, DTC-II) as a target transform check.
在第四方面的某些实现方式中,上述方法还包括:在残差块对应的帧内预测模式为平面模式的情况下,确定变换核对(DST-VII,DST-VII)为目标变换核对。In some implementation manners of the fourth aspect, the above method further includes: determining a transformation check (DST-VII, DST-VII) as a target transformation check when the intra prediction mode corresponding to the residual block is a plane mode.
本申请中,当采用DC模式和平面模式对残差块进行量化时,可以直接采用预设的变换核对进行量化,能够节省遍历过程,进而减少编码所需要的时间。In this application, when the DC mode and the plane mode are used to quantize the residual block, a preset transformation check can be directly used for quantization, which can save the traversal process and further reduce the time required for encoding.
可选地,在残差块对应的帧内预测模式为平面模式且残差块的宽和高均小于或者等于N的情况下,确定变换核对(DST-VII,DST-VII)为目标变换核对。Optionally, when the intra prediction mode corresponding to the residual block is a planar mode and the width and height of the residual block are both less than or equal to N, a transformation check (DST-VII, DST-VII) is determined as the target transformation check .
上述N的数值可以为4,8和16等。The value of N can be 4, 8, and 16 and so on.
第五方面,提供一种反变换装置,该装置包括用于执行上述第一方面或者第二方面中的任意一种实现方式中的方法的模块。According to a fifth aspect, an inverse transform apparatus is provided, and the apparatus includes a module for performing a method in any one of the foregoing implementation manners of the first aspect or the second aspect.
第六方面,提供一种变换装置,该装置包括用于执行上述第三方面或者第四方面中的任意一种实现方式中的方法的模块。According to a sixth aspect, a transformation apparatus is provided, and the apparatus includes a module for executing a method in any one of the foregoing third or fourth aspects.
第七方面,提供一种解码器,包括:相互耦合的非易失性存储器和处理器,所述处理器调用存储在所述存储器中的程序代码以执行第一方面或者第二方面中的任意一种实现方式中的方法的部分或全部步骤。According to a seventh aspect, a decoder is provided, including: a non-volatile memory and a processor coupled to each other, the processor calling program code stored in the memory to execute any of the first aspect or the second aspect Some or all steps of a method in one implementation.
第八方面,提供一种编码器,包括:相互耦合的非易失性存储器和处理器,所述处理器调用存储在所述存储器中的程序代码以执行第三方面或者第四方面中的任意一种实现方式中的方法的部分或全部步骤。According to an eighth aspect, an encoder is provided, including: a non-volatile memory and a processor coupled to each other, the processor invoking program code stored in the memory to execute any of the third aspect or the fourth aspect Some or all steps of a method in one implementation.
第九方面,提供一种计算机可读存储介质,所述计算机可读存储介质存储了程序代码,其中,所述程序代码包括用于执行第一方面、第二方面、第三方面以及第四方面中的任意一种实现方式中的方法的部分或全部步骤的指令。According to a ninth aspect, a computer-readable storage medium is provided. The computer-readable storage medium stores program code, where the program code includes a program for executing the first aspect, the second aspect, the third aspect, and the fourth aspect. An instruction in some or all of the steps of a method in any of the implementations.
第十方面,提供一种计算机程序产品,当所述计算机程序产品在计算机上运行时,使得所述计算机执行第一方面、第二方面、第三方面以及第四方面中的任意一种实现方式中的方法的部分或全部步骤的指令。According to a tenth aspect, a computer program product is provided, and when the computer program product runs on a computer, the computer is caused to execute any one of the first aspect, the second aspect, the third aspect, and the fourth aspect. Instructions in some or all steps of the method.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
图1是帧内编码过程的示意性流程图;FIG. 1 is a schematic flowchart of an intra coding process;
图2是帧内解码过程的示意性流程图;FIG. 2 is a schematic flowchart of an intra decoding process;
图3是各种帧内预测模式的示意图;3 is a schematic diagram of various intra prediction modes;
图4是本申请实施例的反变换方法的示意性流程图;4 is a schematic flowchart of an inverse transform method according to an embodiment of the present application;
图5是本申请实施例的反变换方法的示意性流程图;5 is a schematic flowchart of an inverse transform method according to an embodiment of the present application;
图6是本申请实施例的反变换方法的示意性流程图;6 is a schematic flowchart of an inverse transform method according to an embodiment of the present application;
图7是本申请实施例的变换方法的示意性流程图;7 is a schematic flowchart of a conversion method according to an embodiment of the present application;
图8是本申请实施例的变换方法的示意性流程图;8 is a schematic flowchart of a conversion method according to an embodiment of the present application;
图9是本申请实施例的变换方法的示意性流程图;FIG. 9 is a schematic flowchart of a conversion method according to an embodiment of the present application; FIG.
图10是本申请实施例的反变换装置的示意性框图;10 is a schematic block diagram of an inverse transform device according to an embodiment of the present application;
图11是本申请实施例的视频解码器的示意性框图;11 is a schematic block diagram of a video decoder according to an embodiment of the present application;
图12是本申请实施例的视频编码器的示意性框图。FIG. 12 is a schematic block diagram of a video encoder according to an embodiment of the present application.
具体实施方式detailed description
下面将结合附图,对本申请中的技术方案进行描述。The technical solutions in this application will be described below with reference to the drawings.
为了更好地理解本申请实施例,下面先结合图1和图2对帧内视频编码和帧内视频解码的主要过程进行简单的介绍。应理解,这里的帧内视频编码是指在对视频图像进行编码过程中采用的预测模式为帧内预测模式,帧内视频解码是指在对视频图像进行解码的过程中采用的预测模式为帧内预测模式。In order to better understand the embodiments of the present application, the main processes of intra-frame video coding and intra-frame video decoding are briefly introduced below with reference to FIG. 1 and FIG. 2. It should be understood that the intra video encoding here means that the prediction mode used in the process of encoding the video image is the intra prediction mode, and the intra video decoding means that the prediction mode used in the process of decoding the video image is the frame Intra prediction mode.
如图1所示,通过对待处理图像快进行帧内预测可以得到待处理图像块的预测块,通过将待处理图像块与预测块(也可以称为预测信号)做差,可以得到残差块(也可以成为 残差信号),以去除图像之间的冗余。接下来,对残差块进行变换/量化得到量化系数,并对量化系数进行熵编码从而得到码流。同时在编码过程中还需要对量化系数进行反量化/反变换,以重新得到残差块,接下来,再对残差块和预测块相加从而得到重建块(在得到重建块之前可以进行环路滤波)。As shown in FIG. 1, by performing intra prediction on the image to be processed quickly, a prediction block of the image block to be processed can be obtained, and by making a difference between the image block to be processed and the prediction block (also called a prediction signal), a residual block can be obtained. (Can also be a residual signal) to remove redundancy between images. Next, transform / quantize the residual block to obtain a quantized coefficient, and perform entropy coding on the quantized coefficient to obtain a code stream. At the same time, in the encoding process, the quantization coefficients need to be inverse quantized / inverse transformed to obtain the residual block. Next, the residual block and the prediction block are added to obtain a reconstructed block (a loop can be performed before the reconstructed block is obtained Road filtering).
在上述过程中,可以利用已编码的重建块(重建信息)作为参考信息从不同的方向进行帧内预测,然后对残差信号进行变换使得残差信号的能量进一步的集中,接下来再进行量化,对高频信号采用更大的量化步长,而对于低频信号使用更小的量化步长,保证图像基本信息没有损失。In the above process, intra-frame prediction can be performed from different directions using the encoded reconstruction block (reconstruction information) as reference information, and then the residual signal is transformed so that the energy of the residual signal is further concentrated, and then quantized Use a larger quantization step size for high-frequency signals and a smaller quantization step size for low-frequency signals to ensure that there is no loss of basic image information.
如图2所示,在解码端,通过对码流(二进制码流信息)进行熵解码得到量化系数以及编码模式等编码信息,对量化系数进行反量化/反变换后得到残差块,并将残差块与帧内预测得到的预测块相加后再进行环路滤波就可以得到最终的重建快,同时生成的重建块还会用于接下来其他图像块的帧内预测过程。As shown in Figure 2, at the decoding end, encoding information such as quantization coefficients and coding modes is obtained by entropy decoding the code stream (binary code stream information), and the residual blocks are obtained after inverse quantization / inverse transformation of the quantized coefficients. The residual block is added to the intra prediction block and then loop filtered to obtain the final reconstruction speed. At the same time, the generated reconstruction block will also be used in the subsequent intra prediction process of other image blocks.
在联合视频专家组(joint video experts team,JVET)正在制定的最新视频编码标准中,给出了利用67种帧内角度模式进行帧内预测时的方向示意图,如图3所示。更加密集的角度可以带来更好的预测效果,帧内预测的角度模式数量从HEVC的33种增加到65种,当模式号为0时,表示平面模式(planar);当模式号为1时,表示DC模式;平面模式和DC模式不涉及预测方向,称为非方向预测模式;当模式号为2-66时,表示角度预测模式(也可以称为方向预测模式),不同的模式号代表了不同的预测角度,如图3所示,模式号2-66的预测模式对应的预测角度用实线或者虚线表示。In the latest video coding standard being developed by the Joint Video Experts Group (JVET), a direction diagram is shown for intra prediction using 67 intra-angle modes, as shown in FIG. 3. More dense angles can bring better prediction results. The number of angle modes for intra prediction has increased from 33 to 65 in HEVC. When the mode number is 0, it indicates a planar mode; when the mode number is 1, , Indicates the DC mode; the plane mode and the DC mode do not involve the prediction direction, and are called non-directional prediction modes; when the mode number is 2-66, it represents the angle prediction mode (also known as the directional prediction mode), and different mode numbers represent Different prediction angles are shown. As shown in FIG. 3, the prediction angle corresponding to the prediction mode of the mode number 2-66 is indicated by a solid line or a dotted line.
更加密集的角度方向能够更加有效地捕捉到自然视频中任意方向的纹理边界,可以利用更多的参考信息进行率失真代价选择,从而可以找到更加适合的帧内预测模式来更加准确地预测当前编码块,使得预测块更加接近原始编码块,编码当前块所需要传输的比特更少,从而编码性能更高。在进行帧内编码时,这67种帧内模式运用在所有尺寸的编码块上,包括亮度分量和色度分量。The denser angular directions can more effectively capture the texture boundaries in any direction in natural video, and can use more reference information for rate distortion cost selection, so that more suitable intra prediction modes can be found to more accurately predict the current encoding. Block, which makes the predicted block closer to the original coded block, and fewer bits need to be transmitted to encode the current block, resulting in higher coding performance. When performing intra-frame coding, these 67 intra-modes are used on coding blocks of all sizes, including luminance components and chrominance components.
下面结合图4至图8对本申请实施例进行详细的介绍。The embodiments of the present application will be described in detail below with reference to FIGS. 4 to 8.
图4是本申请实施例的反变换方法的示意性流程图。图4所示的方法可以由解码端设备执行,图4所示的方法包括步骤110至步骤130,下面分别对步骤110至步骤130进行详细的介绍。FIG. 4 is a schematic flowchart of an inverse transform method according to an embodiment of the present application. The method shown in FIG. 4 may be executed by a decoding device. The method shown in FIG. 4 includes steps 110 to 130. The steps 110 to 130 are described in detail below.
110、解析码流以获取当前块的残差系数、帧内预测模式和目标变换核对确定参数。110. Parse the bitstream to obtain the residual coefficient, the intra prediction mode, and the target transformation of the current block to determine the parameters.
在获取到码流之后通过对码流进行熵解码等操作可以获取当前块的残差系数、帧内预测模式以及目标变换核对确定参数。After the code stream is obtained, operations such as entropy decoding on the code stream can be used to obtain the residual coefficient of the current block, the intra prediction mode, and the target transformation check and determination parameters.
上述目标变换核对确定参数是用于确定当前块的残差系数的目标变换核对的信息,目标变换核对确定参数既可以通过单个信息来只直接指示目标变换核对,或者,目标变换核对确定参数也可以通过多个参数来共同指示目标变换核对。The above-mentioned target transformation check determination parameter is information used to determine the target transformation check of the residual coefficient of the current block. The target transformation check determination parameter can directly indicate only the target transformation check through a single message, or the target transformation check determination parameter can also The multiple parameters are used to collectively indicate the target transformation check.
上述解析码流以获取当前块的残差系数具体可以是指先从码流中解析得到量化系数,然后再对量化系数进行反量化从而得到残差系数,该残差系数可以用于反变换。The above parsing the bitstream to obtain the residual coefficient of the current block may specifically refer to firstly parsing the quantized coefficient from the bitstream, and then dequantizing the quantized coefficient to obtain the residual coefficient, which can be used for inverse transformation.
120、从第一变换核对、第二变换核对、以及第三变换核中确定出与目标变换核对确定参数对应的目标变换核对。120. Determine a target transformation check corresponding to the target transformation check determination parameter from the first transformation check, the second transformation check, and the third transformation check.
其中,上述第二变换核对为第一候选变换核对或第二变候选变换核对,第一候选变换 核对和第二变候选变换核对均包含变换核DST-VII,第一候选变换核对和第二变候选变换核对与当前块对应的帧内预测模式对应。The second transformation check is the first candidate transformation check or the second change candidate transformation check. The first candidate transformation check and the second change candidate transformation check both include a transformation kernel DST-VII. The first candidate transformation check and the second transformation check. The candidate transformation check corresponds to the intra prediction mode corresponding to the current block.
可选地,第一候选变换核对为(DST-VII,DCT-VIII),第二候选变换核对为(DCT-VIII,DST-VII);当所述残差块对应的帧内预测模式的模式号小于或者等于预设阈值时,所述第二变换核对为第一候选变换核对;当所述残差块对应的帧内预测模式的模式号大于所述预设阈值时,所述第一变换核对为第二候选变换核对。Optionally, the first candidate transformation check is (DST-VII, DCT-VIII), and the second candidate transformation check is (DCT-VIII, DST-VII); when the mode of the intra prediction mode corresponding to the residual block is When the number is less than or equal to a preset threshold, the second transformation check is a first candidate transformation check; when the mode number of the intra prediction mode corresponding to the residual block is greater than the preset threshold, the first transformation The collation is a second candidate transformation collation.
可选地,上述预设阈值为N,当编码时采用的是H.265标准时,N=18,当编码时采用的是H.266标准时,N=34。Optionally, the preset threshold is N. When the H.265 standard is used for encoding, N = 18, and when the H.266 standard is used for encoding, N = 34.
当上述目标变换核对确定参数通过单个信息来直接指示目标变换核对时,可以通过目标变换核对确定参数的参数值与变换核对的映射关系或者对应关系来确定目标变换核对。When the above target transformation check determination parameter directly instructs the target transformation check through a single piece of information, the target transformation check may be determined through a mapping relationship or a corresponding relationship between the parameter value of the target transformation check determination parameter and the transformation check.
可选地,从第一变换核对、第二变换核对以及第三变换核对中确定出与确定与目标变换核对确定参数对应的目标变换核对,包括:根据目标变换核对确定参数的参数值以及目标变换核对确定参数的参数值与变换核对之间的映射关系,确定目标变换核对。Optionally, determining a target transformation check corresponding to the target transformation check determination parameter from the first transformation check, the second transformation check, and the third transformation check includes: determining the parameter value of the parameter and the target transformation according to the target transformation check. The mapping relationship between the parameter value of the determined parameter and the transformation check is checked, and the target transformation check is determined.
具体地,目标变换核对确定参数分别为第一参数值至第三参数值时,分别对应第一变换核对至第三变换核对。那么,当解码端解析到目标变换核对确定参数为第一参数值时,可以直接确定目标变换核对为第一变换核对。Specifically, when the target transformation check determination parameters are respectively the first parameter value to the third parameter value, they correspond to the first transformation check to the third transformation check, respectively. Then, when the decoding end resolves that the target transformation check determination parameter is the first parameter value, it can directly determine that the target transformation check is the first transformation check.
上述目标变换核对确定参数的参数值与变换核对的对应关系可以如表1所示,如表1所示,在解码端获取到了目标变换核对确定参数的参数值后,可以直接根据表1的映射关系确定目标变换核对。如表1所示的映射关系可以存储在编码端和解码端,编码端确定了目标变换核对之后,可以将该目标变换核对对应的目标变换核对确定参数的参数值写入到码流中,这样解码端通过解析到的目标变换核对确定参数的参数值以及表1所示的映射关系就可以确定目标变换核对了。The corresponding relationship between the parameter values of the target transformation check determination parameters and the transformation check can be shown in Table 1. As shown in Table 1, after the decoder obtains the parameter values of the target transformation check determination parameters, it can directly map according to Table 1. Relationship determination target transformation check. The mapping relationship shown in Table 1 can be stored at the encoding end and the decoding end. After the encoding end determines the target transformation check, the parameter value of the target transformation check corresponding to the target transformation check can be written into the code stream. The decoding end can determine the target transformation check through the parsed target transformation check to determine the parameter values of the determined parameters and the mapping relationship shown in Table 1.
表1Table 1
目标变换核对确定参数的参数值The target transformation checks the parameter values of the determined parameters 目标变换核对Target transformation check
第一参数值First parameter value 第一变换核对First transformation check
第二参数值Second parameter value 第二变换核对Second transformation check
第三参数值Third parameter value 第三变换核对Third transformation check
进一步地,目标变换核对确定参数的参数值与变换核对的对应关系可以如表2所示,如表2所示,目标变换核对确定参数的参数值为0,10和11时分别对应的目标变换核对为(DCT-II,DCT-II)、(DST-VII,DCT-VIII)和(DST-VII,DST-VII)。Further, the correspondence between the parameter values of the target transformation check determination parameter and the transformation check can be shown in Table 2. As shown in Table 2, when the parameter values of the target transformation check determination parameter value are 0, 10 and 11, respectively, the corresponding target transformations are The checks are (DCT-II, DCT-II), (DST-VII, DCT-VIII), and (DST-VII, DST-VII).
表2Table 2
目标变换核对确定参数的参数值The target transformation checks the parameter values of the determined parameters 目标变换核对Target transformation check
00 DCT-II,DCT-IIDCT-II, DCT-II
1010 DST-VII,DCT-VIIIDST-VII, DCT-VIII
1111 DST-VII,DST-VIIDST-VII, DST-VII
应理解,上述表1和表2只是目标变换核对确定参数的参数值与变换核对的对应关系的一种表现形式的举例,本申请对目标变换核对确定参数的参数值与变换核对的对应关系的具体形式不做限定,只要是目标变换核对确定参数的参数值与变换核对有一定的对应关系即可。It should be understood that the above Tables 1 and 2 are merely examples of a manifestation of the correspondence between the parameter values of the target transformation check determination parameters and the transformation check. The specific form is not limited, as long as there is a certain correspondence between the parameter values of the parameters determined by the target transformation check and the transformation check.
可选地,目标变换核对确定参数包括第一标志位,或目标变换核对确定参数包括第一标志位和变换索引值。Optionally, the target transformation check determination parameter includes a first flag bit, or the target transformation check determination parameter includes a first flag bit and a transformation index value.
可选地,从第一变换核对、第二变换核对以及第三变换核对中确定出与确定与目标变换核对确定参数对应的目标变换核对,具体包括以下过程:Optionally, determining, from the first transformation check, the second transformation check, and the third transformation check, the target transformation check corresponding to the determination parameter corresponding to the target transformation check, specifically includes the following process:
(1)当第一标志位为第一取值时,确定与目标变换核对确定参数对应的目标变换核对为第一变换核对;(1) When the first flag bit is the first value, determine that the target transformation check corresponding to the target transformation check determination parameter is the first transformation check;
(2)当第一标志位为第二取值且变换索引值为第一变换索引值时,确定与目标变换核对确定参数对应的目标变换核对为第二变换核对;(2) when the first flag bit has a second value and the transformation index value is the first transformation index value, determining a target transformation check corresponding to the target transformation check determination parameter as a second transformation check;
(3)当第一标志位为第二取值且变换索引值为第二变换索引值时,确定与目标变换核对确定参数对应的目标变换核对为第三变换核对。(3) When the first flag bit has a second value and the transformation index value is a second transformation index value, it is determined that the target transformation check corresponding to the target transformation check determination parameter is a third transformation check.
可选地,上述第一标志位为显式多核变换(explicit multiple core transform,EMT)标志位。Optionally, the first flag bit is an explicit multiple core transform (EMT) flag bit.
可选地,上述第一取值为0,第二取值为1。Optionally, the first value is 0, and the second value is 1.
具体地,当EMT标志位的取值为0时表示在对残差系数进行反变换时要采用单核反变换(相应的,编码端进行变换时采用的也是单核变换);当EMT标志位的取值为1时表示在对残差系数进行反变换时要采用多核反变换(相应的,编码端进行变换时采用的也是多核变换)。Specifically, when the value of the EMT flag is 0, it means that a single-core inverse transformation is used when the inverse transformation is performed on the residual coefficient (correspondingly, the single-core transformation is also used when the encoding end is transformed); A value of 1 indicates that a multi-core inverse transform is used when inverse transforming the residual coefficient (correspondingly, the multi-core transform is also used when the encoding end performs the transform).
可选地,第一变换核对为相同变换核组成的变换核对。Optionally, the first transformation check is a transformation check composed of the same transformation kernel.
可选地,上述第一变换核对、第一候选变换核对、第二候选变换核对以及第三变换核对中包含的变换核的种类可以JEM中定义的五组变换核中的一部分变换核,该五组变换核具体为DCT-II、DCT-V、DCT-VIII、DST-1和DST-VII。该五组变换核的基本信息如表3所示。Optionally, the types of the transformation kernels included in the first transformation check, the first candidate transformation check, the second candidate transformation check, and the third transformation check may be a part of the five transformation kernels defined in the JEM. The group of transform kernels are specifically DCT-II, DCT-V, DCT-VIII, DST-1 and DST-VII. The basic information of the five sets of transformation kernels is shown in Table 3.
表3table 3
Figure PCTCN2018093923-appb-000001
Figure PCTCN2018093923-appb-000001
Figure PCTCN2018093923-appb-000002
Figure PCTCN2018093923-appb-000002
可选地,上述第一变换核对、第一候选变换核对、第二候选变换核对以及第三变换核对中包含的变换核的种类的总数小于5。Optionally, the total number of types of the transformation kernels included in the first transformation check, the first candidate transformation check, the second candidate transformation check, and the third transformation check is less than 5.
本申请中,变换核的种类小于5时,能够减少由于存储变换核所占用的存储空间。In the present application, when the type of the transformation kernel is less than 5, the storage space occupied by storing the transformation kernel can be reduced.
可选地,上述第一变换核对、第一候选变换核对、第二候选变换核对以及第三变换核对中包含的变换核包括DCT-II,DCT-VIII和DST-VII。Optionally, the transformation kernels included in the first transformation check, the first candidate transformation check, the second candidate transformation check, and the third transformation check include DCT-II, DCT-VIII, and DST-VII.
上述第一标志位、变换索引值和目标变换核对之间可以有一定的对应关系(映射关系),该对应关系的具体形式可以是表格。There may be a certain correspondence relationship (mapping relationship) between the first flag bit, the transformation index value, and the target transformation check, and the specific form of the correspondence relationship may be a table.
例如,第一标志位、变换索引值和目标变换核对之间的对应关系可以如表4所示。For example, the correspondence between the first flag bit, the transformation index value, and the target transformation check may be shown in Table 4.
表4Table 4
Figure PCTCN2018093923-appb-000003
Figure PCTCN2018093923-appb-000003
由表4可知,当第一标志位为第一取值时,目标变换核对仅与第一标志位之间存在对应关系,并且,目标变换核对为第一变换核对。当第一标志位为第二取值时,目标变换核对与第一标志位以及变换索引值之间均存在对应关系,当第一标志位为第二取值时且变换索引值分别为第一变换索引值和第二变换索引值时分别对应的目标变换核对为第二变换核对和第三变换核对。It can be known from Table 4 that when the first flag bit is the first value, there is only a corresponding relationship between the target transformation check and the first flag bit, and the target transformation check is the first transformation check. When the first flag bit is the second value, there is a corresponding relationship between the target transformation check and the first flag bit and the transformation index value. When the first flag bit is the second value and the transformation index value is the first The target transformation check corresponding to each of the transformation index value and the second transformation index value are a second transformation check and a third transformation check.
可选地,第一变换索引值为0,第二变换索引值为1。Optionally, the first transformation index value is 0, and the second transformation index value is 1.
当第一变换索引值和第二变换索引值分别为0和1,第一取值和第二取值分别为0和1时,第一标志位、变换索引值和目标变换核对之间的对应关系具体可以如表5所示。Correspondence between the first flag bit, the transformation index value, and the target transformation check when the first transformation index value and the second transformation index value are 0 and 1, respectively, and the first and second values are 0 and 1, respectively. The relationship can be shown in Table 5.
表5table 5
Figure PCTCN2018093923-appb-000004
Figure PCTCN2018093923-appb-000004
应理解,上述第一变换索引值和第二变换索引值也可以分别为1和0,第一取值和第二取值也可以分别为1和0。It should be understood that the foregoing first transformation index value and the second transformation index value may also be 1 and 0, respectively, and the first and second values may also be 1 and 0, respectively.
可选地,所述第一变换索引值和所述第二变换索引值对应的码字的长度均为1。Optionally, the length of the codeword corresponding to the first transformation index value and the second transformation index value is both 1.
可选地,第一变换索引值对应的码字为0,第二变换索引值对应的码字为1。Optionally, the codeword corresponding to the first transformation index value is 0, and the codeword corresponding to the second transformation index value is 1.
将第一变换索引值和第二变换索引值对应的码字加入到表5中,可以得到表6。Table 6 is obtained by adding the codewords corresponding to the first transformation index value and the second transformation index value to Table 5.
表6Table 6
第一标志位First flag 目标变换核对Target transformation check 变换索引值Transform index 码字numbers
00 第一变换核对First transformation check N/AN / A N/AN / A
11 第二变换核对Second transformation check 00 00
 Zh 第三变换核对Third transformation check 11 11
由表6可知,变换索引值对应的码字的长度均为1,能够减少由于指示变换索引值所需要的占用的比特数。As can be seen from Table 6, the lengths of the codewords corresponding to the transformation index value are all 1, which can reduce the number of occupied bits required to indicate the transformation index value.
应理解,上述第一变换索引值和第二变换索引值对应的码字也可以分别为1和0。It should be understood that the codewords corresponding to the first transformation index value and the second transformation index value may also be 1 and 0, respectively.
可选地,第三变换核对为(DST-VII,DST-VII),第一变换核对为(DCT-II,DTC-II)。Optionally, the third transformation check is (DST-VII, DST-VII), and the first transformation check is (DCT-II, DTC-II).
将第一变换核对和第三变换核对所表示的具体变换核对填入到表6中,并对第二变换核对和第三变换核对的顺序做一下调整可以得到表7。Fill in the specific transformation check indicated by the first transformation check and the third transformation check into Table 6, and adjust the order of the second transformation check and the third transformation check to obtain Table 7.
表7Table 7
Figure PCTCN2018093923-appb-000005
Figure PCTCN2018093923-appb-000005
如表7所示,第二变换核对可以依据当前块对应的帧内预测模式来确定。具体地,当帧内预测模式的模式号小于或者等于34时,表7中的第二变换核对为(DST-VII,DCT-VIII);当帧内预测模式的模式号大于34时,表7中的第二变换核对为(DST-VII,DCT-VIII)。As shown in Table 7, the second transformation check may be determined according to the intra prediction mode corresponding to the current block. Specifically, when the mode number of the intra prediction mode is less than or equal to 34, the second transformation check in Table 7 is (DST-VII, DCT-VIII); when the mode number of the intra prediction mode is greater than 34, Table 7 The second transformation check in (DST-VII, DCT-VIII).
另外,还可以通过查表来确定相应的每种帧内预测模式对应的第二变换核对。例如,在获知了当前块对应的帧内预测模式后,可以根据如下的表8中帧内预测模式的预测模式号与变换核对的索引号的对应关系确定出上述第二变换核对。In addition, the second transformation check corresponding to each intra prediction mode can also be determined by looking up the table. For example, after the intra prediction mode corresponding to the current block is known, the foregoing second transformation check may be determined according to the correspondence between the prediction mode number of the intra prediction mode and the index number of the transformation check in Table 8 below.
表8Table 8
预测模式号Prediction mode number 00 11 22 33 44 55 66 77 88 99 1010 1111 1212
变换核对 Transformation check 22 22 00 11 00 11 00 11 00 11 00 11 00
预测模式号 Prediction mode number 1313 1414 1515 1616 1717 1818 1919 2020 21twenty one 22twenty two 23twenty three 24twenty four 2525
变换核对Transformation check 11 00 11 00 11 00 11 00 11 00 11 00 11
预测模式号 Prediction mode number 2626 2727 2828 2929 3030 3131 3232 3333 3434  Zh  Zh  Zh  Zh
变换核对Transformation check 00 11 00 11 00 11 00 11 00  Zh  Zh  Zh  Zh
表8中共包含35中帧内预测模式,帧内预测模式的模式号为0-34,表7中包含3种变换核对,这3种变换核对分别用数字0-2表示,0-2代表的变换核对具体如下:Table 8 contains a total of 35 intra prediction modes. The mode number of the intra prediction mode is 0-34. Table 7 contains three kinds of transformation checks. These three kinds of transformation checks are represented by the numbers 0-2, which are represented by 0-2. The transformation check is as follows:
0:变换核对0,即(DST-VII,DCT-VIII);0: transform check 0, (DST-VII, DCT-VIII);
1:变换核对1,即(DCT-VIII,DST-VII);1: transformation check 1, ie (DCT-VIII, DST-VII);
2:变换核对2,即(DCT-VIII,DCT-VIII)。2: Transform check 2, ie (DCT-VIII, DCT-VIII).
在上述变换核对0至变换核对2中,前面的变换核表示水平变换核,后面的变换核表示垂直变换核。当然,也可以是前面的表示垂直变换核,后面的表示水平变换核。In the above-mentioned transformation kernel 0 to transformation kernel 2, the former transformation kernel represents a horizontal transformation kernel, and the latter transformation kernel represents a vertical transformation kernel. Of course, the former may represent a vertical transformation kernel, and the latter may represent a horizontal transformation kernel.
假设,第一变换核对和第三变换核对如表7所示,表7中的第二变换核对可以根据表8中的关系来确定,那么,第一变换核对至第三变换核对虽然使用了4种变换核对(包括DCT-II,DCT-II),但对于每一种预测模式来讲最多只有3个变换核对可供选择,在编码端进行编码时只需要进行3次RDO,从而降低编码时间开销。这里由于更多的使用了4种变换核对,同时变换核对和预测模式之间的映射关系更加灵活(从表7中可看出,对于 角度预测模式,采用0、1交替出现的方式),可以实现在相同的编码时间开销下获得更好的性能。Assume that the first transformation check and the third transformation check are shown in Table 7. The second transformation check in Table 7 can be determined according to the relationship in Table 8. Then, although the first transformation check to the third transformation check use 4 Kinds of transformation check (including DCT-II, DCT-II), but for each prediction mode, there are only 3 transformation check options available, and only 3 RDOs are required when encoding at the encoding end, thereby reducing encoding time Overhead. Here, because more 4 kinds of transformation check are used, and the mapping relationship between the transformation check and the prediction mode is more flexible (as can be seen from Table 7, for the angle prediction mode, 0 and 1 alternately appear), you can Achieve better performance with the same encoding time overhead.
此外,表8中具体变换核的选择,还可以利用镜像DST-VII来替换本方案中的DCT-VIII。这样从整个变换方案来讲,用到的变换核的种类从3种减少到了2种,即DCT-II和DST-VII。当变换核的种类减少时,能够减少编码端和解码端存储变换核所占用的内存。In addition, for the specific transformation kernel selection in Table 8, the mirror DST-VII can also be used to replace DCT-VIII in this scheme. In terms of the entire transformation scheme, the types of transformation kernels used have been reduced from three to two, namely DCT-II and DST-VII. When the types of transform kernels are reduced, the memory occupied by the encoding kernel and the decoder to store the transform kernels can be reduced.
130、根据所述目标变换核对,对所述残差系数进行反变换,得到残差块。130: Perform inverse transformation on the residual coefficient according to the target transformation check to obtain a residual block.
可选地,作为一个实施例,在步骤120之前,图4所示的方法还包括:确定所述残差块对应的帧内预测模式为方向预测模式。Optionally, as an embodiment, before step 120, the method shown in FIG. 4 further includes: determining an intra prediction mode corresponding to the residual block as a directional prediction mode.
也就是说,在图4所示的方法中,当残差块对应的帧内预测模式为方向预测模式的情况下才根据步骤120获取残差块的候选变换核对。That is, in the method shown in FIG. 4, when the intra prediction mode corresponding to the residual block is a directional prediction mode, the candidate transformation check of the residual block is obtained according to step 120.
可选地,作为一个实施例,在步骤120之前,图4所示的方法还包括:确定所述残差块的宽和高均小于或者等于M。Optionally, as an embodiment, before step 120, the method shown in FIG. 4 further includes: determining that the width and height of the residual block are both less than or equal to M.
M的取值可以根据变换时的情况来设置,例如,M可以为64。The value of M can be set according to the situation during the transformation, for example, M can be 64.
通过在残差块小于一定尺寸时才根据第一映射关系信息来确定残差块的候选变换核对,能够提高变换效果。By determining the candidate transformation check of the residual block according to the first mapping relationship information when the residual block is smaller than a certain size, the transformation effect can be improved.
可选地,当残差块的宽和高至少有一个大于M时,确定(DCT-II,DTC-II)为目标变换核对。Optionally, when at least one of the width and height of the residual block is greater than M, (DCT-II, DTC-II) is determined as the target transformation check.
本申请中,在当前块的尺寸较大的情况下直接采用(DCT-II,DTC-II)作为目标变换核对进行反变换,在当前块的尺寸较小时再根据目标变换核对确定参数最终确定目标变换核,能够灵活处理不同大小的图像块。In this application, when the size of the current block is large, (DCT-II, DTC-II) is directly used as the target transformation check to perform inverse transformation. When the size of the current block is small, the parameters are finally determined according to the target transformation check to determine the target. The transformation kernel can flexibly process image blocks of different sizes.
应理解,图4所示的方法可以适用于任何帧内预测模式,也就是说在方向预测模式或者非方向预测模式下都可以直接根据步骤120来获取残差块的候选变换核对。It should be understood that the method shown in FIG. 4 may be applicable to any intra prediction mode, that is, in the directional prediction mode or the non-directional prediction mode, the candidate transformation check of the residual block may be directly obtained according to step 120.
或者,步骤120中确定残差块的候选变换核对的方式也可以只适用于方向预测模式,对于非方向预测模式可以直接采用预先设定的变换核对作为目标变换核对。Alternatively, the method of determining the candidate transformation check of the residual block in step 120 may only be applicable to the directional prediction mode, and for the non-directional prediction mode, a preset transformation check may be directly adopted as the target transformation check.
可选地,图4所示的方法还包括:在残差块对应的帧内预测模式为DC模式的情况下,确定变换核对(DCT-II,DTC-II)为目标变换核对。Optionally, the method shown in FIG. 4 further includes: when the intra prediction mode corresponding to the residual block is a DC mode, determining a transformation check (DCT-II, DTC-II) as a target transformation check.
可选地,图4所示的方法还包括:在残差块对应的帧内预测模式为平面模式的情况下,确定变换核对(DST-VII,DST-VII)为目标变换核对。Optionally, the method shown in FIG. 4 further includes: when the intra prediction mode corresponding to the residual block is a planar mode, determining a transformation check (DST-VII, DST-VII) as a target transformation check.
本申请中,当帧内预测模式为DC模式或者平面模式时,通过直接采用预设的变换核对进行反变换,能够简化确定目标变换核的过程,减少反变换所需要的时间。In the present application, when the intra prediction mode is a DC mode or a planar mode, by using a preset transformation check directly to perform inverse transformation, the process of determining the target transformation kernel can be simplified and the time required for the inverse transformation can be reduced.
可选地,在当前块对应的帧内预测模式为平面模式且当前块的宽和高均小于或者等于N的情况下,确定变换核对(DST-VII,DST-VII)为目标变换核对。Optionally, when the intra prediction mode corresponding to the current block is a planar mode and the width and height of the current block are both less than or equal to N, a transformation check (DST-VII, DST-VII) is determined as the target transformation check.
上述N的数值可以为4,8和16等,进一步的,N的数值可以是4的倍数。The value of N can be 4, 8, and 16, etc. Further, the value of N can be a multiple of 4.
也就是说,当帧内预测模式为平面模式时,如果当前块的宽和高至少有一个大于N时,可以采用其他预先设定的变换核对作为目标变换核对,例如,将变换核对(DCT-II,DTC-II)确定为目标变换核对。That is, when the intra prediction mode is a planar mode, if at least one of the width and height of the current block is greater than N, other preset transformation checks can be used as the target transformation check, for example, the transformation check (DCT- II, DTC-II) is determined as the target transformation check.
由于平面模式下出现的残差呈现从左到右、从上到下依次增加的趋势,这类信号适合采用DST-VII,因此,在平面模式下采用(DST-VII,DST-VII)作为目标变换核对能够提高反变换的效果。Since the residuals appearing in the planar mode tend to increase from left to right and from top to bottom, this type of signal is suitable for DST-VII. Therefore, (DST-VII, DST-VII) is used as the target in the planar mode. Transform check can improve the effect of inverse transform.
图5是本申请实施例的反变换方法的示意性流程图。图5所示的方法可以由解码端设备执行,图5所示的方法包括步骤210至步骤230,下面分别对步骤210至步骤230进行详细的介绍。FIG. 5 is a schematic flowchart of an inverse transform method according to an embodiment of the present application. The method shown in FIG. 5 may be executed by a decoding device. The method shown in FIG. 5 includes steps 210 to 230. The steps 210 to 230 are described in detail below.
210、解析码流以获取当前块的残差系数和目标变换核对确定参数。210: Parse the bitstream to obtain the residual coefficient of the current block and the target transformation to check and determine the parameters.
在获取到码流之后通过对码流进行熵解码等操作可以获取当前块的残差系数和目标变换核对确定参数等信息。After the code stream is obtained, information such as the residual coefficient of the current block and the target transformation check and determination parameters can be obtained by performing entropy decoding on the code stream.
上述目标变换核对确定参数是用于确定当前块的残差系数的目标变换核对的信息,目标变换核对确定参数既可以通过单个信息来只直接指示目标变换核对,或者,目标变换核对确定参数也可以通过多个参数来共同指示目标变换核对。The above-mentioned target transformation check determination parameter is information used to determine the target transformation check of the residual coefficient of the current block. The target transformation check determination parameter can directly indicate only the target transformation check through a single message, or the target transformation check determination parameter can also The multiple parameters are used to collectively indicate the target transformation check.
上述解析码流以获取当前块的残差系数具体可以是指先从码流中解析得到量化系数,然后再对量化系数进行反量化从而得到残差系数,该残差系数可以用于反变换。The above parsing the bitstream to obtain the residual coefficient of the current block may specifically refer to firstly parsing the quantized coefficient from the bitstream, and then dequantizing the quantized coefficient to obtain the residual coefficient, which can be used for inverse transformation.
220、从第一变换核对、第二变换核对、第三变换核对以及第四变换核对中确定出与所述目标变换核对确定参数对应的目标变换核对。220. Determine a target transformation check corresponding to the target transformation check determination parameter from the first transformation check, the second transformation check, the third transformation check, and the fourth transformation check.
其中,所述第二变换核对,所述第三变换核对和第四变换核对均包括变换核DST-VII,所述第二变换核对,所述第三变换核对和所述第四变换核对中至少一个变换核对包括变换核DCT-VIII。The second transformation check, the third transformation check, and the fourth transformation check each include a transformation kernel DST-VII, the second transformation check, the third transformation check, and the fourth transformation check. A transformation check includes the transformation kernel DCT-VIII.
当上述目标变换核对确定参数通过单个信息来直接指示目标变换核对时,可以通过目标变换核对确定参数的参数值与变换核对的映射关系或者对应关系来确定目标变换核对。When the above target transformation check determination parameter directly instructs the target transformation check through a single piece of information, the target transformation check may be determined through a mapping relationship or a corresponding relationship between the parameter value of the target transformation check determination parameter and the transformation check.
可选地,从第一变换核对、第二变换核对、第三变换核对以及第四变换核对中确定出与所述目标变换核对确定参数对应的目标变换核对,包括:根据目标变换核对确定参数的参数值以及目标变换核对确定参数的参数值与变换核对之间的映射关系,确定目标变换核对。Optionally, determining a target transformation check corresponding to the target transformation check determination parameter from the first transformation check, the second transformation check, the third transformation check, and the fourth transformation check includes: determining the parameter according to the target transformation check. The parameter value and the target transformation check determine the mapping relationship between the parameter value of the parameter and the transformation check to determine the target transformation check.
具体地,目标变换核对确定参数分别为第一参数值至第四参数值时,分别对应第一变换核对至第四变换核对。那么,当解码端解析到目标变换核对确定参数为第二参数值时,可以直接确定目标变换核对为第二变换核对。Specifically, when the target transformation check determination parameters are respectively the first parameter value to the fourth parameter value, they correspond to the first transformation check to the fourth transformation check, respectively. Then, when the decoding end resolves that the target transformation check determination parameter is the second parameter value, it can directly determine that the target transformation check is the second transformation check.
上述目标变换核对确定参数的参数值与变换核对的对应关系可以如表9所示。如表9所示的映射关系可以存储在编码端和解码端,编码端确定了目标变换核对之后,可以将该目标变换核对对应的目标变换核对确定参数的参数值写入到码流中,这样解码端通过解析到的目标变换核对确定参数的参数值以及表9所示的映射关系就可以确定目标变换核对了。The corresponding relationship between the parameter values of the target transformation check determination parameters and the transformation check can be shown in Table 9. The mapping relationship shown in Table 9 can be stored at the encoding end and the decoding end. After the encoding end determines the target transformation check, the parameter value of the target transformation check corresponding to the target transformation check can be written into the code stream. The decoding end can determine the target transformation check through the parsed target transformation check to determine the parameter values of the determined parameters and the mapping relationship shown in Table 9.
表9Table 9
目标变换核对确定参数的参数值The target transformation checks the parameter values of the determined parameters 目标变换核对Target transformation check
第一参数值First parameter value 第一变换核对First transformation check
第二参数值Second parameter value 第二变换核对Second transformation check
第三参数值Third parameter value 第三变换核对Third transformation check
第四参数值Fourth parameter value 第四变换核对Fourth transformation check
可选地,第一变换核对为(DCT-II,DTC-II),第二变换核对为(DST-VII,DST-VII),第三变换核对为(DCT-VIII,DST-VII),第四变换核对为(DST-VII,DCT-VIII)。Optionally, the first transformation check is (DCT-II, DTC-II), the second transformation check is (DST-VII, DST-VII), and the third transformation check is (DCT-VIII, DST-VII). The four transform checks are (DST-VII, DCT-VIII).
将第一变换核对至第四变换核对具体的变换核对添加到表9中可以得到表10,在表 10中第一参数值为0,01,10,11时分别对应的目标变换核对为(DCT-II,DTC-II),(DST-VII,DST-VII),(DCT-VIII,DST-VII),(DST-VII,DCT-VIII)。Adding the first transformation check to the fourth transformation check and adding the specific transformation check to Table 9 can obtain Table 10. In Table 10, when the first parameter value is 0, 01, 10, and 11, the corresponding target transformation check is (DCT). -II, DTC-II), (DST-VII, DST-VII), (DCT-VIII, DST-VII), (DST-VII, DCT-VIII).
表10Table 10
目标变换核对确定参数的参数值The target transformation checks the parameter values of the determined parameters 目标变换核对Target transformation check
00 DCT-II,DTC-IIDCT-II, DTC-II
0101 DST-VII,DST-VIIDST-VII, DST-VII
1010 DCT-VIII,DST-VIIDCT-VIII, DST-VII
1111 DST-VII,DCT-VIIIDST-VII, DCT-VIII
应理解,上述表9和表10只是目标变换核对确定参数的参数值与变换核对的对应关系的一种表现形式的举例,本申请对目标变换核对确定参数的参数值与变换核对的对应关系的具体形式不做限定,只要是目标变换核对确定参数的参数值与变换核对有一定的对应关系即可。It should be understood that the above-mentioned Tables 9 and 10 are merely examples of a manifestation of the correspondence between the parameter values of the target transformation check determination parameters and the transformation check. The specific form is not limited, as long as there is a certain correspondence between the parameter values of the parameters determined by the target transformation check and the transformation check.
当目标变换核对确定参数通过多个参数来共同指示目标变换核对时,可以先获取目标变换核对确定参数中的多个参数,然后再根据该多个参数与目标变换核对的对应关系来确定目标变换核对。When the target transformation check determination parameter collectively indicates the target transformation check through multiple parameters, the multiple parameters in the target transformation check determination parameter may be obtained first, and then the target transformation is determined according to the correspondence between the multiple parameters and the target transformation check. Check.
可选地,目标变换核对确定参数包括第一标志位,或目标变换核对确定参数包括第一标志位和变换索引值。Optionally, the target transformation check determination parameter includes a first flag bit, or the target transformation check determination parameter includes a first flag bit and a transformation index value.
可选地,从第一变换核对、第二变换核对、第三变换核对以及第四变换核对中确定出与所述目标变换核对确定参数对应的目标变换核对,具体包括以下过程:Optionally, determining a target transformation check corresponding to the target transformation check determination parameter from the first transformation check, the second transformation check, the third transformation check, and the fourth transformation check specifically includes the following process:
(1)当所述第一标志位为第一取值时,确定与所述目标变换核对确定参数对应的目标变换核对为第一变换核对;(1) when the first flag bit has a first value, determining a target transformation check corresponding to the target transformation check determination parameter as a first transformation check;
(2)当第一标志位为第二取值并且所述变换索引值为第一变换索引值时,确定与所述目标变换核对确定参数对应的目标变换核对为第二变换核对;(2) when the first flag bit has a second value and the transformation index value is the first transformation index value, determining a target transformation check corresponding to the target transformation check determination parameter as a second transformation check;
(3)当第一标志位为第二取值并且所述变换索引值为第二变换索引值时,确定与所述目标变换核对确定参数对应的目标变换核对为第三变换核对;(3) when the first flag bit has a second value and the transformation index value is a second transformation index value, determining a target transformation check corresponding to the target transformation check determination parameter as a third transformation check;
(4)当第一标志位为第二取值并且所述变换索引值为第三变换索引值时,确定与所述目标变换核对确定参数对应的目标变换核对为第四变换核对。(4) When the first flag bit has a second value and the transformation index value is a third transformation index value, determining a target transformation check corresponding to the target transformation check determination parameter as a fourth transformation check.
可选地,上述第一变换核对、第二变换核对、第三变换核对以及第四变换核对中包含的变换核的种类的总数小于5。Optionally, the total number of types of transformation kernels included in the first transformation check, the second transformation check, the third transformation check, and the fourth transformation check is less than 5.
本申请中,变换核的种类小于5时,能够减少由于存储变换核所占用的存储空间。In the present application, when the type of the transformation kernel is less than 5, the storage space occupied by storing the transformation kernel can be reduced.
可选地,上述第一变换核对、第一候选变换核对、第二候选变换核对以及第三变换核对中包含的变换核包括DCT-II,DCT-VIII和DST-VII。Optionally, the transformation kernels included in the first transformation check, the first candidate transformation check, the second candidate transformation check, and the third transformation check include DCT-II, DCT-VIII, and DST-VII.
上述第一标志位、变换索引值和目标变换核对之间可以有一定的对应关系(映射关系),该对应关系的具体形式可以是表格。There may be a certain correspondence relationship (mapping relationship) between the first flag bit, the transformation index value, and the target transformation check, and the specific form of the correspondence relationship may be a table.
例如,第一标志位、变换索引值和目标变换核对之间的对应关系可以如表11所示。For example, the correspondence between the first flag bit, the transformation index value, and the target transformation check may be shown in Table 11.
表11Table 11
Figure PCTCN2018093923-appb-000006
Figure PCTCN2018093923-appb-000006
Figure PCTCN2018093923-appb-000007
Figure PCTCN2018093923-appb-000007
由表11可知,当第一标志位为第一取值时,目标变换核对仅与第一标志位之间存在对应关系,并且,目标变换核对为第一变换核对。当第一标志位为第二取值时,目标变换核对与第一标志位以及变换索引值之间均存在对应关系,当第一标志位为第二取值时且变换索引值分别为第一变换索引值、第二变换索引值时以及第三变换索引值时分别对应的目标变换核对为第二变换核对、第三变换核对和第四变换核对。It can be known from Table 11 that when the first flag bit is the first value, the target transformation check only has a corresponding relationship with the first flag bit, and the target transformation check is the first transformation check. When the first flag bit is the second value, there is a corresponding relationship between the target transformation check and the first flag bit and the transformation index value. When the first flag bit is the second value and the transformation index value is the first The target transformation check corresponding to the transformation index value, the second transformation index value, and the third transformation index value are respectively a second transformation check, a third transformation check, and a fourth transformation check.
当第一变换索引值、第二变换索引值和第三变换索引值分别为0、1和2时,第一取值和第二取值分别为0和1时,第一标志位、变换索引值和目标变换核对之间的对应关系具体可以如表12所示。When the first transformation index value, the second transformation index value, and the third transformation index value are 0, 1, and 2, respectively, and the first and second values are 0 and 1, respectively, the first flag bit and the transformation index The corresponding relationship between the value and the target transformation check can be specifically shown in Table 12.
表12Table 12
Figure PCTCN2018093923-appb-000008
Figure PCTCN2018093923-appb-000008
应理解,上述第一取值和第二取值也可以分别为1和0,上的第一变换索引值至第三变换索引值也可以是其他数值。It should be understood that the first value and the second value may also be 1 and 0, respectively, and the first transformation index value to the third transformation index value may also be other values.
可选地,上述第一标志位为EMT标志位。Optionally, the first flag is an EMT flag.
具体地,当EMT标志位的取值为0时表示在对残差系数进行反变换时要采用单核反变换(相应的,编码端进行变换时采用的也是单核变换);当EMT标志位的取值为1时表示在对残差系数进行反变换时要采用多核反变换(相应的,编码端进行变换时采用的也是多核变换)。Specifically, when the value of the EMT flag is 0, it means that a single-core inverse transformation is used when the inverse transformation is performed on the residual coefficient (correspondingly, the single-core transformation is also used when the encoding end is transformed); A value of 1 indicates that a multi-core inverse transform is used when inverse transforming the residual coefficient (correspondingly, the multi-core transform is also used when the encoding end performs the transform).
可选地,第一变换核对为相同变换核组成的变换核对。Optionally, the first transformation check is a transformation check composed of the same transformation kernel.
采用第一变换核对进行反变换时进行的就是单核反变换。When the first transform check is used to perform the inverse transform, a single-core inverse transform is performed.
可选地,第一变换索引值对应的码字的长度为1,第二变换索引值和第三变换索引值对应的码字的长度均为2。Optionally, the length of the codeword corresponding to the first transformation index value is 1, and the length of the codeword corresponding to the second transformation index value and the third transformation index value are both 2.
通过将第一变换索引值的码字的长度设置为1,能够减少指示变换索引值时需要的比特位。By setting the length of the codeword of the first transformation index value to 1, the number of bits required to indicate the transformation index value can be reduced.
可选地,上述第一变换索引值对应的码字为0,上述第二变换索引值对应的码字为10,上述第三变换索引值对应的码字为11。Optionally, the codeword corresponding to the first transformation index value is 0, the codeword corresponding to the second transformation index value is 10, and the codeword corresponding to the third transformation index value is 11.
当第一标志位为EMT标志位,第一变换索引值至第三变换索引值分别为0,1,2,这三个索引值的码字分别为0,10,11时,第一标志位、变换索引值和目标变换核对之间的对应关系具体可以如表13所示。When the first flag bit is the EMT flag bit, and the first to third transformation index values are 0, 1, 2, and the codewords of the three index values are 0, 10, and 11, respectively, the first flag bit is The correspondence between the transformation index value and the target transformation check can be shown in Table 13.
表13Table 13
Figure PCTCN2018093923-appb-000009
Figure PCTCN2018093923-appb-000009
Figure PCTCN2018093923-appb-000010
Figure PCTCN2018093923-appb-000010
应理解,上述第二变换索引值和第三变换索引值对应的码字也可以分别为10和01。It should be understood that the codewords corresponding to the second transformation index value and the third transformation index value may also be 10 and 01, respectively.
可选地,第一变换核对为(DCT-II,DTC-II),第二变换核对为(DST-VII,DST-VII),第三变换核对为(DCT-VIII,DST-VII),第四变换核对为(DST-VII,DCT-VIII)。Optionally, the first transformation check is (DCT-II, DTC-II), the second transformation check is (DST-VII, DST-VII), and the third transformation check is (DCT-VIII, DST-VII). The four transform checks are (DST-VII, DCT-VIII).
本申请中,第一变换核对至第四变换核对中包含的变换核的种类为4种,小于现有JEM标准中的5种,可以减少存储变换核时占用的比特。In the present application, there are four types of transformation kernels included in the first transformation verification to the fourth transformation verification, which are less than five in the existing JEM standard, which can reduce the bits occupied when storing the transformation kernel.
将第一变换核对和第四变换核对填入到表13中可以得到表14。Table 14 can be obtained by filling the first transformation check and the fourth transformation check into Table 13.
表14Table 14
Figure PCTCN2018093923-appb-000011
Figure PCTCN2018093923-appb-000011
230、根据目标变换核对,对所述残差系数进行反变换,得到残差块。230: Perform inverse transformation on the residual coefficient according to the target transformation check to obtain a residual block.
本申请中,通过解析到的目标变换核对确定参数就可以确定目标变换核对,进而可以根据该目标变换核对实现对残差系数的反变换。In this application, the target transformation check can be determined through the determined target transformation check determination parameters, and the inverse transformation of the residual coefficient can be realized according to the target transformation check.
进一步的,由于第一候选变换核对和第二变换核对中均包含变换核DST-VII,可以使得最终确定的目标变换核对中包含变换核DST-VII的可能性增加,使得在根据目标变换核对,对残差系数进行反变换时可能会得到更好的反变换效果。Further, since the first candidate transformation check and the second transformation check both include a transformation kernel DST-VII, it is possible to increase the possibility of including the transformation kernel DST-VII in the final target transformation check, so that in the target transformation check, A better inverse transform effect may be obtained when inverse transforming the residual coefficients.
具体地,由于帧内预测模式时利用当前块的上边和右边的参考像素对当前块进行预测,并且预测误差有从上到下从左到右依次逐渐增大的趋势,而DST-VII的基函数是逐渐增大的,因此,DST-VII变换核适合这种逐渐增大的特性,采用DST-VII进行变换和反变换能够取得较好的效果。Specifically, because the intra prediction mode uses the top and right reference pixels of the current block to predict the current block, and the prediction error tends to gradually increase from top to bottom from left to right, the base of DST-VII The function is gradually increasing. Therefore, the DST-VII transformation kernel is suitable for this gradually increasing characteristic. Using DST-VII for transformation and inverse transformation can achieve better results.
可选地,作为一个实施例,在确定所述目标变换核对之前,图5所示的方法还包括:确定当前块对应的帧内预测模式为方向预测模式。Optionally, as an embodiment, before the target transformation check is determined, the method shown in FIG. 5 further includes: determining an intra prediction mode corresponding to the current block as a directional prediction mode.
可选地,作为一个实施例,在确定所述目标变换核对之前,图5所示的方法还包括:确定残差块的宽和高均小于或者等于M。Optionally, as an embodiment, before determining the target transformation check, the method shown in FIG. 5 further includes: determining that the width and height of the residual block are both less than or equal to M.
可选地,作为一个实施例,当残差块的宽和高至少有一个大于M时,确定(DCT-II,DTC-II)为目标变换核对。Optionally, as an embodiment, when at least one of the width and height of the residual block is greater than M, (DCT-II, DTC-II) is determined as the target transformation check.
可选地,上述M的数值为64。Optionally, the value of M is 64.
本申请中,在当前块的尺寸较大的情况下直接采用(DCT-II,DTC-II)作为目标变换核对进行变换,在当前块的尺寸较小时再根据目标变换核对确定参数最终确定目标变换核,能够灵活处理不同大小的图像块。In this application, when the size of the current block is large, (DCT-II, DTC-II) is directly used as the target transformation check to perform the transformation, and when the size of the current block is small, the determination parameters are finally determined according to the target transformation check to determine the target transformation Core, capable of flexibly processing image blocks of different sizes.
可选地,作为一个实施例,图5所示方法还包括:在当前块对应的帧内预测模式为DC模式的情况下,确定变换核对(DCT-II,DTC-II)为所述目标变换核对。Optionally, as an embodiment, the method shown in FIG. 5 further includes: when the intra prediction mode corresponding to the current block is a DC mode, determining a transform check (DCT-II, DTC-II) as the target transform Check.
可选地,作为一个实施例,上述方法还包括:在当前快对应的帧内预测模式为平面模式的情况下,确定变换核对(DST-VII,DST-VII)为所述目标变换核对。Optionally, as an embodiment, the above method further includes: determining a transformation check (DST-VII, DST-VII) as the target transformation check if the intra prediction mode corresponding to the current fast mode is a plane mode.
本申请中,当帧内预测模式为DC模式或者平面模式对时,通过直接采用预设的变换核对进行反变换,能够简化确定目标变换核的过程,减少反变换所需要的时间。In the present application, when the intra prediction mode is a DC mode or a plane mode pair, the inverse transformation can be simplified by directly using a preset transformation check, which can simplify the process of determining the target transformation kernel and reduce the time required for the inverse transformation.
可选地,在当前块对应的帧内预测模式为平面模式且残差块的宽和高均小于或者等于N的情况下,确定变换核对(DST-VII,DST-VII)为所述目标变换核对。Optionally, when the intra prediction mode corresponding to the current block is a planar mode and the width and height of the residual block are both less than or equal to N, a transformation check (DST-VII, DST-VII) is determined as the target transformation Check.
上述N的数值可以为4,8和16等。The value of N can be 4, 8, and 16 and so on.
在平面模式下出现的残差呈现从左到右、从上到下依次增加的趋势,这类信号适合采用DST-VII,因此,在平面模式下采用(DST-VII,DST-VII)作为目标变换核对能够提高反变换的效果。The residuals appearing in the flat mode show an increasing trend from left to right and from top to bottom. This type of signal is suitable for DST-VII. Therefore, (DST-VII, DST-VII) is used as the target in the flat mode. Transform check can improve the effect of inverse transform.
现有的JEM标准中EMT标志位、候选变换核,变换索引值以及码字的对应情况如表15所示。The corresponding conditions of the EMT flag bits, candidate transformation kernels, transformation index values, and codewords in the existing JEM standard are shown in Table 15.
表15Table 15
Figure PCTCN2018093923-appb-000012
Figure PCTCN2018093923-appb-000012
由于现有方案中当EMT标志位为0核1时共对应五种变换核对,因此,在进行率失真优化的过程中需要进行五次遍历,这将可能导致最终的编码时间的增加。In the existing scheme, when the EMT flag bit is 0 core 1 and corresponding to five kinds of transformation check, it is necessary to perform five traversals in the process of rate distortion optimization, which may lead to an increase in the final encoding time.
通过对各种变换索引值对应的变换核对以及变换核对(DCT-II,DCT-II)的统计发现,不同的变换核对的占比情况相差较大,如表16所示,变换核对(DCT-II,DCT-II)的占比最高,达到了43.8%,索引值3的占比最小,只有7.2%。通过分析发现,在所有帧内预测模式在多核变换中,索引值0至索引值3对应的变换核对的占比依次占比呈下降趋势。According to the statistics of the transformation check and transformation check (DCT-II, DCT-II) corresponding to various transformation index values, it is found that the proportion of different transformation checks varies greatly. As shown in Table 16, the transformation check (DCT-II II, DCT-II) accounted for the highest proportion, reaching 43.8%, and the index value 3 accounted for the smallest proportion, only 7.2%. Through analysis, it is found that in the multi-core transformation of all intra prediction modes, the proportion of the transformation check corresponding to the index value 0 to the index value 3 sequentially decreases.
其中,索引值0,1,2对应的水平和垂直变换核都至少采用了一个DST-VII变换核,而索引值3表示的是水平和垂直变换核都没有采用DST-VII变换核。索引值0对应于(DST-VII,DST-VII)变换核,它的占比显然高于索引值1,2,3。这是因为帧内预测利用上边和左边的参考像素对当前块进行预测,预测误差有从上到下从左到右依次逐渐增大的趋势,而DST-VII变换核适用于这类残差信号。Among them, the horizontal and vertical transformation kernels corresponding to the index values 0,1,2 both use at least one DST-VII transformation kernel, and the index value 3 indicates that neither the horizontal or vertical transformation kernels use DST-VII transformation kernels. The index value 0 corresponds to the (DST-VII, DST-VII) transform kernel, and its proportion is obviously higher than the index values 1,2,3. This is because intra prediction uses the top and left reference pixels to predict the current block. The prediction error tends to gradually increase from top to bottom from left to right. The DST-VII transform kernel is suitable for this type of residual signal. .
表16Table 16
变换核对Transformation check DCT-II,DCT-IIDCT-II, DCT-II 索引值0Index value 0 索引值1Index value 1 索引值2 Index value 2 索引值3Index value 3
平均占比Average share 43.8%43.8% 23.2%23.2% 12.8%12.8% 13.0%13.0% 7.2%7.2%
因此,本申请提供了一种新的映射关系,在该映射关系中,EMT标志位为0时对应的候选变换核仍为变换核对(DCT-II,DCT-II),而新增的变换核对的种类减少至3种,具体如表17所示。在表17中,对于新增变换核,根据变换核的占比情况采用了水平和垂直变换核至少使用一个DST-VII变换核。另外,在表17中,变换索引值为0时对应码字0,索引值为1和2分别对应码字为10和11。Therefore, this application provides a new mapping relationship. In this mapping relationship, the candidate transformation kernel corresponding to the EMT flag of 0 is still a transformation check (DCT-II, DCT-II), and a new transformation check is added. The number of types is reduced to three, as shown in Table 17. In Table 17, for the newly added transform kernels, at least one DST-VII transform kernel is used for the horizontal and vertical transform kernels according to the proportion of the transform kernels. In addition, in Table 17, when the transformation index value is 0, the codeword is 0, and the index values of 1 and 2 correspond to the codewords of 10 and 11, respectively.
对于索引值为0,水平和垂直变换核都是DST-VII变换核;对于索引值为1,水平变换核是DST-VII,垂直变换核不是DST-VII变换核;对于索引值2,水平变换核不是DST-VII变换核,垂直变换核为DST-VII;对于索引值为3的变换核组合,由于占比最低,故跳过索引值为3的遍历过程。For an index value of 0, the horizontal and vertical transformation kernels are both DST-VII transformation kernels; for an index value of 1, the horizontal transformation kernel is DST-VII, and the vertical transformation kernel is not a DST-VII transformation kernel; for an index value of 2, horizontal transformation The kernel is not a DST-VII transformation kernel, and the vertical transformation kernel is DST-VII; for a combination of transformation kernels with an index value of 3, the traversal process with an index value of 3 is skipped because it has the lowest ratio.
因此,在编码端进行变换过程中通过采用表17所示的表格能够减少遍历次数,减少编码时间,另外,某些变换索引值可以对应1个码字,能够节省表示变换索引值时的占用的比特。Therefore, in the transformation process at the encoding end, the number of traversals can be reduced and the coding time can be reduced by using the table shown in Table 17. In addition, some transformation index values can correspond to one codeword, which can save the occupation of the transformation index value. Bits.
表17Table 17
Figure PCTCN2018093923-appb-000013
Figure PCTCN2018093923-appb-000013
上述表17中的新增变换核可以通过查询残差块与相应的候选变换核之间的关系来选择新增变换核。The newly added transformation kernel in Table 17 above can be selected by querying the relationship between the residual block and the corresponding candidate transformation kernel.
例如,上述新增变换核可以根据表18和表19来选择。For example, the above-mentioned newly added transform kernels can be selected according to Tables 18 and 19.
表18Table 18
变换候选集Transform candidate set 候选变换核Candidate transformation kernel
00 DST-VII,DCT-VIIIDST-VII, DCT-VIII
11 DST-VII,DST-IDST-VII, DST-I
22 DST-VII,DCT-VDST-VII, DCT-V
表19Table 19
Figure PCTCN2018093923-appb-000014
Figure PCTCN2018093923-appb-000014
Figure PCTCN2018093923-appb-000015
Figure PCTCN2018093923-appb-000015
例如,当残差块对应的帧内预测模式的模式号为51时,根据表19确定水平方向对应的变换候选集为2,垂直方向上对应的变换候选集为0。如表18所示,变换候选集0包含候选变换核DST-VII,DCT-VIII,变换候选集2包含候选变换核DST-VII,DCT-V,那么,可以从变换候选集0中选择出变换核DST-VII,从变换候选集2中选择出变换核DCT-V组成新增变换核,这两种新增变换核有三种组合情况,这三种情况分别对应索引值0至索引值2。For example, when the mode number of the intra prediction mode corresponding to the residual block is 51, it is determined according to Table 19 that the transformation candidate set corresponding to the horizontal direction is 2 and the transformation candidate set corresponding to the vertical direction is 0. As shown in Table 18, transformation candidate set 0 contains candidate transformation kernels DST-VII, DCT-VIII, and transformation candidate set 2 contains candidate transformation kernels DST-VII, DCT-V. Then, transformations can be selected from transformation candidate set 0 In the kernel DST-VII, a transformation kernel DCT-V is selected from the transformation candidate set 2 to form a new transformation kernel. There are three combinations of these two kinds of new transformation kernels, and these three cases correspond to index values 0 to 2 respectively.
在进行变换时,当变换核的种类较多时,存储这些变换核时需要占用一定的内存开销。为了减小内存开销,可以通过减少变换核种类来降低变换核的存贮开销以及变换实现复杂度。When performing transformations, when there are many types of transformation kernels, a certain memory overhead is required to store these transformation kernels. In order to reduce the memory overhead, the storage overhead of the transformation kernel and the complexity of the transformation can be reduced by reducing the types of transformation kernels.
可选地,变换核的种类可以有三种,分别为DCT-II,DCT-VIII和DST-VII。在这种情况下,变换核的使用可以仅仅取决于变换索引值,与帧内预测模式无关,具体如表20所示。Optionally, there may be three types of transform kernels, namely, DCT-II, DCT-VIII, and DST-VII. In this case, the use of the transform kernel can only depend on the transform index value, and has nothing to do with the intra prediction mode, as shown in Table 20.
表20Table 20
Figure PCTCN2018093923-appb-000016
Figure PCTCN2018093923-appb-000016
需要说明的是,上述表20中的DCT-VIII也可以替换成其他类似特性的变换核,如DCT-V,或者,基于DST-VII的某种变形如镜像变换(flip)后的DST-VII(这是因为镜像变换后的DST-VII变换核的特性与DCT-VIII的相似,应理解,这里的镜像变换可以表示做左右镜像也可以是做上下镜像。It should be noted that the DCT-VIII in the above table 20 can also be replaced with other transformation kernels with similar characteristics, such as DCT-V, or a variant based on DST-VII, such as DST-VII after flipping. (This is because the characteristics of the DST-VII transformation kernel after mirror transformation are similar to those of DCT-VIII. It should be understood that the mirror transformation here can be used to do left-right mirroring or up-down mirroring.
进一步的,也可以将变换核的种类减少到两种,这两种变换核为DCT-II和DST-VII,具体如表21所示。Further, the types of transformation kernels can also be reduced to two. The two transformation kernels are DCT-II and DST-VII, as shown in Table 21.
表21Table 21
Figure PCTCN2018093923-appb-000017
Figure PCTCN2018093923-appb-000017
上文分别结合图4和图5对本申请实施例的反变换方法进行了详细的介绍,下面结合图6对解码端执行反变换的过程进行详细的介绍。The inverse transform method according to the embodiment of the present application is described in detail with reference to FIG. 4 and FIG. 5 above, and the process of performing inverse transform at the decoder is described in detail with reference to FIG. 6.
图6是本申请实施例的反变换方法的示意性流程图。图6所示的方法可以由解码端设备执行,图6所示的方法包括步骤1001至步骤1010,下面分别对步骤1001至步骤1010进行详细的介绍。FIG. 6 is a schematic flowchart of an inverse transform method according to an embodiment of the present application. The method shown in FIG. 6 can be executed by a decoding device. The method shown in FIG. 6 includes steps 1001 to 1010. Steps 1001 to 1010 are described in detail below.
1001、开始。1001, start.
步骤1001表示在获取到了当前块的残差系数之后,开始获取残差系数对应的目标变换核对,以便根据目标变换核对,对残差系数进行反变换。Step 1001 indicates that after the residual coefficients of the current block are obtained, the target transformation check corresponding to the residual coefficients is started, so as to perform inverse transformation on the residual coefficients according to the target transformation check.
应理解,当前块的残差系数可以通过解析码流获取。It should be understood that the residual coefficient of the current block can be obtained by analyzing the code stream.
1002、确定当前块的宽(W)和高(H)是否均小于或者等于N。1002. Determine whether the width (W) and height (H) of the current block are both less than or equal to N.
N的数值可以设置为64或者其它数值。The value of N can be set to 64 or other values.
当残差块的W和H至少有一个大于N时,执行步骤1003,当残差块的W和H均小于或者等于N时,执行步骤1004。When at least one of W and H of the residual block is greater than N, step 1003 is performed, and when both of W and H of the residual block are less than or equal to N, step 1004 is performed.
1003、将(DCT-II,DCT-II)确定为目标变换核对。1003. Determine (DCT-II, DCT-II) as the target transformation check.
1004、确定帧内预测模式是否为方向预测模式。1004. Determine whether the intra prediction mode is a directional prediction mode.
应理解,这里的帧内预测模式时当前块对应的帧内预测模式,具体地,是指编码端在进行帧内预测时对应的帧内预测模式。It should be understood that the intra prediction mode here is the intra prediction mode corresponding to the current block, and specifically refers to the intra prediction mode corresponding to the encoding end when performing intra prediction.
当帧内预测模式为方向预测模式时执行步骤1005;当帧内预测模式为非方向预测模式时执行步骤1007。Step 1005 is performed when the intra prediction mode is a directional prediction mode; step 1007 is performed when the intra prediction mode is a non-directional prediction mode.
1005、确定EMT标志位(或者也可以称为EMT编码标志位)是否为1。1005. Determine whether the EMT flag (or the EMT encoding flag) is 1.
当EMT标志位不为1时(例如,为0时),执行步骤1003,将(DCT-II,DCT-II)确定为目标变换核对;当EMT标志位为1时,执行步骤1006。When the EMT flag is not 1 (for example, when it is 0), step 1003 is performed to determine (DCT-II, DCT-II) as the target conversion check; when the EMT flag is 1, step 1006 is performed.
1006、获取变换索引值,将变换索引值对应的变换核对确定为目标变换核对。1006. Obtain a transformation index value, and determine a transformation check corresponding to the transformation index value as a target transformation check.
应理解,在步骤1006中,具体可以根据图4和图5所示的方法中的步骤120和步骤220来确定目标变换核对,具体过程不再重复描述。It should be understood that in step 1006, the target transformation check may be specifically determined according to steps 120 and 220 in the method shown in FIG. 4 and FIG. 5, and the specific process is not described repeatedly.
1007、确定帧内预测模式是否为DC模式。1007. Determine whether the intra prediction mode is a DC mode.
当帧内预测模式为DC模式时执行步骤1008,当帧内预测模式不是DC模式时(此时帧内预测模式为平面模式)执行步骤1009。Step 1008 is performed when the intra prediction mode is a DC mode, and step 1009 is performed when the intra prediction mode is not a DC mode (the intra prediction mode is a planar mode at this time).
1008、将(DCT-II,DTC-II)确定为目标变换核对。1008. Determine (DCT-II, DTC-II) as the target transformation check.
1009、将(DST-VII,DST-VII)确定为目标变换核对。1009. Determine (DST-VII, DST-VII) as the target transformation check.
由于编码块的预测值是由参考像素值平均得到,因此DC模式适合于大面积平坦的区域,而DCT-II变换核适合于这类残差信号,因此,当帧内预测模式为DC模式时,将(DCT-II,DTC-II)确定为目标变换核对能够提高变换效果,并且在DC模式下能够减少指示目标变换核对所需要的比特数。Since the prediction value of the coded block is obtained by averaging the reference pixel values, the DC mode is suitable for a large area with a flat area, and the DCT-II transform kernel is suitable for such residual signals. Therefore, when the intra prediction mode is the DC mode , Determining (DCT-II, DTC-II) as the target transformation check can improve the transformation effect, and can reduce the number of bits required to indicate the target transformation check in the DC mode.
1010、根据目标变换核对,对残差系数进行反变换,得到残差块。1010. Perform inverse transformation on the residual coefficients according to the target transformation check to obtain residual blocks.
应理解,在图6中确定目标变换核对的过程中,还可以综合考虑非零系数的个数来确定目标变换核对。It should be understood that in the process of determining the target transformation check in FIG. 6, the number of non-zero coefficients may also be comprehensively considered to determine the target transformation check.
此外,图6所示的过程可以只是解码端进行反变换的流程的一种示例,图6所示的过程可以仅包含编码端进行变换的部分过程。In addition, the process shown in FIG. 6 may only be an example of a process of inverse transform performed by a decoder, and the process shown in FIG. 6 may include only a part of a process performed by an encoder.
上文结合图4至图6对本申请实施例的反变换方法进行了详细的描述,下面结合图7至图9对本申请实施例的变换方法进行描述,应理解,图7至图9所示的变换方法与图4 至图6所示的反变换方法是对应的,下面结合图7至图9对本申请实施例的变换方法进行详细的描述。The inverse transform method of the embodiment of the present application is described in detail above with reference to FIGS. 4 to 6. The transform method of the embodiment of the present application is described below with reference to FIGS. 7 to 9. It should be understood that the The transformation method corresponds to the inverse transformation method shown in FIGS. 4 to 6. The transformation method according to the embodiment of the present application will be described in detail below with reference to FIGS. 7 to 9.
图7是本申请实施例的变换方法的示意性流程图。图7所示的方法可以由编码端设备执行,图7所示的方法包括步骤310至步骤350,下面分别对步骤310至步骤350进行详细的介绍。FIG. 7 is a schematic flowchart of a conversion method according to an embodiment of the present application. The method shown in FIG. 7 may be executed by a coding end device. The method shown in FIG. 7 includes steps 310 to 350. The steps 310 to 350 are described in detail below.
310、获取待处理图像块的残差块。310: Obtain a residual block of an image block to be processed.
上述残差块可以是根据图1所示的过程通过对当前块(当前图像块)与当前块的预测块进行做差得到的,在得到该当前块的预测块的过程中采用是帧内预测模式。具体地,在得到当前块的预测块,进而得到当前块的残差块时,可以采用如图3所示的各种帧内预测模式。The above residual block may be obtained by making a difference between the current block (current image block) and the prediction block of the current block according to the process shown in FIG. 1. In the process of obtaining the prediction block of the current block, intra prediction is used. mode. Specifically, when the prediction block of the current block is obtained, and then the residual block of the current block is obtained, various intra prediction modes as shown in FIG. 3 may be adopted.
320、根据预设的第一映射关系信息获取所述残差块的候选变换核对。320: Obtain a candidate transformation check of the residual block according to preset first mapping relationship information.
其中,第一映射关系信息包括第一标志位、第一变换索引值和第二变换索引值以及多种变换核对的映射关系,第一标志位为第一取值时采用单核变换,第一标志位为第二取值时采用多核变换;The first mapping relationship information includes a mapping relationship of a first flag bit, a first transformation index value and a second transformation index value, and a variety of transformation checks. When the first flag bit is the first value, a single-core transformation is used. Multi-core transformation is used when the flag is the second value;
此外,第一标志位为第一取值时对应第一变换核对,第一标志位为第二取值时第一变换索引值对应第二变换核对,第一标志位为第二取值时第二变换索引值对应第三变换核对,第二变换核对是根据残差块对应的帧内预测模式从第一候选变换核对和第二候选变换核对中选择得到的,其中,第一候选变换核对和第二变候选变换核对均包含DST-VII。In addition, when the first flag bit is the first value, it corresponds to the first transformation check. When the first flag bit is the second value, the first transformation index value corresponds to the second transformation check. When the first flag bit is the second value, the first transformation bit is checked. The second transformation index value corresponds to the third transformation check, and the second transformation check is selected from the first candidate transformation check and the second candidate transformation check according to the intra prediction mode corresponding to the residual block, where the first candidate transformation check and The second transformation candidate transformation check all includes DST-VII.
可选地,在上述第一映射关系信息中的变换核对中可以包含五组变换核中的至少一部分变换核,这五组变换核为DCT-II、DCT-V、DCT-VIII、DST-1和DST-VII。Optionally, the transformation check in the first mapping relationship information may include at least a part of five sets of transformation kernels. The five sets of transformation kernels are DCT-II, DCT-V, DCT-VIII, and DST-1. And DST-VII.
可选地,上述第一标志位为显式多核变换EMT标志位。Optionally, the first flag bit is an explicit multi-core transform EMT flag bit.
可选地,上述第一取值为0,第二取值为1。Optionally, the first value is 0, and the second value is 1.
具体地,第一映射关系信息包括EMT标志位,当EMT标志位的取值为0时表示在对残差块进行变换时要采用单核变换;当EMT标志位的取值为1时表示在对残差块进行变换时要采用多核变换。Specifically, the first mapping relationship information includes an EMT flag bit. When the value of the EMT flag bit is 0, it means that single-core transformation is used when transforming the residual block; when the value of the EMT flag bit is 1, it means that Multi-core transform is used to transform the residual block.
可选地,第一变换核对为相同变换核组成的变换核对。Optionally, the first transformation check is a transformation check composed of the same transformation kernel.
可选地,上述第一映射关系信息具体表现形式为表格。Optionally, the specific expression form of the first mapping relationship information is a table.
例如,上述第一映射关系信息可以如表22所示。For example, the foregoing first mapping relationship information may be shown in Table 22.
表22Table 22
Figure PCTCN2018093923-appb-000018
Figure PCTCN2018093923-appb-000018
由表22可知,当第一标志位为第一取值时,第一标志位对应第一变换核对,当第一标志位为第二取值时,第一标志位对应两个变换核对,并且这两个变换核对分别对应第一变换索引值和第二变换索引值。As can be seen from Table 22, when the first flag bit is the first value, the first flag bit corresponds to the first transformation check, and when the first flag bit is the second value, the first flag bit corresponds to the two transformation check, and These two transformation checks correspond to the first transformation index value and the second transformation index value, respectively.
应理解,上述第一变换核对可以仅包含一种变换核,例如,上述第一变换核对为(DCT-II,DCT-II)。It should be understood that the first transformation check may include only one kind of transformation kernel, for example, the first transformation check is (DCT-II, DCT-II).
可选地,上述第三变换核对为(DST-VII,DST-VII)。Optionally, the third transformation check is (DST-VII, DST-VII).
可选地,第一变换索引值为0,第二变换索引值为1,或者,第一变换索引值为1,第二变换索引值为0。Optionally, the first transformation index value is 0, the second transformation index value is 1, or the first transformation index value is 1 and the second transformation index value is 0.
可选地,所述第一变换索引值和所述第二变换索引值对应的码字的长度均为1。Optionally, the length of the codeword corresponding to the first transformation index value and the second transformation index value is both 1.
本申请中,变换索引值对应的码字的长度均为1,能够减少由于指示变换索引值所需要的占用的比特数。In this application, the lengths of the codewords corresponding to the transformation index value are all 1, which can reduce the number of occupied bits required to indicate the transformation index value.
可选地,第一变换索引值对应的码字为0,第二变换索引值对应的码字为1。Optionally, the codeword corresponding to the first transformation index value is 0, and the codeword corresponding to the second transformation index value is 1.
可选地,第一变换索引值对应的码字为1,第二变换索引值对应的码字为0。Optionally, the codeword corresponding to the first transformation index value is 1, and the codeword corresponding to the second transformation index value is 0.
上述第一映射关系信息具体还可以如表23所示。The foregoing first mapping relationship information may also be specifically shown in Table 23.
表23Table 23
Figure PCTCN2018093923-appb-000019
Figure PCTCN2018093923-appb-000019
以编码标准H.266为例,当帧内预测模式的模式号小于或者等于34时,表2中的第二变换核对为(DST-VII,DCT-VIII);当帧内预测模式的模式号大于34时,表2中的第二变换核对为(DST-VII,DCT-VIII)。Taking the coding standard H.266 as an example, when the mode number of the intra prediction mode is less than or equal to 34, the second transformation check in Table 2 is (DST-VII, DCT-VIII); when the mode number of the intra prediction mode is When it is greater than 34, the second transformation check in Table 2 is (DST-VII, DCT-VIII).
在图7所示的方法中,第二变换核对需要根据残差块对应的帧内预测模式来选择。In the method shown in FIG. 7, the second transformation check needs to be selected according to the intra prediction mode corresponding to the residual block.
在H.265标准中,帧内预测模式的数量为35个,包含2个非方向预测模式(即平面模式和DC模式)和33个方向预测模式。In the H.265 standard, the number of intra prediction modes is 35, including 2 non-directional prediction modes (that is, planar mode and DC mode) and 33 directional prediction modes.
对于正在制定的H.266标准,帧内预测模式数量可能为67个,包含2个非方向预测模式(平面模式和DC模式)和65个方向预测模式。可以将帧内预测模式分成2组或者3组,每组帧内预测模式对应不同的变换核对。For the H.266 standard being developed, the number of intra prediction modes may be 67, including 2 non-directional prediction modes (planar mode and DC mode) and 65 directional prediction modes. The intra prediction modes can be divided into two or three groups, and each group of intra prediction modes corresponds to a different transformation check.
例如,一种可能的方案如下:For example, one possible scenario is as follows:
变换核对0:(DST-VII,DCT-VIII):帧内预测模式小于等于N时;Transform check 0: (DST-VII, DCT-VIII): when the intra prediction mode is less than or equal to N;
变换核对1:(DCT-VIII,DST-VII):帧内预测模式大于N时。Transform check 1: (DCT-VIII, DST-VII): When the intra prediction mode is greater than N.
N的取值与帧内预测模式的数量有关。对于H265标准,N可取2+(34-2)/2=18,对于正在制定中的H266标准,N可取2+(66-2)/2=34。The value of N is related to the number of intra prediction modes. For the H265 standard, N may be 2+ (34-2) / 2 = 18, and for the H266 standard under development, N may be 2+ (66-2) / 2 = 34.
上述变换核对0和变换核对1分别相当于上文中的第一候选变换核对和第二候选变换核对。The above-mentioned transformation check 0 and transformation check 1 correspond to the first candidate transformation check and the second candidate transformation check respectively.
应理解,在对帧内预测模式进行划分时,还可以将帧内预测模式划分成3组或者更多的组,每组对应一种变换核对,本申请对帧内预测模式的划分组的数目以及与变换核对的对应关系不做限定。It should be understood that when the intra prediction mode is divided, the intra prediction mode may also be divided into three or more groups, each group corresponding to a kind of transformation check, and the number of the divided groups of the intra prediction mode in this application. And the correspondence relationship with the conversion check is not limited.
330、从所述候选变换核对中选择出率失真最小的变换核对作为目标变换核对。330. Select a transformation check with the lowest rate distortion from the candidate transformation checks as a target transformation check.
应理解,可以依次采用各个变换核对残差块进行变换,并进行率失真优化(rate-distortion optimization,RDO),得到各个变换核对进行变换时对应的率失真,然后将率失真RDO最小的变换核对确定为目标变换核对。It should be understood that each transformation kernel may be used to transform the residual block in turn and perform rate-distortion optimization (RDO) to obtain the rate distortion corresponding to each transformation check for transformation, and then check the transformation with the smallest rate distortion RDO Determined as the target transformation check.
340、根据所述目标变换核对,对所述残差块进行变换,得到所述待处理图像块的变 换系数。340: Transform the residual block according to the target transformation check to obtain a transformation coefficient of the image block to be processed.
350、将目标变换核对对应的标志信息写入码流。350. Write the corresponding flag information corresponding to the target transformation check into the code stream.
应理解,目标变换核对对应的标志信息可以包括目标变换核对对应的第一标志位以及变换索引值。具体地,目标变换核对为第一变换核对时,目标变换核对对应的标志信息仅包含第一标志位,且第一标志位的取值为第一取值;当目标变换核对为第二变换核对或者第三变换核对时,目标变换核对对应的标志信息仅包含第一标志位和变换索引值,当目标变换核对为第二变换核对时,第一标志位的取值为第二取值且变换索引值为第一变换索引值,当目标变换核对为第三变换核对时,第一标志位的取值为第二取值且变换索引值为第二变换索引值。It should be understood that the flag information corresponding to the target transformation check may include a first flag bit and a transformation index value corresponding to the target transformation check. Specifically, when the target transformation check is the first transformation check, the flag information corresponding to the target transformation check includes only the first flag bit, and the value of the first flag bit is the first value; when the target transformation check is the second transformation check Or in the third transformation check, the corresponding flag information of the target transformation check includes only the first flag bit and the transformation index value. When the target transformation check is the second transformation check, the value of the first flag bit is the second value and the transformation is performed. The index value is the first transformation index value. When the target transformation check is the third transformation check, the value of the first flag bit is the second value and the transformation index value is the second transformation index value.
本申请中,由于第一映射关系信息中仅包含三个变换核对,因此,能够在选择目标变换核对的过程中减少遍历次数,从而可以减少编码所需要的时间。In this application, because the first mapping relationship information includes only three transformation checkups, the number of traversals can be reduced in the process of selecting a target transformation checkup, thereby reducing the time required for encoding.
可选地,作为一个实施例,在步骤320之前,图7所示的方法还包括:确定所述残差块对应的帧内预测模式为方向预测模式。Optionally, as an embodiment, before step 320, the method shown in FIG. 7 further includes: determining an intra prediction mode corresponding to the residual block as a directional prediction mode.
也就是说,在图7所示的方法中,当残差块对应的帧内预测模式为方向预测模式的情况下才根据步骤320获取残差块的候选变换核对。That is, in the method shown in FIG. 7, when the intra prediction mode corresponding to the residual block is a directional prediction mode, the candidate transformation check of the residual block is obtained according to step 320.
可选地,作为一个实施例,在步骤320之前,图7所示的方法还包括:确定所述残差块的宽和高均小于或者等于M。Optionally, as an embodiment, before step 320, the method shown in FIG. 7 further includes: determining that the width and height of the residual block are both less than or equal to M.
M的取值可以根据变换时的情况来设置,例如,M可以为64。The value of M can be set according to the situation during the transformation, for example, M can be 64.
通过在残差块小于一定尺寸时才根据第一映射关系信息来确定残差块的候选变换核对,能够提高变换效果。By determining the candidate transformation check of the residual block according to the first mapping relationship information when the residual block is smaller than a certain size, the transformation effect can be improved.
可选地,当残差块的宽和高至少有一个大于M时,确定(DCT-II,DTC-II)为目标变换核对。Optionally, when at least one of the width and height of the residual block is greater than M, (DCT-II, DTC-II) is determined as the target transformation check.
本申请中,当残差块的尺寸较大时直接采用(DCT-II,DTC-II)作为目标变换核对进行变换,当残差块的尺寸较小时再根据第一映射关系信息最终确定目标变换核,能够实现对不同大小的残差块进行更好的变换。In this application, when the size of the residual block is large, (DCT-II, DTC-II) is directly used as the target transformation check to perform the transformation, and when the size of the residual block is small, the target transformation is finally determined according to the first mapping relationship information. The kernel can achieve better transformation of residual blocks of different sizes.
应理解,图7所示的方法可以适用于任何帧内预测模式,也就是说在方向预测模式或者非方向预测模式下都可以直接根据步骤320来获取残差块的候选变换核对。It should be understood that the method shown in FIG. 7 may be applicable to any intra prediction mode, that is, in the directional prediction mode or the non-directional prediction mode, the candidate transformation check of the residual block may be directly obtained according to step 320.
或者,步骤320中确定残差块的候选变换核对的方式也可以只适用于方向预测模式,对于非方向预测模式可以直接采用预先设定的变换核对作为目标变换核对。Alternatively, the method for determining candidate transformation check of the residual block in step 320 may only be applicable to the directional prediction mode, and for the non-directional prediction mode, a preset transformation check may be directly adopted as the target transformation check.
可选地,图7所示的方法还包括:在所述残差块对应的帧内预测模式为DC模式的情况下,确定变换核对(DCT-II,DTC-II)为所述目标变换核对。Optionally, the method shown in FIG. 7 further includes: when the intra prediction mode corresponding to the residual block is a DC mode, determining a transformation check (DCT-II, DTC-II) as the target transformation check .
可选地,图7所示的方法还包括:在所述残差块对应的帧内预测模式为平面模式的情况下,确定变换核对(DST-VII,DST-VII)为所述目标变换核对。Optionally, the method shown in FIG. 7 further includes: when the intra prediction mode corresponding to the residual block is a planar mode, determining a transformation check (DST-VII, DST-VII) as the target transformation check .
本申请中,当采用DC模式和平面模式对残差块进行量化时,可以直接采用预设的变换核对进行量化,能够节省遍历过程,进而减少编码所需要的时间。In this application, when the DC mode and the plane mode are used to quantize the residual block, a preset transformation check can be directly used for quantization, which can save the traversal process and further reduce the time required for encoding.
可选地,在所述残差块对应的帧内预测模式为平面模式且残差块的宽和高均小于或者等于N的情况下,确定变换核对(DST-VII,DST-VII)为所述目标变换核对。Optionally, when the intra prediction mode corresponding to the residual block is a planar mode and the width and height of the residual block are both less than or equal to N, a transformation check (DST-VII, DST-VII) is determined as The target transformation check is described.
上述N的数值可以为4,8和16等。The value of N can be 4, 8, and 16 and so on.
也就是说,当帧内预测模式为平面模式时,如果残差块的宽和高至少有一个大于N时, 可以采用其他预先设定的变换核对作为目标变换核对,例如,将变换核对(DCT-II,DTC-II)确定为目标变换核对。That is, when the intra prediction mode is a planar mode, if at least one of the width and height of the residual block is greater than N, other preset transformation check may be used as the target transformation check. For example, a DCT -II, DTC-II) is determined as the target transformation check.
图8是本申请实施例的变换方法的示意性流程图。图8所示的方法可以由编码端设备执行,图8所示的方法包括步骤410至步骤450,下面分别对步骤410至步骤450进行详细的介绍。FIG. 8 is a schematic flowchart of a conversion method according to an embodiment of the present application. The method shown in FIG. 8 may be executed by a coding-end device. The method shown in FIG. 8 includes steps 410 to 450. Steps 410 to 450 are described in detail below.
410、获取待处理图像块的残差块。410: Obtain a residual block of an image block to be processed.
420、根据预设的第一映射关系信息获取所述残差块的候选变换核对。420. Acquire a candidate transformation check of the residual block according to preset first mapping relationship information.
其中,所述第一映射关系信息包括第一标志位、第一变换索引值、第二变换索引值、第三变换索引值以及四种变换核对的映射关系,第一标志位为第一取值和第二取值时分别采用单核变换和多核变换,所述第一标志位为第一取值时对应第一变换核对,所述第一标志位为第二取值时第一变换索引值、第二变换索引值以及第三变换索引值分别对应第二变换核对、第三变换核对和第四变换核对,所述第二变换核对至所述第四变换核对中的任意一个变换核对包括变换核DST-VII,所述第二变换核对至所述第四变换核对中至少一个变换核对包括变换核DCT-VIII。The first mapping relationship information includes a mapping relationship of a first flag bit, a first transformation index value, a second transformation index value, a third transformation index value, and four transformation checklists. The first flag bit is a first value. Single-core transformation and multi-core transformation are respectively used for the second value and the second value. The first flag bit corresponds to the first transformation check when the first value is the first value, and the first transformation index value is the first flag bit when the second value is the second value. , The second transformation index value and the third transformation index value correspond to the second transformation check, the third transformation check, and the fourth transformation check, respectively, and any one of the second to fourth transformation check includes a transformation Kernel DST-VII, at least one of the second to fourth transformation checkups includes a transformation kernel DCT-VIII.
可选地,上述第一标志位为显式多核变换EMT标志位。Optionally, the first flag bit is an explicit multi-core transform EMT flag bit.
可选地,上述第一取值为0,第二取值为1。Optionally, the first value is 0, and the second value is 1.
具体地,第一映射关系信息包括EMT标志位,当EMT标志位的取值为0时表示在对残差块进行变换时要采用单核变换;当EMT标志位的取值为1时表示在对残差块进行变换时要采用多核变换。Specifically, the first mapping relationship information includes an EMT flag bit. When the value of the EMT flag bit is 0, it means that single-core transformation is used when transforming the residual block; when the value of the EMT flag bit is 1, it means that Multi-core transform is used to transform the residual block.
可选地,第一变换核对为相同变换核组成的变换核对。Optionally, the first transformation check is a transformation check composed of the same transformation kernel.
可选地,第一变换索引值对应的码字的长度为1,第二变换索引值和第三变换索引值对应的码字的长度均为2。Optionally, the length of the codeword corresponding to the first transformation index value is 1, and the length of the codeword corresponding to the second transformation index value and the third transformation index value are both 2.
可选地,上述第一变换索引值至第三变换索引值分别为0,1,2。Optionally, the first to third transformation index values are 0, 1, and 2, respectively.
可选地,上述第一变换索引值对应的码字为0,上述第二变换索引值对应的码字为10,上述第三变换索引值对应的码字为11。Optionally, the codeword corresponding to the first transformation index value is 0, the codeword corresponding to the second transformation index value is 10, and the codeword corresponding to the third transformation index value is 11.
可选地,上述第二变换索引值和第三变换索引值对应的码字分别为10和01。Optionally, the codewords corresponding to the second transformation index value and the third transformation index value are 10 and 01, respectively.
430、从所述候选变换核对中选择出率失真最小的变换核对作为目标变换核对;430. Select a transformation check with the lowest rate distortion from the candidate transformation checks as the target transformation check.
440、根据所述目标变换核对对所述残差块进行变换,得到所述待处理图像块的变换系数。440: Transform the residual block according to the target transformation check to obtain a transform coefficient of the image block to be processed.
450、将目标变换核对对应的标志信息写入码流。450. Write the corresponding flag information corresponding to the target transformation check into the code stream.
应理解,目标变换核对对应的标志信息可以包括目标变换核对对应的第一标志位以及变换索引值。具体地,目标变换核对为第一变换核对时,目标变换核对对应的标志信息仅包含第一标志位,且第一标志位的取值为第一取值;当目标变换核对为第二变换核对或者第三变换核对时,目标变换核对对应的标志信息仅包含第一标志位和变换索引值,当目标变换核对为第二变换核对时,第一标志位的取值为第二取值且变换索引值为第一变换索引值,当目标变换核对为第三变换核对时,第一标志位的取值为第二取值且变换索引值为第二变换索引值。It should be understood that the flag information corresponding to the target transformation check may include a first flag bit and a transformation index value corresponding to the target transformation check. Specifically, when the target transformation check is the first transformation check, the flag information corresponding to the target transformation check includes only the first flag bit, and the value of the first flag bit is the first value; when the target transformation check is the second transformation check Or in the third transformation check, the corresponding flag information of the target transformation check includes only the first flag bit and the transformation index value. When the target transformation check is the second transformation check, the value of the first flag bit is the second value and the transformation is performed. The index value is the first transformation index value. When the target transformation check is the third transformation check, the value of the first flag bit is the second value and the transformation index value is the second transformation index value.
本申请中,由于第一映射关系信息中仅包含四个变换核对,因此,能够在选择目标变换核对的过程中减少遍历次数,从而可以减少编码所需要的时间。进一步的,由于第一标 志位为第二取值时对应的每个变换核对中都包含变换核DST-VII,而DST-VII的在帧内预测变换时的使用率较高,因此,根据第一映射关系信息能够选择使用率较高的变换核对进行变换,可以提高变换效果。In the present application, since the first mapping relationship information includes only four transformation checkups, the number of traversals can be reduced in the process of selecting a target transformation checkup, thereby reducing the time required for encoding. Further, since the transformation kernel DST-VII is included in each transformation check corresponding to the first flag bit being the second value, and DST-VII has a higher usage rate in intra prediction transformation, therefore, according to the A mapping relationship information can select a transformation check with a higher usage rate for transformation, which can improve the transformation effect.
进一步的,由于帧内预测模式时利用当前块的上边和右边的参考像素对当前块进行预测,并且预测误差有从上到下从左到右依次逐渐增大的趋势,而DST-VII的基函数是逐渐增大的,因此,DST-VII变换核适合这种逐渐增大的特性,采用DST-VII进行变换能够取得较好的效果。Further, because the intra-prediction mode uses the top and right reference pixels of the current block to predict the current block, and the prediction error gradually increases from top to bottom from left to right, the base of DST-VII The function is gradually increasing. Therefore, the DST-VII transformation kernel is suitable for this gradually increasing characteristic. The transformation using DST-VII can achieve better results.
可选地,上述第一标志位为显式多核变换EMT标志位。Optionally, the first flag bit is an explicit multi-core transform EMT flag bit.
可选地,上述第一取值为0,第二取值为1。Optionally, the first value is 0, and the second value is 1.
具体地,第一映射关系信息包括EMT标志位,当EMT标志位的取值为0时表示在对残差块进行变换时要采用单核变换;当EMT标志位的取值为1时表示在对残差块进行变换时要采用多核变换。Specifically, the first mapping relationship information includes an EMT flag bit. When the value of the EMT flag bit is 0, it means that single-core transformation is used when transforming the residual block; when the value of the EMT flag bit is 1, it means that Multi-core transform is used to transform the residual block.
可选地,第一变换核对为相同变换核组成的变换核对。Optionally, the first transformation check is a transformation check composed of the same transformation kernel.
可选地,作为一个实施例,所述第一变换索引值对应的码字的长度为1,所述第二变换索引值和第三变换索引值对应的码字的长度均为2。Optionally, as an embodiment, the length of the codeword corresponding to the first transformation index value is 1, and the length of the codeword corresponding to the second transformation index value and the third transformation index value are both 2.
可选地,上述第一变换索引值至第三变换索引值分别为0,1,2。Optionally, the first to third transformation index values are 0, 1, and 2, respectively.
可选地,上述第一变换索引值对应的码字为0,上述第二变换索引值对应的码字为10,上述第三变换索引值对应的码字为11。Optionally, the codeword corresponding to the first transformation index value is 0, the codeword corresponding to the second transformation index value is 10, and the codeword corresponding to the third transformation index value is 11.
可选地,上述第二变换索引值和第三变换索引值对应的码字分别为10和01。Optionally, the codewords corresponding to the second transformation index value and the third transformation index value are 10 and 01, respectively.
可选地,所述第一变换核对为(DCT-II,DTC-II),所述第二变换核对为(DST-VII,DST-VII),所述第三变换核对为(DCT-VIII,DST-VII),所述第四变换核对为(DST-VII,DCT-VIII)。Optionally, the first transformation check is (DCT-II, DTC-II), the second transformation check is (DST-VII, DST-VII), and the third transformation check is (DCT-VIII, DST-VII), and the fourth transformation check is (DST-VII, DCT-VIII).
可选地,作为一个实施例,在根据预设的第一映射关系信息获取所述残差块的候选变换核对之前,所述方法还包括:确定所述残差块对应的帧内预测模式为方向预测模式。Optionally, as an embodiment, before obtaining the candidate transformation check of the residual block according to preset first mapping relationship information, the method further includes: determining an intra prediction mode corresponding to the residual block as Direction prediction mode.
可选地,作为一个实施例,在根据预设的第一映射关系信息获取所述残差块的候选变换核对之前,所述方法还包括:确定所述残差块的宽和高均小于或者等于M。Optionally, as an embodiment, before obtaining candidate transformation check of the residual block according to preset first mapping relationship information, the method further includes: determining that the width and height of the residual block are both smaller than or Is equal to M.
可选地,作为一个实施例,当残差块的宽和高至少有一个大于M时,确定(DCT-II,DTC-II)为目标变换核对。Optionally, as an embodiment, when at least one of the width and height of the residual block is greater than M, (DCT-II, DTC-II) is determined as the target transformation check.
可选地,上述M的数值为64。Optionally, the value of M is 64.
本申请中,当残差块的尺寸较大时直接采用(DCT-II,DTC-II)作为目标变换核对进行变换,当残差块的尺寸较小时再根据第一映射关系信息最终确定目标变换核,能够实现对不同大小的残差块进行更好的变换。In this application, when the size of the residual block is large, (DCT-II, DTC-II) is directly used as the target transformation check to perform the transformation, and when the size of the residual block is small, the target transformation is finally determined according to the first mapping relationship information. The kernel can achieve better transformation of residual blocks of different sizes.
可选地,作为一个实施例,上述方法还包括:在所述残差块对应的帧内预测模式为DC模式的情况下,确定变换核对(DCT-II,DTC-II)为所述目标变换核对。Optionally, as an embodiment, the method further includes: in a case where an intra prediction mode corresponding to the residual block is a DC mode, determining a transform check (DCT-II, DTC-II) as the target transform Check.
可选地,作为一个实施例,上述方法还包括:在所述残差块对应的帧内预测模式为平面模式的情况下,确定变换核对(DST-VII,DST-VII)为所述目标变换核对。Optionally, as an embodiment, the above method further includes: determining a transformation check (DST-VII, DST-VII) as the target transformation when the intra prediction mode corresponding to the residual block is a planar mode. Check.
本申请中,当采用DC模式和平面模式对残差块进行量化时,可以直接采用预设的变换核对进行量化,能够节省遍历过程,进而减少编码所需要的时间。In this application, when the DC mode and the plane mode are used to quantize the residual block, a preset transformation check can be directly used for quantization, which can save the traversal process and further reduce the time required for encoding.
可选地,在所述残差块对应的帧内预测模式为平面模式且残差块的宽和高均小于或者 等于N的情况下,确定变换核对(DST-VII,DST-VII)为所述目标变换核对。Optionally, when the intra prediction mode corresponding to the residual block is a planar mode and the width and height of the residual block are both less than or equal to N, a transformation check (DST-VII, DST-VII) is determined as The target transformation check is described.
上述N的数值可以为4,8和16等。The value of N can be 4, 8, and 16 and so on.
上文分别结合图7和图8对本申请实施例的变换方法进行了详细的介绍,下面结合图9对编码端执行变换的过程进行详细的介绍。The transformation method of the embodiment of the present application is described in detail with reference to FIG. 7 and FIG. 8 respectively above, and the process of performing transformation at the encoding end is described in detail with reference to FIG. 9.
图9是本申请实施例的变换方法的示意性流程图。图9所示的方法可以由编码端设备执行,图9所示的方法包括步骤2001至步骤2009,下面分别对步骤2001至步骤2009进行详细的介绍。FIG. 9 is a schematic flowchart of a conversion method according to an embodiment of the present application. The method shown in FIG. 9 can be executed by a coding end device. The method shown in FIG. 9 includes steps 2001 to 2009, and steps 2001 to 2009 are described in detail below.
下面结合图9对本申请实施例的变换方法进行详细的介绍。图9所示的方法包括:The transformation method in the embodiment of the present application is described in detail below with reference to FIG. 9. The method shown in FIG. 9 includes:
2001、开始。2001, the beginning.
步骤2001表示开始对残差块执行变换操作。在进行变换操作之前可以是通过帧内预测得到当前块的预测块,然后再根据当前块以及当前块的预测块来得到当前块的残差块。2002、确定残差块的宽(W)和高(H)是否均小于或者等于N。Step 2001 represents the start of performing a transform operation on the residual block. Before performing the transform operation, a prediction block of the current block may be obtained through intra prediction, and then a residual block of the current block may be obtained according to the current block and the prediction block of the current block. 2002. Determine whether the width (W) and height (H) of the residual block are both less than or equal to N.
N的数值可以设置为64或者其它数值。The value of N can be set to 64 or other values.
当残差块的W和H至少有一个大于N时,执行步骤2003,当残差块的W和H均小于或者等于N时,执行步骤2004。When at least one of W and H of the residual block is greater than N, step 2003 is performed, and when both of W and H of the residual block are less than or equal to N, step 2004 is performed.
2003、将(DCT-II,DCT-II)确定为目标变换核对。In 2003, (DCT-II, DCT-II) was determined as the target transformation check.
当残差块的尺寸较大时,采用(DCT-II,DCT-II)对残差块进行变换能够取得较好的变换效果。When the size of the residual block is large, (DCT-II, DCT-II) can be used to transform the residual block to obtain a better transform effect.
2004、确定残差块对应的帧内预测模式是否为方向预测模式。2004. Determine whether the intra prediction mode corresponding to the residual block is a directional prediction mode.
应理解,残差块对应的帧内预测模式可以是在得到残差块的过程中所采用的帧内预测模式,具体地,残差块对应的帧内预测模式是在得到当前块的预测块的过程中采用的帧内预测模式。It should be understood that the intra prediction mode corresponding to the residual block may be the intra prediction mode used in the process of obtaining the residual block. Specifically, the intra prediction mode corresponding to the residual block is to obtain the predicted block of the current block. The intra prediction mode used in the process.
应理解,在步骤2004之前还可以先确定EMT标志位,如果当EMT标志位为0,那么就直接将(DCT-II,DCT-II)确定为目标变换核对;当EMT标志位为1时,执行步骤2004。It should be understood that the EMT flag can be determined before step 2004. If the EMT flag is 0, then (DCT-II, DCT-II) is directly determined as the target transformation check; when the EMT flag is 1, Go to step 2004.
2005、遍历多种变换核对,将率失真最小的变换核对确定为目标变换核对。In 2005, it traversed a variety of transformation checks, and determined the transformation check with the lowest rate distortion as the target transformation check.
在步骤2005中,具体可以根据图7和图8所示的方法中的第一映射关系信息来获取候选变换核对,然后再依次遍历这些候选变换核对,将率失真最小的变换核对确定为目标变换核对。In step 2005, candidate transformation checks can be obtained according to the first mapping relationship information in the methods shown in FIG. 7 and FIG. 8, and then these candidate transformation checks are traversed in order to determine the transformation check with the lowest rate distortion as the target transformation Check.
2006、确定帧内预测模式是否为DC模式。2006. Determine whether the intra prediction mode is a DC mode.
当帧内预测模式为DC模式时执行步骤2007,当帧内预测模式不是DC模式时(此时帧内预测模式为平面模式)执行步骤2008。Step 2007 is performed when the intra prediction mode is the DC mode, and step 2008 is performed when the intra prediction mode is not the DC mode (the intra prediction mode is the planar mode at this time).
2007、将(DCT-II,DTC-II)确定为目标变换核对。2007. Determine (DCT-II, DTC-II) as the target transformation check.
由于编码块的预测值是由参考像素值平均得到,因此DC模式适合于大面积平坦的区域,而DCT-II变换核适合于这类残差信号,因此,当帧内预测模式为DC模式时,将(DCT-II,DTC-II)确定为目标变换核对能够提高变换效果,并且在DC模式下能够减少指示目标变换核对所需要的比特数。Since the prediction value of the coded block is obtained by averaging the reference pixel values, the DC mode is suitable for a large area with a flat area, and the DCT-II transform kernel is suitable for such residual signals. Therefore, when the intra prediction mode is the DC mode , Determining (DCT-II, DTC-II) as the target transformation check can improve the transformation effect, and can reduce the number of bits required to indicate the target transformation check in the DC mode.
2008、将(DST-VII,DST-VII)确定为目标变换核对。In 2008, (DST-VII, DST-VII) was determined as the target transformation check.
2009、根据目标变换核对,对残差块进行变换,得到变换系数。2009. Transform the residual block according to the target transformation check to obtain the transformation coefficient.
应理解,在图9所示的过程中,在确定目标变换核对时还可以综合考虑非零系数的个数来确定目标变换核对。It should be understood that, in the process shown in FIG. 9, when determining the target transformation check, the number of non-zero coefficients may be comprehensively considered to determine the target transformation check.
应理解,图9所示的过程可以只是编码端进行变换的流程的一种示例,图9所示的过程可以仅包含编码端进行变换的部分过程。It should be understood that the process shown in FIG. 9 may only be an example of a process of transforming the encoding end, and the process shown in FIG. 9 may only include a part of the process of transforming the encoding end.
上文结合图1至图9对本申请实施例的反变换方法和变换方法进行了详细介绍,下面结合图10对本申请实施例的反变换装置进行介绍,图10所示的反变换装置能够执行本申请实施例的反变换方法中的各个步骤,上文中对本申请实施例的反变换方法的限定同样也适用于图10所示的反变换装置,为了避免不必要的重复,下面对本申请实施例的反变换装置进行介绍。The inverse transform method and transform method of the embodiment of the present application are described in detail above with reference to FIGS. 1 to 9. The inverse transform device of the embodiment of the present application is described below with reference to FIG. 10. The inverse transform device shown in FIG. For each step in the inverse transform method of the embodiment of the application, the limitation on the inverse transform method of the embodiment of the present application also applies to the inverse transform device shown in FIG. 10. In order to avoid unnecessary repetition, the following describes the The inverse conversion device will be described.
图10是本申请实施例的反变换装置的示意性框图。图10所示的反变换装置500包括:FIG. 10 is a schematic block diagram of an inverse transform apparatus according to an embodiment of the present application. The inverse transforming apparatus 500 shown in FIG. 10 includes:
获取模块510,用于解析码流以获取当前块的残差系数、帧内预测模式和目标变换核对确定参数,其中,所述目标变换核对确定参数包括第一标志位,或所述目标变换核对确定参数包括第一标志位和变换索引值;An obtaining module 510 is configured to parse a code stream to obtain a residual coefficient, an intra prediction mode, and a target transformation check determination parameter of a current block, where the target transformation check determination parameter includes a first flag bit or the target transformation check Determining parameters include a first flag bit and a transformation index value;
确定模块520,所述确定模块520用于:A determining module 520, the determining module 520 is configured to:
当所述第一标志位为第一取值时,确定与所述目标变换核对确定参数对应的目标变换核对为第一变换核对;When the first flag bit has a first value, determining a target transformation check corresponding to the target transformation check determination parameter as a first transformation check;
当所述第一标志位为第二取值且变换索引值为第一变换索引值时,确定与所述目标变换核对确定参数对应的目标变换核对为第二变换核对,其中,所述第二变换核对为第一候选变换核对或第二变候选变换核对,所述第一候选变换核对和所述第二变候选变换核对均包含变换核DST-VII,所述第一候选变换核对和所述第二变候选变换核对与所述当前块对应的帧内预测模式对应;When the first flag bit has a second value and the transformation index value is the first transformation index value, determining a target transformation check corresponding to the target transformation check determination parameter as a second transformation check, wherein the second transformation check The transformation check is a first candidate transformation check or a second transformation candidate transformation check, and the first candidate transformation check and the second transformation candidate check include a transformation kernel DST-VII, and the first candidate transformation check and the A second change candidate transformation check corresponding to an intra prediction mode corresponding to the current block;
当所述第一标志位为第二取值且所述变换索引值为第二变换索引值时,确定与所述目标变换核对确定参数对应的目标变换核对为第三变换核对;When the first flag bit has a second value and the transformation index value is a second transformation index value, determining a target transformation check corresponding to the target transformation check determination parameter as a third transformation check;
反变换模块530,用于根据所述目标变换核对,对所述残差系数进行反变换,得到残差块。An inverse transform module 530 is configured to perform inverse transform on the residual coefficient according to the target transform check to obtain a residual block.
本申请中,通过解析到的目标变换核对确定参数就可以确定目标变换核对,进而可以根据该目标变换核对实现对残差系数的反变换。In this application, the target transformation check can be determined through the determined target transformation check determination parameters, and the inverse transformation of the residual coefficient can be realized according to the target transformation check.
进一步的,由于第一候选变换核对和第二变换核对中均包含变换核DST-VII,可以使得最终确定的目标变换核对中包含变换核DST-VII的可能性增加,使得在根据目标变换核对,对残差系数进行反变换时可能会得到更好的反变换效果。Further, since the first candidate transformation check and the second transformation check both include a transformation kernel DST-VII, it is possible to increase the possibility of including the transformation kernel DST-VII in the final target transformation check, so that in the target transformation check, A better inverse transform effect may be obtained when inverse transforming the residual coefficients.
具体地,由于帧内预测模式时利用当前块的上边和右边的参考像素对当前块进行预测,并且预测误差有从上到下从左到右依次逐渐增大的趋势,而DST-VII的基函数是逐渐增大的,因此,DST-VII变换核适合这种逐渐增大的特性,采用DST-VII进行变换和反变换能够取得较好的效果。Specifically, because the intra prediction mode uses the top and right reference pixels of the current block to predict the current block, and the prediction error tends to gradually increase from top to bottom from left to right, the base of DST-VII The function is gradually increasing. Therefore, the DST-VII transformation kernel is suitable for this gradually increasing characteristic. Using DST-VII for transformation and inverse transformation can achieve better results.
也就是说,反变换装置500可以用于执行上述图4所示的方法中的步骤110至步骤130。That is, the inverse transforming apparatus 500 may be configured to perform steps 110 to 130 in the method shown in FIG. 4.
可选地,上述反变换装置500也可以用于执行上述图5所示的方法中的步骤210至步骤230。Optionally, the inverse transforming apparatus 500 may also be used to execute steps 210 to 230 in the method shown in FIG. 5.
具体地,当反变换装置500执行上述图5所示的方法中的步骤210至步骤230时,反 变换装置500中的各个模块的作用具体如下:Specifically, when the inverse transforming apparatus 500 performs steps 210 to 230 in the method shown in FIG. 5, the functions of the modules in the inverse transforming apparatus 500 are as follows:
获取模块510,用于解析码流以获取当前块的残差系数和目标变换核对确定参数,其中,所述目标变换核对确定参数包括第一标志位,或所述目标变换核对确定参数包括第一标志位和变换索引值;An obtaining module 510 is configured to parse a bitstream to obtain a residual coefficient of a current block and a target transformation check determination parameter, wherein the target transformation check determination parameter includes a first flag bit, or the target transformation check determination parameter includes a first flag Flag bit and transform index value;
确定模块520,所述确定模块520用于:A determining module 520, the determining module 520 is configured to:
当所述第一标志位为第一取值时,确定与所述目标变换核对确定参数对应的目标变换核对为第一变换核对;When the first flag bit has a first value, determining a target transformation check corresponding to the target transformation check determination parameter as a first transformation check;
当第一标志位为第二取值并且所述变换索引值为第一变换索引值时,确定与所述目标变换核对确定参数对应的目标变换核对为第二变换核对;When the first flag bit has a second value and the transformation index value is the first transformation index value, determining a target transformation check corresponding to the target transformation check determination parameter as a second transformation check;
当第一标志位为第二取值并且所述变换索引值为第二变换索引值时,确定与所述目标变换核对确定参数对应的目标变换核对为第三变换核对;When the first flag bit has a second value and the transformation index value is a second transformation index value, determining a target transformation check corresponding to the target transformation check determination parameter as a third transformation check;
当第一标志位为第二取值并且所述变换索引值为第三变换索引值时,确定与所述目标变换核对确定参数对应的目标变换核对为第四变换核对;When the first flag bit has a second value and the transformation index value is a third transformation index value, determining a target transformation check corresponding to the target transformation check determination parameter as a fourth transformation check;
其中,所述第二变换核对,所述第三变换核对和第四变换核对均包括变换核DST-VII,所述第二变换核对,所述第三变换核对和所述第四变换核对中至少一个变换核对包括变换核DCT-VIII;The second transformation check, the third transformation check, and the fourth transformation check each include a transformation kernel DST-VII, the second transformation check, the third transformation check, and the fourth transformation check. A transformation check includes the transformation kernel DCT-VIII;
反变换模块530,用于根据所述目标变换核对,对所述残差系数进行反变换,得到残差块。An inverse transform module 530 is configured to perform inverse transform on the residual coefficient according to the target transform check to obtain a residual block.
本申请中,通过解析到的目标变换核对确定参数就可以确定目标变换核对,进而可以根据该目标变换核对实现对残差系数的反变换。In this application, the target transformation check can be determined through the determined target transformation check determination parameters, and the inverse transformation of the residual coefficient can be realized according to the target transformation check.
进一步的,由于第一候选变换核对和第二变换核对中均包含变换核DST-VII,可以使得最终确定的目标变换核对中包含变换核DST-VII的可能性增加,使得在根据目标变换核对,对残差系数进行反变换时可能会得到更好的反变换效果。Further, since the first candidate transformation check and the second transformation check both include a transformation kernel DST-VII, it is possible to increase the possibility of including the transformation kernel DST-VII in the final target transformation check, so that in the target transformation check, A better inverse transform effect may be obtained when inverse transforming the residual coefficients.
具体地,由于帧内预测模式时利用当前块的上边和右边的参考像素对当前块进行预测,并且预测误差有从上到下从左到右依次逐渐增大的趋势,而DST-VII的基函数是逐渐增大的,因此,DST-VII变换核适合这种逐渐增大的特性,采用DST-VII进行变换和反变换能够取得较好的效果。Specifically, because the intra prediction mode uses the top and right reference pixels of the current block to predict the current block, and the prediction error tends to gradually increase from top to bottom from left to right, the base of DST-VII The function is gradually increasing. Therefore, the DST-VII transformation kernel is suitable for this gradually increasing characteristic. Using DST-VII for transformation and inverse transformation can achieve better results.
图11是本申请实施例的视频解码器的示意性框图。FIG. 11 is a schematic block diagram of a video decoder according to an embodiment of the present application.
图11所示的视频解码器600包括:熵解码模块610、反变换反量化模块620、解码端预测模块630、解码重建模块640和解码端滤波模块650。The video decoder 600 shown in FIG. 11 includes: an entropy decoding module 610, an inverse transform and inverse quantization module 620, a decoding end prediction module 630, a decoding reconstruction module 640, and a decoding end filtering module 650.
可选的,上述反变换装置500与视频解码器600是对应的,反变换装置500具体可以是一个解码器。其中,反变换装置500与视频解码器600中的各个模块的对应关系如下:Optionally, the inverse transforming device 500 corresponds to the video decoder 600, and the inverse transforming device 500 may specifically be a decoder. The corresponding relationship between the inverse transforming device 500 and each module in the video decoder 600 is as follows:
获取模块510相当于熵解码模块610,用于获取残差系数和第一标志位等信息;The obtaining module 510 is equivalent to the entropy decoding module 610, and is configured to obtain information such as a residual coefficient and a first flag bit;
确定模块520和反变换模块530相当于反变换反量化模块620,用于实现对残差系数进行反变换,得到残差块。The determination module 520 and the inverse transform module 530 are equivalent to the inverse transform and inverse quantization module 620, and are configured to perform inverse transform on the residual coefficients to obtain residual blocks.
图12是本申请实施例的视频编码器的示意性框图。FIG. 12 is a schematic block diagram of a video encoder according to an embodiment of the present application.
图12所示的视频编码器700包括:编码端预测模块710、变换量化模块720、熵编码模块730、编码重建模块740和编码端滤波模块750。图12所示的视频编码器能够执行本申请实施例的变换方法。The video encoder 700 shown in FIG. 12 includes an encoding end prediction module 710, a transform quantization module 720, an entropy encoding module 730, an encoding reconstruction module 740, and an encoding end filtering module 750. The video encoder shown in FIG. 12 can execute the transformation method in the embodiment of the present application.
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。Those of ordinary skill in the art may realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. A professional technician can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices, and units described above can refer to the corresponding processes in the foregoing method embodiments, and are not repeated here.
在本申请所提供的几个实施例中,应该理解到,所揭露的系统、装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed systems, devices, and methods may be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the unit is only a logical function division. In actual implementation, there may be another division manner. For example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored or not implemented. In addition, the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, which may be electrical, mechanical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the objective of the solution of this embodiment.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each of the units may exist separately physically, or two or more units may be integrated into one unit.
所述功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(read-only memory,ROM)、随机存取存储器(random access memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。When the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially a part that contributes to the existing technology or a part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including Several instructions are used to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in the embodiments of the present application. The aforementioned storage media include: U disks, mobile hard disks, read-only memories (ROM), random access memories (RAM), magnetic disks or optical disks, and other media that can store program codes .
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变换或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。The above is only a specific implementation of this application, but the scope of protection of this application is not limited to this. Any person skilled in the art can easily think of changes or replacements within the technical scope disclosed in this application. It should be covered by the protection scope of this application. Therefore, the protection scope of this application shall be subject to the protection scope of the claims.

Claims (28)

  1. 一种反变换方法,其特征在于,包括:An inverse transform method, comprising:
    解析码流以获取当前块的残差系数、帧内预测模式和目标变换核对确定参数,其中,所述目标变换核对确定参数包括第一标志位,或所述目标变换核对确定参数包括第一标志位和变换索引值;Parse the bitstream to obtain the residual coefficient, the intra prediction mode, and the target transformation check determination parameter of the current block, wherein the target transformation check determination parameter includes a first flag bit, or the target transformation check determination parameter includes a first flag Bit and transform index values;
    当所述第一标志位为第一取值时,确定与所述目标变换核对确定参数对应的目标变换核对为第一变换核对;When the first flag bit has a first value, determining a target transformation check corresponding to the target transformation check determination parameter as a first transformation check;
    当所述第一标志位为第二取值且变换索引值为第一变换索引值时,确定与所述目标变换核对确定参数对应的目标变换核对为第二变换核对,其中,所述第二变换核对为第一候选变换核对或第二变候选变换核对,所述第一候选变换核对和所述第二变候选变换核对均包含变换核DST-VII,所述第一候选变换核对和所述第二变候选变换核对与所述当前块对应的帧内预测模式对应;When the first flag bit has a second value and the transformation index value is the first transformation index value, determining a target transformation check corresponding to the target transformation check determination parameter as a second transformation check, wherein the second transformation check The transformation check is a first candidate transformation check or a second transformation candidate transformation check, and the first candidate transformation check and the second transformation candidate check include a transformation kernel DST-VII, and the first candidate transformation check and the A second change candidate transformation check corresponding to an intra prediction mode corresponding to the current block;
    当所述第一标志位为第二取值且所述变换索引值为第二变换索引值时,确定与所述目标变换核对确定参数对应的目标变换核对为第三变换核对;When the first flag bit has a second value and the transformation index value is a second transformation index value, determining a target transformation check corresponding to the target transformation check determination parameter as a third transformation check;
    根据所述目标变换核对,对所述残差系数进行反变换,得到残差块。According to the target transformation check, the residual coefficient is inversely transformed to obtain a residual block.
  2. 如权利要求1所述的方法,其特征在于,所述第一候选变换核对为(DST-VII,DCT-VIII),第二候选变换核对为(DCT-VIII,DST-VII);The method of claim 1, wherein the first candidate transformation check is (DST-VII, DCT-VIII), and the second candidate transformation check is (DCT-VIII, DST-VII);
    当所述当前块对应的帧内预测模式的模式号小于或者等于预设阈值时,所述第二变换核对为所述第一候选变换核对;When the mode number of the intra prediction mode corresponding to the current block is less than or equal to a preset threshold, the second transformation check is the first candidate transformation check;
    当所述当前块对应的帧内预测模式的模式号大于所述预设阈值时,所述第二变换核对为所述第二候选变换核对。When the mode number of the intra prediction mode corresponding to the current block is greater than the preset threshold, the second transformation check is the second candidate transformation check.
  3. 如权利要求1或2所述的方法,其特征在于,所述第三变换核对为(DST-VII,DST-VII)。The method according to claim 1 or 2, wherein the third transformation check is (DST-VII, DST-VII).
  4. 如权利要求1-3中任一项所述的方法,其特征在于,所述第一变换索引值和所述第二变换索引值对应的码字的长度均为1。The method according to any one of claims 1-3, wherein a length of a codeword corresponding to the first transformation index value and the second transformation index value is both 1.
  5. 如权利要求1-4中任一项所述的方法,其特征在于,所述第一变换核对为(DCT-II,DTC-II)。The method according to any one of claims 1-4, wherein the first transformation check is (DCT-II, DTC-II).
  6. 如权利要求1-5中任一项所述的方法,其特征在于,在确定所述目标变换核对之前,所述方法还包括:The method according to any one of claims 1-5, wherein before determining the target transformation check, the method further comprises:
    确定所述当前块对应的帧内预测模式为方向预测模式。It is determined that the intra prediction mode corresponding to the current block is a directional prediction mode.
  7. 如权利要求1所述的方法,其特征在于,所述方法还包括:The method of claim 1, further comprising:
    在所述当前块对应的帧内预测模式为DC模式的情况下,确定变换核对(DCT-II,DTC-II)为所述目标变换核对。When the intra prediction mode corresponding to the current block is a DC mode, a transformation check (DCT-II, DTC-II) is determined as the target transformation check.
  8. 如权利要求如权利要求1所述的方法,其特征在于,所述方法还包括:The method according to claim 1, further comprising:
    在所述当前块对应的帧内预测模式为平面模式的情况下,确定变换核对(DST-VII,DST-VII)为所述目标变换核对。When the intra prediction mode corresponding to the current block is a planar mode, a transformation check (DST-VII, DST-VII) is determined as the target transformation check.
  9. 一种反变换方法,其特征在于,包括:An inverse transform method, comprising:
    解析码流以获取当前块的残差系数和目标变换核对确定参数,其中,所述目标变换核对确定参数包括第一标志位,或所述目标变换核对确定参数包括第一标志位和变换索引值;Parse the bitstream to obtain the residual coefficient of the current block and the target transformation check determination parameter, wherein the target transformation check determination parameter includes a first flag bit, or the target transformation check determination parameter includes a first flag bit and a transformation index value ;
    当所述第一标志位为第一取值时,确定与所述目标变换核对确定参数对应的目标变换核对为第一变换核对;When the first flag bit has a first value, determining a target transformation check corresponding to the target transformation check determination parameter as a first transformation check;
    当第一标志位为第二取值并且所述变换索引值为第一变换索引值时,确定与所述目标变换核对确定参数对应的目标变换核对为第二变换核对;When the first flag bit has a second value and the transformation index value is the first transformation index value, determining a target transformation check corresponding to the target transformation check determination parameter as a second transformation check;
    当第一标志位为第二取值并且所述变换索引值为第二变换索引值时,确定与所述目标变换核对确定参数对应的目标变换核对为第三变换核对;When the first flag bit has a second value and the transformation index value is a second transformation index value, determining a target transformation check corresponding to the target transformation check determination parameter as a third transformation check;
    当第一标志位为第二取值并且所述变换索引值为第三变换索引值时,确定与所述目标变换核对确定参数对应的目标变换核对为第四变换核对;When the first flag bit has a second value and the transformation index value is a third transformation index value, determining a target transformation check corresponding to the target transformation check determination parameter as a fourth transformation check;
    其中,所述第二变换核对,所述第三变换核对和第四变换核对均包括变换核DST-VII,所述第二变换核对,所述第三变换核对和所述第四变换核对中至少一个变换核对包括变换核DCT-VIII;The second transformation check, the third transformation check, and the fourth transformation check each include a transformation kernel DST-VII, the second transformation check, the third transformation check, and the fourth transformation check. A transformation check includes the transformation kernel DCT-VIII;
    根据所述目标变换核对,对所述残差系数进行反变换,得到残差块。According to the target transformation check, the residual coefficient is inversely transformed to obtain a residual block.
  10. 如权利要求9所述的方法,其特征在于,所述第一变换索引值对应的码字的长度为1,所述第二变换索引值和第三变换索引值对应的码字的长度均为2。The method according to claim 9, wherein the length of the codeword corresponding to the first transformation index value is 1, and the length of the codeword corresponding to the second transformation index value and the third transformation index value are both 2.
  11. 如权利要求9或10所述的方法,其特征在于,所述第一变换核对为(DCT-II,DTC-II),所述第二变换核对为(DST-VII,DST-VII),所述第三变换核对为(DCT-VIII,DST-VII),所述第四变换核对为(DST-VII,DCT-VIII)。The method according to claim 9 or 10, wherein the first transformation check is (DCT-II, DTC-II), and the second transformation check is (DST-VII, DST-VII), so The third transformation check is (DCT-VIII, DST-VII), and the fourth transformation check is (DST-VII, DCT-VIII).
  12. 如权利要求9-11中任一项所述的方法,其特征在于,在确定所述目标变换核对之前,所述方法还包括:The method according to any one of claims 9-11, wherein before determining the target transformation check, the method further comprises:
    确定所述当前块对应的帧内预测模式为方向预测模式。It is determined that the intra prediction mode corresponding to the current block is a directional prediction mode.
  13. 如权利要求9所述的方法,其特征在于,所述方法还包括:The method of claim 9, further comprising:
    在所述当前块对应的帧内预测模式为DC模式的情况下,确定变换核对(DCT-II,DTC-II)为所述目标变换核对。When the intra prediction mode corresponding to the current block is a DC mode, a transformation check (DCT-II, DTC-II) is determined as the target transformation check.
  14. 如权利要求9所述的方法,其特征在于,所述方法还包括:The method of claim 9, further comprising:
    在所述当前块对应的帧内预测模式为平面模式的情况下,确定变换核对(DST-VII,DST-VII)为所述目标变换核对。When the intra prediction mode corresponding to the current block is a planar mode, a transformation check (DST-VII, DST-VII) is determined as the target transformation check.
  15. 一种反变换装置,其特征在于,包括:An inverse transforming device, comprising:
    获取模块,用于解析码流以获取当前块的残差系数、帧内预测模式和目标变换核对确定参数,其中,所述目标变换核对确定参数包括第一标志位,或所述目标变换核对确定参数包括第一标志位和变换索引值;An obtaining module, configured to parse a bitstream to obtain a residual coefficient, an intra prediction mode, and a target transformation check determination parameter of a current block, wherein the target transformation check determination parameter includes a first flag bit or the target transformation check determination The parameters include a first flag bit and a transformation index value.
    确定模块,所述确定模块用于:A determining module for:
    当所述第一标志位为第一取值时,确定与所述目标变换核对确定参数对应的目标变换核对为第一变换核对;When the first flag bit has a first value, determining a target transformation check corresponding to the target transformation check determination parameter as a first transformation check;
    当所述第一标志位为第二取值且变换索引值为第一变换索引值时,确定与所述目标变换核对确定参数对应的目标变换核对为第二变换核对,其中,所述第二变换核对为第一候选变换核对或第二变候选变换核对,所述第一候选变换核对和所述第二变候选变换核对均 包含变换核DST-VII,所述第一候选变换核对和所述第二变候选变换核对与所述当前块对应的帧内预测模式对应;When the first flag bit has a second value and the transformation index value is the first transformation index value, determining a target transformation check corresponding to the target transformation check determination parameter as a second transformation check, wherein the second transformation check The transformation check is a first candidate transformation check or a second transformation candidate transformation check, and the first candidate transformation check and the second transformation candidate check include a transformation kernel DST-VII, and the first candidate transformation check and the A second change candidate transformation check corresponding to an intra prediction mode corresponding to the current block;
    当所述第一标志位为第二取值且所述变换索引值为第二变换索引值时,确定与所述目标变换核对确定参数对应的目标变换核对为第三变换核对;When the first flag bit has a second value and the transformation index value is a second transformation index value, determining a target transformation check corresponding to the target transformation check determination parameter as a third transformation check;
    反变换模块,用于根据所述目标变换核对,对所述残差系数进行反变换,得到残差块。An inverse transform module is configured to perform inverse transform on the residual coefficient according to the target transform check to obtain a residual block.
  16. 如权利要求15所述的装置,其特征在于,所述第一候选变换核对为(DST-VII,DCT-VIII),第二候选变换核对为(DCT-VIII,DST-VII);The apparatus according to claim 15, wherein the first candidate transformation check is (DST-VII, DCT-VIII), and the second candidate transformation check is (DCT-VIII, DST-VII);
    当所述当前块对应的帧内预测模式的模式号小于或者等于预设阈值时,所述第二变换核对为所述第一候选变换核对;When the mode number of the intra prediction mode corresponding to the current block is less than or equal to a preset threshold, the second transformation check is the first candidate transformation check;
    当所述当前块对应的帧内预测模式的模式号大于所述预设阈值时,所述第二变换核对为所述第二候选变换核对。When the mode number of the intra prediction mode corresponding to the current block is greater than the preset threshold, the second transformation check is the second candidate transformation check.
  17. 如权利要求15或16所述的装置,其特征在于,所述第三变换核对为(DST-VII,DST-VII)。The device according to claim 15 or 16, wherein the third transformation check is (DST-VII, DST-VII).
  18. 如权利要求15-17中任一项所述的装置,其特征在于,所述第一变换索引值和所述第二变换索引值对应的码字的长度均为1。The device according to any one of claims 15 to 17, wherein a length of a codeword corresponding to the first transformation index value and the second transformation index value is both 1.
  19. 如权利要求15-18中任一项所述的装置,其特征在于,所述第一变换核对为(DCT-II,DTC-II)。The device according to any one of claims 15 to 18, wherein the first transformation check is (DCT-II, DTC-II).
  20. 如权利要求15-19中任一项所述的装置,其特征在于,在确定所述目标变换核对之前,所述确定模块还用于:The apparatus according to any one of claims 15 to 19, wherein before determining the target transformation check, the determining module is further configured to:
    确定所述当前块对应的帧内预测模式为方向预测模式。It is determined that the intra prediction mode corresponding to the current block is a directional prediction mode.
  21. 如权利要求15所述的装置,其特征在于,所述确定模块还用于:The apparatus according to claim 15, wherein the determining module is further configured to:
    在所述当前块对应的帧内预测模式为DC模式的情况下,确定变换核对(DCT-II,DTC-II)为所述目标变换核对。When the intra prediction mode corresponding to the current block is a DC mode, a transformation check (DCT-II, DTC-II) is determined as the target transformation check.
  22. 如权利要求如权利要求15所述的装置,其特征在于,所述确定模块还用于:The apparatus according to claim 15, wherein the determining module is further configured to:
    在所述当前块对应的帧内预测模式为平面模式的情况下,确定变换核对(DST-VII,DST-VII)为所述目标变换核对。When the intra prediction mode corresponding to the current block is a planar mode, a transformation check (DST-VII, DST-VII) is determined as the target transformation check.
  23. 一种反变换装置,其特征在于,包括:An inverse transforming device, comprising:
    获取模块,用于解析码流以获取当前块的残差系数和目标变换核对确定参数,其中,所述目标变换核对确定参数包括第一标志位,或所述目标变换核对确定参数包括第一标志位和变换索引值;An obtaining module, configured to parse a bitstream to obtain a residual coefficient of a current block and a target transformation check determination parameter, wherein the target transformation check determination parameter includes a first flag bit, or the target transformation check determination parameter includes a first flag Bit and transform index values;
    确定模块,所述确定模块用于:A determining module for:
    当所述第一标志位为第一取值时,确定与所述目标变换核对确定参数对应的目标变换核对为第一变换核对;When the first flag bit has a first value, determining a target transformation check corresponding to the target transformation check determination parameter as a first transformation check;
    当第一标志位为第二取值并且所述变换索引值为第一变换索引值时,确定与所述目标变换核对确定参数对应的目标变换核对为第二变换核对;When the first flag bit has a second value and the transformation index value is the first transformation index value, determining a target transformation check corresponding to the target transformation check determination parameter as a second transformation check;
    当第一标志位为第二取值并且所述变换索引值为第二变换索引值时,确定与所述目标变换核对确定参数对应的目标变换核对为第三变换核对;When the first flag bit has a second value and the transformation index value is a second transformation index value, determining a target transformation check corresponding to the target transformation check determination parameter as a third transformation check;
    当第一标志位为第二取值并且所述变换索引值为第三变换索引值时,确定与所述目标变换核对确定参数对应的目标变换核对为第四变换核对;When the first flag bit has a second value and the transformation index value is a third transformation index value, determining a target transformation check corresponding to the target transformation check determination parameter as a fourth transformation check;
    其中,所述第二变换核对,所述第三变换核对和第四变换核对均包括变换核DST-VII,所述第二变换核对,所述第三变换核对和所述第四变换核对中至少一个变换核对包括变换核DCT-VIII;The second transformation check, the third transformation check, and the fourth transformation check each include a transformation kernel DST-VII, the second transformation check, the third transformation check, and the fourth transformation check. A transformation check includes the transformation kernel DCT-VIII;
    反变换模块,用于根据所述目标变换核对,对所述残差系数进行反变换,得到残差块。An inverse transform module is configured to perform inverse transform on the residual coefficient according to the target transform check to obtain a residual block.
  24. 如权利要求23所述的装置,其特征在于,所述第一变换索引值对应的码字的长度为1,所述第二变换索引值和第三变换索引值对应的码字的长度均为2。The apparatus according to claim 23, wherein the length of the codeword corresponding to the first transformation index value is 1, and the length of the codeword corresponding to the second transformation index value and the third transformation index value are both 2.
  25. 如权利要求22或23所述的装置,其特征在于,所述第一变换核对为(DCT-II,DTC-II),所述第二变换核对为(DST-VII,DST-VII),所述第三变换核对为(DCT-VIII,DST-VII),所述第四变换核对为(DST-VII,DCT-VIII)。The device according to claim 22 or 23, wherein the first transformation check is (DCT-II, DTC-II), and the second transformation check is (DST-VII, DST-VII), so The third transformation check is (DCT-VIII, DST-VII), and the fourth transformation check is (DST-VII, DCT-VIII).
  26. 如权利要求23-25中任一项所述的装置,其特征在于,在确定所述目标变换核对之前,所述确定模块还用于:The apparatus according to any one of claims 23 to 25, wherein before determining the target transformation check, the determining module is further configured to:
    确定所述当前块对应的帧内预测模式为方向预测模式。It is determined that the intra prediction mode corresponding to the current block is a directional prediction mode.
  27. 如权利要求23所述的装置,其特征在于,所述确定模块还用于:The apparatus according to claim 23, wherein the determining module is further configured to:
    在所述当前块对应的帧内预测模式为DC模式的情况下,确定变换核对(DCT-II,DTC-II)为所述目标变换核对。When the intra prediction mode corresponding to the current block is a DC mode, a transformation check (DCT-II, DTC-II) is determined as the target transformation check.
  28. 如权利要求23所述的装置,其特征在于,所述确定模块还用于:The apparatus according to claim 23, wherein the determining module is further configured to:
    在所述当前块对应的帧内预测模式为平面模式的情况下,确定变换核对(DST-VII,DST-VII)为所述目标变换核对。When the intra prediction mode corresponding to the current block is a planar mode, a transformation check (DST-VII, DST-VII) is determined as the target transformation check.
PCT/CN2018/093923 2018-06-30 2018-06-30 Transformation method, inverse transformation method and apparatus WO2020000487A1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/CN2018/093923 WO2020000487A1 (en) 2018-06-30 2018-06-30 Transformation method, inverse transformation method and apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2018/093923 WO2020000487A1 (en) 2018-06-30 2018-06-30 Transformation method, inverse transformation method and apparatus

Publications (1)

Publication Number Publication Date
WO2020000487A1 true WO2020000487A1 (en) 2020-01-02

Family

ID=68985695

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/093923 WO2020000487A1 (en) 2018-06-30 2018-06-30 Transformation method, inverse transformation method and apparatus

Country Status (1)

Country Link
WO (1) WO2020000487A1 (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130003828A1 (en) * 2011-07-01 2013-01-03 Cohen Robert A Method for Selecting Transform Types From Mapping Table for Prediction Modes
CN104469488A (en) * 2014-12-29 2015-03-25 北京奇艺世纪科技有限公司 Video decoding method and system
CN107241599A (en) * 2011-10-19 2017-10-10 株式会社Kt The method of decoding video signal
US20180020218A1 (en) * 2016-07-15 2018-01-18 Qualcomm Incorporated Look-up table for enhanced multiple transform

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130003828A1 (en) * 2011-07-01 2013-01-03 Cohen Robert A Method for Selecting Transform Types From Mapping Table for Prediction Modes
CN107241599A (en) * 2011-10-19 2017-10-10 株式会社Kt The method of decoding video signal
CN104469488A (en) * 2014-12-29 2015-03-25 北京奇艺世纪科技有限公司 Video decoding method and system
US20180020218A1 (en) * 2016-07-15 2018-01-18 Qualcomm Incorporated Look-up table for enhanced multiple transform

Similar Documents

Publication Publication Date Title
KR102292592B1 (en) Method and apparatus for decoding image
TWI755376B (en) Geometric transforms for filters for video coding
CN111819852B (en) Method and apparatus for residual symbol prediction in the transform domain
KR102271143B1 (en) Methods of decoding using skip mode and apparatuses for using the same
CN111819854B (en) Method and apparatus for coordinating multi-sign bit concealment and residual sign prediction
US20150063452A1 (en) High efficiency video coding (hevc) intra prediction encoding apparatus and method
KR102393179B1 (en) Method and apparatus for generating reconstruction block
GB2488830A (en) Encoding and decoding image data
CN111801941B (en) Method and apparatus for image filtering using adaptive multiplier coefficients
US20230087855A1 (en) Picture coding method, picture decoding method, and related apparatuses
JP7384974B2 (en) Method and apparatus for image filtering using adaptive multiplication coefficients
WO2021185257A1 (en) Image coding method, image decoding method and related apparatuses
CN113597757A (en) Shape adaptive discrete cosine transform with region number adaptive geometric partitioning
JP7286783B2 (en) Encoding method, decoding method, decoder, encoder and storage medium
WO2021244197A1 (en) Image encoding method, image decoding method, and related apparatuses
WO2022022622A1 (en) Image coding method, image decoding method, and related apparatus
CN114071161B (en) Image encoding method, image decoding method and related devices
WO2020000487A1 (en) Transformation method, inverse transformation method and apparatus
WO2023154359A1 (en) Methods and devices for multi-hypothesis-based prediction
KR101307469B1 (en) Video encoder, video decoder, video encoding method, and video decoding method
CN117581547A (en) Side window bilateral filtering for video encoding and decoding
KR20200050111A (en) Method and apparatus for encoding/decoding image using transformation of axis of color coordinate

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: 18924297

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 18924297

Country of ref document: EP

Kind code of ref document: A1