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

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

Info

Publication number
WO2021134327A1
WO2021134327A1 PCT/CN2019/130157 CN2019130157W WO2021134327A1 WO 2021134327 A1 WO2021134327 A1 WO 2021134327A1 CN 2019130157 W CN2019130157 W CN 2019130157W WO 2021134327 A1 WO2021134327 A1 WO 2021134327A1
Authority
WO
WIPO (PCT)
Prior art keywords
lfnst
value
mip
current block
transform
Prior art date
Application number
PCT/CN2019/130157
Other languages
English (en)
French (fr)
Inventor
霍俊彦
李新伟
乔文涵
马彦卓
万帅
杨付正
Original Assignee
Oppo广东移动通信有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Oppo广东移动通信有限公司 filed Critical Oppo广东移动通信有限公司
Priority to CN201980103146.XA priority Critical patent/CN114830664A/zh
Priority to PCT/CN2019/130157 priority patent/WO2021134327A1/zh
Priority to EP19958505.0A priority patent/EP4087253A4/en
Publication of WO2021134327A1 publication Critical patent/WO2021134327A1/zh
Priority to US17/842,995 priority patent/US20220329862A1/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/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/12Selection from among a plurality of transforms or standards, e.g. selection between discrete cosine transform [DCT] and sub-band transform or selection between H.263 and H.264
    • 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/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/157Assigned coding mode, i.e. the coding mode being predefined or preselected to be further used for selection of another element or parameter
    • H04N19/159Prediction type, e.g. intra-frame, inter-frame or bidirectional frame prediction
    • 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/17Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
    • H04N19/176Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a block, e.g. a macroblock
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • H04N19/593Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving spatial prediction techniques
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/60Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding
    • H04N19/61Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding in combination with predictive coding
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/70Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by syntax aspects related to video coding, e.g. related to compression standards

Definitions

  • the embodiments of the present application relate to the field of image processing technologies, and in particular, to a transformation method, an encoder, a decoder, and a storage medium.
  • VVC High Efficiency Video Coding
  • VTM VVC Test Model
  • the simplified secondary transform (Reduced Second Transform, RST) technology has been accepted, and the name has been changed to Low-Frequency Non-Separable Transform (LFNST) technology. Since the selection of the transform set in the LFNST technology is based on the intra prediction mode, but for the non-traditional intra prediction mode, the lack of variability when performing the LFNST transform reduces the coding efficiency.
  • RST Reduced Second Transform
  • LFNST Low-Frequency Non-Separable Transform
  • the embodiments of the present application provide a transformation method, an encoder, a decoder, and a storage medium, which can improve the applicability of the LFNST technology to non-traditional intra prediction modes, make the selection of the transformation set more flexible, and improve the coding and decoding efficiency.
  • an embodiment of the present application provides a transformation method, which is applied to an encoder, and the method includes:
  • the current block uses the low-frequency inseparable secondary transformation LFNST, determine the LFNST transformation core used by the current block according to the MIP parameters, set the LFNST index number and write it into the video code stream;
  • an embodiment of the present application provides a transformation method applied to a decoder, and the method includes:
  • the prediction mode parameter indicates that the current block uses MIP to determine the intra-frame prediction value, parse the code stream to determine the MIP parameter;
  • an encoder which includes a first determining unit, a first calculating unit, and a first transforming unit; wherein,
  • the first determining unit is configured to determine the prediction mode parameter of the current block
  • the first determining unit is further configured to determine the MIP parameter when the prediction mode parameter indicates that the current block uses the matrix-based intra prediction MIP to determine the intra prediction value;
  • the first calculation unit is configured to determine the intra-frame prediction value of the current block according to the MIP parameter, and calculate the prediction difference between the current block and the intra-frame prediction value;
  • the first determining unit is further configured to determine the LFNST transformation core used by the current block according to the MIP parameters when the current block uses the low-frequency inseparable secondary transformation LFNST, set the LFNST index number, and write it into the video code stream ;
  • the first transformation unit is configured to use the LFNST transformation core to perform transformation processing on the prediction difference.
  • an encoder which includes a first memory and a first processor; wherein,
  • the first memory is used to store a computer program that can run on the first processor
  • the first processor is configured to execute the method described in the first aspect when the computer program is running.
  • an embodiment of the present application provides a decoder, which includes a parsing unit, a second determining unit, and a second transforming unit; wherein,
  • the parsing unit is configured to parse the code stream to determine the prediction mode parameter of the current block; and further configured to parse the code stream to determine the MIP parameter when the prediction mode parameter indicates that the current block uses MIP to determine the intra prediction value; and It is also configured to parse the code stream and determine the transform coefficient and LFNST index number of the current block;
  • a second determining unit configured to determine the LFNST transform core used by the current block according to the MIP parameter when the LFNST index sequence number indicates that the current block uses LFNST;
  • the second transform unit is configured to use the LFNST transform core to perform transform processing on the transform coefficient.
  • an embodiment of the present application provides a decoder, which includes a second memory and a second processor; wherein,
  • the second memory is used to store a computer program that can run on the second processor
  • the second processor is configured to execute the method described in the second aspect when the computer program is running.
  • an embodiment of the present application provides a computer storage medium that stores a computer program that, when executed by a first processor, implements the method described in the first aspect, or is executed by a second
  • the processor implements the method described in the second aspect when executed.
  • the embodiments of the application provide a transformation method, an encoder, a decoder, and a storage medium, which determine the prediction mode parameter of the current block; when the prediction mode parameter indicates that the current block uses the MIP to determine the intra prediction value, it is determined MIP parameters; determine the intra prediction value of the current block according to the MIP parameters, and calculate the prediction difference between the current block and the intra prediction value; when the current block uses LFNST, according to the The MIP parameter determines the LFNST transform core used by the current block, sets the LFNST index number and writes it into the video code stream; uses the LFNST transform core to transform the prediction difference.
  • the selection of the LFNST transformation core is more flexible, which not only improves the applicability of the LFNST technology to non-traditional intra prediction modes, but also Improve the coding and decoding efficiency, but also can improve the video image quality.
  • Figure 1 is a schematic diagram of the application location of a LFNST technology provided by related technical solutions
  • FIG. 2A is a block diagram of a video encoding system provided by an embodiment of this application.
  • 2B is a block diagram of a video decoding system provided by an embodiment of this application.
  • FIG. 3 is a schematic flowchart of a conversion method provided by an embodiment of this application.
  • FIG. 4 is a flowchart of a MIP prediction process provided by an embodiment of this application.
  • FIG. 5 is a schematic structural diagram of a calculation process of a matrix multiplication of LFNST technology provided by an embodiment of the application;
  • Fig. 6A is a structural block diagram of an LFNST transform provided by related technical solutions
  • Fig. 6B is a structural block diagram of another LFNST transform provided by related technical solutions.
  • Fig. 6C is a structural block diagram of yet another LFNST transform provided by related technical solutions.
  • Fig. 6D is a structural block diagram of yet another LFNST transform provided by related technical solutions.
  • FIG. 7 is a schematic flowchart of another conversion method provided by an embodiment of the application.
  • FIG. 8 is a flowchart of a specific process of LFNST according to an embodiment of the application.
  • FIG. 9 is a schematic diagram of the composition structure of an encoder provided by an embodiment of the application.
  • FIG. 10 is a schematic diagram of a specific hardware structure of an encoder provided by an embodiment of the application.
  • FIG. 11 is a schematic diagram of the composition structure of a decoder provided by an embodiment of the application.
  • FIG. 12 is a schematic diagram of a specific hardware structure of a decoder provided by an embodiment of the application.
  • the first image component, the second image component, and the third image component are generally used to represent the coding block (CB); among them, the three image components are a luminance component and a blue chrominance component. And a red chrominance component, specifically, the luminance component is usually represented by the symbol Y, the blue chrominance component is usually represented by the symbol Cb or U, and the red chrominance component is usually represented by the symbol Cr or V; in this way, the video image can be in YCbCr format It can also be expressed in YUV format.
  • CB coding block
  • the first image component may be a luminance component
  • the second image component may be a blue chrominance component
  • the third image component may be a red chrominance component
  • FIG. 1 shows a schematic diagram of the application position of an LFNST technology provided by related technical solutions.
  • LFNST technology is applied between the positive primary transformation unit 11 and the quantization unit 12, and between the inverse quantization unit 13 and the inverse primary transformation unit 14. LFNST technology.
  • the positive primary transformation unit 11 performs the first transformation (which can be called “Core Transform” or “primary transformation” or “ Primary transformation”) to obtain the transformation coefficient matrix after the first transformation; then perform LFNST transformation (may be called “Secondary Transform” or “secondary transformation") on the coefficients in the transformation coefficient matrix to obtain LFNST transformation coefficients
  • LFNST transformation may be called “Secondary Transform” or “secondary transformation”
  • the matrix is finally quantized by the quantization unit 12 for the LFNST transform coefficient matrix, and the final quantized value is written into the video bitstream.
  • the quantized value of the LFNST transform coefficient matrix can be obtained by parsing the code stream, and the quantized value is inversely quantized by the inverse quantization unit 13 (may be called "Scaling") to obtain the restoration of the LFNST transform coefficient matrix
  • the coefficient matrix can be obtained by performing the reverse LFNST transformation on the restored value; then the coefficient matrix is subjected to the inverse transformation corresponding to the "Core Transform" on the encoder side through the inverse primary transformation unit 14, and finally the residual restored value is obtained.
  • the standard only defines the “inverse transform” operation on the decoder side, so in the standard, the “inverse LFNST transform” is also called “LFNST transform”; here, in order to facilitate the transformation with the encoder side To distinguish, the "LFNST transform” on the encoder side can be called “forward LFNST transform”, and the “LFNST transform” on the decoder side can be called “reverse LFNST transform”.
  • the prediction residual of the current transform block can be transformed by a positive primary transformation to obtain primary transformation coefficients, and then part of the primary transformation coefficients can be transformed by matrix multiplication for secondary transformation, resulting in a smaller and more concentrated two.
  • the decoder is subjected to inverse quantization processing.
  • the inverse quantized coefficient is subjected to inverse secondary transformation through matrix multiplication, and then the inverse is reversed.
  • the coefficients after the second transformation are inversely transformed to recover the prediction residuals.
  • the LFNST transformation process may include steps such as configuring the core parameters, mapping the intra prediction mode, selecting the transformation matrix, calculating the matrix multiplication, and constructing the inverse primary transformation coefficient matrix; after these steps, the LFNST transformation is completed.
  • the transformation set needs to be selected first. Since the transformation matrix is related to the directional characteristics of the prediction mode, the transformation set is currently selected according to the intra prediction mode.
  • the value of the intra prediction mode indicator (which can be represented by predModeIntra) can be determined according to the number of the traditional intra prediction mode, and then the transform set index number can be determined according to the value of predModeIntra; but
  • the value of predModeIntra is directly set to indicate the index number of the intra prediction mode corresponding to the PLANAR mode (ie 0)
  • the current block in MIP mode can only select a transform set with a transform set index number of 0, which makes the current block in MIP mode lack variability when performing LFNST transform, which results in LFNST technology not being well applied to MIP mode, and It also reduces coding efficiency.
  • the embodiment of the present application provides a transformation method, which is applied to an encoder.
  • determining the prediction mode parameter of the current block when the prediction mode parameter indicates that the current block uses matrix-based intra prediction MIP to determine the intra prediction value, the MIP parameter is determined; the current block is determined according to the MIP parameter Calculate the prediction difference between the current block and the intra-frame predicted value; when the current block uses the low-frequency inseparable secondary transform LFNST, determine the current block according to the MIP parameter
  • the LFNST transform core used by the block is set and the LFNST index number is set and written into the video code stream; the LFNST transform core is used to transform the prediction difference.
  • the selection of the LFNST transformation core is more flexible, which not only improves the applicability of the LFNST technology to non-traditional intra prediction modes, but also Improve the coding and decoding efficiency, while also improving the video image quality.
  • the video encoding system 10 includes a transform and quantization unit 101, an intra-frame estimation unit 102, and an intra-frame
  • the encoding unit 109 can implement header information encoding and context-based adaptive binary arithmetic coding (Context-based Adaptive Binary Arithmatic Coding, CABAC).
  • CABAC Context-based Adaptive Binary Arithmatic Coding
  • a video coding block can be obtained by dividing the coding tree unit (CTU), and then the residual pixel information obtained after intra-frame or inter-frame prediction is paired by the transformation and quantization unit 101
  • the video coding block is transformed, including transforming the residual information from the pixel domain to the transform domain, and quantizing the resulting transform coefficients to further reduce the bit rate;
  • the intra-frame estimation unit 102 and the intra-frame prediction unit 103 are used for Perform intra-frame prediction on the video encoding block; specifically, the intra-frame estimation unit 102 and the intra-frame prediction unit 103 are used to determine the intra-frame prediction mode to be used to encode the video encoding block;
  • the motion compensation unit 104 and the motion estimation unit 105 is used to perform inter-frame predictive coding of the received video coding block relative to one or more blocks in one or more reference frames to provide temporal prediction information;
  • the motion estimation performed by the motion estimation unit 105 is a method for generating a motion vector In the process, the motion vector can estimate the motion of
  • the context content can be based on adjacent coding blocks, can be used to encode information indicating the determined intra prediction mode, and output the code stream of the video signal; and the decoded image buffer unit 110 is used to store reconstructed video coding blocks for Forecast reference. As the video image encoding progresses, new reconstructed video encoding blocks will be continuously generated, and these reconstructed video encoding blocks will be stored in the decoded image buffer unit 110.
  • the video decoding system 20 includes a decoding unit 201, an inverse transform and inverse quantization unit 202, and an intra-frame
  • the prediction unit 203, the motion compensation unit 204, the filtering unit 205, and the decoded image buffer unit 206, etc. wherein the decoding unit 201 can implement header information decoding and CABAC decoding, and the filtering unit 205 can implement deblocking filtering and SAO filtering.
  • the code stream of the video signal is output; the code stream is input into the video decoding system 20, and first passes through the decoding unit 201 to obtain the decoded transform coefficient; the transform coefficient is passed through
  • the inverse transform and inverse quantization unit 202 performs processing to generate a residual block in the pixel domain; the intra prediction unit 203 can be used to generate data based on the determined intra prediction mode and the data from the previous decoded block of the current frame or picture The prediction data of the current video decoding block; the motion compensation unit 204 determines the prediction information for the video decoding block by analyzing the motion vector and other associated syntax elements, and uses the prediction information to generate the predictability of the video decoding block being decoded Block; by summing the residual block from the inverse transform and inverse quantization unit 202 and the corresponding predictive block generated by the intra prediction unit 203 or the motion compensation unit 204 to form a decoded video block; the decoded video signal Through the filtering unit 205 in order to remove the block effect artifacts, the video quality can
  • the transform method in the embodiment of this application can be applied to the transform and quantization unit 101 shown in FIG. 2A.
  • the transform and quantization unit 101 includes the positive primary transform unit 11 and the quantization unit 12 shown in FIG.
  • the transformation method is specifically applied to the part between transformation and quantization.
  • the transform method in the embodiment of the present application can also be applied to the inverse transform and inverse quantization unit 106 shown in FIG. 2A or the inverse transform and inverse quantization unit 202 shown in FIG. 2B, whether it is inverse transform or inverse quantization.
  • the inverse quantization unit 106 or the inverse transform and inverse quantization unit 202 can both include the inverse quantization unit 13 and the inverse primary transform unit 14 shown in FIG. 1.
  • the transform method is specifically applied to the part between inverse quantization and inverse transform.
  • the transformation method in the embodiment of this application can be applied to both a video encoding system, a video decoding system, or even a video encoding system and a video decoding system at the same time.
  • the embodiment of this application does not make specific details. limited.
  • the “current block” specifically refers to the current encoding block in intra prediction; when the transformation method is applied to a video decoding system, the “current block” specifically refers to Refers to the current decoded block in intra prediction.
  • FIG. 3 shows a schematic flowchart of a conversion method provided by an embodiment of the present application.
  • the method may include:
  • each image block currently to be encoded may be referred to as a coding block (CB).
  • each encoding block may include a first image component, a second image component, and a third image component; and the current block is the encoding of the first image component, the second image component, or the third image component currently to be predicted in the video image.
  • the current block is the encoding of the first image component, the second image component, or the third image component currently to be predicted in the video image.
  • the current block performs the first image component prediction, and the first image component is the brightness component, that is, the image component to be predicted is the brightness component, then the current block can also be called the brightness block; or, it is assumed that the current block performs the second image component Prediction, and the second image component is a chrominance component, that is, the image component to be predicted is a chrominance component, then the current block can also be called a chrominance block.
  • the prediction mode parameter indicates the coding mode of the current block and parameters related to the mode.
  • a rate-distortion optimization (Rate Distortion Optimization, RDO) method can be used to determine the prediction mode parameters of the current block.
  • the determining the prediction mode parameter of the current block may include:
  • a minimum rate-distortion cost result is selected from a plurality of calculated rate-distortion cost results, and a prediction mode corresponding to the minimum rate-distortion cost result is determined as the prediction mode parameter of the current block.
  • multiple prediction modes can be used for the current block to respectively encode the image components to be predicted.
  • multiple prediction modes usually include traditional intra prediction modes and non-traditional intra prediction modes, while traditional intra prediction modes can include direct current (DC) mode, planar (PLANAR) mode, angular mode, etc.
  • Non-traditional intra prediction modes can include MIP mode, Cross-component Linear Model Prediction (CCLM) mode, Intra Block Copy (IBC) mode and PLT (Palette) mode, etc. .
  • the rate-distortion cost result corresponding to each prediction mode can be obtained; then the minimum rate-distortion cost result is selected from the obtained multiple rate-distortion cost results, and The prediction mode corresponding to the minimum rate-distortion cost result is determined as the prediction mode parameter of the current block; in this way, the determined prediction mode can be used to encode the current block, and in this prediction mode, the prediction residual can be made small , Can improve coding efficiency.
  • S303 Determine the intra-frame prediction value of the current block according to the MIP parameter, and calculate the prediction difference between the current block and the intra-frame prediction value;
  • the input data for MIP prediction includes: the position of the current block (xTbCmp, yTbCmp), the MIP prediction mode applied to the current block (can be represented by modeId), and the height of the current block (in nTbH) Representation), the width of the current block (indicated by nTbW), and the transposition processing indication flag (which can be represented by isTransposed) whether transposition is needed, etc.;
  • the output data of MIP prediction includes: the prediction block of the current block, in the prediction block
  • the MIP prediction process can be divided into four steps: configuring core parameters 41, obtaining reference pixels 42, constructing input samples 43, and generating predicted values 44.
  • the core parameter 41 for configuring the core parameter 41, according to the size of the current block in the frame, the current block can be divided into three categories, and mipSizeId is used to record the type of the current block; and for different types of current blocks, refer to the number of sampling points and matrix multiplication output The number of sampling points is different.
  • the reference pixels 42 when predicting the current block, the upper block and the left block of the current block are already coded blocks at this time.
  • the reference pixels of the MIP technology are the reconstructed values of the upper row of pixels and the left column of the current block.
  • the process of obtaining the reference pixel adjacent to the upper side of the current block (indicated by refT) and the reference pixel adjacent to the left side (indicated by refL) is the process of obtaining the reference pixels.
  • this step is used for the input of matrix multiplication, and mainly includes: obtaining reference samples 431, constructing reference sampling buffer 432, and deriving matrix multiplication input samples 433; among them, the process of obtaining reference samples is downsampling Process, and the construction of the reference sampling buffer 432 may include the buffer filling mode 4321 when transposition is not required and the buffer filling mode 4322 when transposition is required.
  • this step is used to obtain the MIP predicted value of the current block, which may mainly include: constructing a matrix multiplication output sampling block 441, matrix multiplication output sampling clamp 442, matrix multiplication output sampling transposition 443, and generating MIP The final predicted value 444; wherein, the construction of the matrix multiplication output sampling block 441 may include obtaining the weight matrix 4411, obtaining the shift factor and the offset factor 4412, and the matrix multiplication operation 4413, and generating the MIP final predicted value 444 may also include generating unneeded upper The sampled predicted value 4441 and the generated predicted value 4442 that need to be up-sampled. In this way, after the four steps, the intra prediction value of the current block can be obtained.
  • the difference calculation can be performed according to the actual pixel value of the current block and the intra-frame prediction value, and the calculated difference value is used as the prediction difference value, which is convenient for subsequent prediction difference values. Transformation processing.
  • the MIP parameter may include a MIP transposition indicator parameter (which can be represented by isTransposed); here, the value of the MIP transposition indicator parameter is used to indicate whether to transpose the sampling point input vector used in the MIP mode. .
  • the adjacent reference sample set can be obtained according to the reference sample value corresponding to the adjacent reference pixel on the left side of the current block and the reference sample value corresponding to the adjacent reference pixel on the upper side; After the adjacent reference sample set, an input reference sample set can be constructed at this time, that is, the sampling point input vector used in the MIP mode.
  • an input reference sample set can be constructed at this time, that is, the sampling point input vector used in the MIP mode.
  • there is a difference between the encoder side and the decoder side which is mainly related to the value of the MIP transpose indicator parameter.
  • the utilization rate distortion optimization method can still be used to determine the value of the MIP transposition indicator parameter. Specifically, it may include:
  • the value of the MIP transposition indicator parameter can be determined to be 1 at this time;
  • the value of the MIP transposition indicator parameter can be determined to be 0 at this time.
  • the reference sample value corresponding to the upper side of the adjacent reference sample set can be stored before the reference sample value corresponding to the left side, At this time, there is no need to perform transposition processing, that is, there is no need to perform transposition processing on the sampling point input vector used in the MIP mode, and the buffer can be directly determined as the input reference sample value set; when the MIP transposition indicates the value of the parameter When it is 1, in the buffer, the reference sample value corresponding to the upper side of the adjacent reference sample set can be stored after the reference sample value corresponding to the left side.
  • the buffer is transposed, that is, it is necessary Transpose the input vector of the sampling points used in the MIP mode, and then determine the transposed buffer as the input reference sample value set. In this way, after the input reference sample value set is obtained, it can be used in the process of determining the intra prediction value corresponding to the current block in the MIP mode.
  • the MIP parameter may also include a MIP mode index number (which can be represented by modeId), where the MIP mode index number is used to indicate the MIP mode used by the current block, and the MIP mode is used to indicate the use of MIP to determine the The calculation and derivation method of the intra prediction value of the current block is described.
  • MIP mode index number which can be represented by modeId
  • MIP mode index number that is, different MIP modes have different MIP mode index numbers; in this way, according to the use MIP determines the calculation and derivation method of the intra-frame prediction value of the current block, and can determine the specific MIP mode, so that the corresponding MIP mode index number can be obtained; in this embodiment of the application, the value of the MIP mode index number can be 0, 1, 2, 3, 4, or 5.
  • the MIP parameters can also include parameters such as the size of the current block and the aspect ratio; among them, according to the size of the current block (that is, the width and height of the current block), the category of the current block can also be determined (you can use mipSizeId said).
  • determining the category of the current block according to the size of the current block may include:
  • the value of mipSizeId can be set to 0;
  • the value of mipSizeId can be set to 1;
  • the value of mipSizeId can be set to 2.
  • determining the category of the current block according to the size of the current block may include:
  • the value of mipSizeId can be set to 0;
  • the value of mipSizeId can be set to 1;
  • the value of mipSizeId can be set to 2.
  • the MIP parameters can also be determined, which is convenient for determining the LFNST transform core (which can be represented by the kernel) used by the current block according to the determined MIP parameters.
  • LFNST can be performed on the current block only when the current block meets the following conditions at the same time. Among them, these conditions include: (a) the width and height of the current block are greater than or equal to 4; (b) the width and height of the current block are less than or equal to the maximum size of the transform block; (c) the current block or the current coding block
  • the prediction mode of is the intra prediction mode; (d) the primary transformation of the current block is two-dimensional forward primary transformation (DCT2) in both the horizontal and vertical directions; (e) the current block or the frame of the coding block where the current block is located
  • DCT2 two-dimensional forward primary transformation
  • the prediction mode is non-MIP mode or the prediction mode of the transform block is MIP mode, and the width and height of the transform block are both greater than or equal to 16. That is to say, for the current block in the embodiment of the present application, the above five conditions need to be met at the same time.
  • the current block when it is determined that the current block can execute LFNST, it is also necessary to determine the LFNST transform core used by the current block (which can be represented by kernel).
  • the LFNST transform core used by the current block which can be represented by kernel.
  • the four transform core candidate sets may include set0, set1, set2, and set3.
  • the selected transform core candidate set can be implicitly derived; for example, in the current H.266/VVC, according to the intra prediction mode of the current block, the use of Which of the four transform core candidate sets is in the transform core candidate set.
  • the value of the intra prediction mode indicator (which can be represented by predModeIntra) can be determined, and the calculation formula is as follows:
  • the image component indicator (can be represented by cIdx) is used to indicate the luminance component or chrominance component of the current block; here, if the current block predicts the luminance component, then cIdx is equal to 0; if the current block predicts the chrominance component , Then cIdx is equal to 1.
  • (xTbY, yTbY) is the coordinates of the sampling point in the upper left corner of the current block
  • IntraPredModeY[xTbY][yTbY] is the intra prediction mode of the luminance component
  • IntraPredModeC[xTbY][yTbY] is the intra prediction mode of the chrominance component.
  • intra-frame prediction modes can be divided into traditional intra-frame prediction modes and non-traditional intra-frame prediction modes.
  • predModeIntra the information indicated by the value of predModeIntra is as follows:
  • predModeIntra can be INTRA_LT_CCLM, INTRA_L_CCLM or INTRA_T_CCLM (81, 82, 83 in VVC);
  • the value of predModeIntra can be the index number of the used MIP mode
  • predModeIntra can be [0,66].
  • predModeIntra can also be set in the following manner:
  • the mode of the central luminance block corresponding to the luminance position of the current block is MIP mode, that is, intra_mip_flag[xTbY+nTbW/2][yTbY+nTbH/2] is 1, then the value of predMode Intra is set to Indicates the index number of the PLANAR mode (ie 0);
  • the value of predModeIntra is set to the index number indicating the DC mode (ie 1);
  • predModeIntra the value of predModeIntra to the value IntraPredModeY[xTbY+nTbW/2][yTbY+nTbH/2] of the mode index number of the central luminance block corresponding to the luminance position of the current block (such as the chrominance block);
  • predModeIntra can be directly set to the index number (that is, 0) indicating the PLANAR mode.
  • wide-angle mapping can be performed according to the size of the current block, and the traditional intra prediction mode [0,66] is extended to [-14,80]; specific mapping The process is as follows:
  • the value of the LFNST index number (which can be represented by SetIdx) can be determined, and the specific value is shown in Table 1.
  • the value of the LFNST index number is set to indicate that the current block uses LFNST and the LFNST transform core is in the LFNST transform core candidate set.
  • the LFNST transform set includes four transform core candidate sets (set0, set1, set2, set3), which correspond to the values of SetIdx as 0, 1, 2, and 3.
  • predModeIntra is set to indicate the index number of the PLANAR mode (ie 0)
  • the transform set used by the current block in the MIP mode can only select the LFNST index number equal to A transformation set of 0 results in a lack of variability when performing LFNST in MIP mode, which reduces coding efficiency.
  • the LFNST transform core candidate set can be determined first, and then the LFNST transform core used by the current block is determined from the LFNST transform core candidate set, and the LFNST index number is set and written into the video code stream.
  • the transformation matrix of LFNST is a plurality of fixed coefficient matrices obtained through training.
  • the LFNST transformation core candidate set includes 2 sets of transformation matrices (also called LFNST transformation cores). After the LFNST transformation core candidate set is determined, it is necessary to A group of LFNST transform cores is selected from the LFNST transform core candidate set, that is, the transform matrix used when determining the current block LFNST.
  • the MIP parameters can include parameters such as the MIP transposition indication parameter (which can be represented by isTransposed), the MIP mode index number (which can be represented by modeId), the size of the current block, and the type of the current block (which can be represented by mipSizeId); the following will How to select the LFNST transform core used by the current block according to the MIP parameters is described in detail.
  • the MIP parameter is a MIP transposition indicator parameter
  • the current block uses LFNST
  • it is determined according to the MIP parameter that the current block uses The LFNST transform core sets the LFNST index number and writes it into the video stream, which can include:
  • the selected transformation core is subjected to matrix transposition processing to obtain the LFNST transformation core used by the current block ;
  • the value of the LFNST index sequence number is set to indicate that the current block uses LFNST and the index sequence number of the LFNST transform core in the LFNST transform core candidate set; wherein, the LFNST transform core candidate set includes a preset user Two or more transformation cores in MIP.
  • a rate-distortion optimization method can be used to select the transform core used by the current block. Specifically, a rate-distortion optimization method can be used to calculate the rate-distortion cost (Rate Distortion Cost, RDCost) for each transform core, and then the transform core with the smallest rate-distortion cost is selected as the transform core used by the current block.
  • RDCost Rate Distortion Cost
  • a group of LFNST transform cores can be selected through RDCost, and the index number (which can be represented by lfnst_idx) corresponding to the LFNST transform core is written into the video code stream and transmitted to the decoder side.
  • the index number which can be represented by lfnst_idx
  • the first group of LFNST transform cores in the LFNST transform core candidate set ie, the first group of transform matrices
  • set lfnst_idx to 1
  • the second group of LFNST transform cores in the LFNST transform core candidate set ie, the second Group transformation matrix
  • the value of the MIP transposition indicator parameter is used to indicate whether to transpose the sampling point input vector used in the MIP mode, then when the value of the MIP transposition indicator parameter is equal to 1, that is, MIP transpose
  • the value of the indicator parameter indicates that when transposing the sampling point input vector used in the MIP mode, the selected transform core needs to be matrix transposed to obtain the LFNST transform core used by the current block.
  • LFNST when the value of the LFNST index number is equal to 0, LFNST will not be used; and when the value of the LFNST index number is greater than 0, LFNST will be used, and the conversion core
  • the index number is equal to the value of the LFNST index number or the value of the LFNST index number minus one. In this way, after determining the LFNST transformation core used by the current block, it is also necessary to set the LFNST index number and write the video code stream, so that the subsequent decoder side can obtain the LFNST index number by parsing the code stream.
  • the MIP parameter is the MIP mode index number
  • the current block uses LFNST
  • the conversion core set the LFNST index number and write it into the video stream, which can include:
  • the value of the LFNST index sequence number is set to indicate that the current block uses LFNST and the index sequence number of the LFNST transform core in the LFNST transform core candidate set; wherein, the LFNST transform core candidate set includes two presets Or multiple LFNST transform cores.
  • the MIP mode index number is used to indicate the MIP mode used by the current block
  • the MIP mode is used to indicate the calculation and derivation method of using MIP to determine the intra prediction value of the current block; that is, according to the MIP mode index number , You can also determine the LFNST transform core.
  • the MIP mode index number can also be converted to the value of the LFNST intra prediction mode index number (which can be represented by predModeIntra); and then according to the value of predModeIntra, from From multiple LFNST transform core candidate sets, select one LFNST transform core candidate set to determine the transform core candidate set; and in the selected LFNST transform core candidate set, select the transform core indicated by the LFNST index number and set it as the current block. LFNST transform core.
  • LFNST when the value of the LFNST index number is equal to 0, LFNST will not be used; and when the value of the LFNST index number is greater than 0, LFNST will be used, and the index number of the transform core is equal to LFNST
  • the MIP parameters are the MIP mode index number and the MIP transposition indication parameter, for S304
  • the current block uses LFNST
  • the LFNST transform core used in the current block is subjected to matrix transposition processing, and the transformation is obtained after transposition processing.
  • the kernel is set to the LFNST transformation kernel used by the current block;
  • the LFNST transform core candidate set includes two or more preset LFNST transform cores.
  • the MIP mode index number is used to indicate the MIP mode used by the current block, and the MIP mode is used to indicate the calculation and derivation method of using MIP to determine the intra prediction value of the current block;
  • the value of the MIP transposition indicator parameter It is used to indicate whether to transpose the sampling point input vector used in the MIP mode; that is, the LFNST transformation core can also be determined according to the combination of the MIP transposition indicator parameter and the MIP mode index number.
  • the MIP mode index number can also be converted to the value of the LFNST intra prediction mode index number (which can be represented by predModeIntra), and then according to the value of predModeIntra, from Select one LFNST transform core candidate set from a plurality of LFNST transform core candidate sets to determine the transform core candidate set; and in the selected LFNST transform core candidate set, select the transform core indicated by the LFNST index number; and when the instruction needs to be transposed During processing, it is also necessary to perform matrix transposition processing on the LFNST transform core used in the current block, and then set the transform core obtained after transposing to the LFNST transform core used in the current block.
  • LFNST when the value of the LFNST index number is equal to 0, LFNST will not be used; and when the value of the LFNST index number is greater than 0, LFNST will be used, and the index number of the transform core is equal to LFNST
  • the MIP parameter includes at least the MIP mode index number (modeId)
  • modeId MIP mode index number
  • the value of the LFNST intra prediction mode index number can also be obtained by looking up the table. Way to get.
  • the determining the value of the LFNST intra prediction mode index number according to the value of the MIP mode index number may include:
  • first lookup table uses a first lookup table to determine the value of the LFNST intra prediction mode index number corresponding to the value of the MIP mode index number, where the first lookup table contains at least two LFNST frames with different values One or more different MIP mode index numbers corresponding to the intra prediction mode index numbers.
  • the first look-up table (Look-Up Table1, LUT1) is used to reflect the correspondence between the MIP mode index number and the LFNST intra prediction mode index number, that is, the first look-up table contains at least two different values One or more different MIP mode index numbers corresponding to each of the LFNST intra prediction mode index numbers.
  • different MIP modes can correspond to different values of predModeIntra; in this way, the MIP mode index number is determined according to the MIP mode, and then the value of predModeIntra is determined according to the first lookup table; and then according to the value of predModeIntra, from From multiple LFNST transform core candidate sets, one LFNST transform core candidate set can be selected, and then the LFNST transform core used by the current block is determined.
  • the value of predModeIntra can be determined according to the value of the MIP mode index number (modeId); then, according to the value of predModeIntra, the value of SetIdx can be directly determined according to Table 2, that is, the value of the current block selected The LFNST transform kernel candidate set.
  • the value of SetIdx indicates the transform core candidate set used in LFNST; since the value of modeId can include 0, 1, 2, 3, 4, and 5, the value of predModeIntra is also 0, 1, 2 , 3, 4, 5; its corresponding relationship with SetIdx is as follows,
  • the LFNST transform core used by the current block is determined according to the MIP parameters, the LFNST index number is set, and the video code stream is written.
  • the LFNST transform core candidate set includes two or more preset LFNST transform cores.
  • the selecting one LFNST transformation core candidate set from a plurality of LFNST transformation core candidate sets according to the value of the MIP mode index number may include:
  • the second look-up table (Look-Up Table2, LUT2) contains at least one or more different MIP mode index sequence numbers corresponding to the LFNST transformation core candidate set index sequence numbers of two different values.
  • the selected LFNST transform core candidate set can be determined according to the value of the MIP mode index number (modeId). As shown in Table 3, each MIP mode index number corresponds to a LFNST transform core candidate set.
  • the value of the index number of the corresponding LFNST transformation core candidate set can be determined, so as to select the LFNST transformation core candidate set indicated by the value of the index number of the LFNST transformation core candidate set, Take it as the selected LFNST transform core candidate set.
  • the selecting one LFNST transformation core candidate set from a plurality of LFNST transformation core candidate sets according to the value of the MIP mode index sequence number may include:
  • the value of the MIP mode index number determine the index number of the LFNST transformation core candidate set using the first calculation method
  • the LFNST transformation core candidate set indicated by the index number of the LFNST transformation core candidate set is selected as the selected LFNST transformation core candidate set.
  • using the first calculation method to determine the index sequence number of the LFNST transform core candidate set according to the value of the MIP mode index sequence number may include:
  • the value of the LFNST transformation core candidate set index sequence number is set to be equal to the value of the MIP mode index sequence number
  • the value of the LFNST transformation core candidate set index sequence number is set to be equal to the value of the MIP mode index sequence number minus the second preset value.
  • the value of the first preset value may be equal to 3, and the value of the second preset value may be equal to 2.
  • the first calculation method can be used to determine the index number of the LFNST transformation core candidate set, where the first calculation formula is as follows:
  • x represents the first preset value
  • y represents the second preset value
  • SetIdx represents the value of the index number of the LFNST transformation core candidate set
  • modeId represents the value of the MIP mode index number.
  • one of the transform sets (such as set1 or set2 or set3) can be selected as the candidate set from multiple LFNST transform cores.
  • a selected LFNST transform core candidate set can be selected as the candidate set from multiple LFNST transform cores.
  • the candidate set of LFNST transform cores can also be selected according to the value of the MIP mode index number (modeId); as shown in Table 4, each MIP mode corresponds to a kind of LFNST transform core Candidate set; here, the specific number of the LFNST transform core candidate set is limited; among them, a, b, c, d, e can all take any value from ⁇ 0, 1, 2, 3 ⁇ .
  • modeId MIP mode index number
  • the LFNST transform core candidate set can also be selected based on one or more information combinations in the MIP parameters; it can also be compared with the traditional intraframe based on the MIP parameters.
  • the judgment transformation matrix includes the selection of transformation set and transformation matrix group; here, a certain transformation matrix group in a certain transformation set can be fixed according to the MIP parameters, and there is no need to select on the encoder side, and there is no need to transmit at this time lfnst_idx.
  • the method may further include:
  • one LFNST transform core candidate set is selected from a plurality of LFNST transform core candidate sets.
  • the value of predModeIntra can be determined according to the intra-frame prediction mode; then according to the value of predModeIntra, combined with Table 1 above, multiple LFNSTs can be obtained from The LFNST transform core candidate set is selected from the transform core candidate set, and then from the selected LFNST transform core candidate set, the transform core indicated by the LFNST index number is selected and set as the LFNST transform core used by the current block; the LFNST index number is selected The value is set to indicate that the current block uses LFNST and the index number of the LFNST transform core in the LFNST transform core candidate set.
  • LFNST when the value of the LFNST index number is equal to 0, LFNST will not be used; and when the value of the LFNST index number is greater than 0, LFNST will be used, and the index number of the transform core is equal to LFNST
  • the transform matrix selected by the current block can be obtained, and then the prediction difference can be transformed.
  • each group of transformation matrices may also include two sizes of basic transformation matrices T, such as 16x16 and 16x48.
  • T For the transformation matrix selected for 4 sizes of TUs, specifically, for a 4x4 size TU, an 8x16 transformation matrix will be used, and the 8x16 transformation matrix is derived from the first 8x16 of the 16x16 basic transformation matrix; for 4xN or Nx4 (N>4) size TU will use 16x16 basic transformation matrix; for 8x8 size TU, will use 8x48 transformation matrix, the 8x48 transformation matrix comes from the first 8x48 of the 16x48 basic transformation matrix; for larger than 8x8 size The TU will use a 16x48 basic transformation matrix.
  • LFNST is based on direct matrix multiplication to apply inseparable transformations.
  • a simplified indivisible transform technique is used in the LFNST transform.
  • the main idea of the simplified inseparable transform technology is to map N-dimensional vectors to R-dimensional vectors in different spaces, where N/R (R ⁇ N) is the scaling factor; at this time, the simplified inseparable transform technology corresponds to the transformation
  • the matrix is an R ⁇ N matrix, as shown below,
  • FIG. 5 shows a structural schematic diagram of a calculation process of a matrix multiplication of an LFNST technology provided by an embodiment of the present application.
  • (a) shows the calculation process of the forward LFNST transformation. After the primary transformation coefficient passes through the transformation matrix T, the secondary transformation coefficient can be obtained;
  • (b) shows the calculation process of the reverse LFNST transformation . After the inverse quadratic transformation coefficients are transposed by the transformation matrix T T , the inverse primary transformation coefficients can be obtained.
  • the “4 ⁇ 4 inseparable transform” can be collectively referred to as “4 ⁇ 4LFNST” and “8 ⁇ 4 inseparable transform”.
  • ⁇ 8 inseparable transform is collectively referred to as "8 ⁇ 8LFNST”.
  • 16 coefficients will be input on the encoder side, and 16 or 8 coefficients will be output after the forward LFNST; while on the decoder side, 16 coefficients will be input Or 8 coefficients, 16 coefficients will be output; that is to say, the encoder and the decoder have the opposite number of inputs and outputs.
  • TU Transform unit
  • the forward LFNST process corresponding to the 4 ⁇ 4 transform block is shown in Fig. 6A.
  • the white block is the prediction difference
  • the gray block is the primary transform coefficient
  • the black block is the secondary transform coefficient; here, at the position of the “0” example, the encoder sets the transform coefficient to 0.
  • the transform matrix size used is 8 ⁇ 16
  • the 4 ⁇ 4 primary transform coefficients in the current transform block are all input
  • the output is 4 ⁇ 2 secondary transform coefficients.
  • the forward LFNST process corresponding to the 4 ⁇ N or N ⁇ 4 transform block is shown in Fig. 6B.
  • the white block is the prediction difference
  • the gray block is the primary transform coefficient
  • the black block is the secondary transform coefficient; here, for the 4 ⁇ N or N ⁇ 4 transform block, when the forward LFNST is used,
  • the transform matrix size is 16 ⁇ 16
  • the first 4 ⁇ 4 sub-block in the current transform block specifically, it is the uppermost sub-block for the 4 ⁇ N transform block, and the left-most sub-block for the N ⁇ 4 transform block
  • the primary transform coefficients within are used as input
  • the output is 4 ⁇ 4 secondary transform coefficients.
  • the encoder still sets the transform coefficient to 0.
  • the forward LFNST process corresponding to the 8 ⁇ 8 transform block is shown in Fig. 6C.
  • the white block is the prediction difference
  • the gray block is the primary transform coefficient
  • the black block is the secondary transform coefficient
  • the transform matrix size used is 8 ⁇ 48.
  • the primary transform coefficients of the first three 4 ⁇ 4 sub-blocks (that is, the three sub-blocks located in the upper left corner) in the current transform block are used as input, and the output is 4 ⁇ 2 secondary transform coefficients.
  • the encoder still sets the transform coefficient to 0.
  • the forward LFNST process corresponding to the transform block larger than 8 ⁇ 8 is shown in Fig. 6D.
  • the white block is the prediction difference
  • the gray block is the primary transformation coefficient
  • the black block is the secondary transformation coefficient
  • the transformation matrix size used is 48 ⁇ 16
  • the primary transform coefficients of the first three 4 ⁇ 4 sub-blocks (that is, the three sub-blocks located in the upper left corner) in the current transform block are used as input, and the output is 4 ⁇ 4 secondary transform coefficients.
  • the encoder still sets the transform coefficient to 0.
  • Fig. 6A or Fig. 6B or Fig. 6C or Fig. 6D implements the transformation processing on the prediction difference.
  • the applicability of the LFNST technology to the current block using the MIP mode can be improved, making the selection of the transform set (or transform core) more flexible.
  • the relevant information of the MIP parameters is introduced, and the characteristics of the current block are judged according to the MIP information, and then the transform set (or transform core) is selected.
  • the transformation method is applied to VTM7.0, and the test is performed under All Intra conditions at 24 frame intervals. Based on the average bit rate change under the same peak signal to noise ratio (Peak Signal to Noise Ratio, PSNR), it can be tested at this time.
  • PSNR Peak Signal to Noise Ratio
  • the three image components (ie Y, Cb, and Cr) obtain BD-rate changes of -0.03%, 0.00%, and -0.01% respectively; especially on large-resolution sequences, there will be better performance, Specifically, a BD-rate change of -0.10% in Y can be achieved on Class A1, thereby improving coding efficiency.
  • This embodiment provides a transformation method, which is applied to an encoder. Determine the prediction mode parameter of the current block; when the prediction mode parameter indicates that the current block uses matrix-based intra prediction MIP to determine the intra prediction value, determine the MIP parameter; determine the MIP parameter according to the MIP parameter Intra-frame prediction value, calculating the prediction difference between the current block and the intra-frame prediction value; when the current block uses the low-frequency inseparable secondary transform LFNST, the current block is determined according to the MIP parameter
  • the used LFNST transformation core sets the LFNST index number and writes it into the video code stream; and uses the LFNST transformation core to perform transformation processing on the prediction difference.
  • the selection of the LFNST transformation core is more flexible, which not only improves the applicability of the LFNST technology to non-traditional intra prediction modes, but also Improve the coding efficiency, but also can improve the video image quality.
  • FIG. 7 shows a schematic flowchart of another transformation method provided by an embodiment of the present application.
  • the method may include:
  • prediction mode parameter indicates the coding mode of the current block and parameters related to the mode.
  • prediction modes usually include traditional intra prediction modes and non-traditional intra prediction modes, while traditional intra prediction modes can include DC mode, PLANAR mode, and angle mode, etc., and non-traditional intra prediction modes can include MIP mode, CCLM mode, IBC mode and PLT mode, etc.
  • prediction mode of the current block can be determined, and the corresponding prediction mode parameters will be written into the code stream, and the encoder will transmit it to the decoder.
  • the intra prediction mode of the luminance or chrominance component of the current block or the coding block where the current block is located can be obtained by parsing the code stream.
  • the value of predModeIntra can be determined, and the calculation formula is as the aforementioned formula (1) .
  • the image component indicator (which can be represented by cIdx) is used to indicate the luminance component or chrominance component of the current block; here, if the current block predicts the luminance component, then cIdx is equal to 0; if the current block predicts Is the chrominance component, then cIdx is equal to 1.
  • (xTbY, yTbY) is the coordinates of the sampling point in the upper left corner of the current block
  • IntraPredModeY[xTbY][yTbY] is the intra prediction mode of the luminance component
  • IntraPredModeC[xTbY][yTbY] is the intra prediction mode of the chrominance component.
  • MIP parameters can include parameters such as MIP transposition indication parameters (which can be represented by isTransposed), MIP mode index number (which can be represented by modeId), the size of the current block, and the category of the current block (which can be represented by mipSizeId), etc. ; The values of these parameters can be obtained by parsing the code stream.
  • the value of isTransposed can be determined by parsing the code stream; when the value of isTransposed is equal to 1, the input vector of the sampling point used in the MIP mode needs to be transposed; when the value of isTransposed is equal to 0 , There is no need to transpose the sampling point input vector used in the MIP mode; that is, the MIP transposition indication parameter can be used to indicate whether to transpose the sampling point input vector used in the MIP mode.
  • the MIP mode index number (which can be represented by modeId) can also be determined; where the MIP mode index number can be used to indicate the MIP mode used by the current block, and the MIP mode can be used to indicate the use of MIP Determine the calculation and derivation method of the intra prediction value of the current block. That is to say, different MIP modes have different values of the corresponding MIP mode index number; here, the value of the MIP mode index number can be 0, 1, 2, 3, 4, or 5.
  • parameter information such as the size of the current block, the aspect ratio, and the category of the current block (which can be represented by mipSizeId) can also be determined.
  • the MIP parameters are determined, it is convenient to subsequently select the LFNST transform core (which can be represented by the kernel) used by the current block according to the determined MIP parameters.
  • the value of the LFNST index number can be used to indicate whether the current block uses LFNST and the index number of the LFNST transform core in the LFNST transform core candidate set. Specifically, after the LFNST index number is parsed, when the value of the LFNST index number is equal to 0, it indicates that the current block does not use LFNST; and when the value of the LFNST index number is greater than 0, it indicates that the current block uses LFNST, and The index number of the transformation core is equal to the value of the LFNST index number or the value of the LFNST index number minus one.
  • the specific process of LFNST can be divided into four steps: configuring core parameters 81, intra prediction mode mapping 82, selecting transformation matrix 83, calculating matrix multiplication 84 and constructing primary transformation coefficient matrix 85. step.
  • this step is used to determine the value of predModeIntra, which may mainly include: non-traditional intra prediction mode mapping 821 and wide angle mapping 822; for selecting the transformation matrix 83, this step It is used to select a transformation set and a transformation matrix, and mainly includes: selecting a transformation set 831, selecting a transformation matrix group 832, and selecting a transformation matrix size 833.
  • the core parameter 81 For configuring the core parameter 81, it is first necessary to configure the length of the input secondary transform coefficient vector for LFNST calculation (which can be expressed by nonZeroSize) and the length of the output primary transform coefficient vector (which can be expressed by nLfnstOutSzie). Among them, the values for nonZeroSize and nLfnstOutSzie are shown in Table 5.
  • nLfnstSize is as follows:
  • the intra-frame prediction mode of the luminance or chrominance component of the current block or the coding block where the current block is located can also be obtained.
  • the value of predModeIntra can be determined, and the calculation formula is as the aforementioned formula (1).
  • the inverse quantized coefficient d[x][y] at this time is the secondary transform coefficient.
  • the intra prediction mode can be divided into a traditional intra prediction mode and a non-traditional intra prediction mode.
  • the information indicated by the value of predModeIntra is as follows:
  • predModeIntra can be INTRA_LT_CCLM, INTRA_L_CCLM or INTRA_T_CCLM (81, 82, 83 respectively in VVC), it indicates that the prediction mode of the current block is CCLM mode;
  • intra_mip_flag[xTbY][yTbY] is equal to 1 and cIdx is equal to 0, it indicates that the prediction mode of the current block is MIP mode, and the value of predModeIntra indicates the used MIP mode index number modeId;
  • predModeIntra can be [0,66], which indicates that the prediction mode of the current block is the traditional intra prediction mode.
  • the LFNST transform core candidate set index number is determined according to the serial number of the traditional intra prediction mode by parsing the code stream. At this time, if the prediction mode of the current block is CCLM mode and MIP mode, you can also set the value of predModeIntra as follows:
  • predModeIntra indicates INTRA_LT_CCLM, INTRA_L_CCLM or INTRA_T_CCLM (81, 82, 83 in VVC).
  • the mode of the central luminance block corresponding to the luminance position of the current block is MIP mode, that is, intra_mip_flag[xTbY+nTbW/2][yTbY+nTbH/2] is 1, then the value of predMode Intra is set to Indicates the index number of the PLANAR mode (ie 0);
  • the value of predModeIntra is set to the index number indicating the DC mode (ie 1);
  • predModeIntra the value of predModeIntra to the value IntraPredModeY[xTbY+nTbW/2][yTbY+nTbH/2] of the mode index number of the central luminance block corresponding to the luminance position of the current block (such as the chrominance block);
  • wide-angle mapping can also be performed according to the size of the current block, and the traditional intra prediction mode [0, 66] can be extended to [ -14,80];
  • the specific mapping process is as follows:
  • the value of the LFNST index number (which can be represented by SetIdx) can be determined, and the specific value is shown in Table 1.
  • the value of the LFNST index number is set to indicate that the current block uses LFNST and the LFNST transform core is in the LFNST transform core candidate set.
  • the LFNST transform set includes four transform core candidate sets (set0, set1, set2, set3), which correspond to the values of SetIdx as 0, 1, 2, and 3.
  • the transform set used by the current block in the MIP mode can only select the LFNST index number equal to The transformation set of 0 results in the lack of variability when performing LFNST in MIP mode, which reduces the decoding efficiency.
  • the LFNST transform core candidate set can be determined according to the MIP parameters, and then the LFNST transform core used by the current block can be determined from the LFNST transform core candidate set.
  • the MIP parameters can include parameters such as the MIP transposition indication parameter (which can be represented by isTransposed), the MIP mode index number (which can be represented by modeId), the size of the current block, and the type of the current block (which can be represented by mipSizeId); the following will How to select the LFNST transform core used by the current block according to the MIP parameters is described in detail.
  • the MIP parameter is a MIP transposition indication parameter, for S704
  • the LFNST index sequence number indicates that the current block uses LFNST
  • the LFNST transform core used by the current block may include:
  • the selected transformation core is subjected to matrix transposition processing to obtain the LFNST transformation core used by the current block ;
  • the LFNST transform core candidate set includes two or more preset transform cores for MIP.
  • the LFNST transform core candidate set includes two or more preset transform cores for MIP
  • the value of the obtained LFNST index number can be obtained from The LFNST transform core candidate set selects the transform core indicated by the LFNST index number. For example, when the value of the LFNST index number is 1, the first group of LFNST transform cores (that is, the first group of transformation matrices) in the LFNST transform core candidate set will be selected; and when the value of the LFNST index number is 2, it will be selected
  • the second group of LFNST transform cores ie, the second group of transform matrices
  • the value of the MIP transposition indicator parameter is used to indicate whether to transpose the sampling point input vector used in the MIP mode, then when the value of the MIP transposition indicator parameter is equal to 1, that is, MIP transpose
  • the value of the indicator parameter indicates that when transposing the sampling point input vector used in the MIP mode, the selected transform core needs to be matrix transposed to obtain the LFNST transform core used by the current block.
  • the LFNST index number (that is, lfnst_idx)
  • LFNST when the value of the LFNST index number is equal to 0, LFNST will not be used; and when the value of the LFNST index number is greater than 0, LFNST will be used, and the conversion core
  • the index number is equal to the value of the LFNST index number or the value of the LFNST index number minus one. In this way, according to the LFNST index number, the LFNST transform core used by the current block can be determined.
  • the MIP parameter when the MIP parameter is the MIP mode index sequence number, for S704, when the LFNST index sequence number indicates that the current block uses LFNST, the MIP parameter is used to determine The LFNST transform core used in the current block may include:
  • From the selected LFNST transform core candidate set select the transform core indicated by the LFNST index number and set it as the LFNST transform core used by the current block; wherein the LFNST transform core candidate set includes two or more presets A LFNST transform core.
  • the MIP mode index number is used to indicate the MIP mode used by the current block
  • the MIP mode is used to indicate the calculation and derivation method of using MIP to determine the intra prediction value of the current block; that is, according to the MIP mode index number , You can also determine the LFNST transform core.
  • the MIP mode index number can also be converted to the value of the LFNST intra prediction mode index number (which can be represented by predModeIntra); and then according to the value of predModeIntra, from From multiple LFNST transform core candidate sets, select one LFNST transform core candidate set to determine the transform core candidate set; and in the selected LFNST transform core candidate set, select the transform core indicated by the LFNST index number and set it as the current block. LFNST transform core.
  • the MIP parameters are the MIP mode index sequence number and the MIP transposition indication parameter, for S704
  • when the LFNST index sequence number indicates that the current block uses LFNST according to the The MIP parameter, determining the LFNST transform core used by the current block, may include:
  • the LFNST transform core used in the current block is subjected to matrix transposition processing, and the transformation is obtained after transposition processing.
  • the core is set as the LFNST transform core used by the current block; wherein the LFNST transform core candidate set includes two or more preset LFNST transform cores.
  • the MIP mode index number is used to indicate the MIP mode used by the current block, and the MIP mode is used to indicate the calculation and derivation method of using MIP to determine the intra prediction value of the current block;
  • the value of the MIP transposition indicator parameter It is used to indicate whether to transpose the sampling point input vector used in the MIP mode; that is, the LFNST transformation core can also be determined according to the combination of the MIP transposition indicator parameter and the MIP mode index number.
  • the MIP mode index number can also be converted to the value of the LFNST intra prediction mode index number (which can be represented by predModeIntra), and then according to the value of predModeIntra, from Select one LFNST transform core candidate set from a plurality of LFNST transform core candidate sets to determine the transform core candidate set; and in the selected LFNST transform core candidate set, select the transform core indicated by the LFNST index number; and when the instruction needs to be transposed During processing, it is also necessary to perform matrix transposition processing on the LFNST transform core used in the current block, and then set the transform core obtained after transposing to the LFNST transform core used in the current block.
  • the MIP parameter includes at least the MIP mode index number (modeId)
  • modeId MIP mode index number
  • the value of the LFNST intra prediction mode index number can also be obtained by looking up the table. Way to get.
  • the determining the value of the LFNST intra prediction mode index number according to the value of the MIP mode index number may include:
  • first lookup table uses a first lookup table to determine the value of the LFNST intra prediction mode index number corresponding to the value of the MIP mode index number, where the first lookup table contains at least two LFNST frames with different values One or more different MIP mode index numbers corresponding to the intra prediction mode index numbers.
  • the first look-up table (Look-Up Table1, LUT1) is used to reflect the correspondence between the MIP mode index number and the LFNST intra prediction mode index number, that is, the first look-up table contains at least two different values One or more different MIP mode index numbers corresponding to each of the LFNST intra prediction mode index numbers.
  • different MIP modes can correspond to different values of predModeIntra; in this way, the MIP mode index number is determined according to the MIP mode, and then the value of predModeIntra is determined according to the first lookup table; and then according to the value of predModeIntra, from From multiple LFNST transform core candidate sets, one LFNST transform core candidate set can be selected, and then the LFNST transform core used by the current block is determined.
  • the value of predModeIntra can be determined according to the value of the MIP mode index number (modeId); then, according to the value of predModeIntra, the value of SetIdx can be directly determined according to Table 2, that is, the value of the current block selected The LFNST transform kernel candidate set.
  • the value of SetIdx indicates the transform core candidate set used in LFNST; since the value of modeId can include 0, 1, 2, 3, 4, and 5, the value of predModeIntra is also 0, 1, 2 , 3, 4, 5; the corresponding relationship between predModeIntra and SetIdx is shown in Table 2.
  • determining the LFNST transformation core used by the current block according to the MIP parameters may include:
  • From the selected LFNST transform core candidate set select the transform core indicated by the LFNST index number and set it as the LFNST transform core used by the current block; wherein the LFNST transform core candidate set includes two or more presets A LFNST transform core.
  • the selecting one LFNST transformation core candidate set from a plurality of LFNST transformation core candidate sets according to the value of the MIP mode index number may include:
  • the second look-up table (Look-Up Table2, LUT2) contains at least one or more different MIP mode index sequence numbers corresponding to the LFNST transformation core candidate set index sequence numbers of two different values.
  • the selected LFNST transform core candidate set can be determined according to the value of the MIP mode index number (modeId). As shown in Table 3, each MIP mode index number corresponds to a LFNST transform core candidate set.
  • the value of the index number of the corresponding LFNST transformation core candidate set can be determined, so as to select the LFNST transformation core candidate set indicated by the value of the index number of the LFNST transformation core candidate set, Take it as the selected LFNST transform core candidate set.
  • the selecting one LFNST transformation core candidate set from a plurality of LFNST transformation core candidate sets according to the value of the MIP mode index sequence number may include:
  • the value of the MIP mode index number determine the index number of the LFNST transformation core candidate set using the first calculation method
  • the LFNST transformation core candidate set indicated by the index number of the LFNST transformation core candidate set is selected as the selected LFNST transformation core candidate set.
  • using the first calculation method to determine the index sequence number of the LFNST transform core candidate set according to the value of the MIP mode index sequence number may include:
  • the value of the LFNST transformation core candidate set index sequence number is set to be equal to the value of the MIP mode index sequence number
  • the value of the LFNST transformation core candidate set index sequence number is set to be equal to the value of the MIP mode index sequence number minus the second preset value.
  • the value of the first preset value may be equal to 3, and the value of the second preset value may be equal to 2.
  • the first calculation method can be used to determine the index number of the LFNST transform core candidate set, where the first calculation formula is as shown in the above formula (3), and x represents the first prediction.
  • Set the value, y represents the second preset value;
  • SetIdx represents the value of the index number of the LFNST transform core candidate set, and
  • modeId represents the value of the MIP mode index number.
  • one of the transform sets (such as set1 or set2 or set3) can be selected as the candidate set from multiple LFNST transform cores.
  • a selected LFNST transform core candidate set can be selected as the candidate set from multiple LFNST transform cores.
  • the candidate set of LFNST transform cores can also be selected according to the value of the MIP mode index number (modeId); as shown in Table 4, each MIP mode corresponds to a kind of LFNST transform core Candidate set; here, the specific number of the LFNST transform core candidate set is limited; among them, a, b, c, d, e can all take any value from ⁇ 0, 1, 2, 3 ⁇ .
  • modeId MIP mode index number
  • the LFNST transform core candidate set can also be selected based on one or more information combinations in the MIP parameters; it can also be compared with the traditional intraframe based on the MIP parameters.
  • the judgment transformation matrix includes the choice of transformation set and transformation matrix group; here, a certain transformation matrix group in a certain transformation set can be fixedly selected according to the MIP parameters, and there is no need to select on the encoder side, so it does not When lfnst_idx is transmitted, the decoder side does not need to analyze the code stream of lfnst_idx.
  • the method may further include:
  • one LFNST transform core candidate set is selected from a plurality of LFNST transform core candidate sets.
  • the value of predModeIntra can be determined according to the intra-frame prediction mode; then according to the value of predModeIntra, combined with Table 1 above, multiple LFNSTs can be obtained from The LFNST transform core candidate set is selected from the transform core candidate set, and then from the selected LFNST transform core candidate set, the transform core indicated by the LFNST index number is selected and set as the LFNST transform core used by the current block.
  • S705 Use the LFNST transform core to perform transform processing on the transform coefficients.
  • the value of the LFNST index number (lfnst_idx) is obtained by parsing the code stream; according to the value of lfnst_idx, the value indicated by lfnst_idx can be selected from the LFNST transform core candidate set Transformation matrix (transformation kernel). For example, when lfnst_idx is 1, the first set of transformation matrices can be used as the LFNST transformation core in the decoding process; when lfnst_idx is 2, the second set of transformation matrices can be used as the LFNST transformation core in the decoding process.
  • each set of transformation matrixes transformation cores
  • two basic transformation matrices are included, and the sizes of the basic transformation matrices used on the decoder side are 16 ⁇ 16 and 48 ⁇ 16.
  • the selection is made according to nLfnstOutSzie. If nLfnstOutSzie is 16, a 16x16 basic transformation matrix is selected; or, if nLfnstOutSzie is 48, a 48x16 basic transformation matrix is selected. Or, if nonZeroSize is 8, only the first 8 rows in the transformation matrix are used for matrix multiplication calculations.
  • the specific calculation process of v[j] is as follows:
  • Clip3 is a clamp work, and the value of the coefficient can be limited between the two numbers below, as shown below,
  • the applicability of the LFNST technology to the current block using the MIP mode can be improved, making the selection of the transform set (or transform core) more flexible.
  • the relevant information of the MIP parameters is introduced, and the characteristics of the current block are judged according to the MIP information, and then the transform set (or transform core) is selected.
  • the conversion method is applied to VTM7.0, and tested under All Intra conditions at 24 frame intervals, based on the average bit rate change under the same peak signal to noise ratio (Peak Signal to Noise Ratio, PSNR).
  • the three image components (ie Y, Cb, and Cr) obtain BD-rate changes of -0.03%, 0.00%, and -0.01% respectively; especially on large-resolution sequences, there will be better performance, Specifically, a BD-rate change of -0.10% in Y can be achieved on Class A1, thereby improving decoding efficiency.
  • This embodiment provides a transformation method to parse the code stream to determine the prediction mode parameters of the current block; when the prediction mode parameter indicates that the current block uses MIP to determine the intra prediction value, the code stream is parsed to determine the MIP parameters; the code stream is parsed, Determine the transform coefficient and LFNST index number of the current block; when the LFNST index number indicates that the current block uses LFNST, determine the LFNST transform core used by the current block according to the MIP parameters; use the LFNST transform core to perform the transformation The coefficients undergo transformation processing.
  • the choice of LFNST transformation core is more flexible, which not only improves the applicability of LFNST technology to non-traditional intra prediction modes, but also Improve the decoding efficiency, but also can improve the video image quality.
  • FIG. 9 shows a schematic diagram of the composition structure of an encoder 90 provided in an embodiment of the present application.
  • the encoder 90 may include: a first determining unit 901, a first calculating unit 902, and a first transforming unit 903; wherein,
  • the first determining unit 901 is configured to determine the prediction mode parameter of the current block
  • the first determining unit 901 is further configured to determine the MIP parameter when the prediction mode parameter indicates that the current block uses the matrix-based intra prediction MIP to determine the intra prediction value;
  • the first calculation unit 902 is configured to determine the intra prediction value of the current block according to the MIP parameter, and calculate the prediction difference between the current block and the intra prediction value;
  • the first determining unit 901 is further configured to determine the LFNST transformation core used by the current block according to the MIP parameters when the current block uses the low-frequency inseparable secondary transformation LFNST, set the LFNST index number, and write the video code flow;
  • the first transformation unit 903 is configured to use the LFNST transformation core to perform transformation processing on the prediction difference.
  • the MIP parameter includes a MIP transposition indicator parameter, wherein the value of the MIP transposition indicator parameter is used to indicate whether to transpose the sampling point input vector used in the MIP mode.
  • the encoder 90 may further include a first selection unit 904, a first transposition unit 905, and a setting unit 906; wherein,
  • the first selection unit 904 is configured to select the transform core used by the current block from the LFNST transform core candidate set;
  • the first transposition unit 905 is configured to perform matrix transposition processing on the selected transformation core when the value of the MIP transposition indication parameter indicates that the sampling point input vector used in the MIP mode is transposed, to obtain The LFNST transform core used by the current block;
  • the setting unit 906 is configured to set the value of the LFNST index sequence number to indicate that the current block uses LFNST and the index sequence number of the LFNST transform core in the LFNST transform core candidate set; wherein, the LFNST transform core candidate set Contains two or more transformation cores preset for MIP.
  • the MIP parameter includes a MIP mode index sequence number, where the MIP mode index sequence number is used to indicate the MIP mode used by the current block, and the MIP mode is used to indicate the use of MIP to determine the intra prediction value of the current block The calculation and derivation method.
  • the first determining unit 901 is further configured to determine the value of the LFNST intra prediction mode index number according to the value of the MIP mode index number;
  • the first selection unit 904 is further configured to select one LFNST transform core candidate set from a plurality of LFNST transform core candidate sets according to the value of the LFNST intra prediction mode index number; and from the selected LFNST transform core candidate set, Selecting the transformation core indicated by the LFNST index number and setting it as the LFNST transformation core used by the current block;
  • the setting unit 906 is configured to set the value of the LFNST index sequence number to indicate that the current block uses LFNST and the index sequence number of the LFNST transform core in the LFNST transform core candidate set; wherein, the LFNST transform core candidate set Contains two or more preset LFNST transform cores.
  • the first determining unit 901 is further configured to use a first lookup table to determine the value of the LFNST intra prediction mode index number corresponding to the value of the MIP mode index number, wherein the first The look-up table contains at least one or more different MIP mode index numbers corresponding to two LFNST intra prediction mode index numbers with different values.
  • the first selection unit 904 is further configured to select one LFNST transformation core candidate set from a plurality of LFNST transformation core candidate sets according to the value of the MIP mode index number; and from the selected LFNST transformation core candidate Centrally, select the transformation core indicated by the LFNST index number and set it as the LFNST transformation core used by the current block;
  • the setting unit 906 is configured to set the value of the LFNST index sequence number to indicate that the current block uses LFNST and the index sequence number of the LFNST transform core in the LFNST transform core candidate set; wherein, the LFNST transform core candidate set Contains two or more LFNST transformation cores.
  • the first selection unit 904 is further configured to use the second lookup table to determine the value of the LFNST transformation core candidate set index number corresponding to the value of the MIP mode index number, and select the LFNST transformation core candidate set
  • the LFNST transform core candidate set indicated by the value of the index number is used as the selected LFNST transform core candidate set; wherein, the second look-up table contains at least two LFNST transform core candidate set index numbers with different values, respectively Corresponding index number of one or more different MIP modes.
  • the first calculation unit 902 is further configured to use the first calculation method to determine the index number of the LFNST transform core candidate set according to the value of the MIP mode index number;
  • the first selection unit 904 is further configured to select the LFNST transformation core candidate set indicated by the index number of the LFNST transformation core candidate set as the selected LFNST transformation core candidate set.
  • the first calculation unit 902 is specifically configured to set the value of the index number of the LFNST transformation core candidate set equal to the value of the index number of the MIP mode index when the value of the index number of the MIP mode is less than the first preset value.
  • the value of the MIP mode index sequence number; and when the value of the MIP mode index sequence number is greater than or equal to the first preset value, the value of the LFNST transformation core candidate set index sequence number is set to be equal to the MIP mode index The difference value obtained by subtracting the second preset value from the value of the serial number; wherein, the first preset value and the second preset value are both integer values.
  • the value of the first preset value is equal to 3.
  • the value of the second preset value is equal to 2.
  • the MIP parameter further includes a MIP transposition indicator parameter, wherein the value of the MIP transposition indicator parameter is used to indicate whether to transpose the sampling point input vector used in the MIP mode;
  • the first transposition unit 905 is further configured to perform matrix conversion on the LFNST transformation core used in the current block when the value of the MIP transposition indication parameter indicates that the sampling point input vector used in the MIP mode is transposed. Setting processing, setting the transformation core obtained after transposition processing as the LFNST transformation core used by the current block.
  • a "unit" may be a part of a circuit, a part of a processor, a part of a program or software, etc., of course, may also be a module, or may also be non-modular.
  • the various components in this embodiment may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.
  • the above-mentioned integrated unit can be realized in the form of hardware or software function module.
  • the integrated unit is implemented in the form of a software function module and is not sold or used as an independent product, it can be stored in a computer readable storage medium.
  • the technical solution of this embodiment is essentially or It is said that the part that contributes to the existing technology or all or 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 and includes several instructions to enable a computer device (which can A personal computer, a server, or a network device, etc.) or a processor (processor) executes all or part of the steps of the method described in this embodiment.
  • the aforementioned storage media include: U disk, mobile hard disk, read only memory (Read Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk and other media that can store program codes.
  • an embodiment of the present application provides a computer storage medium, which is applied to the encoder 90, and the computer storage medium stores a transformation program that, when executed by a first processor, implements the foregoing description of any one of the embodiments. Methods.
  • FIG. 10 shows an example of the specific hardware structure of the encoder 90 provided by the embodiment of the present application, which may include: a first communication interface 1001, a first memory 1002, and a first communication interface 1001; A processor 1003; various components are coupled together through a first bus system 1004.
  • the first bus system 1004 is used to implement connection and communication between these components.
  • the first bus system 1004 also includes a power bus, a control bus, and a status signal bus.
  • various buses are marked as the first bus system 1004 in FIG. 10. among them,
  • the first communication interface 1001 is used for receiving and sending signals in the process of sending and receiving information with other external network elements;
  • the first memory 1002 is configured to store a computer program that can run on the first processor 1003;
  • the first processor 1003 is configured to execute: when running the computer program:
  • the current block uses the low-frequency inseparable secondary transformation LFNST, determine the LFNST transformation core used by the current block according to the MIP parameters, set the LFNST index number and write it into the video code stream;
  • the first memory 1002 in the embodiment of the present application may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memory.
  • the non-volatile memory can be read-only memory (Read-Only Memory, ROM), programmable read-only memory (Programmable ROM, PROM), erasable programmable read-only memory (Erasable PROM, EPROM), and electrically available Erase programmable read-only memory (Electrically EPROM, EEPROM) or flash memory.
  • the volatile memory may be a random access memory (Random Access Memory, RAM), which is used as an external cache.
  • RAM static random access memory
  • DRAM dynamic random access memory
  • DRAM synchronous dynamic random access memory
  • DDRSDRAM Double Data Rate Synchronous Dynamic Random Access Memory
  • Enhanced SDRAM, ESDRAM Synchronous Link Dynamic Random Access Memory
  • Synchlink DRAM Synchronous Link Dynamic Random Access Memory
  • DRRAM Direct Rambus RAM
  • the first processor 1003 may be an integrated circuit chip with signal processing capability. In the implementation process, the steps of the foregoing method can be completed by an integrated logic circuit of hardware in the first processor 1003 or instructions in the form of software.
  • the aforementioned first processor 1003 may be a general-purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application specific integrated circuit (ASIC), a ready-made programmable gate array (Field Programmable Gate Array, FPGA) Or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components.
  • DSP Digital Signal Processor
  • ASIC application specific integrated circuit
  • FPGA ready-made programmable gate array
  • the methods, steps, and logical block diagrams disclosed in the embodiments of the present application can be implemented or executed.
  • the general-purpose processor may be a microprocessor or the processor may also be any conventional processor or the like.
  • the steps of the method disclosed in the embodiments of the present application may be directly embodied as being executed and completed by a hardware decoding processor, or executed and completed by a combination of hardware and software modules in the decoding processor.
  • the software module can be located in a mature storage medium in the field, such as random access memory, flash memory, read-only memory, programmable read-only memory, or electrically erasable programmable memory, registers.
  • the storage medium is located in the first memory 1002, and the first processor 1003 reads the information in the first memory 1002, and completes the steps of the foregoing method in combination with its hardware.
  • the embodiments described in this application can be implemented by hardware, software, firmware, middleware, microcode, or a combination thereof.
  • the processing unit can be implemented in one or more application specific integrated circuits (ASIC), digital signal processor (Digital Signal Processing, DSP), digital signal processing equipment (DSP Device, DSPD), programmable Logic device (Programmable Logic Device, PLD), Field-Programmable Gate Array (Field-Programmable Gate Array, FPGA), general-purpose processors, controllers, microcontrollers, microprocessors, and others for performing the functions described in this application Electronic unit or its combination.
  • ASIC application specific integrated circuits
  • DSP Digital Signal Processing
  • DSP Device digital signal processing equipment
  • PLD programmable Logic Device
  • PLD Field-Programmable Gate Array
  • FPGA Field-Programmable Gate Array
  • the technology described in this application can be implemented through modules (for example, procedures, functions, etc.) that perform the functions described in this application.
  • the software codes can be stored in the memory and executed by
  • the first processor 1003 is further configured to execute the method described in any one of the foregoing embodiments when the computer program is running.
  • This embodiment provides an encoder, which may include a first determining unit, a first calculating unit, and a first transforming unit; in this way, for the current block in the MIP mode, since the LFNST transform is introduced
  • the MIP parameter makes the selection of the LFNST transform core more flexible, which not only improves the applicability of the LFNST technology to non-traditional intra prediction modes, but also improves the coding efficiency and at the same time improves the video image quality.
  • FIG. 11 shows a schematic diagram of the composition structure of a decoder 110 provided by an embodiment of the present application.
  • the decoder 110 may include: a parsing unit 1101, a second determining unit 1102, and a second transforming unit 1103; wherein,
  • the parsing unit 1101 is configured to parse the code stream to determine the prediction mode parameter of the current block; and further configured to parse the code stream to determine the MIP parameter when the prediction mode parameter indicates that the current block uses MIP to determine the intra prediction value; And it is also configured to analyze the code stream to determine the transform coefficient and LFNST index number of the current block;
  • the second determining unit 1102 is configured to determine the LFNST transform core used by the current block according to the MIP parameter when the LFNST index sequence number indicates that the current block uses LFNST;
  • the second transform unit 1103 is configured to use the LFNST transform core to perform transform processing on the transform coefficients.
  • the MIP parameter includes a MIP transposition indicator parameter, wherein the value of the MIP transposition indicator parameter is used to indicate whether to transpose the sampling point input vector used in the MIP mode.
  • the decoder 110 may further include a second selection unit 1104 and a second transposition unit 1105; wherein,
  • the second selection unit 1104 is configured to select the transformation core indicated by the LFNST index number from the LFNST transformation core candidate set;
  • the second transposition unit 1105 is configured to perform matrix transposition processing on the selected transformation core when the value of the MIP transposition indication parameter indicates that the sampling point input vector used in the MIP mode is transposed, to obtain The LFNST transform core used by the current block; wherein the LFNST transform core candidate set includes two or more preset transform cores for MIP.
  • the MIP parameter includes a MIP mode index sequence number, where the MIP mode index sequence number is used to indicate the MIP mode used by the current block, and the MIP mode is used to indicate the use of MIP to determine the intra prediction value of the current block The calculation and derivation method.
  • the second determining unit 1102 is further configured to determine the value of the LFNST intra prediction mode index number according to the value of the MIP mode index number;
  • the second selection unit 1104 is further configured to select one LFNST transform core candidate set from a plurality of LFNST transform core candidate sets according to the value of the LFNST intra prediction mode index number; and from the selected LFNST transform core candidate set, The transform core indicated by the LFNST index number is selected and set as the LFNST transform core used by the current block; wherein the LFNST transform core candidate set includes two or more preset LFNST transform cores.
  • the second determining unit 1102 is further configured to use a first lookup table to determine the value of the LFNST intra prediction mode index number corresponding to the value of the MIP mode index number, wherein the first The look-up table contains at least one or more different MIP mode index numbers corresponding to two LFNST intra prediction mode index numbers with different values.
  • the second selection unit 1104 is further configured to select one LFNST transformation core candidate set from a plurality of LFNST transformation core candidate sets according to the value of the MIP mode index number; and from the selected LFNST transformation core candidate In the set, the transform core indicated by the LFNST index number is selected and set as the LFNST transform core used by the current block; wherein the LFNST transform core candidate set includes two or more preset LFNST transform cores.
  • the second selection unit 1104 is further configured to use a second lookup table to determine the value of the LFNST transformation core candidate set index number corresponding to the value of the MIP mode index number, and select the LFNST transformation core candidate set The LFNST transform core candidate set indicated by the value of the index number is used as the selected LFNST transform core candidate set; wherein, the second look-up table contains at least two LFNST transform core candidate set index numbers with different values, respectively Corresponding index number of one or more different MIP modes.
  • the decoder 110 may further include a second calculation unit 1106 configured to determine the index number of the LFNST transform core candidate set using the first calculation method according to the value of the MIP mode index number;
  • the second selection unit 1104 is further configured to select the LFNST transformation core candidate set indicated by the index number of the LFNST transformation core candidate set as the selected LFNST transformation core candidate set.
  • the second calculating unit 1106 is specifically configured to set the value of the index number of the LFNST transformation core candidate set equal to the value of the index number of the MIP mode index when the value of the index number of the MIP mode is less than the first preset value.
  • the value of the MIP mode index sequence number; and when the value of the MIP mode index sequence number is greater than or equal to the first preset value, the value of the LFNST transformation core candidate set index sequence number is set to be equal to the MIP mode index The difference value obtained by subtracting the second preset value from the value of the serial number; wherein, the first preset value and the second preset value are both integer values.
  • the value of the first preset value is equal to 3.
  • the value of the second preset value is equal to 2.
  • the MIP parameter further includes a MIP transposition indicator parameter, wherein the value of the MIP transposition indicator parameter indicates whether to transpose the sampling point input vector used in the MIP mode;
  • the second transposition unit 1105 is further configured to perform matrix transformation on the LFNST transformation core used in the current block when the value of the MIP transposition indication parameter indicates that the sampling point input vector used in the MIP mode is transposed. Setting processing, setting the transformation core obtained after transposition processing as the LFNST transformation core used by the current block.
  • a "unit" may be a part of a circuit, a part of a processor, a part of a program or software, etc., of course, it may also be a module, or it may also be non-modular.
  • the various components in this embodiment may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.
  • the above-mentioned integrated unit can be realized in the form of hardware or software function module. If the integrated unit is implemented in the form of a software function module and is not sold or used as an independent product, it can be stored in a computer readable storage medium.
  • this embodiment provides a computer storage medium for use in the decoder 110.
  • the computer storage medium stores a transformation program that, when executed by a second processor, implements the procedures described in any of the foregoing embodiments. method.
  • FIG. 12 shows an example of a specific hardware structure of the decoder 110 provided in an embodiment of the present application, which may include: a second communication interface 1201, a second memory 1202, and a second communication interface 1201
  • Two processors 1203; various components are coupled together through a second bus system 1204.
  • the second bus system 1204 is used to implement connection and communication between these components.
  • the second bus system 1204 also includes a power bus, a control bus, and a status signal bus.
  • various buses are marked as the second bus system 1204 in FIG. 12. among them,
  • the second communication interface 1201 is used for receiving and sending signals in the process of sending and receiving information with other external network elements;
  • the second memory 1202 is configured to store a computer program that can run on the second processor 1203;
  • the second processor 1203 is configured to execute: when the computer program is running:
  • the prediction mode parameter indicates that the current block uses MIP to determine the intra-frame prediction value, parse the code stream to determine the MIP parameter;
  • the second processor 1203 is further configured to execute the method described in any one of the foregoing embodiments when the computer program is running.
  • the hardware function of the second memory 1202 is similar to that of the first memory 1002, and the hardware function of the second processor 1203 is similar to that of the first processor 1003; it will not be described in detail here.
  • This embodiment provides a decoder, which may include a parsing unit, a second determining unit, and a second transforming unit; in this way, for the current block adopting the MIP mode, since the MIP parameter is introduced during the LFNST transform , Making the selection of the LFNST transform core more flexible, which not only improves the applicability of the LFNST technology to non-traditional intra prediction modes, but also improves the decoding efficiency and at the same time improves the video image quality.
  • the prediction mode parameter of the current block is first determined; when the prediction mode parameter indicates that the current block uses MIP to determine the intra prediction value, the MIP parameter is determined; then the current block is determined according to the MIP parameter.
  • the intra prediction value of the block is calculated, and the prediction difference between the current block and the intra prediction value is calculated; when the current block uses LFNST, the LFNST used by the current block is determined according to the MIP parameters
  • the transformation core sets the LFNST index number and writes it into the video code stream; finally, the LFNST transformation core is used to perform transformation processing on the prediction difference.
  • the selection of the LFNST transformation core is more flexible, which not only improves the applicability of the LFNST technology to non-traditional intra prediction modes, but also Improve the coding and decoding efficiency, but also can improve the video image quality.

Landscapes

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

Abstract

本申请实施例公开了一种变换方法、编码器、解码器以及存储介质,该方法包括:确定当前块的预测模式参数;当所述预测模式参数指示所述当前块使用基于矩阵的帧内预测MIP确定帧内预测值时,确定MIP参数;根据所述MIP参数,确定所述当前块的帧内预测值,计算所述当前块与所述帧内预测值之间的预测差值;当所述当前块使用低频不可分离二次变换LFNST时,根据所述MIP参数,确定所述当前块使用的LFNST变换核,设置LFNST索引序号并写入视频码流;使用所述LFNST变换核,对所述预测差值进行变换处理。

Description

变换方法、编码器、解码器以及存储介质 技术领域
本申请实施例涉及图像处理技术领域,尤其涉及一种变换方法、编码器、解码器以及存储介质。
背景技术
随着人们对视频显示质量要求的提高,高清和超高清视频等新视频应用形式应运而生。H.265/高效率视频编码(High Efficiency Video Coding,HEVC)已经无法满足视频应用迅速发展的需求,联合视频研究组(Joint Video Exploration Team,JVET)提出了下一代视频编码标准H.266/多功能视频编码(Versatile Video Coding,VVC),其相应的测试模型为VVC的参考软件测试平台(VVC Test Model,VTM)。
在H.266/VVC中,目前已经接受了简化的二次变换(Reduced Second Transform,RST)技术,并更名为低频不可分二次变换(Low-Frequency Non-Separable Transform,LFNST)技术。由于LFNST技术中关于变换集的选择是根据帧内预测模式进行的,但是对于非传统帧内预测模式,在进行LFNST变换时缺乏可变性,降低了编码效率。
发明内容
本申请实施例提供一种变换方法、编码器、解码器以及存储介质,可以提高LFNST技术对非传统帧内预测模式的适用性,使得变换集的选择更加灵活,从而能够提高编解码效率。
本申请实施例的技术方案可以如下实现:
第一方面,本申请实施例提供了一种变换方法,应用于编码器,该方法包括:
确定当前块的预测模式参数;
当所述预测模式参数指示所述当前块使用基于矩阵的帧内预测MIP确定帧内预测值时,确定MIP参数;
根据所述MIP参数,确定所述当前块的帧内预测值,计算所述当前块与所述帧内预测值之间的预测差值;
当所述当前块使用低频不可分离二次变换LFNST时,根据所述MIP参数,确定所述当前块使用的LFNST变换核,设置LFNST索引序号并写入视频码流;
使用所述LFNST变换核,对所述预测差值进行变换处理。
第二方面,本申请实施例提供了一种变换方法,应用于解码器,该方法包括:
解析码流,确定当前块的预测模式参数;
当所述预测模式参数指示所述当前块使用MIP确定帧内预测值时,解析码流,确定MIP参数;
解析码流,确定所述当前块的变换系数和LFNST索引序号;
当所述LFNST索引序号指示所述当前块使用LFNST时,根据所述MIP参数,确定所述当前块使用的LFNST变换核;
使用所述LFNST变换核,对所述变换系数进行变换处理。
第三方面,本申请实施例提供了一种编码器,该编码器包括第一确定单元、第一计算单元和第一变换单元;其中,
第一确定单元,配置为确定当前块的预测模式参数;
第一确定单元,还配置为当所述预测模式参数指示所述当前块使用基于矩阵的帧内预测MIP确定帧内预测值时,确定MIP参数;
第一计算单元,配置为根据所述MIP参数,确定所述当前块的帧内预测值,计算所述当前块与所述帧内预测值之间的预测差值;
第一确定单元,还配置为当所述当前块使用低频不可分离二次变换LFNST时,根据所述MIP参数,确定所述当前块使用的LFNST变换核,设置LFNST索引序号并写入视频码流;
第一变换单元,配置为使用所述LFNST变换核,对所述预测差值进行变换处理。
第四方面,本申请实施例提供了一种编码器,该编码器包括第一存储器和第一处理器;其中,
第一存储器,用于存储能够在第一处理器上运行的计算机程序;
第一处理器,用于在运行所述计算机程序时,执行如第一方面所述的方法。
第五方面,本申请实施例提供了一种解码器,该解码器包括解析单元、第二确定单元和第二变换单元;其中,
解析单元,配置为解析码流,确定当前块的预测模式参数;以及还配置为当所述预测模式参数指示所述当前块使用MIP确定帧内预测值时,解析码流,确定MIP参数;以及还配置为解析码流,确定所述当前块的变换系数和LFNST索引序号;
第二确定单元,配置为当所述LFNST索引序号指示所述当前块使用LFNST时,根据所述MIP参数,确定所述当前块使用的LFNST变换核;
第二变换单元,配置为使用所述LFNST变换核,对所述变换系数进行变换处理。
第六方面,本申请实施例提供了一种解码器,该解码器包括第二存储器和第二处理器;其中,
第二存储器,用于存储能够在第二处理器上运行的计算机程序;
第二处理器,用于在运行所述计算机程序时,执行如第二方面所述的方法。
第七方面,本申请实施例提供了一种计算机存储介质,该计算机存储介质存储有计算机程序,所述计算机程序被第一处理器执行时实现如第一方面所述的方法、或者被第二处理器执行时实现如第二方面所述的方法。
本申请实施例提供了一种变换方法、编码器、解码器以及存储介质,通过确定当前块的预测模式参数;当所述预测模式参数指示所述当前块使用MIP确定帧内预测值时,确定MIP参数;根据所述MIP参数,确定所述当前块的帧内预测值,计算所述当前块与所述帧内预测值之间的预测差值;当所述当前块使用LFNST时,根据所述MIP参数,确定所述当前块使用的LFNST变换核,设置LFNST索引序号并写入视频码流;使用所述LFNST变换核,对所述预测差值进行变换处理。这样,针对采用MIP模式的当前块来说,由于在进行LFNST变换时引入了MIP参数,使得LFNST变换核的选择更加灵活,从而不仅提高了LFNST技术对非传统帧内预测模式的适用性,还提高了编解码效率,同时还能够提升视频图像质量。
附图说明
图1为相关技术方案提供的一种LFNST技术的应用位置示意图;
图2A为本申请实施例提供的一种视频编码系统的组成框图;
图2B为本申请实施例提供的一种视频解码系统的组成框图;
图3为本申请实施例提供的一种变换方法的流程示意图;
图4为本申请实施例提供的一种MIP预测过程的流程框图;
图5为本申请实施例提供的一种LFNST技术矩阵乘法的计算过程的结构示意图;
图6A为相关技术方案提供的一种LFNST变换的结构框图;
图6B为相关技术方案提供的另一种LFNST变换的结构框图;
图6C为相关技术方案提供的又一种LFNST变换的结构框图;
图6D为相关技术方案提供的再一种LFNST变换的结构框图;
图7为本申请实施例提供的另一种变换方法的流程示意图;
图8为本申请实施例提供的一种LFNST具体过程的流程框图;
图9为本申请实施例提供的一种编码器的组成结构示意图;
图10为本申请实施例提供的一种编码器的具体硬件结构示意图;
图11为本申请实施例提供的一种解码器的组成结构示意图;
图12为本申请实施例提供的一种解码器的具体硬件结构示意图。
具体实施方式
为了能够更加详尽地了解本申请实施例的特点与技术内容,下面结合附图对本申请实施例的实现进行详细阐述,所附附图仅供参考说明之用,并非用来限定本申请实施例。
在视频图像中,一般采用第一图像分量、第二图像分量和第三图像分量来表征编码块(Coding Block,CB);其中,这三个图像分量分别为一个亮度分量、一个蓝色色度分量和一个红色色度分量,具体地,亮度分量通常使用符号Y表示,蓝色色度分量通常使用符号Cb或者U表示,红色色度分量通常使用符号Cr或者V表示;这样,视频图像可以用YCbCr格式表示,也可以用YUV格式表示。
在本申请实施例中,第一图像分量可以为亮度分量,第二图像分量可以为蓝色色度分量,第三图像分量可以为红色色度分量,但是本申请实施例不作具体限定。
下面将针对目前LFNST技术的相关技术方案描述。
参见图1,其示出了相关技术方案提供的一种LFNST技术的应用位置示意图。如图1所示,在帧内预测模式中,对于编码器侧,在正一次变换单元11与量化单元12之间应用有LFNST技术,在反量化单元13与反一次变换单元14之间应用有LFNST技术。
具体来说,在编码器侧,首先针对数据,比如预测残差(可以用residual表示)通过正一次变换单元11进行第一次变换(可以称之为“Core Transform”或者“一次变换”或者“主变换”),以得到第一次变换后的变换系数矩阵;然后针对该变换系数矩阵中的系数进行LFNST变换(可以称之为“Secondary Transform”或者“二次变换”),得到LFNST变换系数矩阵,最后针对LFNST变换系数矩阵通过量化单元12进行量化处理,将最终的量化值写入视频码流(bitstream)。
在解码器侧,通过解析码流,可以获得LFNST变换系数矩阵的量化值,通过反量化单元13对该量化值进行反量化处理(可以称之为“Scaling”),得到LFNST变换系数矩阵的恢复值,对该恢复值进行反向LFNST变换,可以得到系数矩阵;然后再通过反一次变换单元14对系数矩阵进行与编码器侧“Core Transform”对应的反变换,最终得到residual的恢复值。需要注意的是,标准中仅定义了解码器侧的“反变换”操作,因此在标准中针对“反向LFNST变换”也称之为“LFNST变换”;这里,为了便于和编码器侧的变换进行区分,可以将编码器侧“LFNST变换”称为“正向LFNST变换”,将解码器侧“LFNST变换”称为“反向LFNST变换”。
也就是说,在编码器侧,当前变换块的预测残差通过正一次变换,可以得到一次变换系数,然后将部分一次变换系数通过矩阵乘法进行二次变换,得到数量更少且更加集中的二次变换系数,再对其进行量化处理;在解码器侧,则是在解析出量化值之后,对其进行反量化处理,将反量化后的系数通过矩阵乘法进行反二次变换,然后将反二次变换后的系数进行反一次变换,从而恢复出预测残差。
在LFNST技术中,LFNST变换过程可以包括:配置核心参数、帧内预测模式映射、选择变换矩阵、计算矩阵乘法和构造反一次变换系数矩阵等步骤;经过这些步骤之后,表示完成了LFNST变换。然而,在选择变换矩阵的步骤中,首先需要选择变换集,由于变换矩阵与预测模式的方向特性相关,目前是根据帧内预测模式来选择变换集的。其中,对于传统帧内预测模式,可以根据传统帧内预测模式的编号来确定帧内预测模式指示符(可以用predModeIntra表示)的取值,然后根据predModeIntra的取值来确定变换集索引序号;但是对于非传统帧预测模式,尤其是基于矩阵的帧内预测(Matrix-based Intra Prediction,MIP)模式,是将predModeIntra的取值直接设置为指示PLANAR模式对应的帧内预测模式索引序号(即0),致使MIP模式下当前块只能选择变换集索引序号为0的变换集,使得采用MIP模式下当前块在进行LFNST变换时缺乏可变性,从而导致LFNST技术不能很好地适用于MIP模式,并且还降低了编码效率。
本申请实施例提供了一种变换方法,应用于编码器。通过确定当前块的预测模式参数;当所述预测模式参数指示所述当前块使用基于矩阵的帧内预测MIP确定帧内预测值时,确定MIP参数;根据所述MIP参数,确定所述当前块的帧内预测值,计算所述当前块与所述帧内预测值之间的预测差值;当所述当前块使用低频不可分离二次变换LFNST时,根据所述MIP参数,确定所述当前块使用的LFNST变换核,设置LFNST索引序号并写入视频码流;使用所述LFNST变换核,对所述预测差值进行变换处理。这样,针对采用MIP模式的当前块来说,由于在进行LFNST变换时引入了MIP参数,使得LFNST变换核的选择更加灵活,从而不仅提高了LFNST技术对非传统帧内预测模式的适用性,还提高了编解码效率,同时还能够提升视频图像质量。
下面将结合附图对本申请各实施例进行详细说明。
参见图2A,其示出了本申请实施例提供的一种视频编码系统的组成框图示例;如图2A所示,该视频编码系统10包括变换与量化单元101、帧内估计单元102、帧内预测单元103、运动补偿单元104、运动估计单元105、反变换与反量化单元106、滤波器控制分析单元107、滤波单元108、编码单元109和解码图像缓存单元110等,其中,滤波单元108可以实现去方块滤波及样本自适应缩进(Sample Adaptive 0ffset,SAO)滤波,编码单元109可以实现头信息编码及基于上下文的自适应二进制算术编码(Context-based Adaptive Binary Arithmatic Coding,CABAC)。针对输入的原始视频信号,通过编码树块(Coding Tree Unit,CTU)的划分可以得到一个视频编码块,然后对经过帧内或帧间预测后得到的残差像素信息通过变换与量化单元101对该视频编码块进行变换,包括将残差信息从像素域变换到变换域,并对所得的变换系数进行量化,用以进一步减少比特率;帧内估计单元102和帧内预测单元103是用于对该视频编码块进行帧内预测;明确地说,帧内估计单元102和帧内预测单元103用于确定待用以编码该视频编码块的帧内预测模式;运动补偿单元104和运动估计单元105用于执行所接收的视频编 码块相对于一或多个参考帧中的一或多个块的帧间预测编码以提供时间预测信息;由运动估计单元105执行的运动估计为产生运动向量的过程,所述运动向量可以估计该视频编码块的运动,然后由运动补偿单元104基于由运动估计单元105所确定的运动向量执行运动补偿;在确定帧内预测模式之后,帧内预测单元103还用于将所选择的帧内预测数据提供到编码单元109,而且运动估计单元105将所计算确定的运动向量数据也发送到编码单元109;此外,反变换与反量化单元106是用于该视频编码块的重构建,在像素域中重构建残差块,该重构建残差块通过滤波器控制分析单元107和滤波单元108去除方块效应伪影,然后将该重构残差块添加到解码图像缓存单元110的帧中的一个预测性块,用以产生经重构建的视频编码块;编码单元109是用于编码各种编码参数及量化后的变换系数,在基于CABAC的编码算法中,上下文内容可基于相邻编码块,可用于编码指示所确定的帧内预测模式的信息,输出该视频信号的码流;而解码图像缓存单元110是用于存放重构建的视频编码块,用于预测参考。随着视频图像编码的进行,会不断生成新的重构建的视频编码块,这些重构建的视频编码块都会被存放在解码图像缓存单元110中。
参见图2B,其示出了本申请实施例提供的一种视频解码系统的组成框图示例;如图2B所示,该视频解码系统20包括解码单元201、反变换与反量化单元202、帧内预测单元203、运动补偿单元204、滤波单元205和解码图像缓存单元206等,其中,解码单元201可以实现头信息解码以及CABAC解码,滤波单元205可以实现去方块滤波以及SAO滤波。输入的视频信号经过图2A的编码处理之后,输出该视频信号的码流;该码流输入视频解码系统20中,首先经过解码单元201,用于得到解码后的变换系数;针对该变换系数通过反变换与反量化单元202进行处理,以便在像素域中产生残差块;帧内预测单元203可用于基于所确定的帧内预测模式和来自当前帧或图片的先前经解码块的数据而产生当前视频解码块的预测数据;运动补偿单元204是通过剖析运动向量和其他关联语法元素来确定用于视频解码块的预测信息,并使用该预测信息以产生正被解码的视频解码块的预测性块;通过对来自反变换与反量化单元202的残差块与由帧内预测单元203或运动补偿单元204产生的对应预测性块进行求和,而形成解码的视频块;该解码的视频信号通过滤波单元205以便去除方块效应伪影,可以改善视频质量;然后将经解码的视频块存储于解码图像缓存单元206中,解码图像缓存单元206存储用于后续帧内预测或运动补偿的参考图像,同时也用于视频信号的输出,即得到了所恢复的原始视频信号。
本申请实施例中的变换方法,可以应用在如图2A所示的变换与量化单元101部分,该变换与量化单元101包括有图1所示的正一次变换单元11和量化单元12,这时候该变换方法具体应用在变换与量化之间的部分。另外,本申请实施例中的变换方法,还可以应用在如图2A所示的反变换与反量化单元106部分或者如图2B所示的反变换与反量化单元202部分,无论是反变换与反量化单元106还是反变换与反量化单元202,均可以包括有图1所示的反量化单元13和反一次变换单元14,这时候该变换方法具体应用在反量化与反变换之间的部分。也就是说,本申请实施例中的变换方法,既可以应用于视频编码系统,也可以应用于视频解码系统,甚至还可以同时应用于视频编码系统和视频解码系统,但是本申请实施例不作具体限定。还需要说明的是,当该变换方法应用于视频编码系统时,“当前块”具体是指帧内预测中的当前编码块;当该变换方法应用于视频解码系统时,“当前块”具体是指帧内预测中的当前解码块。
基于上述图2A的应用场景示例,参见图3,其示出了本申请实施例提供的一种变换方法的流程示意图。如图3所示,该方法可以包括:
S301:确定当前块的预测模式参数;
需要说明的是,视频图像可以划分为多个图像块,每个当前待编码的图像块可以称为编码块(Coding Block,CB)。这里,每个编码块可以包括第一图像分量、第二图像分量和第三图像分量;而当前块为视频图像中当前待进行第一图像分量、第二图像分量或者第三图像分量预测的编码块。
其中,假定当前块进行第一图像分量预测,而且第一图像分量为亮度分量,即待预测图像分量为亮度分量,那么当前块也可以称为亮度块;或者,假定当前块进行第二图像分量预测,而且第二图像分量为色度分量,即待预测图像分量为色度分量,那么当前块也可以称为色度块。
还需要说明的是,预测模式参数指示了当前块的编码模式及该模式相关的参数。通常可以采用率失真优化(Rate Distortion Optimization,RDO)的方式确定当前块的预测模式参数。
具体地,在一些实施例中,对于S301来说,所述确定当前块的预测模式参数,可以包括:
确定当前块的待预测图像分量;
基于所述当前块的参数,利用多种预测模式分别对所述待预测图像分量进行预测编码,计算多种预测模式下每一种预测模式对应的率失真代价结果;
从计算得到的多个率失真代价结果中选取最小率失真代价结果,并将所述最小率失真代价结果对应的预测模式确定为所述当前块的预测模式参数。
也就是说,在编码器侧,针对当前块可以采用多种预测模式分别对待预测图像分量进行编码。这里,多种预测模式通常包括有传统帧内预测模式和非传统帧内预测模式,而传统帧内预测模式又可以包括有直流(Direct Current,DC)模式、平面(PLANAR)模式和角度模式等,非传统帧内预测模式又可以包括有MIP模式、跨分量线性模型预测(Cross-component Linear Model Prediction,CCLM)模式、帧内块复制(Intra Block Copy,IBC)模式和PLT(Palette)模式等。
这样,在利用多种预测模式分别对当前块进行编码之后,可以得到每一种预测模式对应的率失真代价结果;然后从所得到的多个率失真代价结果中选取最小率失真代价结果,并将该最小率失真代价结果对应的预测模式确定为当前块的预测模式参数;如此,最终可以使用所确定的预测模式对当前块进行编码,而且在这种预测模式下,可以使得预测残差小,能够提高编码效率。
S302:当所述预测模式参数指示当前块使用MIP确定帧内预测值时,确定MIP参数;
S303:根据所述MIP参数,确定当前块的帧内预测值,计算所述当前块与所述帧内预测值之间的预测差值;
需要说明的是,针对MIP模式,MIP预测的输入数据,包括有:当前块的位置(xTbCmp,yTbCmp)、当前块所应用的MIP预测模式(可以用modeId表示)、当前块的高度(用nTbH表示)、当前块的宽度(用nTbW表示)以及是否需要转置的转置处理指示标志(可以用isTransposed表示)等;MIP预测的输出数据,包括有:当前块的预测块,该预测块中像素坐标[x][y]所对应的帧内预测值为predSamples[x][y];其中,x=0,1,…,nTbW-1;y=0,1,…,nTbH-1。
具体地,如图4所示,MIP预测过程可以分为四个步骤:配置核心参数41、获取参考像素42、构造输入采样43以及生成预测值44。其中,对于配置核心参数41来说,根据帧内当前块的大小,可以将当前块划分为三类,用mipSizeId记录当前块的种类;而且不同种类的当前块,参考采样点数量和矩阵乘法输出采样点数量是不同的。对于获取参考像素42来说,预测当前块时,这时候当前块的上块和左块都是已编码的块,MIP技术的参考像素为当前块的上一行像素和左一列像素的重建值,获取当前块的上侧边相邻的参考像素(用refT表示)和左侧边相邻的参考像素(用refL表示)的过程即为参考像素的获取过程。对于构造输入采样43来说,该步骤用于矩阵乘法的输入,主要可以包括:获取参考采样431、构造参考采样缓冲区432和推导矩阵乘法输入采样433;其中,获取参考采样的过程为下采样过程,而构造参考采样缓冲区432又可以包括不需要转置时缓冲区的填充方式4321和需要转置时缓冲区的填充方式4322。对于生成预测值44来说,该步骤用于获取当前块的MIP预测值,主要可以包括:构造矩阵乘法输出采样块441、矩阵乘法输出采样嵌位442、矩阵乘法输出采样转置443和生成MIP最终预测值444;其中,构造矩阵乘法输出采样块441又可以包括获取权重矩阵4411、获取移位因子和偏移因子4412和矩阵乘法运算4413,生成MIP最终预测值444又可以包括生成不需要上采样的预测值4441和生成需要上采样的预测值4442。这样,在经过该四个步骤之后,可以得到当前块的帧内预测值。
如此,在确定出当前块的帧内预测值之后,可以根据当前块的像素真实值与帧内预测值进行差值计算,将计算得到的差值作为预测差值,便于后续针对预测差值进行变换处理。
进一步地,在MIP预测过程中,还需要确定出MIP参数。
在一些实施例中,MIP参数可以包括有MIP转置指示参数(可以用isTransposed表示);这里,MIP转置指示参数的取值用于指示是否对MIP模式使用的采样点输入向量进行转置处理。
具体地,在MIP模式中,根据当前块左侧边相邻参考像素对应的参考采样值和上侧边相邻参考像素对应的参考采样值,可以得到相邻参考采样集;如此,在得到相邻参考采样集之后,这时候可以构造一个输入参考样值集,即MIP模式使用的采样点输入向量。但是针对输入参考样值集的构造,在编码器侧和解码器侧的构造方式是有区别的,主要是和MIP转置指示参数的取值有关。
当应用于编码器侧时,仍然可以利用率失真优化的方式,确定MIP转置指示参数的取值,具体地,可以包括:
分别计算进行转置处理的第一代价值和不进行转置处理的第二代价值;
如果第一代价值小于第二代价值,这时候可以确定MIP转置指示参数的取值为1;
如果第一代价值不小于第二代价值,这时候可以确定MIP转置指示参数的取值为0。
进一步地,当所述MIP转置指示参数的取值为0时,在缓冲区内,可以将相邻参考采样集中上侧边对应的参考采样值存储在左侧边对应的参考采样值之前,这时候不需要进行转置处理,即不需要对MIP模式使用的采样点输入向量进行转置处理,可以直接将缓冲区确定为输入参考样值集;当所述MIP转置指示参数的取值为1时,在缓冲区内,可以将相邻参考采样集中上侧边对应的参考采样值存储在左侧边对应的参考采样值之后,这时候对所述缓冲区进行转置处理,即需要对MIP模式使用的采样点输入向量进行转置处理,然后将转置后的缓冲区确定为输入参考样值集。这样,在得到输入参考样值集之后,可以用于MIP模式下确定当前块对应的帧内预测值的过程。
还需要说明的是,在编码器侧,在确定出MIP转置指示参数的取值之后,还需要将所确定的MIP转置指示参数的取值写入码流中,便于后续在解码器侧进行解析处理。
在一些实施例中,MIP参数还可以包括MIP模式索引序号(可以用modeId表示),其中,MIP模式索引序号用于指示所述当前块使用的MIP模式,而MIP模式用于指示使用MIP确定所述当前块的帧内预测值的计算推导方式。
也就是说,在MIP模式中,由于MIP模式又可以包括有很多种,这多种MIP模式可以通过MIP模式索引序号进行区分,即不同的MIP模式具有不同的MIP模式索引序号;这样,根据使用MIP确定当前块的帧内预测值的计算推导方式,可以确定出具体的MIP模式,从而就可以得到对应的MIP模式索引序号;本申请实施例中,MIP模式索引序号的取值可以为0、1、2、3、4或5。
在一些实施例中,MIP参数还可以包括当前块的大小、宽高比等参数;其中,根据当前块的大小(即当前块的宽度和高度),还可以确定出当前块的类别(可以用mipSizeId表示)。
在一种实施方式中,根据当前块的大小,确定当前块的类别,可以包括:
如果当前块的宽度和高度均等于4,那么可以将mipSizeId的取值设置为0;
反之,如果当前块的宽度和高度之一等于4,或者当前块的宽度和高度均等于8,那么可以将mipSizeId的取值设置为1;
反之,如果当前块为其他大小的块,那么可以将mipSizeId的取值设置为2。
在另一种实施方式中,根据当前块的大小,确定当前块的类别,可以包括:
如果当前块的宽度和高度均等于4,那么可以将mipSizeId的取值设置为0;
反之,如果当前块的宽度和高度之一等于4,那么可以将mipSizeId的取值设置为1;
反之,如果当前块为其他大小的块,那么可以将mipSizeId的取值设置为2。
这样,在使用MIP确定帧内预测值的过程中,还可以确定出MIP参数,便于根据所确定的MIP参数来确定当前块使用的LFNST变换核(可以用kernel表示)。
S304:当所述当前块使用LFNST时,根据所述MIP参数,确定当前块使用的LFNST变换核,设置LFNST索引序号并写入视频码流;
需要说明的是,并不是任意的当前块都可以执行LFNST。只有当前块同时满足如下条件时,才可以对当前块进行LFNST。其中,这些条件包括:(a)当前块的宽度和高度均大于或等于4;(b)当前块的宽度和高度均小于或等于变换块的最大尺寸;(c)当前块或当前所在编码块的预测模式为帧内预测模式;(d)当前块的一次变换在水平方向和垂直方向上均为二维正向一次变换(DCT2);(e)当前块或当前块所在编码块的帧内预测模式为非MIP模式或者变换块的预测模式为MIP模式且变换块的宽度和高度均大于或等于16。也就是说,针对本申请实施例中的当前块,需要同时满足上述的五个条件。
进一步地,在确定当前块可以执行LFNST时,这时候还需要确定当前块使用的LFNST变换核(可以用kernel表示)。其中,LFNST中共有4个变换核候选集,这四个变换核候选集可以包括有set0、set1、set2和set3。其中,根据当前块或当前块所在编码块的编码参数,可以隐含推导出所选择的变换核候选集;比如在目前H.266/VVC中,根据当前块的帧内预测模式,可以确定出使用四个变换核候选集中的哪一个变换核候选集。
具体来讲,在获取到当前块的帧内预测模式之后,可以确定出帧内预测模式指示符(可以用predModeIntra表示)的取值,计算公式如下,
Figure PCTCN2019130157-appb-000001
其中,图像分量指示符(可以用cIdx表示)用于指示当前块的亮度分量或色度分量;这里,如果当前块预测的为亮度分量,那么cIdx等于0;如果当前块预测的为色度分量,那么cIdx等于1。另外,(xTbY,yTbY)是当前块左上角采样点的坐标,IntraPredModeY[xTbY][yTbY]为亮度分量的帧内预测模式,IntraPredModeC[xTbY][yTbY]为色度分量的帧内预测模式。
在目前H.266/VVC中,帧内预测模式又可以划分为传统帧内预测模式和非传统帧内预测模式。对于非传统帧内预测模式来说,predModeIntra取值指示的信息如下:
若当前块的预测模式为CCLM模式,则predModeIntra的取值可以为INTRA_LT_CCLM、INTRA_L_CCLM或INTRA_T_CCLM(在VVC中分别为81,82,83);
若当前块的预测模式为MIP模式,则predModeIntra的取值可以为所使用的MIP模式索引序号;
若当前块的预测模式为传统帧内预测模式,则predModeIntra的取值可以在[0,66]。
进一步地,如果当前块的预测模式为CCLM模式和MIP模式,那么还可以使用如下方式设置predModeIntra的取值:
(1)当前块的预测模式为CCLM模式时,
若当前块(比如色度块)对应亮度位置的中心亮度块的模式为MIP模式,即intra_mip_flag[xTbY+nTbW/2][yTbY+nTbH/2]为1,则将predMode Intra的取值设置为指示PLANAR模式的索引序号(即0);
否则,若当前块(比如色度块)对应亮度位置的中心亮度块的模式为IBC模式或者PLT模式,则将predModeIntra的取值设置为指示DC模式的索引序号(即1);
否则,将predModeIntra的取值设置为当前块(比如色度块)对应亮度位置的中心亮度块的模式索引序号的取值IntraPredModeY[xTbY+nTbW/2][yTbY+nTbH/2];
(2)当前块的预测模式为MIP模式时,
可以直接将predModeIntra的取值设置为指示PLANAR模式的索引序号(即0)。
对于传统帧内预测模式(比如宽角度映射)来说,可以根据当前块的尺寸进行宽角度的映射,将传统帧内预测模式[0,66]扩展到[-14,80];具体的映射过程如下:
首先计算宽高比例因子(可以用whRatio表示),如下所示,
whRatio=Abs(Log2(nTbW/nTbH))    (2)
对于非正方形的当前块(即nTbW不等于nTbH),这时候可以对predModeIntra进行如下修正,如果nTbW大于nTbH、且predModeIntra大于或等于2、且predModeIntra小于((whRatio>1?(8+2×whRatio):8),那么predModeIntra=(predModeIntra+65);否则,如果nTbW小于nTbH、且predModeIntra小于或等于66、且predModeIntra大于((whRatio>1?(60-2×whRatio):60),那么predModeIntra=(predModeIntra-67)。
在目前H.266/VVC中,根据predModeIntra的取值以及表1,可以确定出LFNST索引序号(可以用SetIdx表示)的取值,具体取值如表1所示。这里,LFNST索引序号的取值设置为指示当前块使用LFNST、且LFNST变换核在LFNST变换核候选集中的索引序号。通常来说,LFNST变换集中包括有四个变换核候选集(set0,set1,set2,set3),分别对应于SetIdx的取值为0、1、2、3。
表1
predModeIntra SetIdx
predModeIntra<0 1
0<=predModeIntra<=1 0
2<=predModeIntra<=12 1
13<=predModeIntra<=23 2
24<=predModeIntra<=44 3
45<=predModeIntra<=55 2
56<=predModeIntra<=80 1
在目前H.266/VVC中,针对MIP模式,由于将predModeIntra的取值设置为指示PLANAR模式的索引序号(即0),使得MIP模式下当前块所使用的变换集只能选取LFNST索引序号等于0的变换集,导致MIP模式下进行LFNST时缺乏可变性,降低了编码效率。
本申请实施例中,可以根据MIP参数,首先确定出LFNST变换核候选集,然后从LFNST变换核候选集中来确定当前块使用的LFNST变换核,并设置LFNST索引序号并写入视频码流。这里,LFNST的变换矩阵是通过训练得到的多个固定系数矩阵,LFNST变换核候选集包括有2组变换矩阵(也可以称之为LFNST变换核),当确定出LFNST变换核候选集之后,需要从LFNST变换核候选集中选取一组LFNST变换核,即确定当前块LFNST时所使用的变换矩阵。
这里,MIP参数可以包括有MIP转置指示参数(可以用isTransposed表示)、MIP模式索引序号(可以用modeId表示)、当前块的大小、当前块的类别(可以用mipSizeId表示)等参数;下面将针对如何根据MIP参数来选取当前块使用的LFNST变换核进行详细描述。
可选地,在一些实施例中,当MIP参数为MIP转置指示参数时,对于S304来说,所述当所述当前块使用LFNST时,根据所述MIP参数,确定所述当前块使用的LFNST变换核,设置LFNST索引序号并写入视频码流,可以包括:
从LFNST变换核候选集中,选择所述当前块使用的变换核;
当所述MIP转置指示参数的取值指示对MIP模式使用的采样点输入向量进行转置处理时,对所述选择的变换核进行矩阵转置处理,得到所述当前块使用的LFNST变换核;
将所述LFNST索引序号的取值设置为指示所述当前块使用LFNST、且所述LFNST变换核在LFNST变换核候选集中的索引序号;其中,所述LFNST变换核候选集包含了预设的用于MIP的两个或多个变换核。
需要说明的是,由于LFNST变换核候选集中包括有预设的用于MIP的两个或多个变换核,这时候可以使用率失真优化的方式选择当前块使用的变换核。具体地,可以针对每一种变换核分别使用率失真优化的方式计算率失真代价(Rate Distortion Cost,RDCost),然后选取率失真代价最小的变换核作为当前块使用的变换核。
也就是说,在编码器侧,可以通过RDCost选择出一组LFNST变换核,并将LFNST变换核对应的索引序号(可以用lfnst_idx表示)写入视频码流,传输到解码器侧。其中,当选择LFNST变换核候选集中的第一组LFNST变换核(即第一组变换矩阵)时,将lfnst_idx设置为1;当选择LFNST变换核候选集中的第二组LFNST变换核(即第二组变换矩阵)时,将lfnst_idx设置为2。
还需要说明的是,由于MIP转置指示参数的取值用于指示是否对MIP模式使用的采样点输入向量进行转置处理,那么当MIP转置指示参数的取值等于1,即MIP转置指示参数的取值指示对MIP模式使用的采样点输入向量进行转置处理时,此时需要对所选择的变换核进行矩阵转置处理,以得到当前块使用的LFNST变换核。
这里,针对LFNST索引序号(即lfnst_idx)的取值,当LFNST索引序号的取值等于0时,将不使用LFNST;而当LFNST索引序号的取值大于0时,将使用LFNST,且变换核的索引序号等于LFNST索引序号的取值、或者该LFNST索引序号的取值减1。如此,在确定出当前块使用的LFNST变换核后,还需要设置LFNST索引序号并写入视频码流,便于后续解码器侧通过解析码流得到该LFNST索引序号。
可选地,在一些实施例中,当MIP参数为MIP模式索引序号时,对于S304来说,所述当所述当前块使用LFNST时,根据所述MIP参数,确定所述当前块使用的LFNST变换核,设置LFNST索引序号并写入视频码流,可以包括:
根据所述MIP模式索引序号的取值,确定LFNST帧内预测模式索引序号的取值;
根据所述LFNST帧内预测模式索引序号的取值,从多个LFNST变换核候选集中选择一个LFNST变换核候选集;
从所选择的LFNST变换核候选集中,选择所述LFNST索引序号指示的变换核,设置为所述当前块使用的LFNST变换核;
将所述LFNST索引序号的取值设置为指示所述当前块使用LFNST、且所述LFNST变换核在LFNST变换核候选集中的索引序号;其中,所述LFNST变换核候选集包含预设的两个或多个LFNST变换核。
需要说明的是,MIP模式索引序号用于指示当前块使用的MIP模式,MIP模式则用于指示使用MIP确定所述当前块的帧内预测值的计算推导方式;也即,根据MIP模式索引序号,也可以确定出LFNST变换核。
还需要说明的是,在确定出MIP模式索引序号之后,还可以将MIP模式索引序号转换为LFNST帧内预测模式索引序号(可以用predModeIntra表示)的取值;然后再根据predModeIntra的取值,从多个LFNST变换核候选集中选择一个LFNST变换核候选集,以确定出变换核候选集;并且在所选择的LFNST变换核候选集中,选择出LFNST索引序号指示的变换核,设置为当前块使用的LFNST变换核。
这里,针对LFNST索引序号的取值,当LFNST索引序号的取值等于0时,将不使用LFNST;而当LFNST索引序号的取值大于0时,将使用LFNST,且变换核的索引序号等于LFNST索引序号的取值、或者该LFNST索引序号的取值减1。如此,在确定出当前块使用的LFNST变换核后,还需要设置LFNST索引序号并写入视频码流,便于后续解码器侧通过解析码流得到该LFNST索引序号。
可选地,在一些实施例中,当MIP参数为MIP模式索引序号和MIP转置指示参数时,对于S304来说,所述当所述当前块使用LFNST时,根据所述MIP参数,确定所述当前块使用的LFNST变换核,设置LFNST索引序号并写入视频码流,可以包括:
根据所述MIP模式索引序号的取值,确定LFNST帧内预测模式索引序号的取值;
根据所述LFNST帧内预测模式索引序号的取值,从多个LFNST变换核候选集中选择一个LFNST变换核候选集;
从所选择的LFNST变换核候选集中,选择所述LFNST索引序号指示的变换核,设置为所述当前块使用的LFNST变换核;
当所述MIP转置指示参数的取值指示对MIP模式使用的采样点输入向量进行转置处理时,对所述当前块使用的LFNST变换核进行矩阵转置处理,将转置处理后得到变换核设置为所述当前块使用的LFNST变换核;
将所述LFNST索引序号的取值设置为指示所述当前块使用LFNST、且所述LFNST变换核在LFNST变换核候选集中的索引序号;
其中,所述LFNST变换核候选集包含预设的两个或多个LFNST变换核。
需要说明的是,MIP模式索引序号用于指示当前块使用的MIP模式,MIP模式则用于指示使用MIP确定所述当前块的帧内预测值的计算推导方式;MIP转置指示参数的取值用于指示是否对MIP模式使用的采样点输入向量进行转置处理;也即,还可以根据MIP转置指示参数和MIP模式索引序号的两者组合,以确定出LFNST变换核。
还需要说明的是,在确定出MIP模式索引序号之后,还可以将MIP模式索引序号转换为LFNST帧内预测模式索引序号(可以用predModeIntra表示)的取值后,在根据predModeIntra的取值,从多个LFNST变换核候选集中选择一个LFNST变换核候选集,以确定出变换核候选集;并且在所选择的LFNST变换核候选集中,选择出LFNST索引序号指示的变换核;并且当指示需要转置处理时,还需要对当前块使用的LFNST变换核进行矩阵转置处理,然后将转置处理后得到变换核设置为当前块使用的LFNST变换核。
这里,针对LFNST索引序号的取值,当LFNST索引序号的取值等于0时,将不使用LFNST;而当LFNST索引序号的取值大于0时,将使用LFNST,且变换核的索引序号等于LFNST索引序号的取值、或者该LFNST索引序号的取值减1。如此,在确定出当前块使用的LFNST变换核后,还需要设置LFNST索引序号并写入视频码流,便于后续解码器侧通过解析码流得到该LFNST索引序号。
还需要说明的是,针对上述的几种选取当前块使用的LFNST变换核的方式,实验结果表明,根据MIP转置指示参数和MIP模式索引序号的两者组合,所确定LFNST变换核的性能最佳。
进一步地,当MIP参数中至少包括有MIP模式索引序号(modeId)时,在选取当前块使用的LFNST变换核的过程中,对于LFNST帧内预测模式索引序号的取值,还可以通过查表的方式获得。
具体地,在一些实施例中,所述根据所述MIP模式索引序号的取值,确定LFNST帧内预测模式索引序号的取值,可以包括:
使用第一查找表确定所述MIP模式索引序号的取值对应的所述LFNST帧内预测模式索引序号的取值,其中,所述第一查找表中,至少包含两个不同取值的LFNST帧内预测模式索引序号各自所对应的一个或多个不同的MIP模式索引序号。
这里,第一查找表(Look-Up Table1,LUT1)用于反映MIP模式索引序号和LFNST帧内预测模式索引序号之间的对应关系,即在第一查找表中,至少包含两个不同取值的LFNST帧内预测模式索引序号各自所对应的一个或多个不同的MIP模式索引序号。
也就是说,不同的MIP模式可以对应不同的predModeIntra的取值;如此,根据MIP模式确定出MIP模式索引序号,然后根据第一查找表确定出predModeIntra的取值;再根据predModeIntra的取值,从多个LFNST变换核候选集中可以选择出一个LFNST变换核候选集,进而确定出当前块使用的LFNST变换核。
可以理解地,根据MIP模式索引序号(modeId)的取值,可以确定出predModeIntra的取值;然后根据predModeIntra的取值,可以根据表2直接确定出SetIdx的取值,即确定出当前块所选择的LFNST变换核候选集。这里,SetIdx的取值指示了LFNST时所使用的变换核候选集;由于modeId的取值可以包括有0、1、2、3、4、5,那么predModeIntra的取值也为0、1、2、3、4、5;其与SetIdx的对应关系如下,
表2
predModeIntra SetIdx
0 2
1 2
2 0
3 0
4 1
5 3
进一步地,还可以根据MIP模式索引序号的取值直接确定LFNST变换核候选集,这时候不再需要借助predModeIntra的取值,即不再需要根据MIP模式索引序号来确定LFNST帧内预测模式索引序号的取值。
可选地,在一些实施例中,所述当所述当前块使用LFNST时,根据所述MIP参数,确定所述当前块使用的LFNST变换核,设置LFNST索引序号并写入视频码流,可以包括:
根据所述MIP模式索引序号的取值,从多个LFNST变换核候选集中选择一个LFNST变换核候选集;
从所选择的LFNST变换核候选集中,选择所述LFNST索引序号指示的变换核,设置为所述当前块使用的LFNST变换核;
将所述LFNST索引序号的取值设置为指示所述当前块使用LFNST、且所述LFNST变换核在LFNST变换核候选集中的索引序号;
其中,所述LFNST变换核候选集包含预设的两个或多个LFNST变换核。
进一步地,所述根据所述MIP模式索引序号的取值,从多个LFNST变换核候选集中选择一个LFNST变换核候选集,可以包括:
使用第二查找表确定所述MIP模式索引序号的取值对应的LFNST变换核候选集索引序号的取值,选择所述LFNST变换核候选集索引序号的取值指示的LFNST变换核候选集,作为所述选择的LFNST变换核候选集;
其中,所述第二查找表(Look-Up Table2,LUT2)中,至少包含两个不同取值的所述LFNST变换核候选集索引序号各自对应的一个或多个不同的MIP模式索引序号。
需要说明的是,如果当前块使用的预测模式为MIP模式,那么可以根据MIP模式索引序号(modeId)的取值来确定所选择的LFNST变换核候选集。如表3所示,每一种MIP模式索引序号对应一种LFNST变换核候选集。
表3
modeId SetIdx
0 0
1 0
2 0
3 1
4 2
5 3
这样,根据MIP模式索引序号的取值,可以确定出对应的LFNST变换核候选集索引序号的取值,以选择出述LFNST变换核候选集索引序号的取值所指示的LFNST变换核候选集,将其作为所选择的LFNST变换核候选集。例如,从表3中可以看出,当MIP模式索引序号(modeId)的取值为0时,这时候可以确定出LFNST变换核候选集索引序号(SetIdx)的取值为0,也就是将0所指示的变换核候选集作为所选择的LFNST变换核候选集;或者,当modeId为3时,这时候可以确定出SetIdx的取值为1,也就是将1所指示的变换核候选集作为所选择的LFNST变换核候选集等等。
可选地,在一些实施例中,所述根据所述MIP模式索引序号的取值,从多个LFNST变换核候选集中选择一个LFNST变换核候选集,可以包括:
根据所述MIP模式索引序号的取值,使用第一计算方式确定LFNST变换核候选集的索引序号;
选择所述LFNST变换核候选集索引序号的取值指示的LFNST变换核候选集,作为所述选择的LFNST变换核候选集。
进一步地,所述根据所述MIP模式索引序号的取值,使用第一计算方式确定LFNST变换核候选集的索引序号,可以包括:
当所述MIP模式索引序号的取值小于第一预设值时,将所述LFNST变换核候选集索引序号的取值设置为等于所述MIP模式索引序号的取值;
当所述MIP模式索引序号的取值大于或等于第一预设值时,将所述LFNST变换核候选集索引序号的取值设置为等于所述MIP模式索引序号的取值减去第二预设值得到的差值;其中,所述第一预设值和所述第二预设值均是整数值。
在本申请实施例中,第一预设值的取值可以等于3,第二预设值的取值可以等于2。
也就是说,根据MIP模式索引序号的取值,可以使用第一计算方式确定LFNST变换核候选集的索引序号,其中,第一计算公式如下,
SetIdx=modeId<x?0:(modeId-y)     (3)
其中,x表示第一预设值,y表示第二预设值;SetIdx表示LFNST变换核候选集索引序号的取值,modeId表示MIP模式索引序号的取值。
具体地,假定x等于3,y等于2;那么当modeId<3时,表示了这时候SetIdx可以为0;当modeId≥3时,表示了这时候SetIdx可以为modeId-2;即modeId=3时,SetIdx可以为1;modeId=4时,SetIdx可以为2;modeId=5时,SetIdx可以为3;可以看出,根据式(3),所得到的SetIdx的取值与表3的内容是相同的。
除此之外,如果当前块的预测模式为MIP模式,针对LFNST变换核候选集的确定,还可以固定选用其中一种变换集(比如set1或者set2或者set3)作为从多个LFNST变换核候选集中所选择的一个LFNST变换核候选集。
另外,如果当前块的预测模式为MIP模式,还可以根据MIP模式索引序号(modeId)的取值来选择LFNST变换核候选集;如表4所示,每一种MIP模式对应一种LFNST变换核候选集;这里,针对LFNST变换核候选集的具体编号作限定;其中,a、b、c、d、e均可以从{0,1,2,3}中任意取值。
表4
modeId SetIdx
0 a
1 b
2 c
3 d
4 e
5 f
还需要注意的是,如果当前块的预测模式为MIP模式,也可以根据MIP参数中的一种或多种信息组合,来选择LFNST变换核候选集;还可以是根据MIP参数进行与传统帧内预测模式之间的映射,然后根据所映射的角度,来选择LFNST变换核候选集;甚至还可以是根据MIP参数中的一种或多种信息组合来判断使用的变换矩阵(即变换核),而判断变换矩阵包括有变换集和变换矩阵组别的选择;这里,可以根据MIP参数固定选择某一变换集中的某一变换矩阵组别,不用在编码器侧进行选择,这时候也不需要传输lfnst_idx。
进一步地,在一些实施例中,当预测模式参数指示当前块使用非MIP模式时,该方法还可以包括:
基于所述帧内预测模式,确定predModeIntra的取值;
根据predModeIntra的取值,从多个LFNST变换核候选集中选择一个LFNST变换核候选集。
也就是说,如果当前块的预测模式为非MIP模式,这时候可以根据帧内预测模式,确定出predModeIntra的取值;然后根据predModeIntra的取值,同时结合上述的表1,可以从多个LFNST变换核候选集中选择出LFNST变换核候选集,进而从所选择的LFNST变换核候选集中,选择LFNST索引序号指示的变换核,设置为所述当前块使用的LFNST变换核;将LFNST索引序号的取值设置为指示当前块使用LFNST、且所述LFNST变换核在LFNST变换核候选集中的索引序号。
这里,针对LFNST索引序号的取值,当LFNST索引序号的取值等于0时,将不使用LFNST;而当LFNST索引序号的取值大于0时,将使用LFNST,且变换核的索引序号等于LFNST索引序号的取值、或者该LFNST索引序号的取值减1。如此,在确定出当前块使用的LFNST变换核后,还需要设置LFNST索引序号并写入视频码流,便于后续解码器侧通过解析码流得到该LFNST索引序号。
S305:使用所述LFNST变换核,对所述预测差值进行变换处理。
需要说明的是,在确定出FNST变换核之后,就可以得到当前块所选择的变换矩阵,这时候就可以对预测差值进行变换处理。
其中,每组变换矩阵还可以包含两种尺寸的基础变换矩阵T,比如16x16和16x48。而针对对于4种尺寸的TU所选择的变换矩阵而言,具体地,对于4x4尺寸的TU,会使用8x16的变换矩阵,该8x16的变换矩阵来自于16x16基础变换矩阵的前8x16;对于4xN或Nx4(N>4)尺寸的TU,会使用16x16的基础变换矩阵;对于8x8尺寸的TU,会使用8x48的变换矩阵,该8x48的变换矩阵来自于16x48基础变换矩阵的前8x48;对于大于8x8尺寸的TU,会使用16x48的基础变换矩阵。需要注意的是,在目前H.266/VVC中,仅存储了解码器侧LFNST的变换矩阵(可以用T T表示),而编码器侧所使用的变换矩阵为LFNST的变换矩阵的转置矩阵(可以用T表示)。
还需要说明的是,LFNST是基于直接矩阵乘法方式来应用不可分离变换。为了尽可能减小计算复杂度和的存储空间,在LFNST变换中使用了简化的不可分变换技术。其中,简化的不可分变换技术的主要思想是将N维向量映射到不同空间中的R维向量,这里,N/R(R<N)为缩放因子;这时候简化的不可分变换技术所对应的变换矩阵为R×N矩阵,如下所示,
Figure PCTCN2019130157-appb-000002
这里,正向LFNST变换和反向LFNST变换所使用的变换矩阵互为转置关系,参见图5,其示出了本申请实施例提供的一种LFNST技术矩阵乘法的计算过程的结构示意图。如图5所示,(a)示出了正向LFNST变换的计算过程,由一次变换系数经过变换矩阵T之后,可以得到二次变换系数;(b)示出了反向LFNST变换的计算过程,由反二次变换系数经过转置变换矩阵T T之后,可以得到反一次变换系数。
进一步地,在LFNST技术中,可以根据当前块的大小决定是采用4×4不可分变换还是8×8不可分变换;这里,可以将“4×4不可分变换”统称为“4×4LFNST”,“8×8不可分变换”统称为“8×8LFNST”。其中,假定当前块的宽度为nTbW,高度为nTbH,那么可以得出:如果min(nTbW,nTbH)<=4,那么可以对当前块使用4×4LFNST;否则,可以对当前块使用8×8LFNST。需要注意的是,min(A,B)的返回值是A和B中的较小值。
在一种实施方式中,针对4×4LFNST,在编码器侧,将会输入16个系数,经过正向LFNST后,会输出16个或8个系数;而在解码器侧,将会输入16个或8个系数,会输出16个系数;也就是说,编码器和解码器关于输入和输出的数量正好相反。
假定变换块(Transform unit,TU)的大小可以表示为nTbW×nTbH,其中,变换块是基于预测差值所得到的预测残差块。即TU可以等于4×4,也可以等于4×N或N×4(N>4)。下面分别对其进行详细描述。
当TU等于4×4时,4×4的变换块对应的正向LFNST过程如图6A所示。其中,在图6A中,白色块为预测差值,灰色块为一次变换系数,黑色块为二次变换系数;这里,在“0”示例的位置上,编码器将变换系数设置为0。对于4×4的变换块,正向LFNST时,使用的变换矩阵大小为8×16,当前变换块内的4×4个一次变换系数全部作为输入,输出为4×2个二次变换系数。
当TU等于4×N或N×4(N>4)时,4×N或N×4的变换块对应的正向LFNST过程如图6B所示。其中,在图6B中,白色块为预测差值,灰色块为一次变换系数,黑色块为二次变换系数;这里,对于4×N或N×4的变换块,正向LFNST时,使用的变换矩阵大小为16×16,当前变换块内的第一个4×4子块(具体地,对于4×N变换块为最上侧子块,对于N×4变换块为最左侧子块)内的一次变换系数作为输入,输出为4×4个二次变换系数。这里,在“0”示例的位置上,编码器将变换系数仍然设置为0。
在另一种实施方式中,对于8×8LFNST,在编码器侧,将会输入48个系数,经过正向LFNST后,会输出16个或8个系数;而在解码器侧,将会输入16个或8个系数,会输出48个系数;也就是说,编码器和解码器关于输入和输出的数量正好相反。
当TU等于8×8时,8×8的变换块对应的正向LFNST过程如图6C所示。其中,在图6C中,白色块为预测差值,灰色块为一次变换系数,黑色块为二次变换系数;对于8×8的变换块,正向LFNST时,使用的变换矩阵大小为8×48,当前变换块内的前三个4×4子块(即位于左上角的三个子块)的一次变换系数作为输入,输出为4×2个二次变换系数。这里,在“0”示例的位置上,编码器将变换系数仍然设置为0。
当TU大于8×8时,大于8×8的变换块对应的正向LFNST过程如图6D所示。其中,在图6D中,白色块为预测差值,灰色块为一次变换系数,黑色块为二次变换系数;对于大于8×8的变换块,正向LFNST时,使用的变换矩阵大小为48×16,当前变换块内的前三个4×4子块(即位于左上角的三个子块)的一次变换系数作为输入,输出为4×4个二次变换系数。这里,在“0”示例的位置上,编码器将变换系数仍然设置为0。
这样,预测差值所对应的TU无论是4×4大小,还是4×N或N×4(N>4)大小、或者8×8大小,甚至还可以大于8×8大小,这时候可以按照图6A或者图6B或者图6C或者图6D来实现对预测差值的变换处理。
在本申请实施例中,可以提高LFNST技术对使用MIP模式的当前块的适用性,使得变换集(或者变换核)的选取更加灵活。通过在使用MIP模式的当前块进行LFNST过程中引入了MIP参数的相关信息,并根据这些MIP信息判断当前块的特性,进而选择出变换集(或者变换核)。例如,该变换方法应用在VTM7.0上,以24帧间隔在All Intra条件下进行测试,基于同等峰值信噪比(Peak Signal to Noise Ratio,PSNR)下的平均码率变化,这时候可以在三个图像分量(即Y、Cb和Cr)上分别获得-0.03%、0.00%和-0.01%的BD-rate变化;尤其是在大分辨率的序列上,将会有更好的性能表现,具体地,在Class A1上可以达到Y有-0.10%的BD-rate变化,从而提高了编码效率。
本实施例提供了一种变换方法,应用于编码器。确定当前块的预测模式参数;当所述预测模式参数指示所述当前块使用基于矩阵的帧内预测MIP确定帧内预测值时,确定MIP参数;根据所述MIP参数,确定所述当前块的帧内预测值,计算所述当前块与所述帧内预测值之间的预测差值;当所述当前块使用低频不可分离二次变换LFNST时,根据所述MIP参数,确定所述当前块使用的LFNST变换核,设置LFNST索引序号并写入视频码流;使用所述LFNST变换核,对所述预测差值进行变换处理。这样,针对采用MIP模式的当前块来说,由于在进行LFNST变换时引入了MIP参数,使得LFNST变换核的选择更加灵活,从而不仅提高了LFNST技术对非传统帧内预测模式的适用性,还提高了编码效率,同时还能够提升视频图像质量。
基于上述图2B的应用场景示例,参见图7,其示出了本申请实施例提供的另一种变换方法的流程示意图。如图7所示,该方法可以包括:
S701:解析码流,确定当前块的预测模式参数;
需要说明的是,预测模式参数指示了当前块的编码模式及该模式相关的参数。其中,预测模式通常包括有传统帧内预测模式和非传统帧内预测模式,而传统帧内预测模式又可以包括有DC模式、PLANAR模式和角度模式等,非传统帧内预测模式又可以包括有MIP模式、CCLM模式、IBC模式和PLT模式等。
还需要说明的是,在编码器侧,会针对当前块进行预测编码,在这过程中就可以确定出当前块的预测模式,并将相应的预测模式参数写入码流,由编码器传输到解码器。
在解码器侧,通过解析码流可以获取到当前块或者当前块所在编码块的亮度或色度分量的帧内预测模式,这时候可以确定出predModeIntra的取值,计算公式如前述式(1)。
在式(1)中,图像分量指示符(可以用cIdx表示)用于指示当前块的亮度分量或色度分量;这里,如果当前块预测的为亮度分量,那么cIdx等于0;如果当前块预测的为色度分量,那么cIdx等于1。另外,(xTbY,yTbY)是当前块左上角采样点的坐标,IntraPredModeY[xTbY][yTbY]为亮度分量的帧内预测模式,IntraPredModeC[xTbY][yTbY]为色度分量的帧内预测模式。
S702:当所述预测模式参数指示当前块使用MIP确定帧内预测值时,解析码流,确定MIP参数;
需要说明的是,MIP参数可以包括有MIP转置指示参数(可以用isTransposed表示)、MIP模式索引序号(可以用modeId表示)、当前块的大小、当前块的类别(可以用mipSizeId表示)等参数;这些参数的取值可以通过解析码流得到。
在一些实施例中,通过解析码流,可以确定isTransposed的取值;当isTransposed的取值等于1时,需要对MIP模式使用的采样点输入向量进行转置处理;当isTransposed的取值等于0时,不需要对MIP模式使用的采样点输入向量进行转置处理;也就是说,MIP转置指示参数可以用于指示是否对MIP模式使用的采样点输入向量进行转置处理。
在一些实施例中,通过解析码流,还可以确定MIP模式索引序号(可以用modeId表示);其中,MIP模式索引序号可以用于指示当前块使用的MIP模式,MIP模式可以用于指示使用MIP确定当前块的帧内预测值的计算推导方式。也就是说,不同的MIP模式,其对应的MIP模式索引序号的取值是不同的;这里,MIP模式索引序号的取值可以为0、1、2、3、4或5。
在一些实施例中,通过解析码流,还可以确定当前块的大小、宽高比、当前块的类别(可以用mipSizeId表示)等参数信息。这样,在确定出MIP参数之后,以方便后续根据所确定的MIP参数来选择当前块使用的LFNST变换核(可以用kernel表示)。
S703:解析码流,确定所述当前块的变换系数和LFNST索引序号;
需要说明的是,LFNST索引序号的取值可以用于指示当前块是否使用LFNST、且LFNST变换核在LFNST变换核候选集中的索引序号。具体地,在解析出LFNST索引序号之后,当LFNST索引序号的取值等于0时,表明了当前块不使用LFNST;而当LFNST索引序号的取值大于0时,表明了当前块使用LFNST,且变换核的索引序号等于LFNST索引序号的取值、或者该LFNST索引序号的取值减1。
还需要说明的是,在解码器侧,LFNST的输入数据,可以包括有:当前变换块的亮度位置(xTbY,yTbY),当前块的宽度nTbW,当前块的高度nTbH,当前块是亮度分量还是色度分量cIdx,当前变换块反量化(Scaling)后的系数d[x][y],x=0,1,…,nTbW-1,y=0,1,…,nTbH-1;LFNST的输出数据,可以包括有:二次变换系数经过LFNST生成的一次变换系数d’[x][y],x=0,1,…,nLfnstSize-1,y=0,1,…,nLfnstSize-1。
具体地,如图8所示,LFNST具体过程可以分为四个步骤:配置核心参数81、帧内预测模式映射82、选择变换矩阵83、计算矩阵乘法84和构造一次变换系数矩阵85等五个步骤。其中,对于帧内预测模式映射82来说,该步骤用于确定predModeIntra的取值,主要可以包括:非传统帧内预测模式映射821和宽角度映射822;对于选择变换矩阵83来说,该步骤用于选择出变换集以及变换矩阵,主要可以包括:选择变换集831、选择变换矩阵组别832和选择变换矩阵尺寸833。
对于配置核心参数81来说,首先需要配置进行LFNST计算的输入二次变换系数向量的长度(可以用nonZeroSize表示)和输出一次变换系数向量的长度(可以用nLfnstOutSzie表示)。其中,针对nonZeroSize和nLfnstOutSzie的取值如表5所示。
表5
变换块尺寸 nonZeroSize nLfnstOutSzie
4×4 8 16
4×N或N×4(N>4) 16 16
8×8 8 48
>8×8 16 48
在目前H.266/VVC中,则是通过以下公式计算得到nonZeroSize和nLfnstOutSzie等参数配置的,公式如下,
nLfnstOutSzie=(nTbW>=8&&nTbH>=8)?48:16    (5)
nonZeroSize=(nTbW==4&&nTbH==4)||(nTbW==8&&nTbH==8)?8:16   (6)
除此之外,还需要配置参数nLfnstSize,表示当前块内仅前nLfnstSize×nLfnstSize范围内会存在有一次变换系数,nLfnstSize的取值如下所示,
Log2LfnstSize=(nTbW>=8&&nTbH>=8)?3:2    (7)
nLfnstSize=1<<Log2LfnstSize      (8)
这时候通过解析码流,还可以获取到当前块或者当前块所在编码块的亮度或色度分量的帧内预测模式,这时候可以确定出predModeIntra的取值,计算公式如前述式(1)。
进一步地,获取二次变化系数的向量u[i],i=0,1,…,nonZeroSize-1。在确定当前变换块使用了LFNST时,此时的反量化后的系数d[x][y]即为二次变换系数。按照对角扫描顺序获取其前nonZeroSize个值,即为二次变化系数的向量u[i],i=0,1,…,nonZeroSize-1;在下式中,xC和yC表示为按照对角顺序,编号为x的系数所在当前块内相对于左上角点的横坐标和纵坐标),xC和yC如下所示,
xC=DiagScanOrder[2][2][x][0]    (9)
yC=DiagScanOrder[2][2][x][1]     (10)
u[i]=d[xC][yC]    (11)
进一步地,对于帧内预测模式映射82来说,帧内预测模式又可以划分为传统帧内预测模式和非传统帧内预测模式。对于非传统帧内预测模式来说,predModeIntra取值指示的信息如下:
若predModeIntra的取值可以为INTRA_LT_CCLM、INTRA_L_CCLM或INTRA_T_CCLM(在VVC中分别为81,82,83),则指示当前块的预测模式为CCLM模式;
若intra_mip_flag[xTbY][yTbY]等于1而且cIdx等于0,则指示当前块的预测模式为MIP模式,此时predModeIntra的取值指示了所使用的MIP模式索引序号modeId;
若不是上述的两种情况,predModeIntra的取值可以在[0,66],则指示当前块的预测模式为传统帧内预测模式。
进一步地,通过解析码流根据传统帧内预测模式的编号来确定LFNST变换核候选集索引序号。这时候,如果当前块的预测模式为CCLM模式和MIP模式,那么还可以使用如下方式设置predModeIntra的取值:
(1)当predModeIntra的取值指示INTRA_LT_CCLM、INTRA_L_CCLM或INTRA_T_CCLM(在VVC中分别为81,82,83)时,
若当前块(比如色度块)对应亮度位置的中心亮度块的模式为MIP模式,即intra_mip_flag[xTbY+nTbW/2][yTbY+nTbH/2]为1,则将predMode Intra的取值设置为指示PLANAR模式的索引序号(即0);
否则,若当前块(比如色度块)对应亮度位置的中心亮度块的模式为IBC模式或者PLT模式,则将predModeIntra的取值设置为指示DC模式的索引序号(即1);
否则,将predModeIntra的取值设置为当前块(比如色度块)对应亮度位置的中心亮度块的模式索引序号的取值IntraPredModeY[xTbY+nTbW/2][yTbY+nTbH/2];
(2)当intra_mip_flag[xTbY][yTbY]等于1而且cIdx等于0时,即当前块的预测模式为MIP模式,可以直接将predModeIntra的取值设置为指示PLANAR模式的索引序号(即0)。
对于传统帧内预测模式(比如宽角度映射)来说,在解析码流的过程中,还可以根据当前块的尺寸进行宽角度的映射,将传统帧内预测模式[0,66]扩展到[-14,80];具体的映射过程如下:
首先计算宽高比例因子(可以用whRatio表示),如上述的式(2)所示。
对于非正方形的当前块(即nTbW不等于nTbH),可以对predModeIntra的取值进行如下修正,如果nTbW大于nTbH、且predModeIntra大于或等于2、且predModeIntra小于((whRatio>1?(8+2×whRatio):8),那么predModeIntra=(predModeIntra+65);否则,如果nTbW小于nTbH、且predModeIntra小于或等于66、且predModeIntra大于((whRatio>1?(60-2×whRatio):60),那么predModeIntra=(predModeIntra-67)。
在目前H.266/VVC中,根据predModeIntra的取值以及表1,可以确定出LFNST索引序号(可以用SetIdx表示)的取值,具体取值如表1所示。这里,LFNST索引序号的取值设置为指示当前块使用LFNST、且LFNST变换核在LFNST变换核候选集中的索引序号。通常来说,LFNST变换集中包括有四个变换核候选集(set0,set1,set2,set3),分别对应于SetIdx的取值为0、1、2、3。
在目前H.266/VVC中,针对MIP模式,由于将predModeIntra的取值设置为指示PLANAR模式的索引序号(即0),使得MIP模式下当前块所使用的变换集只能选取LFNST索引序号等于0的变换集,导致MIP模式下进行LFNST时缺乏可变性,降低了解码效率。而在本申请实施例中,在确定出LFNST索引序号之后,可以根据MIP参数,确定出LFNST变换核候选集,然后从LFNST变换核候选集中来确定当前块使用的LFNST变换核。
S704:当所述LFNST索引序号指示当前块使用LFNST时,根据MIP参数,确定所述当前块使用的LFNST变换核;
这里,MIP参数可以包括有MIP转置指示参数(可以用isTransposed表示)、MIP模式索引序号(可以用modeId表示)、当前块的大小、当前块的类别(可以用mipSizeId表示)等参数;下面将针对如何根据MIP参数来选取当前块使用的LFNST变换核进行详细描述。
可选地,在一些实施例中,当MIP参数为MIP转置指示参数时,对于S704来说,所述当所述LFNST索引序号指示所述当前块使用LFNST时,根据所述MIP参数,确定所述当前块使用的LFNST变换核,可以包括:
从LFNST变换核候选集中,选择所述LFNST索引序号指示的变换核;
当所述MIP转置指示参数的取值指示对MIP模式使用的采样点输入向量进行转置处理时,对所述选择的变换核进行矩阵转置处理,得到所述当前块使用的LFNST变换核;其中,所述LFNST变换核候选集包含预设的用于MIP的两个或多个变换核。
需要说明的是,由于LFNST变换核候选集中包括有预设的用于MIP的两个或多个变换核,通过解析码流获得LFNST索引序号之后,可以根据所获得LFNST索引序号的取值,从LFNST变换核候选集中选择出LFNST索引序号指示的变换核。例如,当LFNST索引序号的取值为1时,将选择LFNST变换核候选集中的第一组LFNST变换核(即第一组变换矩阵);而当LFNST索引序号的取值为2时,将选择LFNST变换核候选集中的第二组LFNST变换核(即第二组变换矩阵)。
还需要说明的是,由于MIP转置指示参数的取值用于指示是否对MIP模式使用的采样点输入向量进行转置处理,那么当MIP转置指示参数的取值等于1,即MIP转置指示参数的取值指示对MIP模式使用的采样点输入向量进行转置处理时,此时需要对所选择的变换核进行矩阵转置处理,以得到当前块使用的LFNST变换核。
这里,针对LFNST索引序号(即lfnst_idx)的取值,当LFNST索引序号的取值等于0时,将不使用LFNST;而当LFNST索引序号的取值大于0时,将使用LFNST,且变换核的索引序号等于LFNST索引序号的取值、或者该LFNST索引序号的取值减1。如此,根据LFNST索引序号,可以确定出当前块使用的LFNST变换核。
可选地,在一些实施例中,当MIP参数为MIP模式索引序号时,对于S704来说,所述当所述LFNST索引序号指示所述当前块使用LFNST时,根据所述MIP参数,确定所述当前块使用的LFNST变换核,可以包括:
根据所述MIP模式索引序号的取值,确定LFNST帧内预测模式索引序号的取值;
根据所述LFNST帧内预测模式索引序号的取值,从多个LFNST变换核候选集中选择一个LFNST变换核候选集;
从所选择的LFNST变换核候选集中,选择所述LFNST索引序号指示的变换核,设置为所述当前块使用的LFNST变换核;其中,所述LFNST变换核候选集包含预设的两个或多个LFNST变换核。
需要说明的是,MIP模式索引序号用于指示当前块使用的MIP模式,MIP模式则用于指示使用MIP确定所述当前块的帧内预测值的计算推导方式;也即,根据MIP模式索引序号,也可以确定出LFNST变换核。
还需要说明的是,在确定出MIP模式索引序号之后,还可以将MIP模式索引序号转换为LFNST帧内预测模式索引序号(可以用predModeIntra表示)的取值;然后再根据predModeIntra的取值,从多个LFNST变换核候选集中选择一个LFNST变换核候选集,以确定出变换核候选集;并且在所选择的LFNST变换核候选集中,选择出LFNST索引序号指示的变换核,设置为当前块使用的LFNST变换核。
可选地,在一些实施例中,当MIP参数为MIP模式索引序号和MIP转置指示参数时,对于S704来说,所述当所述LFNST索引序号指示所述当前块使用LFNST时,根据所述MIP参数,确定所述当前块使用的LFNST变换核,可以包括:
根据所述MIP模式索引序号的取值,确定LFNST帧内预测模式索引序号的取值;
根据所述LFNST帧内预测模式索引序号的取值,从多个LFNST变换核候选集中选择一个LFNST变换核候选集;
从所选择的LFNST变换核候选集中,选择所述LFNST索引序号指示的变换核,设置为所述当前块使用的LFNST变换核;
当所述MIP转置指示参数的取值指示对MIP模式使用的采样点输入向量进行转置处理时,对所述当前块使用的LFNST变换核进行矩阵转置处理,将转置处理后得到变换核设置为所述当前块使用的LFNST变换核;其中,所述LFNST变换核候选集包含预设的两个或多个LFNST变换核。
需要说明的是,MIP模式索引序号用于指示当前块使用的MIP模式,MIP模式则用于指示使用MIP确定所述当前块的帧内预测值的计算推导方式;MIP转置指示参数的取值用于指示是否对MIP模式使用的采样点输入向量进行转置处理;也即,还可以根据MIP转置指示参数和MIP模式索引序号的两者组合,以确定出LFNST变换核。
还需要说明的是,在确定出MIP模式索引序号之后,还可以将MIP模式索引序号转换为LFNST帧内预测模式索引序号(可以用predModeIntra表示)的取值后,在根据predModeIntra的取值,从多个LFNST变换核候选集中选择一个LFNST变换核候选集,以确定出变换核候选集;并且在所选择的LFNST变换核候选集中,选择出LFNST索引序号指示的变换核;并且当指示需要转置处理时,还需要对当前块使用的LFNST变换核进行矩阵转置处理,然后将转置处理后得到变换核设置为当前块使用的LFNST变换核。
还需要说明的是,针对上述的几种选取当前块使用的LFNST变换核的方式,实验结果表明,根据MIP转置指示参数和MIP模式索引序号的两者组合,所确定LFNST变换核的性能最佳。
进一步地,当MIP参数中至少包括有MIP模式索引序号(modeId)时,在选取当前块使用的LFNST变换核的过程中,对于LFNST帧内预测模式索引序号的取值,还可以通过查表的方式获得。
具体地,在一些实施例中,所述根据所述MIP模式索引序号的取值,确定LFNST帧内预测模式索引序号的取值,可以包括:
使用第一查找表确定所述MIP模式索引序号的取值对应的所述LFNST帧内预测模式索引序号的取值,其中,所述第一查找表中,至少包含两个不同取值的LFNST帧内预测模式索引序号各自所对应的一个或多个不同的MIP模式索引序号。
这里,第一查找表(Look-Up Table1,LUT1)用于反映MIP模式索引序号和LFNST帧内预测模式索引序号之间的对应关系,即在第一查找表中,至少包含两个不同取值的LFNST帧内预测模式索引序号各自所对应的一个或多个不同的MIP模式索引序号。
也就是说,不同的MIP模式可以对应不同的predModeIntra的取值;如此,根据MIP模式确定出MIP模式索引序号,然后根据第一查找表确定出predModeIntra的取值;再根据predModeIntra的取值,从多个LFNST变换核候选集中可以选择出一个LFNST变换核候选集,进而确定出当前块使用的LFNST变换核。
可以理解地,根据MIP模式索引序号(modeId)的取值,可以确定出predModeIntra的取值;然后根据predModeIntra的取值,可以根据表2直接确定出SetIdx的取值,即确定出当前块所选择的LFNST变换核候选集。这里,SetIdx的取值指示了LFNST时所使用的变换核候选集;由于modeId的取值可以包括有0、1、2、3、4、5,那么predModeIntra的取值也为0、1、2、3、4、5;其predModeIntra与SetIdx的对应关系参加表2。
进一步地,还可以根据MIP模式索引序号的取值直接确定LFNST变换核候选集,这时候不再需要借助predModeIntra的取值,即不再需要根据MIP模式索引序号来确定LFNST帧内预测模式索引序号的取值。
可选地,在一些实施例中,所述当所述LFNST索引序号指示所述当前块使用LFNST时,根据所述MIP参数,确定所述当前块使用的LFNST变换核,可以包括:
根据所述MIP模式索引序号的取值,从多个LFNST变换核候选集中选择一个LFNST变换核候选集;
从所选择的LFNST变换核候选集中,选择所述LFNST索引序号指示的变换核,设置为所述当前块使用的LFNST变换核;其中,所述LFNST变换核候选集包含预设的两个或多个LFNST变换核。
进一步地,所述根据所述MIP模式索引序号的取值,从多个LFNST变换核候选集中选择一个LFNST变换核候选集,可以包括:
使用第二查找表确定所述MIP模式索引序号的取值对应的LFNST变换核候选集索引序号的取值,选择所述LFNST变换核候选集索引序号的取值指示的LFNST变换核候选集,作为所述选择的LFNST 变换核候选集;
其中,所述第二查找表(Look-Up Table2,LUT2)中,至少包含两个不同取值的所述LFNST变换核候选集索引序号各自对应的一个或多个不同的MIP模式索引序号。
需要说明的是,如果当前块使用的预测模式为MIP模式,那么可以根据MIP模式索引序号(modeId)的取值来确定所选择的LFNST变换核候选集。如表3所示,每一种MIP模式索引序号对应一种LFNST变换核候选集。
这样,根据MIP模式索引序号的取值,可以确定出对应的LFNST变换核候选集索引序号的取值,以选择出述LFNST变换核候选集索引序号的取值所指示的LFNST变换核候选集,将其作为所选择的LFNST变换核候选集。例如,从表3中可以看出,当MIP模式索引序号(modeId)的取值为0时,这时候可以确定出LFNST变换核候选集索引序号(SetIdx)的取值为0,也就是将0所指示的变换核候选集作为所选择的LFNST变换核候选集;或者,当modeId为3时,这时候可以确定出SetIdx的取值为1,也就是将1所指示的变换核候选集作为所选择的LFNST变换核候选集等等。
可选地,在一些实施例中,所述根据所述MIP模式索引序号的取值,从多个LFNST变换核候选集中选择一个LFNST变换核候选集,可以包括:
根据所述MIP模式索引序号的取值,使用第一计算方式确定LFNST变换核候选集的索引序号;
选择所述LFNST变换核候选集索引序号的取值指示的LFNST变换核候选集,作为所述选择的LFNST变换核候选集。
进一步地,所述根据所述MIP模式索引序号的取值,使用第一计算方式确定LFNST变换核候选集的索引序号,可以包括:
当所述MIP模式索引序号的取值小于第一预设值时,将所述LFNST变换核候选集索引序号的取值设置为等于所述MIP模式索引序号的取值;
当所述MIP模式索引序号的取值大于或等于第一预设值时,将所述LFNST变换核候选集索引序号的取值设置为等于所述MIP模式索引序号的取值减去第二预设值得到的差值;其中,所述第一预设值和所述第二预设值均是整数值。
在本申请实施例中,第一预设值的取值可以等于3,第二预设值的取值可以等于2。
也就是说,根据MIP模式索引序号的取值,可以使用第一计算方式确定LFNST变换核候选集的索引序号,其中,第一计算公式如上述的式(3)所示,x表示第一预设值,y表示第二预设值;SetIdx表示LFNST变换核候选集索引序号的取值,modeId表示MIP模式索引序号的取值。
具体地,假定x等于3,y等于2;那么当modeId<3时,表示了这时候SetIdx可以为0;当modeId≥3时,表示了这时候SetIdx可以为modeId-2;即modeId=3时,SetIdx可以为1;modeId=4时,SetIdx可以为2;modeId=5时,SetIdx可以为3;可以看出,根据式(3),所得到的SetIdx的取值与表3的内容是相同的。
除此之外,如果当前块的预测模式为MIP模式,针对LFNST变换核候选集的确定,还可以固定选用其中一种变换集(比如set1或者set2或者set3)作为从多个LFNST变换核候选集中所选择的一个LFNST变换核候选集。
另外,如果当前块的预测模式为MIP模式,还可以根据MIP模式索引序号(modeId)的取值来选择LFNST变换核候选集;如表4所示,每一种MIP模式对应一种LFNST变换核候选集;这里,针对LFNST变换核候选集的具体编号作限定;其中,a、b、c、d、e均可以从{0,1,2,3}中任意取值。
还需要注意的是,如果当前块的预测模式为MIP模式,也可以根据MIP参数中的一种或多种信息组合,来选择LFNST变换核候选集;还可以是根据MIP参数进行与传统帧内预测模式之间的映射,然后根据所映射的角度,来选择LFNST变换核候选集;甚至还可以是根据MIP参数中的一种或多种信息组合来判断使用的变换矩阵(即变换核),而判断变换矩阵包括有变换集和变换矩阵组别的选择;这里,可以根据MIP参数固定选择某一变换集中的某一变换矩阵组别,既不需要在编码器侧进行选择,也就不需要传输lfnst_idx,解码器侧还不需要对lfnst_idx进行解析码流。
进一步地,在一些实施例中,当预测模式参数指示当前块使用非MIP模式时,该方法还可以包括:
基于所述帧内预测模式,确定predModeIntra的取值;
根据predModeIntra的取值,从多个LFNST变换核候选集中选择一个LFNST变换核候选集。
也就是说,如果当前块的预测模式为非MIP模式,这时候可以根据帧内预测模式,确定出predModeIntra的取值;然后根据predModeIntra的取值,同时结合上述的表1,可以从多个LFNST变换核候选集中选择出LFNST变换核候选集,进而从所选择的LFNST变换核候选集中,选择LFNST索引序号指示的变换核,设置为当前块使用的LFNST变换核。
S705:使用所述LFNST变换核,对所述变换系数进行变换处理。
需要说明的是,在选择出LFNST变换核候选集之后,通过解析码流,获得LFNST索引序号(lfnst_idx)的取值;根据lfnst_idx的取值,可以从LFNST变换核候选集中选择出lfnst_idx所指示的变换矩阵(变换核)。例如,当lfnst_idx为1时,解码过程中可以使用第一组变换矩阵作为LFNST变换核;当lfnst_idx为2时,解码过程中可以使用第二组变换矩阵作为LFNST变换核。
进一步地,针对每一组变换矩阵(变换核),包含有两种尺寸的基础变换矩阵,在解码器侧所使用的基础变换矩阵大小为16×16和48×16。根据nLfnstOutSzie进行选择,若nLfnstOutSzie为16,则选择16x16的基础变换矩阵;或者,若nLfnstOutSzie为48,则选择48x16的基础变换矩阵。或者,若nonZeroSize为8,则变换矩阵中仅前8行用于矩阵乘法计算。
进一步地,将二次变换系数向量u[i]作为输入,使用变换矩阵与之相乘得到一次变换系数向量v[j],这里,i=0,1,…,nonZeroSize-1,j=0,1,…,nLfnstOutSzie-1。假定前面步骤获取到的变换矩阵为lowFreqTransMatrix,那么v[j]的具体计算过程如下所示,
Figure PCTCN2019130157-appb-000003
这里,Clip3为嵌位工作,可以将系数的值限制在下面的两个数之间,如下所示,
CoeffMin=-(1<<15)       (13)
CoeffMax=(1<<15)-1      (14)
如此,经过上述矩阵计算之后,可以实现对变换系数的变换处理。这里,对于4×4LFNST,在解码器侧,将会输入16个或8个系数,会输出16个系数;而对于8×8LFNST,在解码器侧,将会输入16个或8个系数,会输出48个系数,以实现对变换系数的LFNST变换处理。
在本申请实施例中,可以提高LFNST技术对使用MIP模式的当前块的适用性,使得变换集(或者变换核)的选取更加灵活。通过在使用MIP模式的当前块进行LFNST过程中引入了MIP参数的相关信息,并根据这些MIP信息判断当前块的特性,进而选择出变换集(或者变换核)。例如,该变换方法应用在VTM7.0上,以24帧间隔在All Intra条件下进行测试,基于同等峰值信噪比(Peak Signal to Noise Ratio,PSNR)下的平均码率变化,这时候可以在三个图像分量(即Y、Cb和Cr)上分别获得-0.03%、0.00%和-0.01%的BD-rate变化;尤其是在大分辨率的序列上,将会有更好的性能表现,具体地,在Class A1上可以达到Y有-0.10%的BD-rate变化,从而提高了解码效率。
本实施例提供了一种变换方法,解析码流,确定当前块的预测模式参数;当预测模式参数指示当前块使用MIP确定帧内预测值时,解析码流,确定MIP参数;解析码流,确定当前块的变换系数和LFNST索引序号;当LFNST索引序号指示所述当前块使用LFNST时,根据所述MIP参数,确定当前块使用的LFNST变换核;使用所述LFNST变换核,对所述变换系数进行变换处理。这样,针对采用MIP模式的当前块来说,由于在进行LFNST变换时引入了MIP参数,使得LFNST变换核的选择更加灵活,从而不仅提高了LFNST技术对非传统帧内预测模式的适用性,还提高了解码效率,同时还能够提升视频图像质量。
基于前述实施例相同的发明构思,参见图9,其示出了本申请实施例提供的一种编码器90的组成结构示意图。如图9所示,该编码器90可以包括:第一确定单元901、第一计算单元902和第一变换单元903;其中,
第一确定单元901,配置为确定当前块的预测模式参数;
第一确定单元901,还配置为当所述预测模式参数指示所述当前块使用基于矩阵的帧内预测MIP确定帧内预测值时,确定MIP参数;
第一计算单元902,配置为根据所述MIP参数,确定所述当前块的帧内预测值,计算所述当前块与所述帧内预测值之间的预测差值;
第一确定单元901,还配置为当所述当前块使用低频不可分离二次变换LFNST时,根据所述MIP参数,确定所述当前块使用的LFNST变换核,设置LFNST索引序号并写入视频码流;
第一变换单元903,配置为使用所述LFNST变换核,对所述预测差值进行变换处理。
在上述方案中,所述MIP参数包括MIP转置指示参数,其中,所述MIP转置指示参数的取值用于指示是否对MIP模式使用的采样点输入向量进行转置处理。
在上述方案中,参见图9,编码器90还可以包括第一选择单元904、第一转置单元905和设置单元906;其中,
第一选择单元904,配置为从LFNST变换核候选集中,选择所述当前块使用的变换核;
第一转置单元905,配置为当所述MIP转置指示参数的取值指示对MIP模式使用的采样点输入向量进行转置处理时,对所述选择的变换核进行矩阵转置处理,得到所述当前块使用的LFNST变换核;
设置单元906,配置为将所述LFNST索引序号的取值设置为指示所述当前块使用LFNST、且所述LFNST变换核在LFNST变换核候选集中的索引序号;其中,所述LFNST变换核候选集包含预设的用于MIP的两个或多个变换核。
在上述方案中,MIP参数包括MIP模式索引序号,其中,MIP模式索引序号用于指示所述当前块使用的MIP模式,所述MIP模式用于指示使用MIP确定所述当前块的帧内预测值的计算推导方式。
在上述方案中,第一确定单元901,还配置为根据所述MIP模式索引序号的取值,确定LFNST帧内预测模式索引序号的取值;
第一选择单元904,还配置为根据所述LFNST帧内预测模式索引序号的取值,从多个LFNST变换核候选集中选择一个LFNST变换核候选集;以及从所选择的LFNST变换核候选集中,选择所述LFNST索引序号指示的变换核,设置为所述当前块使用的LFNST变换核;
设置单元906,配置为将所述LFNST索引序号的取值设置为指示所述当前块使用LFNST、且所述LFNST变换核在LFNST变换核候选集中的索引序号;其中,所述LFNST变换核候选集包含预设的两个或多个LFNST变换核。
在上述方案中,第一确定单元901,还配置为使用第一查找表确定所述MIP模式索引序号的取值对应的所述LFNST帧内预测模式索引序号的取值,其中,所述第一查找表至少包含两个不同取值的LFNST帧内预测模式索引序号各自所对应的一个或多个不同的MIP模式索引序号。
在上述方案中,第一选择单元904,还配置为根据所述MIP模式索引序号的取值,从多个LFNST变换核候选集中选择一个LFNST变换核候选集;以及从所选择的LFNST变换核候选集中,选择所述LFNST索引序号指示的变换核,设置为所述当前块使用的LFNST变换核;
设置单元906,配置为将所述LFNST索引序号的取值设置为指示所述当前块使用LFNST、且所述LFNST变换核在LFNST变换核候选集中的索引序号;其中,所述LFNST变换核候选集包含预设的两个或多个LFNST变换核。
在上述方案中,第一选择单元904,还配置为使用第二查找表确定所述MIP模式索引序号的取值对应的LFNST变换核候选集索引序号的取值,选择所述LFNST变换核候选集索引序号的取值指示的LFNST变换核候选集,作为所述选择的LFNST变换核候选集;其中,所述第二查找表至少包含两个不同取值的所述LFNST变换核候选集索引序号各自对应的一个或多个不同的MIP模式索引序号。
在上述方案中,第一计算单元902,还配置为根据所述MIP模式索引序号的取值,使用第一计算方式确定LFNST变换核候选集的索引序号;
第一选择单元904,还配置为选择所述LFNST变换核候选集索引序号的取值指示的LFNST变换核候选集,作为所述选择的LFNST变换核候选集。
在上述方案中,第一计算单元902,具体配置为当所述MIP模式索引序号的取值小于第一预设值时,将所述LFNST变换核候选集索引序号的取值设置为等于所述MIP模式索引序号的取值;以及当所述MIP模式索引序号的取值大于或等于第一预设值时,将所述LFNST变换核候选集索引序号的取值设置为等于所述MIP模式索引序号的取值减去第二预设值得到的差值;其中,所述第一预设值和所述第二预设值均是整数值。
在上述方案中,所述第一预设值的取值等于3。
在上述方案中,所述第二预设值的取值等于2。
在上述方案中,所述MIP参数还包括MIP转置指示参数,其中,所述MIP转置指示参数的取值用于指示是否对MIP模式使用的采样点输入向量进行转置处理;
第一转置单元905,还配置为当所述MIP转置指示参数的取值指示对MIP模式使用的采样点输入向量进行转置处理时,对所述当前块使用的LFNST变换核进行矩阵转置处理,将转置处理后得到变换核设置为所述当前块使用的LFNST变换核。
可以理解地,在本申请实施例中,“单元”可以是部分电路、部分处理器、部分程序或软件等等,当然也可以是模块,还可以是非模块化的。而且在本实施例中的各组成部分可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。
所述集成的单元如果以软件功能模块的形式实现并非作为独立的产品进行销售或使用时,可以存储在一个计算机可读取存储介质中,基于这样的理解,本实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)或processor(处理器)执行本实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、 磁碟或者光盘等各种可以存储程序代码的介质。
因此,本申请实施例提供了一种计算机存储介质,应用于编码器90,该计算机存储介质存储有变换程序,所述变换程序被第一处理器执行时实现前述实施例中任一项所述的方法。
基于上述编码器90的组成以及计算机存储介质,参见图10,其示出了本申请实施例提供的编码器90的具体硬件结构示例,可以包括:第一通信接口1001、第一存储器1002和第一处理器1003;各个组件通过第一总线系统1004耦合在一起。可理解,第一总线系统1004用于实现这些组件之间的连接通信。第一总线系统1004除包括数据总线之外,还包括电源总线、控制总线和状态信号总线。但是为了清楚说明起见,在图10中将各种总线都标为第一总线系统1004。其中,
第一通信接口1001,用于在与其他外部网元之间进行收发信息过程中,信号的接收和发送;
第一存储器1002,用于存储能够在第一处理器1003上运行的计算机程序;
第一处理器1003,用于在运行所述计算机程序时,执行:
确定当前块的预测模式参数;
当预测模式参数指示所述当前块使用基于矩阵的帧内预测MIP确定帧内预测值时,确定MIP参数;
根据MIP参数,确定当前块的帧内预测值,计算所述当前块与所述帧内预测值之间的预测差值;
当所述当前块使用低频不可分离二次变换LFNST时,根据所述MIP参数,确定所述当前块使用的LFNST变换核,设置LFNST索引序号并写入视频码流;
使用所述LFNST变换核,对所述预测差值进行变换处理。
可以理解,本申请实施例中的第一存储器1002可以是易失性存储器或非易失性存储器,或可包括易失性和非易失性存储器两者。其中,非易失性存储器可以是只读存储器(Read-Only Memory,ROM)、可编程只读存储器(Programmable ROM,PROM)、可擦除可编程只读存储器(Erasable PROM,EPROM)、电可擦除可编程只读存储器(Electrically EPROM,EEPROM)或闪存。易失性存储器可以是随机存取存储器(Random Access Memory,RAM),其用作外部高速缓存。通过示例性但不是限制性说明,许多形式的RAM可用,例如静态随机存取存储器(Static RAM,SRAM)、动态随机存取存储器(Dynamic RAM,DRAM)、同步动态随机存取存储器(Synchronous DRAM,SDRAM)、双倍数据速率同步动态随机存取存储器(Double Data Rate SDRAM,DDRSDRAM)、增强型同步动态随机存取存储器(Enhanced SDRAM,ESDRAM)、同步连接动态随机存取存储器(Synchlink DRAM,SLDRAM)和直接内存总线随机存取存储器(Direct Rambus RAM,DRRAM)。本申请描述的系统和方法的第一存储器1002旨在包括但不限于这些和任意其它适合类型的存储器。
而第一处理器1003可能是一种集成电路芯片,具有信号的处理能力。在实现过程中,上述方法的各步骤可以通过第一处理器1003中的硬件的集成逻辑电路或者软件形式的指令完成。上述的第一处理器1003可以是通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。可以实现或者执行本申请实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。结合本申请实施例所公开的方法的步骤可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于第一存储器1002,第一处理器1003读取第一存储器1002中的信息,结合其硬件完成上述方法的步骤。
可以理解的是,本申请描述的这些实施例可以用硬件、软件、固件、中间件、微码或其组合来实现。对于硬件实现,处理单元可以实现在一个或多个专用集成电路(Application Specific Integrated Circuits,ASIC)、数字信号处理器(Digital Signal Processing,DSP)、数字信号处理设备(DSP Device,DSPD)、可编程逻辑设备(Programmable Logic Device,PLD)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)、通用处理器、控制器、微控制器、微处理器、用于执行本申请所述功能的其它电子单元或其组合中。对于软件实现,可通过执行本申请所述功能的模块(例如过程、函数等)来实现本申请所述的技术。软件代码可存储在存储器中并通过处理器执行。存储器可以在处理器中或在处理器外部实现。
可选地,作为另一个实施例,第一处理器1003还配置为在运行所述计算机程序时,执行前述实施例中任一项所述的方法。
本实施例提供了一种编码器,该编码器可以包括第一确定单元、第一计算单元和第一变换单元;这样,针对采用MIP模式的当前块来说,由于在进行LFNST变换时引入了MIP参数,使得LFNST变换核的选择更加灵活,从而不仅提高了LFNST技术对非传统帧内预测模式的适用性,还提高了编码效率,同时还能够提升视频图像质量。
基于前述实施例相同的发明构思,参见图11,其示出了本申请实施例提供的一种解码器110的组 成结构示意图。如图11所示,该解码器110可以包括:解析单元1101、第二确定单元1102和第二变换单元1103;其中,
解析单元1101,配置为解析码流,确定当前块的预测模式参数;以及还配置为当所述预测模式参数指示所述当前块使用MIP确定帧内预测值时,解析码流,确定MIP参数;以及还配置为解析码流,确定所述当前块的变换系数和LFNST索引序号;
第二确定单元1102,配置为当所述LFNST索引序号指示所述当前块使用LFNST时,根据所述MIP参数,确定所述当前块使用的LFNST变换核;
第二变换单元1103,配置为使用所述LFNST变换核,对所述变换系数进行变换处理。
在上述方案中,所述MIP参数包括MIP转置指示参数,其中,所述MIP转置指示参数的取值用于指示是否对MIP模式使用的采样点输入向量进行转置处理。
在上述方案中,参见图11,解码器110还可以包括第二选择单元1104和第二转置单元1105;其中,
第二选择单元1104,配置为从LFNST变换核候选集中,选择所述LFNST索引序号指示的变换核;
第二转置单元1105,配置为当所述MIP转置指示参数的取值指示对MIP模式使用的采样点输入向量进行转置处理时,对所述选择的变换核进行矩阵转置处理,得到所述当前块使用的LFNST变换核;其中,所述LFNST变换核候选集包含预设的用于MIP的两个或多个变换核。
在上述方案中,MIP参数包括MIP模式索引序号,其中,MIP模式索引序号用于指示所述当前块使用的MIP模式,所述MIP模式用于指示使用MIP确定所述当前块的帧内预测值的计算推导方式。
在上述方案中,第二确定单元1102,还配置为根据所述MIP模式索引序号的取值,确定LFNST帧内预测模式索引序号的取值;
第二选择单元1104,还配置为根据所述LFNST帧内预测模式索引序号的取值,从多个LFNST变换核候选集中选择一个LFNST变换核候选集;以及从所选择的LFNST变换核候选集中,选择所述LFNST索引序号指示的变换核,设置为所述当前块使用的LFNST变换核;其中,所述LFNST变换核候选集包含预设的两个或多个LFNST变换核。
在上述方案中,第二确定单元1102,还配置为使用第一查找表确定所述MIP模式索引序号的取值对应的所述LFNST帧内预测模式索引序号的取值,其中,所述第一查找表至少包含两个不同取值的LFNST帧内预测模式索引序号各自所对应的一个或多个不同的MIP模式索引序号。
在上述方案中,第二选择单元1104,还配置为根据所述MIP模式索引序号的取值,从多个LFNST变换核候选集中选择一个LFNST变换核候选集;以及从所选择的LFNST变换核候选集中,选择所述LFNST索引序号指示的变换核,设置为所述当前块使用的LFNST变换核;其中,所述LFNST变换核候选集包含预设的两个或多个LFNST变换核。
在上述方案中,第二选择单元1104,还配置为使用第二查找表确定所述MIP模式索引序号的取值对应的LFNST变换核候选集索引序号的取值,选择所述LFNST变换核候选集索引序号的取值指示的LFNST变换核候选集,作为所述选择的LFNST变换核候选集;其中,所述第二查找表至少包含两个不同取值的所述LFNST变换核候选集索引序号各自对应的一个或多个不同的MIP模式索引序号。
在上述方案中,参见图11,解码器110还可以包括第二计算单元1106,配置为根据所述MIP模式索引序号的取值,使用第一计算方式确定LFNST变换核候选集的索引序号;
第二选择单元1104,还配置为选择所述LFNST变换核候选集索引序号的取值指示的LFNST变换核候选集,作为所述选择的LFNST变换核候选集。
在上述方案中,第二计算单元1106,具体配置为当所述MIP模式索引序号的取值小于第一预设值时,将所述LFNST变换核候选集索引序号的取值设置为等于所述MIP模式索引序号的取值;以及当所述MIP模式索引序号的取值大于或等于第一预设值时,将所述LFNST变换核候选集索引序号的取值设置为等于所述MIP模式索引序号的取值减去第二预设值得到的差值;其中,所述第一预设值和所述第二预设值均是整数值。
在上述方案中,所述第一预设值的取值等于3。
在上述方案中,所述第二预设值的取值等于2。
在上述方案中,所述MIP参数还包括MIP转置指示参数,其中,所述MIP转置指示参数的取值指示了是否对MIP模式使用的采样点输入向量进行转置处理;
第二转置单元1105,还配置为当所述MIP转置指示参数的取值指示对MIP模式使用的采样点输入向量进行转置处理时,对所述当前块使用的LFNST变换核进行矩阵转置处理,将转置处理后得到变换核设置为所述当前块使用的LFNST变换核。
可以理解地,在本实施例中,“单元”可以是部分电路、部分处理器、部分程序或软件等等,当然也可以是模块,还可以是非模块化的。而且在本实施例中的各组成部分可以集成在一个处理单元中,也 可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。所述集成的单元如果以软件功能模块的形式实现并非作为独立的产品进行销售或使用时,可以存储在一个计算机可读取存储介质中。
因此,本实施例提供了一种计算机存储介质,应用于解码器110,该计算机存储介质存储有变换程序,所述变换程序被第二处理器执行时实现前述实施例中任一项所述的方法。
基于上述解码器110的组成以及计算机存储介质,参见图12,其示出了本申请实施例提供的解码器110的具体硬件结构示例,可以包括:第二通信接口1201、第二存储器1202和第二处理器1203;各个组件通过第二总线系统1204耦合在一起。可理解,第二总线系统1204用于实现这些组件之间的连接通信。第二总线系统1204除包括数据总线之外,还包括电源总线、控制总线和状态信号总线。但是为了清楚说明起见,在图12中将各种总线都标为第二总线系统1204。其中,
第二通信接口1201,用于在与其他外部网元之间进行收发信息过程中,信号的接收和发送;
第二存储器1202,用于存储能够在第二处理器1203上运行的计算机程序;
第二处理器1203,用于在运行所述计算机程序时,执行:
解析码流,确定当前块的预测模式参数;
当所述预测模式参数指示所述当前块使用MIP确定帧内预测值时,解析码流,确定MIP参数;
解析码流,确定所述当前块的变换系数和LFNST索引序号;
当LFNST索引序号指示当前块使用LFNST时,根据MIP参数,确定当前块使用的LFNST变换核;
使用所述LFNST变换核,对所述变换系数进行变换处理。
可选地,作为另一个实施例,第二处理器1203还配置为在运行所述计算机程序时,执行前述实施例中任一项所述的方法。
可以理解,第二存储器1202与第一存储器1002的硬件功能类似,第二处理器1203与第一处理器1003的硬件功能类似;这里不再详述。
本实施例提供了一种解码器,该解码器可以包括解析单元、第二确定单元和第二变换单元;这样,针对采用MIP模式的当前块来说,由于在进行LFNST变换时引入了MIP参数,使得LFNST变换核的选择更加灵活,从而不仅提高了LFNST技术对非传统帧内预测模式的适用性,还提高了解码效率,同时还能够提升视频图像质量。
需要说明的是,在本申请中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者装置不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者装置所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者装置中还存在另外的相同要素。
上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。
本申请所提供的几个方法实施例中所揭露的方法,在不冲突的情况下可以任意组合,得到新的方法实施例。
本申请所提供的几个产品实施例中所揭露的特征,在不冲突的情况下可以任意组合,得到新的产品实施例。
本申请所提供的几个方法或设备实施例中所揭露的特征,在不冲突的情况下可以任意组合,得到新的方法实施例或设备实施例。
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。
工业实用性
本申请实施例中,首先确定当前块的预测模式参数;当所述预测模式参数指示所述当前块使用MIP确定帧内预测值时,确定MIP参数;然后根据所述MIP参数,确定所述当前块的帧内预测值,计算所述当前块与所述帧内预测值之间的预测差值;当所述当前块使用LFNST时,再根据所述MIP参数,确定所述当前块使用的LFNST变换核,设置LFNST索引序号并写入视频码流;最后使用所述LFNST变换核,对所述预测差值进行变换处理。这样,针对采用MIP模式的当前块来说,由于在进行LFNST变换时引入了MIP参数,使得LFNST变换核的选择更加灵活,从而不仅提高了LFNST技术对非传统帧内预测模式的适用性,还提高了编解码效率,同时还能够提升视频图像质量。

Claims (31)

  1. 一种变换方法,应用于编码器,所述方法包括:
    确定当前块的预测模式参数;
    当所述预测模式参数指示所述当前块使用基于矩阵的帧内预测MIP确定帧内预测值时,确定MIP参数;
    根据所述MIP参数,确定所述当前块的帧内预测值,计算所述当前块与所述帧内预测值之间的预测差值;
    当所述当前块使用低频不可分离二次变换LFNST时,根据所述MIP参数,确定所述当前块使用的LFNST变换核,设置LFNST索引序号并写入视频码流;
    使用所述LFNST变换核,对所述预测差值进行变换处理。
  2. 根据权利要求1所述的方法,其中,所述MIP参数包括MIP转置指示参数,其中,所述MIP转置指示参数的取值用于指示是否对MIP模式使用的采样点输入向量进行转置处理。
  3. 根据权利要求2所述的方法,其中,所述当所述当前块使用LFNST时,根据所述MIP参数,确定所述当前块使用的LFNST变换核,设置LFNST索引序号并写入视频码流,包括:
    从LFNST变换核候选集中,选择所述当前块使用的变换核;
    当所述MIP转置指示参数的取值指示对MIP模式使用的采样点输入向量进行转置处理时,对所述选择的变换核进行矩阵转置处理,得到所述当前块使用的LFNST变换核;
    将所述LFNST索引序号的取值设置为指示所述当前块使用LFNST、且所述LFNST变换核在LFNST变换核候选集中的索引序号;
    其中,所述LFNST变换核候选集包含预设的用于MIP的两个或多个变换核。
  4. 根据权利要求1所述的方法,其中,所述MIP参数包括MIP模式索引序号,其中,所述MIP模式索引序号用于指示所述当前块使用的MIP模式,所述MIP模式用于指示使用MIP确定所述当前块的帧内预测值的计算推导方式。
  5. 根据权利要求4所述的方法,其中,所述当所述当前块使用LFNST时,根据所述MIP参数,确定所述当前块使用的LFNST变换核,设置LFNST索引序号并写入视频码流,包括:
    根据所述MIP模式索引序号的取值,确定LFNST帧内预测模式索引序号的取值;
    根据所述LFNST帧内预测模式索引序号的取值,从多个LFNST变换核候选集中选择一个LFNST变换核候选集;
    从所选择的LFNST变换核候选集中,选择所述LFNST索引序号指示的变换核,设置为所述当前块使用的LFNST变换核;
    将所述LFNST索引序号的取值设置为指示所述当前块使用LFNST、且所述LFNST变换核在LFNST变换核候选集中的索引序号;
    其中,所述LFNST变换核候选集包含预设的两个或多个LFNST变换核。
  6. 根据权利要求5所述的方法,其中,所述根据所述MIP模式索引序号的取值,确定LFNST帧内预测模式索引序号的取值,包括:
    使用第一查找表确定所述MIP模式索引序号的取值对应的所述LFNST帧内预测模式索引序号的取值,其中,所述第一查找表至少包含两个不同取值的LFNST帧内预测模式索引序号各自所对应的一个或多个不同的MIP模式索引序号。
  7. 根据权利要求4所述的方法,其中,所述当所述当前块使用LFNST时,根据所述MIP参数,确定所述当前块使用的LFNST变换核,设置LFNST索引序号并写入视频码流,包括:
    根据所述MIP模式索引序号的取值,从多个LFNST变换核候选集中选择一个LFNST变换核候选集;
    从所选择的LFNST变换核候选集中,选择所述LFNST索引序号指示的变换核,设置为所述当前块使用的LFNST变换核;
    将所述LFNST索引序号的取值设置为指示所述当前块使用LFNST、且所述LFNST变换核在LFNST变换核候选集中的索引序号;
    其中,所述LFNST变换核候选集包含预设的两个或多个LFNST变换核。
  8. 根据权利要求7所述的方法,其中,所述根据所述MIP模式索引序号的取值,从多个LFNST变换核候选集中选择一个LFNST变换核候选集,包括:
    使用第二查找表确定所述MIP模式索引序号的取值对应的LFNST变换核候选集索引序号的取值, 选择所述LFNST变换核候选集索引序号的取值指示的LFNST变换核候选集,作为所述选择的LFNST变换核候选集;
    其中,所述第二查找表至少包含两个不同取值的所述LFNST变换核候选集索引序号各自对应的一个或多个不同的MIP模式索引序号。
  9. 根据权利要求7所述的方法,其中,所述根据所述MIP模式索引序号的取值,从多个LFNST变换核候选集中选择一个LFNST变换核候选集,包括:
    根据所述MIP模式索引序号的取值,使用第一计算方式确定LFNST变换核候选集的索引序号;
    选择所述LFNST变换核候选集索引序号的取值指示的LFNST变换核候选集,作为所述选择的LFNST变换核候选集。
  10. 根据权利要求9所述的方法,其中,所述根据所述MIP模式索引序号的取值,使用第一计算方式确定LFNST变换核候选集的索引序号,包括:
    当所述MIP模式索引序号的取值小于第一预设值时,将所述LFNST变换核候选集索引序号的取值设置为等于所述MIP模式索引序号的取值;
    当所述MIP模式索引序号的取值大于或等于第一预设值时,将所述LFNST变换核候选集索引序号的取值设置为等于所述MIP模式索引序号的取值减去第二预设值得到的差值;
    其中,所述第一预设值和所述第二预设值均是整数值。
  11. 根据权利要求10所述的方法,其中,所述第一预设值的取值等于3。
  12. 根据权利要求10所述的方法,其中,所述第二预设值的取值等于2。
  13. 根据权利要求5至12中任一项所述的方法,其中,所述方法还包括:
    所述MIP参数还包括MIP转置指示参数,其中,所述MIP转置指示参数的取值用于指示是否对MIP模式使用的采样点输入向量进行转置处理;
    当所述MIP转置指示参数的取值指示对MIP模式使用的采样点输入向量进行转置处理时,对所述当前块使用的LFNST变换核进行矩阵转置处理,将转置处理后得到变换核设置为所述当前块使用的LFNST变换核。
  14. 一种变换方法,应用于解码器,所述方法包括:
    解析码流,确定当前块的预测模式参数;
    当所述预测模式参数指示所述当前块使用MIP确定帧内预测值时,解析码流,确定MIP参数;
    解析码流,确定所述当前块的变换系数和LFNST索引序号;
    当所述LFNST索引序号指示所述当前块使用LFNST时,根据所述MIP参数,确定所述当前块使用的LFNST变换核;
    使用所述LFNST变换核,对所述变换系数进行变换处理。
  15. 根据权利要求14所述的方法,其中,所述MIP参数包括MIP转置指示参数,其中,所述MIP转置指示参数的取值用于指示是否对MIP模式使用的采样点输入向量进行转置处理。
  16. 根据权利要求15所述的方法,其中,所述当所述LFNST索引序号指示所述当前块使用LFNST时,根据所述MIP参数,确定所述当前块使用的LFNST变换核,包括:
    从LFNST变换核候选集中,选择所述LFNST索引序号指示的变换核;
    当所述MIP转置指示参数的取值指示对MIP模式使用的采样点输入向量进行转置处理时,对所述选择的变换核进行矩阵转置处理,得到所述当前块使用的LFNST变换核;
    其中,所述LFNST变换核候选集包含预设的用于MIP的两个或多个变换核。
  17. 根据权利要求14所述的方法,其中,所述MIP参数包括MIP模式索引序号,其中,所述MIP模式索引序号用于指示所述当前块使用的MIP模式,所述MIP模式用于指示使用MIP确定所述当前块的帧内预测值的计算推导方式。
  18. 根据权利要求17所述的方法,其中,所述当所述LFNST索引序号指示所述当前块使用LFNST时,根据所述MIP参数,确定所述当前块使用的LFNST变换核,包括:
    根据所述MIP模式索引序号的取值,确定LFNST帧内预测模式索引序号的取值;
    根据所述LFNST帧内预测模式索引序号的取值,从多个LFNST变换核候选集中选择一个LFNST变换核候选集;
    从所选择的LFNST变换核候选集中,选择所述LFNST索引序号指示的变换核,设置为所述当前块使用的LFNST变换核;
    其中,所述LFNST变换核候选集包含预设的两个或多个LFNST变换核。
  19. 根据权利要求18所述的方法,其中,所述根据所述MIP模式索引序号的取值,确定LFNST帧内预测模式索引序号的取值,包括:
    使用第一查找表确定所述MIP模式索引序号的取值对应的所述LFNST帧内预测模式索引序号的取值,其中,所述第一查找表至少包含两个不同取值的LFNST帧内预测模式索引序号各自所对应的一个或多个不同的MIP模式索引序号。
  20. 根据权利要求17所述的方法,其中,所述当所述LFNST索引序号指示所述当前块使用LFNST时,根据所述MIP参数,确定所述当前块使用的LFNST变换核,包括:
    根据所述MIP模式索引序号的取值,从多个LFNST变换核候选集中选择一个LFNST变换核候选集;
    从所选择的LFNST变换核候选集中,选择所述LFNST索引序号指示的变换核,设置为所述当前块使用的LFNST变换核;
    其中,所述LFNST变换核候选集包含预设的两个或多个LFNST变换核。
  21. 根据权利要求20所述的方法,其中,所述根据所述MIP模式索引序号的取值,从多个LFNST变换核候选集中选择一个LFNST变换核候选集,包括:
    使用第二查找表确定所述MIP模式索引序号的取值对应的LFNST变换核候选集索引序号的取值,选择所述LFNST变换核候选集索引序号的取值指示的LFNST变换核候选集,作为所述选择的LFNST变换核候选集;
    其中,所述第二查找表至少包含两个不同取值的所述LFNST变换核候选集索引序号各自对应的一个或多个不同的MIP模式索引序号。
  22. 根据权利要求20所述的方法,其中,所述根据所述MIP模式索引序号的取值,从多个LFNST变换核候选集中选择一个LFNST变换核候选集,包括:
    根据所述MIP模式索引序号的取值,使用第一计算方式确定LFNST变换核候选集的索引序号;
    选择所述LFNST变换核候选集索引序号的取值指示的LFNST变换核候选集,作为所述选择的LFNST变换核候选集。
  23. 根据权利要求22所述的方法,其中,所述根据所述MIP模式索引序号的取值,使用第一计算方式确定LFNST变换核候选集的索引序号,包括:
    当所述MIP模式索引序号的取值小于第一预设值时,将所述LFNST变换核候选集索引序号的取值设置为等于所述MIP模式索引序号的取值;
    当所述MIP模式索引序号的取值大于或等于第一预设值时,将所述LFNST变换核候选集索引序号的取值设置为等于所述MIP模式索引序号的取值减去第二预设值得到的差值;
    其中,所述第一预设值和所述第二预设值均是整数值。
  24. 根据权利要求23所述的方法,其中,所述第一预设值的取值等于3。
  25. 根据权利要求23所述的方法,其中,所述第二预设值的取值等于2。
  26. 根据权利要求18至25中任一项所述的方法,其中,所述方法还包括:
    所述MIP参数还包括MIP转置指示参数,其中,所述MIP转置指示参数的取值指示了是否对MIP模式使用的采样点输入向量进行转置处理;
    当所述MIP转置指示参数的取值指示对MIP模式使用的采样点输入向量进行转置处理时,对所述当前块使用的LFNST变换核进行矩阵转置处理,将转置处理后得到变换核设置为所述当前块使用的LFNST变换核。
  27. 一种编码器,所述编码器包括第一确定单元、第一计算单元和第一变换单元;其中,
    所述第一确定单元,配置为确定当前块的预测模式参数;
    所述第一确定单元,还配置为当所述预测模式参数指示所述当前块使用基于矩阵的帧内预测MIP确定帧内预测值时,确定MIP参数;
    所述第一计算单元,配置为根据所述MIP参数,确定所述当前块的帧内预测值,计算所述当前块与所述帧内预测值之间的预测差值;
    所述第一确定单元,还配置为当所述当前块使用低频不可分离二次变换LFNST时,根据所述MIP参数,确定所述当前块使用的LFNST变换核,设置LFNST索引序号并写入视频码流;
    所述第一变换单元,配置为使用所述LFNST变换核,对所述预测差值进行变换处理。
  28. 一种编码器,所述编码器包括第一存储器和第一处理器;其中,
    所述第一存储器,用于存储能够在所述第一处理器上运行的计算机程序;
    所述第一处理器,用于在运行所述计算机程序时,执行如权利要求1至13任一项所述的方法。
  29. 一种解码器,所述解码器包括解析单元、第二确定单元和第二变换单元;其中,
    所述解析单元,配置为解析码流,确定当前块的预测模式参数;以及还配置为当所述预测模式参数指示所述当前块使用MIP确定帧内预测值时,解析码流,确定MIP参数;以及还配置为解析码流,确 定所述当前块的变换系数和LFNST索引序号;
    所述第二确定单元,配置为当所述LFNST索引序号指示所述当前块使用LFNST时,根据所述MIP参数,确定所述当前块使用的LFNST变换核;
    所述第二变换单元,配置为使用所述LFNST变换核,对所述变换系数进行变换处理。
  30. 一种解码器,所述解码器包括第二存储器和第二处理器;其中,
    所述第二存储器,用于存储能够在所述第二处理器上运行的计算机程序;
    所述第二处理器,用于在运行所述计算机程序时,执行如权利要求14至26任一项所述的方法。
  31. 一种计算机存储介质,其中,所述计算机存储介质存储有计算机程序,所述计算机程序被第一处理器执行时实现如权利要求1至13任一项所述的方法、或者被第二处理器执行时实现如权利要求14至26任一项所述的方法。
PCT/CN2019/130157 2019-12-30 2019-12-30 变换方法、编码器、解码器以及存储介质 WO2021134327A1 (zh)

Priority Applications (4)

Application Number Priority Date Filing Date Title
CN201980103146.XA CN114830664A (zh) 2019-12-30 2019-12-30 变换方法、编码器、解码器以及存储介质
PCT/CN2019/130157 WO2021134327A1 (zh) 2019-12-30 2019-12-30 变换方法、编码器、解码器以及存储介质
EP19958505.0A EP4087253A4 (en) 2019-12-30 2019-12-30 TRANSFORMATION PROCESS, ENCODER, DECODER, AND STORAGE MEDIA
US17/842,995 US20220329862A1 (en) 2019-12-30 2022-06-17 Transformation method, encoder, decoder, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2019/130157 WO2021134327A1 (zh) 2019-12-30 2019-12-30 变换方法、编码器、解码器以及存储介质

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US17/842,995 Continuation US20220329862A1 (en) 2019-12-30 2022-06-17 Transformation method, encoder, decoder, and storage medium

Publications (1)

Publication Number Publication Date
WO2021134327A1 true WO2021134327A1 (zh) 2021-07-08

Family

ID=76686235

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/130157 WO2021134327A1 (zh) 2019-12-30 2019-12-30 变换方法、编码器、解码器以及存储介质

Country Status (4)

Country Link
US (1) US20220329862A1 (zh)
EP (1) EP4087253A4 (zh)
CN (1) CN114830664A (zh)
WO (1) WO2021134327A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2024007120A1 (zh) * 2022-07-04 2024-01-11 Oppo广东移动通信有限公司 编解码方法、编码器、解码器以及存储介质

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107925763A (zh) * 2015-12-23 2018-04-17 华为技术有限公司 等级分割中的块级别变换选择和隐式信令的编码变换方法和设备
CN109076243A (zh) * 2016-05-04 2018-12-21 夏普株式会社 用于对变换数据进行编码的系统和方法
US20190306526A1 (en) * 2018-04-03 2019-10-03 Electronics And Telecommunications Research Institute Inter-prediction method and apparatus using reference frame generated based on deep learning

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107925763A (zh) * 2015-12-23 2018-04-17 华为技术有限公司 等级分割中的块级别变换选择和隐式信令的编码变换方法和设备
CN109076243A (zh) * 2016-05-04 2018-12-21 夏普株式会社 用于对变换数据进行编码的系统和方法
US20190306526A1 (en) * 2018-04-03 2019-10-03 Electronics And Telecommunications Research Institute Inter-prediction method and apparatus using reference frame generated based on deep learning

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
JONATHAN PFAFF , TOBIAS HINZ , PHILLIP HELLE , PHILLIP MERKLE , BJORN STALLENBERGER , MICHAEL SCHAFER , DETLEV MARPE , THOMAS WIEG: "Non-CE3: Harmonization of 8-Bit MIP with Unified-MPM and LFNST", 15. JVET MEETING; 20190703 - 20190712; GOTHENBURG; (THE JOINT VIDEO EXPLORATION TEAM OF ISO/IEC JTC1/SC29/WG11 AND ITU-T SG.16 ), no. JVET-O0485-r2, 1 July 2019 (2019-07-01), Gothenburg, pages 1 - 4, XP030219703 *
K. NASER (INTERDIGITAL), F. LE LÉANNEC, T. POIRIER (INTERDIGITAL): "Non-CE6 Interaction between Implicit MTS and LFNST and MIP (JVET- O0529)", 15. JVET MEETING; 20190703 - 20190712; GOTHENBURG; (THE JOINT VIDEO EXPLORATION TEAM OF ISO/IEC JTC1/SC29/WG11 AND ITU-T SG.16 ), 25 June 2019 (2019-06-25), Gothenburg, pages 1 - 4, XP030219824 *
See also references of EP4087253A4 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2024007120A1 (zh) * 2022-07-04 2024-01-11 Oppo广东移动通信有限公司 编解码方法、编码器、解码器以及存储介质

Also Published As

Publication number Publication date
CN114830664A (zh) 2022-07-29
EP4087253A1 (en) 2022-11-09
EP4087253A4 (en) 2023-01-25
US20220329862A1 (en) 2022-10-13

Similar Documents

Publication Publication Date Title
WO2016138779A1 (zh) 帧内编解码方法、编码器和解码器
WO2021139572A1 (zh) 编码方法、解码方法、编码器、解码器以及存储介质
WO2021004155A1 (zh) 图像分量预测方法、编码器、解码器以及存储介质
WO2022104498A1 (zh) 帧内预测方法、编码器、解码器以及计算机存储介质
WO2021134635A1 (zh) 变换方法、编码器、解码器以及存储介质
WO2021120122A1 (zh) 图像分量预测方法、编码器、解码器以及存储介质
WO2022087901A1 (zh) 图像预测方法、编码器、解码器以及计算机存储介质
JP2022524916A (ja) 適応的な数の領域を伴う幾何学的分割のための形状適応離散コサイン変換
US20220329862A1 (en) Transformation method, encoder, decoder, and storage medium
US20220329809A1 (en) Transform method, encoder, decoder, and storage medium
WO2023044868A1 (zh) 视频编解码方法、设备、系统、及存储介质
WO2021134637A1 (zh) 变换方法、编码器、解码器以及存储介质
WO2023197195A1 (zh) 视频编解码方法、编码器、解码器及存储介质
CN114424544A (zh) 允许基于矩阵的帧内预测块具有多个变换块
WO2024007120A1 (zh) 编解码方法、编码器、解码器以及存储介质
WO2024007116A1 (zh) 解码方法、编码方法、解码器以及编码器
WO2023184747A1 (zh) 视频编解码方法、装置、设备、系统及存储介质
CN113411588B (zh) 预测方向的确定方法、解码器以及计算机存储介质
CN113302934B (zh) 图像预测方法、编码器、解码器以及存储介质
WO2023141970A1 (zh) 解码方法、编码方法、解码器、编码器和编解码系统
WO2023197179A1 (zh) 解码方法、编码方法、解码器以及编码器

Legal Events

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

Ref document number: 19958505

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

ENP Entry into the national phase

Ref document number: 2019958505

Country of ref document: EP

Effective date: 20220801