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

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

Info

Publication number
WO2022174477A1
WO2022174477A1 PCT/CN2021/079064 CN2021079064W WO2022174477A1 WO 2022174477 A1 WO2022174477 A1 WO 2022174477A1 CN 2021079064 W CN2021079064 W CN 2021079064W WO 2022174477 A1 WO2022174477 A1 WO 2022174477A1
Authority
WO
WIPO (PCT)
Prior art keywords
quantization
block
coefficient
scanning area
quantized
Prior art date
Application number
PCT/CN2021/079064
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 浙江大学
Priority to CN202180093807.2A priority Critical patent/CN116998151A/zh
Publication of WO2022174477A1 publication Critical patent/WO2022174477A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/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/124Quantisation
    • H04N19/126Details of normalisation or weighting functions, e.g. normalisation matrices or variable uniform quantisers

Definitions

  • the present application relates to the technical field of encoding and decoding, and in particular, to an encoding method, a decoding method, an encoder, a decoder, and a storage medium.
  • the image data to be encoded will be sent to the traditional video encoder for compression encoding after passing through the transform module and the quantization module, and the code stream generated by the traditional video encoder will be It is transmitted to the decoding end; and then sent to the traditional video decoder for decoding after going through the inverse quantization module and the inverse transformation module to restore the original input image data.
  • the dual quantization technique is usually applied to all the global coefficient blocks; however, the dual quantization is adopted in all the global coefficient blocks, which cannot bring about an improvement in coding performance.
  • the present application proposes an encoding method, a decoding method, an encoder, a decoder and a storage medium.
  • the first quantization method that is, dual quantization
  • the dual quantization no longer acts on all the global coefficient blocks, and the restriction conditions are given for the use of dual quantization, thereby improving the coding performance.
  • an embodiment of the present application provides an encoding method, the method comprising:
  • the coefficients in the scanning area are quantized based on the first quantization method; wherein, the scanning area is the area covering all non-zero coefficients in the transform block. Minimum rectangular area; the first quantization mode is dual quantization;
  • the quantized quantized block is encoded and written into the code stream.
  • an embodiment of the present application provides a decoding method, the method comprising:
  • inverse quantization is performed on the quantization block based on the first inverse quantization method; wherein, the scanning area covers all non-zero coefficients in the quantization block
  • the minimum rectangular area of , the first inverse quantization method is dual quantization and inverse quantization.
  • an embodiment of the present application provides an encoder, where the encoder includes a determining unit, a first processing unit, and an encoding unit; wherein,
  • the determining unit is configured to determine the transform block corresponding to the current block in the image to be processed
  • the first processing unit is configured to quantize the coefficients in the scan area based on a first quantization method when the scan area of the transform block satisfies a trigger condition for dual quantization; wherein the scan area is the The smallest rectangular area covering all non-zero coefficients in the transform block; the first quantization mode is dual quantization;
  • the encoding unit is configured to encode the quantized quantized block and write it into the code stream.
  • an embodiment of the present application provides a decoder, where the decoder includes a decoding unit and a second processing unit; wherein,
  • the decoding unit is configured to parse the code stream to obtain a quantized block
  • the second processing unit is configured to perform inverse quantization on the quantization block based on the first inverse quantization method when the scanning area of the quantization block satisfies the trigger condition of dual quantization and inverse quantization; wherein, the scanning area is the The smallest rectangular area covering all non-zero coefficients in the quantization block, and the first inverse quantization method is dual quantization and inverse quantization.
  • an embodiment of the present application provides an encoder, where the encoder includes a first memory and a first processor; wherein,
  • the first memory for storing a computer program executable on the first processor
  • the first processor is configured to execute the method according to the first aspect when running the computer program.
  • an embodiment of the present application provides a decoder, where the decoder includes a second memory and a second processor; wherein,
  • the second memory for storing a computer program executable on the second processor
  • the second processor is configured to execute the method according to the second aspect when running the computer program.
  • an embodiment of the present application provides a computer storage medium, where the computer storage medium stores a computer program, and when the computer program is executed by the first processor, the method described in the first aspect is implemented, or the computer program is executed by the first processor.
  • the method as described in the second aspect is implemented when the two processors execute.
  • An encoding method, decoding method, encoder, decoder, and storage medium provided by the embodiments of the present application, wherein the encoding method includes determining a transform block corresponding to a current block in an image to be processed; when the scanning area of the transform block satisfies dual quantization When the triggering condition of the The block is encoded and written into the code stream; in this application, when the trigger condition of dual quantization is satisfied, the first quantization method, that is, dual quantization, is used to quantize the coefficients in the scanning area, that is, dual quantization no longer acts on the global In all coefficient blocks, restrictions are given to the use of dual quantization, thereby improving the coding performance.
  • FIG. 1 is a schematic diagram of a coding framework provided by a related technical solution
  • FIG. 2 is a schematic flowchart of an encoding method provided by an embodiment of the present application.
  • FIG. 3 is a schematic flowchart of an encoding method provided by an embodiment of the present application.
  • FIG. 4 is a schematic structural diagram of a dual quantizer Q0 and Q1 and their respective corresponding reconstructed transform coefficients provided by an embodiment of the present application;
  • FIG. 5 is a schematic diagram of a scanning area within a transform block provided by an embodiment of the present application.
  • FIG. 6 is a schematic flowchart of an encoding method provided by an embodiment of the present application.
  • FIG. 7 is a schematic diagram of a state transition of a quantizer used for determining a quantization coefficient provided by an embodiment of the present application.
  • FIG. 8 is a schematic diagram of a state transition table provided by an embodiment of the present application.
  • FIG. 9 is a schematic diagram of a grid structure of a dependency relationship between a state of a quantizer and a transform coefficient level provided by an embodiment of the present application.
  • FIG. 10 is a schematic diagram of a matching relationship between an original transform coefficient and a candidate transform coefficient provided by an embodiment of the present application
  • FIG. 11 is a schematic flowchart of a decoding method provided by an embodiment of the present application.
  • FIG. 12 is a schematic flowchart of a decoding method provided by an embodiment of the present application.
  • FIG. 13 is a schematic flowchart of a decoding method provided by an embodiment of the present application.
  • FIG. 15 is a schematic structural diagram of a decoder provided by an embodiment of the application.
  • 16 is a schematic diagram of a hardware structure of an encoder provided by an embodiment of the application.
  • FIG. 17 is a schematic diagram of a hardware structure of a decoder according to an embodiment of the present application.
  • MPEG Moving Picture Experts Group
  • JVET Joint Video Experts Team
  • VVC Next-generation video coding standard H.266/Versatile Video Coding
  • VVC's reference software test platform VVC Test Model, VTM
  • HPM High-Performance Model
  • Quantization Parameter (QP) Quantization Parameter
  • SRCC Scan Region based Coefficient Coding
  • Digital video compression technology mainly compresses huge digital video and video data to facilitate transmission and storage.
  • Digital video compression standards can save a lot of video data, it is still necessary to pursue better digital video compression technology to reduce digital video data. Bandwidth and traffic pressure for video transmission.
  • video compression includes intra-frame prediction (spatial domain) and/or inter-frame prediction (temporal domain) for reducing or taking out internal redundancy in video, quantization and inverse quantization of residual information, and inverse changes to improve the main Multiple modules such as loop filtering and entropy coding for objective reconstruction quality.
  • Most mainstream video compression standards describe block-based compression techniques.
  • a video slice, a frame of pictures or a series of pictures are divided into basic units of Coding Tree Units (CTUs), and further divided into blocks of Coding Units (CUs) based on this.
  • Intra-frame blocks are predicted using pixels around the block as references, while inter-frame blocks refer to spatially adjacent block information and reference information in other frames.
  • the residual information is transformed, quantized and entropy encoded into a code stream through block-based transformation.
  • FIG. 2 shows a schematic flowchart of an encoding method provided by an embodiment of the present application.
  • the encoding method is applied to an encoder, and the encoding method may include:
  • the encoding method can be applied to the encoder of the H.265/HEVC standard, also can be applied to the encoder of the H.266/Versatile Video Coding (VVC) standard, and can even be applied to the encoder of the H.266/Versatile Video Coding (VVC) standard
  • Encoders of other standards such as an encoder applicable to the AVS standard, an encoder of the Essential Video Coding (Essential Video Coding, EVC) standard, etc., are not specifically limited in this embodiment of the present application.
  • the transform block corresponding to the current block in the image to be processed is determined, including:
  • the scanning area is the smallest rectangular area covering all non-zero coefficients in the transform block; the first quantization mode is dual quantization.
  • the scanning area is at least a partial area in the transform block.
  • S203 Encode the quantized quantized block and write it into the code stream.
  • the transform block corresponding to the current block in the image to be processed is determined; when the scanning area of the transform block satisfies the trigger condition of dual quantization, the coefficients in the scanning area are quantized based on the first quantization method; Wherein, the scanning area is the smallest rectangular area covering all non-zero coefficients in the transform block; the first quantization method is dual quantization; the quantized quantization block is encoded and written into the code stream; in this application, when the trigger condition for dual quantization is satisfied When , the first quantization method, that is, dual quantization, is used to quantize the coefficients in the scanning area. That is to say, dual quantization no longer acts on all coefficient blocks in the world, and restrictive conditions are given for the use of dual quantization, which improves the encoding performance.
  • FIG. 3 shows a schematic flowchart of an encoding method provided by an embodiment of the present application.
  • the encoding method is applied to the encoder, and the encoding method may include:
  • the scanning area is the smallest rectangular area covering all non-zero coefficients in the transform block; the first quantization mode is dual quantization.
  • transformed coefficients and non-transformed coefficients may be collectively referred to as coefficients.
  • Quantization is often used to reduce the dynamic range of the coefficients, thereby expressing the video with fewer codewords.
  • the quantized values are often referred to as levels, reconstruction levels or reconstruction levels.
  • the quantization operation consists of dividing the coefficients by the quantization step size, which is determined by the quantization factor passed in the code stream. Inverse quantization is done by multiplying the reconstruction level by the quantization step size. For an N ⁇ M block, the quantization of all coefficients can be done independently. This technique is also widely used in many international video compression standards, such as H.264 and HEVC.
  • a specific scan order can transform a two-dimensional coefficient block into a one-dimensional coefficient stream.
  • the scan sequence can be Z-type, horizontal, vertical or any other sequence of scans.
  • the correlation between coefficients can be used, and the characteristics of the quantized coefficients can be used to select a better quantization method, so as to achieve the purpose of optimizing the quantization.
  • Dual quantization is a quantization method defined in VVC. Dual quantization acts on the transformed block. Different from traditional quantization, dual quantization consists of two quantizers. Although these two quantizers have the same quantization step size (ie 2* ⁇ ), their respective The corresponding reconstructed transform coefficients are, however, interleaved. Referring to FIG. 4 , FIG. 4 is a schematic diagram of the dual quantized quantizer Q0 and quantizer Q1 and their respective corresponding reconstructed transform coefficients.
  • the reconstructed transform coefficients are -8 ⁇ , -6 ⁇ , -4 ⁇ , -2 ⁇ , 0, 2 ⁇ , 4 ⁇ , 6 ⁇ , 8 ⁇ , etc.
  • the levels are -4, -3, -2, -1, 0, 1, 2, 3, 4, etc.;
  • the reconstruction transform coefficients are -9 ⁇ , -7 ⁇ , -5 ⁇ , -3 ⁇ , - ⁇ , 0, ⁇ , 3 ⁇ , 5 ⁇ , 7 ⁇ , 9 ⁇ , etc.
  • the levels of the quantization coefficients are -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, etc.
  • the quantizer Q0 corresponds to the reconstruction transform coefficient level is an even multiple of ⁇ (the quantization step size of the two quantizers Q0 and Q1 is 2* ⁇ , the combination of Q0 and Q1 in the dual quantizer is equivalent to a quantization step size of ⁇ ) (that is, the numbers corresponding to points A and B), and the quantizer Q1 corresponds to ⁇ whose level of the reconstructed transform coefficient is an odd multiple (that is, the numbers corresponding to points C and D).
  • Dual quantization introduces two interleaved quantizers and the principle of jumping between quantizers, so that quantizers with large step size can be combined to complete finer quantization, reducing the difference between the reconstructed transform coefficients and the original transform coefficients. loss, thereby improving coding efficiency.
  • this application can choose to use one of the two quantizers Q0 and Q1 described in FIG. 4 for quantization. quantification) are similar.
  • the reconstructed transform coefficients of the two quantizers can be represented by multiples of the quantization step size ⁇ , and the reconstructed transform coefficients of the two quantizers are defined as follows:
  • the reconstructed transform coefficient level of the quantizer is an even multiple (including zero times) quantization step size ⁇ .
  • the reconstructed transform coefficient t' can be calculated according to the following formula,
  • k represents the associated transform coefficient level described in FIG. 4 .
  • the reconstructed transform coefficient level of the quantizer is an odd or zero-fold quantization step size ⁇ .
  • the reconstructed transform coefficient t' can be calculated according to the following formula,
  • sgn( ) represents the symbolic function
  • the scanning area satisfying the trigger condition of the dual quantization includes: the value of the area of the scanning area meeting the first preset condition.
  • the first preset condition may be a first parameter range.
  • the scanning area satisfying the trigger condition of dual quantization further includes: the length of the scanning area satisfies the second preset condition; and/or the width of the scanning area satisfies the third preset condition.
  • the second preset condition may be a second parameter range.
  • the third preset condition may be a third parameter range.
  • S303 Determine the length of the scan area based on the abscissa of the rightmost non-zero coefficient in the quantized scan area.
  • S304 Determine the width of the scan area based on the ordinate of the lowermost non-zero coefficient in the quantized scan area.
  • S305 Encode the quantized block and write it into the code stream, and write the length of the scanning area and the width of the scanning area into the code stream.
  • FIG. 5 shows that the coefficient coding method (SRCC) based on scanning area is adopted in AVS3, and this technology uses (SRx, SRy) to determine the quantization coefficient area that needs to be scanned in a transform unit, where SRx is The abscissa of the rightmost non-zero coefficient in the coefficient matrix, SRy is the ordinate of the lowermost non-zero coefficient in the coefficient matrix. Only the coefficients in the scan area determined by (SRx, SRy) need to be coded.
  • the scan order of the encoding is a reverse zigzag scan from the lower right corner to the upper left corner.
  • FIG. 6 it shows a schematic flowchart of an encoding method provided by an embodiment of the present application.
  • the encoding method is applied to the encoder, and the encoding method may include:
  • S501 Determine the transform block corresponding to the current block in the image to be processed.
  • S501 determines the transform block corresponding to the current block in the image to be processed, which may be implemented by the following steps:
  • S503 Determine the scanning area based on the traversed coordinates of the target non-zero coefficients.
  • S503 determines the scanning area based on the coordinates of the traversed target non-zero coefficients, which can be implemented by the following steps:
  • the scan area is determined.
  • S503 is based on the traversed target
  • the coordinates of the non-zero coefficients to determine the scanning area can be achieved by the following steps:
  • the scan area is determined from the transform block.
  • the coefficient traversal can be performed along the direction from the right edge to the left edge of the transform block first, and then the coefficient traversal can be performed along the direction from the lower edge to the upper edge of the transform block; The coefficient traversal is performed in the direction to the upper edge, and then the coefficient traversal is performed in the direction from the right edge to the left edge of the transform block; The coefficient traversal is performed in the direction from the lower edge to the upper edge of the transform block.
  • the scanning area is the smallest rectangular area covering all non-zero coefficients in the transform block; the first quantization mode is dual quantization.
  • the coefficients in the scanning area are quantized based on the first quantization method, which can be implemented by the following steps:
  • the current coefficient is quantized based on the quantizer corresponding to the current coefficient.
  • the reference coefficient is the previous coefficient of the current coefficient in the coefficient scanning order.
  • the reconstructed value of the current coefficient can determine the state of the next coefficient through the transition method shown in Fig. 7 and Fig. 8.
  • states there are four kinds of states, respectively 0, 1 , 2, and 3 are represented by the four values.
  • the state of the first coefficient in scan order of each transform block is set to the initial state 0.
  • the states 0, 1, 2, and 3 also determine which quantizer is used for the current coefficient.
  • the states 0 and 1 correspond to the use of the quantizer Q0, and the states 2 and 3 correspond to the use of the quantizer Q1.
  • t k and q k represent the original transform coefficient and transform coefficient level, respectively, t' k (q k
  • the present application can express the dependency between the quantizer and the transform coefficient level as a trellis diagram as shown in FIG.
  • the coding order goes from left to right, the four states in each column represent the possible four states of the current coefficient, and each node is connected to the possible two state nodes of the next coefficient in the coding order.
  • the present application can use the current quantizer to quantize the corresponding transform coefficient level.
  • the encoder can choose to use an odd-numbered transform coefficient level or an even-numbered transform coefficient level.
  • Transform coefficient levels correspond to B (Q0 with parity 1) and D (Q1 with parity 1) in FIG.
  • the transform coefficient levels q k of a series of current nodes are determined using the Viterbi algorithm with the estimated rate-distortion sum (the cost synthesis corresponding to the transform coefficient levels determined by the previous node).
  • the first quantization method includes at least two quantizers, and the at least two quantizers include a first quantizer and a second quantizer, and the coefficients in the scanning area are quantized based on the first quantization method, including:
  • For the coefficient determine to use the first quantizer or the second quantizer, and use the determined quantizer to quantize the coefficient to obtain a quantized value
  • the reconstruction coefficient value corresponding to the target quantization value when the first quantizer is used for quantization is different from the reconstruction coefficient value corresponding to the target quantization value when the second quantizer is used for quantization.
  • the coefficients in the quantization block corresponding to the second quantization mode and the quantization values are in a one-to-one correspondence.
  • S506 Encode the quantized block and write it into the code stream.
  • step S505 when the scanning area does not meet the trigger condition for dual quantization, the coefficients in the scanning area are quantized based on the second quantization method, and after obtaining the quantized block, the following steps may also be performed:
  • the identification information is used to indicate whether the quantization mode of the quantization block is the first quantization mode
  • the difference between the original video signal and its predicted block is called the residual.
  • the residual can be further transformed in two dimensions or not.
  • the transformed or untransformed blocks need to be further quantized.
  • the residual transformed or untransformed blocks are collectively referred to as transform blocks.
  • a transform block is a rectangular block of size (N, M), where both N and M are integers greater than zero.
  • the scanning area of the transform block refers to the smallest rectangular area (SRx, SRy) covering all non-zero coefficients in the transform block, where SRx and SRy are both an integer greater than or equal to zero, but less than or equal to N or M, the scanning area of the following transform block Referred to as the scan area.
  • dual quantization should only be applied to a scanning area larger than or equal to a specific area, and a scanning area with an area smaller than this specific value does not use dual quantization.
  • the decoding end obtains the code stream information and parses the identification bit of the current encoding block.
  • Decode transform blocks Obtain the coefficient scanning range information in the transform block of the current coding block, including the abscissa SRx at the right end of the scanning area and the ordinate SRy at the lower end of the scanning area. It is judged whether the usage conditions of the limited scanning area of the dual quantization technology are satisfied. If the value of SRx*SRy is greater than S, perform inverse quantization with the dual quantization technique. Otherwise, default inverse quantization is performed.
  • the encoding end is implemented as follows:
  • the current coded block is predicted by the prediction part, or by inter-frame prediction, or by means of intra-frame prediction, etc., to obtain the current prediction block by predicting the current block. Take the image block at the corresponding position of the original image and the coordinates of the current prediction block, and make a difference with the current prediction block to obtain the residual block of the current coding unit. Then, two-dimensional transformation is performed on the residual block or no transformation is performed, and a transformed block containing transformed coefficients or a non-transformed coefficient block can be obtained, which are collectively referred to as coefficient blocks herein.
  • the abscissa SRx at the right end of the scanning area and the ordinate SRy at the lower end of the scanning area are determined according to the coefficient scanning technique. It is judged whether the usage conditions of the limited scanning area of the dual quantization technology are satisfied. If the value of SRx*SRy is greater than S, use the dual quantization technique for quantization. Otherwise, default quantization is performed.
  • the present application uses dual quantization for transform blocks whose scanning area is within a specific range.
  • the dual quantization technology no longer acts on all the coefficient blocks globally, and restricts the use of the DQ technology, thereby improving the coding performance.
  • This technique can be extended to other standards such as MPEG, AOM or any custom coefficient block coding.
  • FIG. 11 shows a schematic flowchart of a decoding method provided by an embodiment of the present application.
  • the decoding method is applied to the decoder, and the decoding method may include:
  • the scanning area is the smallest rectangular area covering all non-zero coefficients in the quantization block, and the first inverse quantization mode is dual quantization and inverse quantization.
  • the present application provides a decoding method, which parses a code stream to obtain a quantized block; when the scanning area of the quantized block satisfies the trigger condition of dual quantization and inverse quantization, the quantized block is inversely quantized based on the first inverse quantization method; the scanning area is the quantized block In the smallest rectangular area covering all non-zero coefficients, the first inverse quantization method is dual quantization and inverse quantization, so that the decoding efficiency is improved.
  • FIG. 12 shows a schematic flowchart of a decoding method provided by an embodiment of the present application.
  • the decoding method is applied to the decoder, and the decoding method may include:
  • S701 Parse the code stream to obtain a quantized block and obtain the length of the scanning area and the width of the scanning area.
  • the scanning area is the smallest rectangular area covering all non-zero coefficients in the quantization block, and the first inverse quantization mode is dual quantization and inverse quantization.
  • the decoder may determine whether the scan area satisfies the trigger condition of dual quantization and inverse quantization based on the length of the scan area and the width of the scan area.
  • the triggering conditions for the dual quantization and inverse quantization include: the length of the scanning area satisfies the second preset condition; and/or the width of the scanning area satisfies the third preset condition.
  • the trigger condition of the dual quantization inverse quantization includes: the product of the length of the scanning area and the width of the scanning area satisfies the fourth preset condition, and the length of the scanning area satisfies the second preset condition; and/or the product satisfies the fourth preset condition. set conditions, and the width of the scanning area satisfies the third preset condition.
  • the first inverse quantization method includes at least two inverse quantizers, the at least two inverse quantizers include a first inverse quantizer and a second inverse quantizer, and the quantization block is inversely quantized based on the first inverse quantization method, including:
  • the quantized value in the quantization block it is determined to use the first inverse quantizer or the second inverse quantizer, and the determined inverse quantizer is used to perform inverse quantization on the quantized value to obtain the reconstructed transform coefficient;
  • the reconstructed transform coefficient obtained by using the first inverse quantizer is different from the reconstructed coefficient obtained by using the second inverse quantizer.
  • the target quantization value may be all quantization values, or may be all quantization values excluding 0.
  • S705 Perform inverse transform processing on the reconstructed transform block to obtain a reconstructed residual block.
  • S706 Perform prediction processing on the quantized block to obtain a prediction block of the quantized block.
  • S707 Determine the reconstructed block of the quantization block according to the reconstructed residual block and the prediction block.
  • FIG. 13 shows a schematic flowchart of a decoding method provided by an embodiment of the present application.
  • the decoding method is applied to the decoder, and the decoding method may include:
  • S801 Parse the code stream to obtain quantized blocks and identification information.
  • the identification information is used to indicate whether to use the first quantization method.
  • the decoding end obtains the code stream information and parses the identification bit of the current encoding block.
  • Decode transform blocks Obtain the coefficient scanning range information in the transform block of the current coding block, including the abscissa SRx at the right end of the scanning area and the ordinate SRy at the lower end of the scanning area. It is judged whether the usage conditions of the limited scanning area of the dual quantization technology are satisfied. If SRx is greater than X and/or SRy is greater than Y, inverse quantization is performed with the dual quantization technique. Otherwise, default inverse quantization is performed.
  • the encoding end is implemented as follows:
  • the current coded block is predicted by the prediction part, or by inter-frame prediction, or by means of intra-frame prediction, etc., to obtain the current prediction block by predicting the current block. Take the image block at the corresponding position of the original image and the coordinates of the current prediction block, and make a difference with the current prediction block to obtain the residual block of the current coding unit. Then, two-dimensional transformation is performed on the residual block or no transformation is performed, and a transformed block containing transformed coefficients or a non-transformed coefficient block can be obtained, which are collectively referred to as coefficient blocks herein.
  • the abscissa SRx at the right end of the scanning area and the ordinate SRy at the lower end of the scanning area are determined according to the coefficient scanning technique. It is judged whether the usage conditions of the limited scanning area of the dual quantization technology are satisfied. If SRx is greater than X and/or SRy is greater than Y, quantization is performed using a dual quantization technique. Otherwise, default quantization is performed.
  • FIG. 14 it shows a schematic structural diagram of the composition of an encoder 90 provided by the embodiments of the present application.
  • the encoder 90 may include a determination unit 901, a first processing unit 902 and an encoding unit 903; wherein,
  • Determining unit 901 configured to determine the transform block corresponding to the current block in the image to be processed
  • the first processing unit 902 is configured to quantize the coefficients in the scanning area based on the first quantization method when the scanning area of the transform block satisfies the trigger condition of dual quantization; wherein, the scanning area is the area covering all non-zero coefficients in the transform block. Minimum rectangular area; the first quantization method is dual quantization;
  • the encoding unit 903 is configured to encode the quantized quantized block and write it into the code stream.
  • the scanning area satisfying the trigger condition of the dual quantization includes: the value of the area of the scanning area meeting the first preset condition.
  • the scanning area satisfying the trigger condition of dual quantization further includes: the length of the scanning area satisfies the second preset condition; and/or the width of the scanning area satisfies the third preset condition.
  • the determining unit 901 is further configured to determine the length of the scan area based on the abscissa of the rightmost non-zero coefficient in the quantized scan area;
  • the first processing unit 902 is further configured to write the length of the scanning area and the width of the scanning area into the code stream.
  • the determining unit 901 is further configured to traverse at least part of the coefficients of the transform block;
  • the scanning area is determined.
  • the determining unit 901 is further configured to traverse each coefficient of the transform block;
  • the scan area is determined.
  • the determining unit 901 is further configured to perform coefficient traversal along the direction from the right edge to the left edge of the transform block, and perform coefficient traversal along the direction from the lower edge to the upper edge of the transform block;
  • the scan area is determined from the transform block.
  • the first processing unit 902 is further configured to quantize the coefficients in the scan area based on the second quantization method when the scan area does not satisfy the trigger condition of the dual quantization to obtain a quantized block; wherein the second quantization The method is different from the first quantization method.
  • the first quantization method includes at least two quantizers, and the at least two quantizers include a first quantizer and a second quantizer, and the coefficients in the scanning area are quantized based on the first quantization method, including:
  • For the coefficient determine to use the first quantizer or the second quantizer, and use the determined quantizer to quantize the coefficient to obtain a quantized value
  • the reconstruction coefficient value corresponding to the target quantization value when the first quantizer is used for quantization is different from the reconstruction coefficient value corresponding to the target quantization value when the second quantizer is used for quantization.
  • the coefficients in the quantization block corresponding to the second quantization mode and the quantization values are in a one-to-one correspondence.
  • the first processing unit 902 is further configured to determine a quantizer corresponding to the current coefficient in the scanning area based on the parity of the quantized value of the reference coefficient in the scanning area; wherein the reference coefficient and the current coefficient have adjacent coefficient scan order;
  • the current coefficient is quantized based on the quantizer corresponding to the current coefficient.
  • the encoding unit 903 is further configured to encode the quantized block according to the scanning order in the direction from the lower right corner to the upper left corner, and write the code stream.
  • the determining unit 901 is further configured to perform prediction on the current block to obtain the current prediction block;
  • the first processing unit 902 is further configured to generate identification information; wherein the identification information is used to indicate whether the quantization mode of the quantization block is the first quantization mode;
  • FIG. 15 shows a schematic structural diagram of the composition of a decoder 100 provided by the embodiments of the present application.
  • the decoder 100 may include a decoding unit 1001 and a second processing unit 1002; wherein,
  • a decoding unit 1001 configured to parse the code stream to obtain a quantized block
  • the second processing unit 1002 is configured to perform inverse quantization on the quantization block based on the first inverse quantization method when the scanning area of the quantization block satisfies the trigger condition of the dual quantization and inverse quantization; wherein, the scanning area covers all non-zero coefficients in the quantization block The smallest rectangular region of , the first inverse quantization method is dual quantization and inverse quantization.
  • the second processing unit 1002 is further configured to perform inverse quantization on the quantization block based on the second inverse quantization method when the scanning area does not satisfy the trigger condition of the dual quantization and inverse quantization; the second inverse quantization method is the same as the first inverse quantization method. Inverse quantization is different.
  • the first inverse quantization method includes at least two inverse quantizers, the at least two inverse quantizers include a first inverse quantizer and a second inverse quantizer, and the quantization block is inversely quantized based on the first inverse quantization method, including:
  • the quantized value in the quantization block it is determined to use the first inverse quantizer or the second inverse quantizer, and the determined inverse quantizer is used to perform inverse quantization on the quantized value to obtain the reconstructed transform coefficient;
  • the reconstructed transform coefficient obtained by using the first inverse quantizer is different from the reconstructed coefficient obtained by using the second inverse quantizer.
  • the decoding unit 1001 is further configured to parse the code stream to obtain the length of the scanning area and the width of the scanning area;
  • the second processing unit 1002 is further configured to determine, based on the length of the scan area and the width of the scan area, whether the scan area satisfies the trigger condition for dual quantization and inverse quantization.
  • the scanning area satisfying the trigger condition for dual quantization and inverse quantization includes: the length of the scanning area satisfies the second preset condition; and/or the width of the scanning area satisfies the third preset condition.
  • the triggering condition that the scanning area satisfies the dual quantization and inverse quantization includes: the product of the length of the scanning area and the width of the scanning area satisfies the fourth preset condition, and the length of the scanning area satisfies the second preset condition; and/ Or the product satisfies the fourth preset condition, and the width of the scanning area satisfies the third preset condition.
  • the decoding unit 1001 is further configured to parse the code stream to obtain identification information; wherein the identification information is used to indicate whether to use the first quantization mode;
  • the second processing unit 1002 is further configured to determine, based on the identification information, whether the scanning area satisfies or does not satisfy the trigger condition of the dual quantization and inverse quantization.
  • the second processing unit 1002 is further configured to form a reconstructed transform block based on the obtained reconstructed transform coefficients after performing inverse quantization processing on all the quantized coefficients of the quantized block;
  • the second processing unit 1002 is further configured to perform prediction processing on the quantized block to obtain a predicted block of the quantized block;
  • the reconstructed block of the quantized block is determined.
  • 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, and it may also be non-modular.
  • each component in this embodiment may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit.
  • the above-mentioned integrated units can be implemented in the form of hardware, or can be implemented in the form of software function modules.
  • the integrated unit is implemented in the form of software function modules 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 correct. Part of the contribution made by the prior art 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 make a computer device (which can be a personal A computer, a server, or a network device, etc.) or a processor (processor) executes all or part of the steps of the method in this embodiment.
  • the aforementioned storage medium includes: 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, where the computer storage medium stores a computer program, and when the computer program is executed by the first processor, implements any of the methods in the foregoing embodiments.
  • FIG. 16 shows a schematic diagram of the hardware structure of the encoder 90 provided by the embodiment of the present application.
  • it may include: a first communication interface 1101 , a first memory 1102 and a first processor 1103 ; each component is coupled together through a first bus system 1104 .
  • the first bus system 1104 is used to realize the connection and communication between these components.
  • the first bus system 1104 also includes a power bus, a control bus and a status signal bus.
  • the various buses are labeled as the first bus system 1104 in FIG. 16 . in,
  • the first communication interface 1101 is used for receiving and sending signals in the process of sending and receiving information with other external network elements;
  • a first memory 1102 for storing computer programs that can run on the first processor 1103;
  • the first processor 1103 is configured to, when running the computer program, execute:
  • the coefficients in the scanning area are quantized based on the first quantization method; wherein, the scanning area is the smallest rectangular area covering all non-zero coefficients in the transform block; the first quantization method for dual quantization;
  • the quantized quantized block is encoded and written into the code stream.
  • the first memory 1102 in this embodiment of the present application may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories.
  • the non-volatile memory may be a read-only memory (Read-Only Memory, ROM), a programmable read-only memory (Programmable ROM, PROM), an erasable programmable read-only memory (Erasable PROM, EPROM), an electrically programmable read-only memory (Erasable PROM, EPROM). Erase programmable read-only memory (Electrically EPROM, EEPROM) or flash memory.
  • Volatile memory may be Random Access Memory (RAM), which acts as an external cache.
  • RAM Static RAM
  • DRAM Dynamic RAM
  • SDRAM Synchronous DRAM
  • SDRAM double data rate synchronous dynamic random access memory
  • Double Data Rate SDRAM DDRSDRAM
  • enhanced SDRAM ESDRAM
  • synchronous link dynamic random access memory Synchlink DRAM, SLDRAM
  • Direct Rambus RAM Direct Rambus RAM
  • the first processor 1103 may be an integrated circuit chip with signal processing capability. In the implementation process, each step of the above method may be completed by an integrated logic circuit of hardware in the first processor 1103 or an instruction in the form of software.
  • the above-mentioned first processor 1103 can be a general-purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), a ready-made programmable gate array (Field Programmable Gate Array, FPGA) Or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
  • DSP Digital Signal Processor
  • ASIC Application Specific Integrated Circuit
  • FPGA Field Programmable Gate Array
  • the methods, steps, and logic block diagrams disclosed in the embodiments of this application can be implemented or executed.
  • a general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
  • the steps of the method disclosed in conjunction with the embodiments of the present application may be directly embodied as executed by a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor.
  • the software modules may be located in random access memory, flash memory, read-only memory, programmable read-only memory or electrically erasable programmable memory, registers and other storage media mature in the art.
  • the storage medium is located in the first memory 1102, and the first processor 1103 reads the information in the first memory 1102, and completes the steps of the above method in combination with its hardware.
  • the embodiments described herein may be implemented in 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 Processing (DSP), Digital Signal Processing Device (DSP Device, DSPD), programmable Logic device (Programmable Logic Device, PLD), Field-Programmable Gate Array (Field-Programmable Gate Array, FPGA), general-purpose processor, controller, microcontroller, microprocessor, other electronic units for performing the functions of the present application or a combination thereof.
  • the techniques of the present application may be implemented through modules (eg, procedures, functions, etc.) that perform the functions of the present application.
  • Software codes may be stored in memory and executed by a processor.
  • the memory can be implemented in the processor or external to the processor.
  • the integrated unit may be stored in a computer-readable storage medium if it is implemented in the form of software functional modules and is not sold or used as a separate product. Based on this understanding, this embodiment provides a computer storage medium, which is applied to the decoder 100 , where the computer storage medium stores a computer program, and when the computer program is executed by the second processor, the method of any one of the foregoing embodiments is implemented. .
  • FIG. 17 shows a schematic diagram of the hardware structure of the decoder 100 provided by the embodiment of the present application.
  • it may include: a second communication interface 1201 , a second memory 1202 and a second processor 1203 ; each component is coupled together through a second bus system 1204 .
  • the second bus system 1204 is used to implement connection communication between these components.
  • the second bus system 1204 also includes a power bus, a control bus, and a status signal bus.
  • the various buses are labeled as the second bus system 1204 in FIG. 17 . in,
  • 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;
  • a second memory 1202 for storing computer programs that can run on the second processor 1203;
  • the second processor 1203 is configured to, when running the computer program, execute:
  • a decoding unit configured to parse the code stream to obtain a quantized block
  • the second processing unit is configured to perform inverse quantization on the quantization block based on the first inverse quantization method when the scanning area of the quantization block satisfies the trigger condition of the dual quantization and inverse quantization; wherein, the scanning area is the area covering all non-zero coefficients in the quantization block.
  • the first inverse quantization method is dual quantization and inverse quantization.
  • the second processor 1203 is further configured to execute the method of any one of the foregoing embodiments when running the computer program.
  • the encoding method provided by the embodiment of the present application includes determining the transform block corresponding to the current block in the image to be processed; when the scanning area of the transform block satisfies the trigger condition of dual quantization, quantizing the coefficients in the scanning area based on the first quantization method; Wherein, the scanning area is the smallest rectangular area covering all non-zero coefficients in the transform block; the first quantization method is dual quantization; the quantized quantization block is encoded and written into the code stream; in this application, when the trigger condition for dual quantization is satisfied When , the first quantization method, that is, dual quantization, is used to quantize the coefficients in the scanning area. That is to say, dual quantization no longer acts on all coefficient blocks in the world, and restrictive conditions are given for the use of dual quantization, which improves the encoding performance.

Landscapes

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

Abstract

本申请实施例公开了一种编码方法、解码方法、编码器、解码器及存储介质,其中,编码方法包括:确定待处理图像中当前块对应的变换块;当变换块的扫描区域满足对偶量化的触发条件时,基于第一量化方式对扫描区域中的系数进行量化;其中,扫描区域为变换块中覆盖所有非零系数的最小矩形区域;第一量化方式为对偶量化;对量化后的量化块进行编码并写入码流。

Description

一种编码方法、解码方法、编码器、解码器以及存储介质
相关申请的交叉引用
本申请要求在2021年02月22日提交中国专利局、申请号为202110200048.7、申请名称为“一种编码方法、解码方法、编码器、解码器及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及编解码技术领域,尤其涉及一种编码方法、解码方法、编码器、解码器及存储介质。
背景技术
随着人们对视频显示质量要求的提高,计算机视觉相关领域得到了越来越多的关注。近年来,图像处理技术在各行各业都取得了成功地应用。对于视频图像的编解码过程而言,在编码端,针对待编码的图像数据,在经过变换模块和量化模块之后将送入传统视频编码器进行压缩编码,而传统视频编码器产生的码流将传输到解码端;然后再经过反量化模块和反变换模块后送入传统视频解码器进行解码,以恢复出原始输入的图像数据。
在相关技术中,目前通常将对偶量化技术作用于全局所有的系数块中;然而,全局所有的系数块均采用对偶量化,并不能带来编码性能的提升。
发明内容
本申请提出一种编码方法、解码方法、编码器、解码器及存储介质,当满足对偶量化的触发条件时,才采用第一量化方式即对偶量化对扫描区域中的系数进行量化,也就是说,对偶量化不再作用于全局所有的系数块中,对使用对偶量化给出了限定条件,从而提升了编码性能。
本申请的技术方案是这样实现的:
第一方面,本申请实施例提供了一种编码方法,该方法包括:
确定待处理图像中当前块对应的变换块;
当所述变换块的扫描区域满足对偶量化的触发条件时,基于第一量化方式对所述扫描区域中的系数进行量化;其中,所述扫描区域为所述变换块中覆盖所有非零系数的最小矩形区域;所述第一量化方式为对偶量化;
对量化后的量化块进行编码并写入码流。
第二方面,本申请实施例提供了一种解码方法,该方法包括:
解析码流,获得量化块;
当所述量化块的扫描区域满足对偶量化反量化的触发条件时,基于第一反量化方式对所述量化块进行反量化;其中,所述扫描区域为所述量化块中覆盖所有非零系数的最小矩形区域,所述第一反量化方式为对偶量化反量化。
第三方面,本申请实施例提供了一种编码器,所述编码器包括确定单元、第一处理单元和编码单元;其中,
所述确定单元,配置为确定待处理图像中当前块对应的变换块;
所述第一处理单元,配置为当所述变换块的扫描区域满足对偶量化的触发条件时,基于第一量化方式对所述扫描区域中的系数进行量化;其中,所述扫描区域为所述变换块中覆盖所有非零系数的最小矩形区域;所述第一量化方式为对偶量化;
所述编码单元,配置为对量化后的量化块进行编码并写入码流。
第四方面,本申请实施例提供了一种解码器,所述解码器包括解码单元和第二处理单元;其中,
所述解码单元,配置为解析码流,获得量化块;
所述第二处理单元,配置为当所述量化块的扫描区域满足对偶量化反量化的触发条件时,基于第一反量化方式对所述量化块进行反量化;其中,所述扫描区域为所述量化块中覆盖所有非零系数的最小矩形区域,所述第一反量化方式为对偶量化反量化。
第五方面,本申请实施例提供了一种编码器,所述编码器包括第一存储器和第一处理器;其中,
所述第一存储器,用于存储能够在所述第一处理器上运行的计算机程序;
所述第一处理器,用于在运行所述计算机程序时,执行如第一方面所述的方法。
第六方面,本申请实施例提供了一种解码器,所述解码器包括第二存储器和第二处理器;其中,
所述第二存储器,用于存储能够在所述第二处理器上运行的计算机程序;
所述第二处理器,用于在运行所述计算机程序时,执行如第二方面所述的方法。
第七方面,本申请实施例提供了一种计算机存储介质,所述计算机存储介质存储有计算机程序,所述计算机程序被第一处理器执行时实现如第一方面所述的方法、或者被第二处理器执行时实现如第二方面所述的方法。
本申请实施例所提供的一种编码方法、解码方法、编码器、解码器及存储介质,其中,编码方法包括确定待处理图像中当前块对应的变换块;当变换块的扫描区域满足对偶量化的触发条件时,基于第一量化方式对扫描区域中的系数进行量化;其中,扫描区域为变换块中覆盖所有非零系数的最小矩形区域;第一量化方式为对偶量化;对量化后的量化块进行编码并写入码流;本申请中当满足对偶量化的触发条件时,才采用第一量化方式即对偶量化对扫描区域中的系数进行量化,也就是说,对偶量化不再作用于全局所有的系数块中,对使用对偶量化给出了限定条件,从而提升了编码性能。
附图说明
图1为相关技术方案提供的一种编码框架的示意图;
图2为本申请实施例提供的一种编码方法的流程示意图;
图3为本申请实施例提供的一种编码方法的流程示意图;
图4为本申请实施例提供的一种对偶量化器Q0和Q1与其各自对应的重建变换系数的结构示意图;
图5为本申请实施例提供的一种变换块内扫描区域的示意图;
图6为本申请实施例提供的一种编码方法的流程示意图;
图7为本申请实施例提供的决策量化系数所使用量化器的状态转移示意图;
图8为本申请实施例提供的状态转移表的示意图;
图9为本申请实施例提供的量化器的状态与变换系数级别之间的依赖关系的网格结构示意图;
图10为本申请实施例提供的原始变换系数与候选变换系数之间的匹配关系示意图;
图11为本申请实施例提供的一种解码方法的流程示意图;
图12为本申请实施例提供的一种解码方法的流程示意图;
图13为本申请实施例提供的一种解码方法的流程示意图;
图14为本申请实施例提供的一种编码器的结构示意图;
图15为本申请实施例提供的一种解码器的结构示意图;
图16为本申请实施例提供的一种编码器的硬件结构示意图;
图17为本申请实施例提供的一种解码器的硬件结构示意图。
具体实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述。可以理解的是,此处所描述的具体实施例仅仅用于解释相关申请,而非对该申请的限定。另外还需要说明的是,为了便于描述,附图中仅示出了与有关申请相关的部分。
对本申请实施例进行进一步详细说明之前,先对本申请实施例中涉及的名词和术语进行说明,本申请实施例中涉及的名词和术语适用于如下的解释:
动态图像专家组(Moving Picture Experts Group,MPEG)
国际标准化组织(International Standardization Organization,ISO)
国际电工委员会(International Electrotechnical Commission,IEC)
联合视频专家组(Joint Video Experts Team,JVET)
开放媒体联盟(Alliance for Open Media,AOM)
下一代视频编码标准H.266/多功能视频编码(Versatile Video Coding,VVC)
VVC的参考软件测试平台(VVC Test Model,VTM)
音视频编码标准(Audio Video Standard,AVS)
AVS的高性能测试模型(High-Performance Model,HPM)
对偶量化(Dependent Quantization,DQ)
量化参数(Quantization Parameter,QP)
变换系数(Transform coefficients)
量化步长(Quantization step)
变换系数级别(Transform coefficient levels)
状态机(State machine)
状态转移(State transition)
拉格朗日率失真代价(Lagrangian rate-distortion costs)
基于扫描区域的系数编码(Scan Region based Coefficient Coding,SRCC)
下面将针对目前的视频编码的相关技术方案进行描述。
数字视频压缩技术主要是将庞大的数字影像视频数据进行压缩,以便于传输以及存储等。随着互联网视频的激增以及人们对视频清晰度的要求越来越高,尽管已有的数字视频压缩标准能够节省不少视频数据,但目前仍然需要追求更好的数字视频压缩技术,以减少数字视频传输的带宽和流量压力。
参照图1所示,视频压缩包括用于减少或取出视频内在冗余的帧内预测(空域)和/或帧间预测(时域),残差信息的变化量化和反量化反变化,提高主客观重建质量的环路滤波和熵编码等多个模块。主流的视频压缩标准大都描述的是以块为基础的压缩技术。一个视频片,一帧图片或一系列图片会被划分成以编码树单元(CodingTreeUnit,CTU)的基本单元,以此为基础进一步被划分成以编码单元(CodingUnit,CU)为单位的块。帧内块通过块周边像素作为参考进行预测,帧间块则参考空间上的邻近块信息和其他帧里的参考信息。与预测信号相对,残差信息通过以块为单位的变换,量化和熵编码成码流。
下面将结合附图对本申请各实施例进行详细说明。
本申请的一个实施例中,参见图2,其示出了本申请实施例提供的一种编码方法的流程示意图。如图2所示,该编码方法应用于编码器,编码方法可以包括:
S201:确定待处理图像中当前块对应的变换块。
需要说明的是,该编码方法可以适用于H.265/HEVC标准的编码器,也可以适用于H.266/多功能视频编码(Versatile Video Coding,VVC)标准的编码器,甚至还可以适用于其他标准的编码器,比如适用于AVS标准的编码器、基本视频编码(Essential Video Coding,EVC)标准的编码器等,本申请实施例不作具体限定。
这里,确定待处理图像中当前块对应的变换块,包括:
对待处理图像的当前块进行预测,得到当前预测块;
确定当前块与当前预测块的残差块;
确定残差块对应的变换块。
S202:当变换块的扫描区域满足对偶量化的触发条件时,基于第一量化方式对扫描区域中的系数进行量化。
其中,扫描区域为变换块中覆盖所有非零系数的最小矩形区域;第一量化方式为对偶量化。扫描区域为变换块中的至少部分区域。
S203:对量化后的量化块进行编码并写入码流。
本申请实施例提供的编码方法,通过确定待处理图像中当前块对应的变换块;当变换块的扫描区域满足对偶量化的触发条件时,基于第一量化方式对扫描区域中的系数进行量化;其中,扫描区域为变换块中覆盖所有非零系数的最小矩形区域;第一量化方式为对偶量化;对量化后的量化块进行编码并写入码流;本申请中当满足对偶量化的触发条件时,才采用第一量化方式即对偶量化对扫描区域中的系数进行量化,也就是说,对偶量化不再作用于全局所有的系数块中,对使用对偶量化给出了限定条件,从而提升了编码性能。
本申请的另一个实施例中,参见图3,其示出了本申请实施例提供的一种编码方法的流程示意图。如图3所示,该编码方法应用于编码器,编码方法可以包括:
S301:确定待处理图像中当前块对应的变换块。
S302:当变换块的扫描区域满足对偶量化的触发条件时,基于第一量化方式对扫描区域中的系数进行量化。
其中,扫描区域为变换块中覆盖所有非零系数的最小矩形区域;第一量化方式为对偶量化。
本申请实施例中,在视频编码中,变换后的系数和非变换的系数可以统称为系数(coefficient)。量化通常被用于降低系数的动态范围,从而达到用更少的码字表达视频的目的。量化后的数值通常称为级别,重建级别或者重建电平(level)。量化的操作包括用系数除以量化步长,量化步长由在码流传递的量化因子决定。反量化则是通过重建级别乘以量化步长来完成。对于一个N×M的块,所有系数的量化可以独立的完成,这一技术也被广泛地应用在很多国际视频压缩标准,例如H.264,HEVC中。
与此同时,特定的扫描顺序可以把一个二维的系数块变换成一维系数流。扫描顺序可以是Z型,水平,垂直或者其它任何一种顺序的扫描。量化操作可以利用系数间的相关性,利用已量化系数的特性来选择更优的量化方式,从而达到优化量化的目的。
对偶量化是在VVC中定义的一种量化方式。对偶量化作用在变换后的块上,与传统的量化不同的是,对偶量化共包含了两个量化器,这两个量化器虽然有着相同的量化步长(即2*Δ),但它们各自对应的重建变换系数却是交错的。参见图4所示,图4是对偶量化的量化器Q0和量化器Q1与它们各自对应的重建变换系数的示意。
如图4所示,在该对偶量化器中,对于量化器Q0而言,重建变换系数为-8Δ、-6Δ、-4Δ、-2Δ、0、2Δ、4Δ、6Δ、8Δ等,量化系数的级别为-4、-3、-2、-1、0、1、2、3、4等;对于量化器Q1而言,重建变换系数为-9Δ、-7Δ、-5Δ、-3Δ、-Δ、0、Δ、3Δ、5Δ、7Δ、9Δ等,量化系数的级别为-5、-4、-3、-2、-1、0、1、2、3、4、5等。
其中,量化器Q0对应了重建变换系数级别是偶数倍的Δ(Q0与Q1两个量化器的量化步长均为2*Δ,对偶量化器中Q0与Q1合并起来相当于量化步长为Δ)(即A,B点对应的数字),量化器Q1对应了重建变换系数级别是奇数倍的Δ(即C,D点对应的数字)。
对偶量化通过引入两个交错的量化器,以及量化器之间跳转的原则,使得大步长的量化器组合起来能够完成更精细的量化,达到减小了重建的变换系数与原始变换系数之间的损失,从而提高编码效率。
对于每个变换系数,本申请都可以选择使用图4中描述的两种量化器Q0,Q1中的一种进行量化,这两个量化器各自的量化的方式与传统的量化器(HEVC中的量化)相似。两个量化器的重建变换系数都可以用量化步长Δ的倍数表示,两个量化器的重建变换系数定义如下:
Q0:该量化器的重建变换系数级别为偶数倍(包括零倍)的量化步长Δ,当使用这个量化器时,重建的变换系数t'可根据如下公式计算,
t′=2·k·Δ,
其中,k表示图4中所述相关的变换系数级别。
Q1:该量化器的重建变换系数级别为奇数或零倍的量化步长Δ,当使用这个量化器时,重建的变换系数t'可根据如下公式计算,
t′=(2·k-sgn(k))·Δ,
其中,sgn(·)代表符号函数,
Figure PCTCN2021079064-appb-000001
其中,x是被量化的变换系数。
选择使用Q0或Q1进行量化并不会通过编码标志位来进行控制。取而代之的是,使用在系数扫描顺序上的上一个系数的变换系数级别(图4中所述的变换系数级别)的奇偶性来决定当前变换系数使用Q0或Q1。
在一些实施例中,扫描区域满足对偶量化的触发条件包括:扫描区域的面积的值满足第一预设条件。
其中,第一预设条件可以是第一参数范围。
在另一些实施例中,扫描区域满足对偶量化的触发条件还包括:扫描区域的长度满足第二预设条件;和/或扫描区域的宽度满足第三预设条件。
其中,第二预设条件可以是第二参数范围。第三预设条件可以是第三参数范围。
S303:基于量化后的扫描区域中最右侧的非零系数的横坐标,确定扫描区域的长度。
S304:基于量化后的扫描区域中最下侧的非零系数的纵坐标,确定扫描区域的宽度。
S305:对量化后的量化块进行编码并写入码流,将扫描区域的长度和扫描区域的宽度写入码流。
参照图5所示,图5示出了AVS3中采用了基于扫描区域的系数编码方式(SRCC),该技术利用(SRx,SRy)来确定一个变换单元中需要扫描的量化系数区域,其中SRx是系数矩阵中最右面的非零系数的横坐标,SRy是系数矩阵中最下面的非零系数的纵坐标。只有(SRx,SRy)确定的扫描区域内的系数需要编码。编码的扫描顺序是从右下角到左上角的反向Z字型扫描。
本申请的另一个实施例中,参见图6,其示出了本申请实施例提供的一种编码方法的流程示意图。如图6所示,该编码方法应用于编码器,编码方法可以包括:
S501:确定待处理图像中当前块对应的变换块。
在一些实施例中,S501确定待处理图像中当前块对应的变换块,可以通过如下步骤实现:
对当前块进行预测,得到当前预测块;
确定当前块与当前预测块的残差块;
确定残差块对应的变换块。
S502:对变换块的至少部分系数进行遍历。
S503:基于遍历到的目标非零系数的坐标,确定扫描区域。
在一些实施例中,当对变换块的各个系数进行遍历时,S503基于遍历到的目标非零系数的坐标,确定扫描区域,可以通过如下步骤实现:
确定遍历到的各个系数中位于变换块的最右侧的非零系数的横坐标;
确定遍历到的各个系数中位于变换块的最下侧的非零系数的纵坐标;
基于最右侧的非零系数的横坐标和最下侧的非零系数的纵坐标,确定扫描区域。
在另一些实施例中,当沿着从变换块的右边缘到左边缘的方向进行系数遍历,并沿着从变换块的下边缘到上边缘的方向进行系数遍历时,S503基于遍历到的目标非零系数的坐标,确定扫描区域,可以通过如下步骤实现:
分别确定遍历得到的右边缘和下边缘对应的第一个非零系数的坐标;
基于第一个非零系数的坐标,从变换块中确定扫描区域。
这里,可以先沿着从变换块的右边缘到左边缘的方向进行系数遍历,再沿着从变换块的下边缘到上边缘的方向进行系数遍历;也可以先沿着从变换块的下边缘到上边缘的方向进行系数遍历,再沿着从变换块的右边缘到左边缘的方向进行系数遍历;还可以在沿着从变换块的右边缘到左边缘的方向进行系数遍历,同时沿着从变换块的下边缘到上边缘的方向进行系数遍历。
S504:当变换块的扫描区域满足对偶量化的触发条件时,基于第一量化方式对扫描区域中的系数进行量化。
其中,扫描区域为变换块中覆盖所有非零系数的最小矩形区域;第一量化方式为对偶量化。
本申请实施例中,S504当变换块的扫描区域满足对偶量化的触发条件时,基于第一量化方式对扫描区域中的系数进行量化,可以通过如下步骤实现:
基于扫描区域中参考系数的量化值的奇偶性,确定扫描区域中当前系数对应的量化器;其中,参考系数与当前系数具有相邻的系数扫描顺序;
基于当前系数对应的量化器,对当前系数进行量化。其中,参考系数为系数扫描顺序上当前系数的前一个系数。
参见图7和图8所示,在系数扫描顺序上,当前系数的重建值可以通过图7和图8中所示的转移方法决定下一个系数的状态,状态共有四种,分别由0,1,2,3这四个值来表示。例如当前系数的状态为2且当前变换系数级别为5时,由于5是奇数,所以决定下一个系数的状态跳转为状态3。每一个变换块在扫描顺序上的第一个系数的状态被设定为初始状态0。状态的0,1,2,3也决定这当前的系数使用哪一个量化器,状态0,1对应着使用量化器Q0,状态2,3对应着使用量化器Q1。
进一步地,对编码器对对偶量化的决策过程进行说明:
与rate-distortion optimized quantization(RDOQ)的实现方式相似,变换系数级别{q k}的取值为最小化如下拉格朗日率失真代价的一个过程,
Figure PCTCN2021079064-appb-000002
t k和q k分别代表原始的表换系数和变换系数级别,t' k(q k|…)代表在当前变换系数级别q k下重建出的变换系数值,R k(q k|…)代表估计出的编码q k需要消耗的比特数。
如之前所介绍的状态机的转移,本申请可以将量化器与变换系数级别之间的依赖性表示成如图9所示的网格图,网格结构表示状态与变换系数级别的依赖性,编码顺序从左到右,每一列的四个状态表示当前系数的可能的四种状态,每个节点与编码顺序上下一个系数的可能的两个状态节点相连。对于一个给定的当前状态和当前变换系数t k,本申请可以使用当前量化器量化出对应的变换系数级别,编码器可以选择使用奇数的变换系数级别也可以选择使用偶数的变换系数级别,奇数变换系数级别对应图9中B(Q0 with parity 1)和D(Q1 with parity 1),偶数变换系数级别对应A(Q0 with parity 0)和C(Q1 with parity 0)。当算出所有节点的代价J k(q k)=(t k‐t' k(q k|…)) 2+λ·R k(q k|…)后,变换系数级别q k就可以通过找到一条代价总和最小的路线来决定,而确定最小代价和可以通过维特比算法(Viterbi algorithm)来 实现。
进一步地的实现由两步组成:
参见图10所示,找到4个与原始变换系数对应的4个分别来自Q0和Q1的候选变换系数级别。
使用维特比算法以估计出的rate-distortion总和(之前节点已确定的变换系数级别对应的代价综合)来确定一系列当前节点的变换系数级别q k
S505:当扫描区域不满足对偶量化的触发条件时,基于第二量化方式对扫描区域中的系数进行量化,得到量化块。
第一量化方式包含至少两个量化器,至少两个量化器包括第一量化器和第二量化器,基于第一量化方式对扫描区域中的系数进行量化,包括:
对于系数,确定使用第一量化器或第二量化器,使用所确定的量化器对系数进行量化得到量化值;
其中,当量化值为目标量化值时,使用第一量化器进行量化时目标量化值对应的重建系数值与使用第二量化器进行量化时目标量化值对应的重建系数值不同。
其中,第二量化方式对应的量化块中的系数与量化值之间是一一对应的关系。
S506:对量化后的量化块进行编码并写入码流。
本申请其他实施例中,在步骤S505当扫描区域不满足对偶量化的触发条件时,基于第二量化方式对扫描区域中的系数进行量化,得到量化块之后,还可以执行如下步骤:
生成标识信息;其中,标识信息用于指示量化块的量化方式是否为第一量化方式;
将标识信息写入码流。
在一个可实现的场景中,在基于块的视频编码中,原始视频信号和它的预测块的差称为残差。残差可以进一步做二维变换或者不做变换,在有损压缩中,变换后或者不经变换的块需要做进一步的量化,这里残差变换后或者不经变换的块都统称为变换块。变换块是一个(N,M)大小的矩形块,其中N和M都是一个大于零的整数。变换块的扫描区域是指变换块中覆盖所有非零系数的最小矩形区域(SRx,SRy),其中SRx和SRy都是一个大于等于零,但小于等于N或M的整数,以下变换块的扫描区域简称为扫描区域。
本申请该场景中提出对偶量化只应用于大于等于一个特定面积的扫描区域,面积小于这个特定值的扫描区域,不使用对偶量化。特定面积S大小事先确定好,其值为大于零的整数。例如S=10,系数扫描区域大小为SRx=6,SRy=2时,该扫描区域的面积符合条件(即12大于10),可以使用对偶量化;系数扫描区域大小为SRx=3,SRy=3时。该扫描区域的面积不符合条件(即9不大于10),此时不使用对偶量化。
本申请的一种实施例解码端实现如下:
解码端获取码流信息,解析当前编码块的标识位。
确定编码单元划分为变换块的方式。
解码变换块。获取当前编码块变换块中系数扫描范围信息,包括扫描区域右端横坐标SRx,扫描区域下端纵坐标SRy。判断是否满足对偶量化技术限定扫描区域的使用条件。若SRx*SRy的值大于S,进行对偶量化技术反量化。否则,进行默认反量化。
本方案对变换块语法结构的改变如表1所示。
表1变换块定义
Figure PCTCN2021079064-appb-000003
Figure PCTCN2021079064-appb-000004
本申请的一种实施例中编码端实现如下:
当前编码块经过预测部分,或通过帧间预测,或通过帧内预测等方式,对当前块进行预测得到当前预测块。取原始图像与当前预测块坐标等相对应位置的图像块,与当前预测块做差得到当前编码单元的残差块。然后对残差块进行二维变换或不进行变换,可以得到含有变换后系数的变换块或非变换的系数块,这里统称为系数块。根据系数扫描技术确定的扫描区域右端横坐标SRx,扫描区域下端纵坐标SRy。判断是否满足对偶量化技术限定扫描区域的使用条件。若SRx*SRy的值大于S,使用对偶量化技术进行量化。否则,进行默认量化。
本方案提出另一个使用对偶量化的条件。如果扫描区域长SRy大于等于Y和/或SRx大于等于X,Y和X是一个确定的整数,这个扫描区域也使用对偶量化。例如X=3,Y=3,当且仅当扫描区域SRx大于等于3和/或SRy大于等于3的扫描区域使用对偶量化。
由此可知,本申请对于扫描区域面积在特定范围内的变换块使用对偶量化。对偶量化技术不再作用于全局所有的系数块中,对使用DQ技术给出限定条件,从而提升编码性能。该技术可以扩展应用到其他标准,例如MPEG,AOM或任何自定义的系数块编码中。
本申请的一个实施例中,参见图11,其示出了本申请实施例提供的一种解码方法的流程示意图。如图11所示,该解码方法应用于解码器,解码方法可以包括:
S601:解析码流,获得量化块。
S602:当量化块的扫描区域满足对偶量化反量化的触发条件时,基于第一反量化方式对量化块进行反量化。
其中,扫描区域为量化块中覆盖所有非零系数的最小矩形区域,第一反量化方式为对偶量化反量化。
本申请提供一种解码方法,解析码流,获得量化块;当量化块的扫描区域满足对偶量化反量化的触发条件时,基于第一反量化方式对量化块进行反量化;扫描区域为量化块中覆盖所有非零系数的最小矩形区域,第一反量化方式为对偶量化反量化,如此,提高解码效率。
本申请的一个实施例中,参见图12,其示出了本申请实施例提供的一种解码方法的流程示意图。如图12所示,该解码方法应用于解码器,解码方法可以包括:
S701:解析码流,获得量化块和获得扫描区域的长度和扫描区域的宽度。
S702:当量化块的扫描区域满足对偶量化反量化的触发条件时,基于第一反量化方式对量化块进行反量化。
其中,扫描区域为量化块中覆盖所有非零系数的最小矩形区域,第一反量化方式为对偶量化反量化。
这里,解码器可以基于扫描区域的长度和扫描区域的宽度,确定扫描区域是否满足对偶量化反量化的触发条件。
进一步地,对偶量化反量化的触发条件包括:扫描区域的长度满足第二预设条件;和/或扫描区域的宽度满足第三预设条件。
进一步地,对偶量化反量化的触发条件包括:扫描区域的长度和扫描区域的宽度的乘积满足第四预设条件,且扫描区域的长度满足第二预设条件;和/或乘积满足第四预设条件,且扫描区域的宽度满足第三预设条件。
S703:当扫描区域不满足对偶量化反量化的触发条件时,基于第二反量化方式对量化块进行反量化;第二反量化方式与第一反量化方式不同。
其中,第一反量化方式包含至少两个反量化器,至少两个反量化器包括第一反量化器和第二反量化器,基于第一反量化方式对量化块进行反量化,包括:
对于量化块中的量化值,确定使用第一反量化器或第二反量化器,使用所确定的反量化器对量化值进行反量化得到重建变换系数;
其中,当量化值为目标量化值时,使用第一反量化器得到的重建变换系数与使用第二反量化器得到的重建系数的值不同。
这里,参照图4所示,目标量化值可以是所有量化值,也可以是不包括0的所有量化值。
其中,第二反量化方式对应的重建变换块中的重建变换系数与量化值之间是一一对应的关系。
S704:在对量化块的量化系数全部进行反量化处理后,将所得到的重建变换系数组成重建变换块。
S705:对重建变换块进行逆变换处理,得到重构残差块。
S706:对量化块进行预测处理,得到量化块的预测块。
S707:根据重构残差块和预测块,确定量化块的重构块。
本申请的一个实施例中,参见图13,其示出了本申请实施例提供的一种解码方法的流程示意图。 如图13所示,该解码方法应用于解码器,解码方法可以包括:
S801:解析码流,获得量化块和标识信息。
其中,标识信息用于指示是否使用第一量化方式。
S802:基于标识信息,确定扫描区域满足对偶量化反量化的触发条件,基于第一反量化方式对量化块进行反量化。
S803:基于标识信息,确定扫描区域不满足对偶量化反量化的触发条件,基于第二反量化方式对量化块进行反量化。
本申请的另一种实施例解码端实现如下:
解码端获取码流信息,解析当前编码块的标识位。
确定编码单元划分为变换块的方式。
解码变换块。获取当前编码块变换块中系数扫描范围信息,包括扫描区域右端横坐标SRx,扫描区域下端纵坐标SRy。判断是否满足对偶量化技术限定扫描区域的使用条件。若SRx大于X和/或SRy大于Y,进行对偶量化技术反量化。否则,进行默认反量化。
本方案对变换块语法结构的改变如表2所示。
表2变换块定义
Figure PCTCN2021079064-appb-000005
本申请的另一种实施例中编码端实现如下:
当前编码块经过预测部分,或通过帧间预测,或通过帧内预测等方式,对当前块进行预测得到当前预测块。取原始图像与当前预测块坐标等相对应位置的图像块,与当前预测块做差得到当前编码单元的残差块。然后对残差块进行二维变换或不进行变换,可以得到含有变换后系数的变换块或非变换的系数块,这里统称为系数块。根据系数扫描技术确定的扫描区域右端横坐标SRx,扫描区域下端纵坐标SRy。判断是否满足对偶量化技术限定扫描区域的使用条件。若SRx大于X和/或SRy大于Y,使用对偶量化技术进行量化。否则,进行默认量化。
本申请实施例中,基于前述实施例相同的发明构思,参见图14,其示出了本申请实施例提供的一种编码器90的组成结构示意图。如图14所示,编码器90可以包括确定单元901、第一处理单元902和编码单元903;其中,
确定单元901,配置为确定待处理图像中当前块对应的变换块;
第一处理单元902,配置为当变换块的扫描区域满足对偶量化的触发条件时,基于第一量化方式对扫描区域中的系数进行量化;其中,扫描区域为变换块中覆盖所有非零系数的最小矩形区域;第一量化方式为对偶量化;
编码单元903,配置为对量化后的量化块进行编码并写入码流。
在一些实施例中,扫描区域满足对偶量化的触发条件包括:扫描区域的面积的值满足第一预设条件。
在一些实施例中,扫描区域满足对偶量化的触发条件还包括:扫描区域的长度满足第二预设条件;和/或扫描区域的宽度满足第三预设条件。
在一些实施例中,确定单元901,还配置为基于量化后的扫描区域中最右侧的非零系数的横坐标,确定扫描区域的长度;
基于量化后的扫描区域中最下侧的非零系数的纵坐标,确定扫描区域的宽度;
第一处理单元902,还配置为将扫描区域的长度和扫描区域的宽度写入码流。
在一些实施例中,确定单元901,还配置为对变换块的至少部分系数进行遍历;
基于遍历到的目标非零系数的坐标,确定扫描区域。
在一些实施例中,确定单元901,还配置为对变换块的各个系数进行遍历;
确定遍历到的各个系数中位于变换块的最右侧的非零系数的横坐标;
确定遍历到的各个系数中位于变换块的最下侧的非零系数的纵坐标;
基于最右侧的非零系数的横坐标和最下侧的非零系数的纵坐标,确定扫描区域。
在一些实施例中,确定单元901,还配置为沿着从变换块的右边缘到左边缘的方向进行系数遍历,并沿着从变换块的下边缘到上边缘的方向进行系数遍历;
分别确定遍历得到的右边缘和下边缘对应的第一个非零系数的坐标;
基于第一个非零系数的坐标,从变换块中确定扫描区域。
在一些实施例中,第一处理单元902,还配置为当扫描区域不满足对偶量化的触发条件时,基于第二量化方式对扫描区域中的系数进行量化,得到量化块;其中,第二量化方式与第一量化方式不同。
其中,第一量化方式包含至少两个量化器,至少两个量化器包括第一量化器和第二量化器,基于第一量化方式对扫描区域中的系数进行量化,包括:
对于系数,确定使用第一量化器或第二量化器,使用所确定的量化器对系数进行量化得到量化值;
其中,当量化值为目标量化值时,使用第一量化器进行量化时目标量化值对应的重建系数值与使用第二量化器进行量化时目标量化值对应的重建系数值不同。
其中,第二量化方式对应的量化块中的系数与量化值之间是一一对应的关系。
在一些实施例中,第一处理单元902,还配置为基于扫描区域中参考系数的量化值的奇偶性,确定扫描区域中当前系数对应的量化器;其中,参考系数与当前系数具有相邻的系数扫描顺序;
基于当前系数对应的量化器,对当前系数进行量化。
在一些实施例中,编码单元903,还配置为对量化后的量化块按照从右下角到左上角的方向的扫描顺序进行编码并写入码流。
在一些实施例中,确定单元901,还配置为对当前块进行预测,得到当前预测块;
确定当前块与当前预测块的残差块;
确定残差块对应的变换块。
在一些实施例中,第一处理单元902,还配置为生成标识信息;其中,标识信息用于指示量化块的量化方式是否为第一量化方式;
将标识信息写入码流。
本申请实施例中,基于前述实施例相同的发明构思,参见图15,其示出了本申请实施例提供的一种解码器100的组成结构示意图。如图15所示,解码器100可以包括解码单元1001和第二处理单元1002;其中,
解码单元1001,配置为解析码流,获得量化块;
第二处理单元1002,配置为当量化块的扫描区域满足对偶量化反量化的触发条件时,基于第一反量化方式对量化块进行反量化;其中,扫描区域为量化块中覆盖所有非零系数的最小矩形区域,第一反量化方式为对偶量化反量化。
在一些实施例中,第二处理单元1002,还配置为当扫描区域不满足对偶量化反量化的触发条件时,基于第二反量化方式对量化块进行反量化;第二反量化方式与第一反量化方式不同。
其中,第一反量化方式包含至少两个反量化器,至少两个反量化器包括第一反量化器和第二反量化器,基于第一反量化方式对量化块进行反量化,包括:
对于量化块中的量化值,确定使用第一反量化器或第二反量化器,使用所确定的反量化器对量化值进行反量化得到重建变换系数;
其中,当量化值为目标量化值时,使用第一反量化器得到的重建变换系数与使用第二反量化器得到的重建系数的值不同。
其中,第二反量化方式对应的重建变换块中的重建变换系数与量化值之间是一一对应的关系。
在一些实施例中,解码单元1001,还配置为解析码流,获得扫描区域的长度和扫描区域的宽度;
第二处理单元1002,还配置为基于扫描区域的长度和扫描区域的宽度,确定扫描区域是否满足对偶量化反量化的触发条件。
在一些实施例中,扫描区域满足对偶量化反量化的触发条件包括:扫描区域的长度满足第二预设条件;和/或扫描区域的宽度满足第三预设条件。
在一些实施例中,扫描区域满足对偶量化反量化的触发条件包括:扫描区域的长度和扫描区域的宽度的乘积满足第四预设条件,且扫描区域的长度满足第二预设条件;和/或乘积满足第四预设条件,且扫描区域的宽度满足第三预设条件。
在一些实施例中,解码单元1001,还配置为解析码流,得到标识信息;其中,标识信息用于指示是否使用第一量化方式;
第二处理单元1002,还配置为基于标识信息,确定扫描区域满足或不满足对偶量化反量化的触发条件。
在一些实施例中,第二处理单元1002,还配置为基在对量化块的量化系数全部进行反量化处理后,将所得到的重建变换系数组成重建变换块;
对重建变换块进行逆变换处理,得到重构残差块。
在一些实施例中,第二处理单元1002,还配置为对量化块进行预测处理,得到量化块的预测块;
根据重构残差块和预测块,确定量化块的重构块。
可以理解地,在本实施例中,“单元”可以是部分电路、部分处理器、部分程序或软件等等,当然也可以是模块,还可以是非模块化的。而且在本实施例中的各组成部分可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。
集成的单元如果以软件功能模块的形式实现并非作为独立的产品进行销售或使用时,可以存储在一个计算机可读取存储介质中,基于这样的理解,本实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)或processor(处理器)执行本实施例方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。
因此,本申请实施例提供了一种计算机存储介质,应用于编码器90,该计算机存储介质存储有计算机程序,计算机程序被第一处理器执行时实现前述实施例中任一项的方法。
基于上述编码器90的组成以及计算机存储介质,参见图16,其示出了本申请实施例提供的编码器90的硬件结构示意图。如图16所示,可以包括:第一通信接口1101、第一存储器1102和第一处理器1103;各个组件通过第一总线系统1104耦合在一起。可理解,第一总线系统1104用于实现这些组件之间的连接通信。第一总线系统1104除包括数据总线之外,还包括电源总线、控制总线和状态信号总线。但是为了清楚说明起见,在图16中将各种总线都标为第一总线系统1104。其中,
第一通信接口1101,用于在与其他外部网元之间进行收发信息过程中,信号的接收和发送;
第一存储器1102,用于存储能够在第一处理器1103上运行的计算机程序;
第一处理器1103,用于在运行计算机程序时,执行:
确定待处理图像中当前块对应的变换块;
当变换块的扫描区域满足对偶量化的触发条件时,基于第一量化方式对扫描区域中的系数进行量化;其中,扫描区域为变换块中覆盖所有非零系数的最小矩形区域;第一量化方式为对偶量化;
对量化后的量化块进行编码并写入码流。
可以理解,本申请实施例中的第一存储器1102可以是易失性存储器或非易失性存储器,或可包括易失性和非易失性存储器两者。其中,非易失性存储器可以是只读存储器(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)。本申请描述的系统和方法的第一存储器1102旨在包括但不限于这些和任意其它适合类型的存储器。
而第一处理器1103可能是一种集成电路芯片,具有信号的处理能力。在实现过程中,上述方法的各步骤可以通过第一处理器1103中的硬件的集成逻辑电路或者软件形式的指令完成。上述的第一处理器1103可以是通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field Programmable Gate Array,FPGA)或者其 他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。可以实现或者执行本申请实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。结合本申请实施例所公开的方法的步骤可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于第一存储器1102,第一处理器1103读取第一存储器1102中的信息,结合其硬件完成上述方法的步骤。
可以理解的是,本申请描述的这些实施例可以用硬件、软件、固件、中间件、微码或其组合来实现。对于硬件实现,处理单元可以实现在一个或多个专用集成电路(Application Specific Integrated Circuits,ASIC)、数字信号处理器(Digital Signal Processing,DSP)、数字信号处理设备(DSP Device,DSPD)、可编程逻辑设备(Programmable Logic Device,PLD)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)、通用处理器、控制器、微控制器、微处理器、用于执行本申请功能的其它电子单元或其组合中。对于软件实现,可通过执行本申请功能的模块(例如过程、函数等)来实现本申请的技术。软件代码可存储在存储器中并通过处理器执行。存储器可以在处理器中或在处理器外部实现。
集成的单元如果以软件功能模块的形式实现并非作为独立的产品进行销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本实施例提供了一种计算机存储介质,应用于解码器100,该计算机存储介质存储有计算机程序,计算机程序被第二处理器执行时实现前述实施例中任一项的方法。
基于上述解码器100的组成以及计算机存储介质,参见图17,其示出了本申请实施例提供的解码器100的硬件结构示意图。如图17所示,可以包括:第二通信接口1201、第二存储器1202和第二处理器1203;各个组件通过第二总线系统1204耦合在一起。可理解,第二总线系统1204用于实现这些组件之间的连接通信。第二总线系统1204除包括数据总线之外,还包括电源总线、控制总线和状态信号总线。但是为了清楚说明起见,在图17中将各种总线都标为第二总线系统1204。其中,
第二通信接口1201,用于在与其他外部网元之间进行收发信息过程中,信号的接收和发送;
第二存储器1202,用于存储能够在第二处理器1203上运行的计算机程序;
第二处理器1203,用于在运行计算机程序时,执行:
解码单元,配置为解析码流,获得量化块;
第二处理单元,配置为当量化块的扫描区域满足对偶量化反量化的触发条件时,基于第一反量化方式对量化块进行反量化;其中,扫描区域为量化块中覆盖所有非零系数的最小矩形区域,第一反量化方式为对偶量化反量化。
可选地,作为另一个实施例,第二处理器1203还配置为在运行计算机程序时,执行前述实施例中任一项的方法。
可以理解,第二存储器1202与第一存储器1102的硬件功能类似,第二处理器1203与第一处理器1103的硬件功能类似;这里不再详述。
需要说明的是,在本申请中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者装置不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者装置所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者装置中还存在另外的相同要素。
上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。
本申请所提供的几个方法实施例中所揭露的方法,在不冲突的情况下可以任意组合,得到新的方法实施例。
本申请所提供的几个产品实施例中所揭露的特征,在不冲突的情况下可以任意组合,得到新的产品实施例。
本申请所提供的几个方法或设备实施例中所揭露的特征,在不冲突的情况下可以任意组合,得到新的方法实施例或设备实施例。
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。
工业实用性
本申请实施例提供的编码方法,包括确定待处理图像中当前块对应的变换块;当变换块的扫描区域 满足对偶量化的触发条件时,基于第一量化方式对扫描区域中的系数进行量化;其中,扫描区域为变换块中覆盖所有非零系数的最小矩形区域;第一量化方式为对偶量化;对量化后的量化块进行编码并写入码流;本申请中当满足对偶量化的触发条件时,才采用第一量化方式即对偶量化对扫描区域中的系数进行量化,也就是说,对偶量化不再作用于全局所有的系数块中,对使用对偶量化给出了限定条件,从而提升了编码性能。

Claims (27)

  1. 一种编码方法,所述方法包括:
    确定待处理图像中当前块对应的变换块;
    当所述变换块的扫描区域满足对偶量化的触发条件时,基于第一量化方式对所述扫描区域中的系数进行量化;其中,所述扫描区域为所述变换块中覆盖所有非零系数的最小矩形区域;所述第一量化方式为对偶量化;
    对量化后的量化块进行编码并写入码流。
  2. 根据权利要求1所述的方法,其中,所述扫描区域满足所述对偶量化的触发条件包括:所述扫描区域的面积的值满足第一预设条件。
  3. 根据权利要求1或2所述的方法,其中,所述扫描区域满足所述对偶量化的触发条件还包括:所述扫描区域的长度满足第二预设条件;和/或所述扫描区域的宽度满足第三预设条件。
  4. 根据权利要求1所述的方法,其中,所述方法还包括:
    基于量化后的所述扫描区域中最右侧的非零系数的横坐标,确定所述扫描区域的长度;
    基于量化后的所述扫描区域中最下侧的非零系数的纵坐标,确定所述扫描区域的宽度;
    将所述扫描区域的长度和所述扫描区域的宽度写入所述码流。
  5. 根据权利要求1所述的方法,其中,所述方法包括:
    对所述变换块的至少部分系数进行遍历;
    基于遍历到的目标非零系数的坐标,确定所述扫描区域。
  6. 根据权利要求5所述的方法,其中,所述对所述变换块的至少部分系数进行遍历,包括:
    对所述变换块的各个系数进行遍历;
    相应的,所述基于遍历得到的目标非零系数的坐标,确定所述扫描区域,包括:
    确定遍历到的所述各个系数中位于所述变换块的最右侧的非零系数的横坐标;
    确定遍历到的所述各个系数中位于所述变换块的最下侧的非零系数的纵坐标;
    基于所述最右侧的非零系数的横坐标和所述最下侧的非零系数的纵坐标,确定所述扫描区域。
  7. 根据权利要求5所述的方法,其中,所述对所述变换块的至少部分系数进行遍历,包括:
    沿着从所述变换块的右边缘到左边缘的方向进行系数遍历,并沿着从所述变换块的下边缘到上边缘的方向进行系数遍历;
    相应的,所述基于遍历得到的目标非零系数的坐标,确定所述扫描区域,包括:
    分别确定遍历得到的所述右边缘和下边缘对应的第一个非零系数的坐标;
    基于所述第一个非零系数的坐标,从所述变换块中确定所述扫描区域。
  8. 根据权利要求1所述的方法,其中,所述方法还包括:
    当所述扫描区域不满足所述对偶量化的触发条件时,基于第二量化方式对所述扫描区域中的系数进行量化,得到所述量化块;其中,所述第二量化方式与所述第一量化方式不同。
  9. 根据权利要求1所述的方法,其中,第一量化方式包含至少两个量化器,所述至少两个量化器包括第一量化器和第二量化器,所述基于第一量化方式对所述扫描区域中的系数进行量化,包括:
    对于所述系数,确定使用所述第一量化器或所述第二量化器,使用所确定的量化器对所述系数进行量化得到量化值;
    其中,当所述量化值为目标量化值时,使用所述第一量化器进行量化时所述目标量化值对应的重建系数值与使用所述第二量化器进行量化时所述目标量化值对应的重建系数值不同。
  10. 根据权利要求1所述的方法,其中,所述基于第一量化方式对所述变换块进行量化,包括:
    基于所述扫描区域中参考系数的量化值,确定所述扫描区域中当前系数对应的量化器;其中,所述参考系数与所述当前系数具有相邻的系数扫描顺序;
    基于所述当前系数对应的量化器,对所述当前系数进行量化。
  11. 根据权利要求10所述的方法,其中,所述基于所述扫描区域中参考系数的量化值,确定所述扫描区域中当前系数对应的量化器,包括:
    基于所述参考系数的量化值的奇偶性,确定所述当前系数对应的量化器。
  12. 根据权利要求1所述的方法,其中,所述对量化后的量化块进行编码并写入码流,包括:
    对所述量化后的量化块按照从右下角到左上角的方向的扫描顺序进行编码并写入所述码流。
  13. 根据权利要求1所述的方法,其中,所述确定待处理图像中当前块对应的变换块,包括:
    对所述当前块进行预测,得到当前预测块;
    确定所述当前块与所述当前预测块的残差块;
    确定所述残差块对应的变换块。
  14. 根据权利要求1或8所述的方法,其中,所述方法还包括:
    生成标识信息;其中,所述标识信息用于指示所述量化块的量化方式是否为所述第一量化方式;
    将所述标识信息写入所述码流。
  15. 一种解码方法,其中,所述方法包括:
    解析码流,获得量化块;
    当所述量化块的扫描区域满足对偶量化反量化的触发条件时,基于第一反量化方式对所述量化块进行反量化;其中,所述扫描区域为所述量化块中覆盖所有非零系数的最小矩形区域,所述第一反量化方式为对偶量化反量化。
  16. 根据权利要求15所述的方法,其中,所述方法还包括:
    当所述扫描区域不满足所述对偶量化反量化的触发条件时,基于第二反量化方式对所述量化块进行反量化;所述第二反量化方式与所述第一反量化方式不同。
  17. 根据权利要求15所述的方法,其中,第一反量化方式包含至少两个反量化器,所述至少两个反量化器包括第一反量化器和第二反量化器,所述基于第一反量化方式对所述量化块进行反量化,包括:
    对于所述量化块中的量化值,确定使用所述第一反量化器或所述第二反量化器,使用所确定的反量化器对量化值进行反量化得到重建变换系数;
    其中,当所述量化值为目标量化值时,使用所述第一反量化器得到的重建变换系数与使用所述第二反量化器得到的重建系数的值不同。
  18. 根据权利要求15所述的方法,其中,所述方法还包括:
    解析所述码流,获得所述扫描区域的长度和所述扫描区域的宽度;
    基于所述扫描区域的长度和所述扫描区域的宽度,确定所述扫描区域是否满足所述对偶量化反量化的触发条件。
  19. 根据权利要求15所述的方法,其中,所述扫描区域满足所述对偶量化反量化的触发条件包括:
    所述扫描区域的长度满足第二预设条件;和/或
    所述扫描区域的宽度满足第三预设条件。
  20. 根据权利要求15所述的方法,其中,所述方法还包括:
    解析所述码流,得到标识信息;其中,所述标识信息用于指示是否使用第一量化方式;
    基于所述标识信息,确定所述扫描区域满足或不满足所述对偶量化反量化的触发条件。
  21. 根据权利要求15所述的方法,其中,所述方法还包括:
    在对所述量化块的量化系数全部进行反量化处理后,将所得到的重建变换系数组成重建变换块;
    对所述重建变换块进行逆变换处理,得到重构残差块。
  22. 根据权利要求21所述的方法,其中,所述方法还包括:
    对所述量化块进行预测处理,得到所述量化块的预测块;
    根据所述重构残差块和所述预测块,确定所述量化块的重构块。
  23. 一种编码器,其中,所述编码器包括确定单元、第一处理单元和编码单元;其中,
    所述确定单元,配置为确定待处理图像中当前块对应的变换块;
    所述第一处理单元,配置为当所述变换块的扫描区域满足对偶量化的触发条件时,基于第一量化方式对所述扫描区域中的系数进行量化;其中,所述扫描区域为所述变换块中覆盖所有非零系数的最小矩形区域;所述第一量化方式为对偶量化;
    所述编码单元,配置为对量化后的量化块进行编码并写入码流。
  24. 一种解码器,其中,所述解码器包括解码单元和第二处理单元;其中,
    所述解码单元,配置为解析码流,获得量化块;
    所述第二处理单元,配置为当所述量化块的扫描区域满足对偶量化反量化的触发条件时,基于第一反量化方式对所述量化块进行反量化;其中,所述扫描区域为所述量化块中覆盖所有非零系数的最小矩形区域,所述第一反量化方式为对偶量化反量化。
  25. 一种编码器,其中,所述编码器包括第一存储器和第一处理器;其中,
    所述第一存储器,用于存储能够在所述第一处理器上运行的计算机程序;
    所述第一处理器,用于在运行所述计算机程序时,执行如权利要求1至14任一项所述的方法。
  26. 一种解码器,其中,所述解码器包括第二存储器和第二处理器;其中,
    所述第二存储器,用于存储能够在所述第二处理器上运行的计算机程序;
    所述第二处理器,用于在运行所述计算机程序时,执行如权利要求15至22任一项所述的方法。
  27. 一种计算机存储介质,其中,所述计算机存储介质存储有计算机程序,所述计算机程序被第一处理器执行时实现如权利要求1至14任一项所述的方法、或者被第二处理器执行时实现如权利要求15至22任一项所述的方法。
PCT/CN2021/079064 2021-02-22 2021-03-04 一种编码方法、解码方法、编码器、解码器以及存储介质 WO2022174477A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202180093807.2A CN116998151A (zh) 2021-02-22 2021-03-04 一种编码方法、解码方法、编码器、解码器以及存储介质

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110200048 2021-02-22
CN202110200048.7 2021-02-22

Publications (1)

Publication Number Publication Date
WO2022174477A1 true WO2022174477A1 (zh) 2022-08-25

Family

ID=82932077

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/079064 WO2022174477A1 (zh) 2021-02-22 2021-03-04 一种编码方法、解码方法、编码器、解码器以及存储介质

Country Status (2)

Country Link
CN (1) CN116998151A (zh)
WO (1) WO2022174477A1 (zh)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020106668A1 (en) * 2018-11-22 2020-05-28 Interdigital Vc Holdings, Inc. Quantization for video encoding and decoding
WO2020117716A2 (en) * 2018-12-05 2020-06-11 Interdigital Vc Holdings, Inc. Method and device for picture encoding and decoding
CN111787324A (zh) * 2020-06-29 2020-10-16 北京大学 率失真优化量化的方法、编码方法及装置
CN112236999A (zh) * 2018-03-29 2021-01-15 弗劳恩霍夫应用研究促进协会 依赖性量化
US20210029360A1 (en) * 2018-03-29 2021-01-28 Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V. Transform coefficient block coding
CN113453002A (zh) * 2020-03-25 2021-09-28 浙江大学 量化与熵编码方法及装置

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112236999A (zh) * 2018-03-29 2021-01-15 弗劳恩霍夫应用研究促进协会 依赖性量化
US20210029360A1 (en) * 2018-03-29 2021-01-28 Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V. Transform coefficient block coding
WO2020106668A1 (en) * 2018-11-22 2020-05-28 Interdigital Vc Holdings, Inc. Quantization for video encoding and decoding
WO2020117716A2 (en) * 2018-12-05 2020-06-11 Interdigital Vc Holdings, Inc. Method and device for picture encoding and decoding
CN113453002A (zh) * 2020-03-25 2021-09-28 浙江大学 量化与熵编码方法及装置
CN111787324A (zh) * 2020-06-29 2020-10-16 北京大学 率失真优化量化的方法、编码方法及装置

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
M. KARCZEWICZ (QUALCOMM), A. NALCI (QUALCOMM), Y.-H. CHAO, H. WANG, H. E. EGILMEZ, M. COBAN (QUALCOMM): "AHG18: Disabling Dependent Quantization for Lossless", 16. JVET MEETING; 20191001 - 20191011; GENEVA; (THE JOINT VIDEO EXPLORATION TEAM OF ISO/IEC JTC1/SC29/WG11 AND ITU-T SG.16 ), no. JVET-P0258 ; m50222, 6 October 2019 (2019-10-06), XP030216715 *

Also Published As

Publication number Publication date
CN116998151A (zh) 2023-11-03

Similar Documents

Publication Publication Date Title
US20240348839A1 (en) Video encoding method for encoding division block, video decoding method for decoding division block, and recording medium for implementing the same
CN109997361B (zh) 用于视频译码的低复杂度符号预测
JP5869493B2 (ja) ビデオ符号化および復号化のためのテンプレート・マッチング予測の適応型残差更新のための方法および装置
KR101588559B1 (ko) 모션 벡터 저장 방법 및 장치, 인코딩 및 디코딩 방법, 인코딩 및 디코딩 장치, 및 기록 매체
KR101108681B1 (ko) 동영상 코덱에서의 주파수 변환 계수 예측 방법 및 장치,이를 구비한 부호화 및 복호화 장치와 방법
US20110243220A1 (en) Method and apparatus for encoding and decoding image and method and apparatus for decoding image using adaptive coefficient scan order
KR20110047697A (ko) 픽처 경계의 부호화 단위를 부호화, 복호화 하는 방법 및 장치
US10638155B2 (en) Apparatus for video encoding, apparatus for video decoding, and non-transitory computer-readable storage medium
WO2022178686A1 (zh) 编解码方法、编解码设备、编解码系统以及计算机可读存储介质
WO2020181504A1 (zh) 视频编码的方法与装置,以及视频解码的方法与装置
KR20200096227A (ko) 블록 형상에 기초한 비디오 인코딩 및 디코딩을 위한 방법 및 장치
JP7542278B2 (ja) 明示的信号伝達および暗黙的信号伝達を用いた、使用不可参照フレームの適応ブロック更新
CN113039793A (zh) 指数分区的方法与系统
CN117716691A (zh) 用于视频编解码的基于小波变换域卷积神经网络的环路滤波
KR102125601B1 (ko) 비변환 코딩을 위한 스캐닝 순서 조정 기법
WO2022174477A1 (zh) 一种编码方法、解码方法、编码器、解码器以及存储介质
JP2017073598A (ja) 動画像符号化装置、動画像符号化方法及び動画像符号化用コンピュータプログラム
CN113938679B (zh) 图像类型的确定方法、装置、设备及存储介质
WO2022174475A1 (zh) 视频编解码方法与系统、及视频编码器与视频解码器
CN108353178B (zh) 编码和解码方法及相应设备
JP7359653B2 (ja) 動画像符号化装置
WO2022217442A1 (zh) 系数编解码方法、编码器、解码器以及计算机存储介质
CN113132734B (zh) 一种编码、解码方法、装置及其设备
WO2022174478A1 (zh) 编码方法、解码方法、编码器、解码器及存储介质
KR101525325B1 (ko) 인트라 예측 모드 결정 방법 및 그 장치

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

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 202180093807.2

Country of ref document: CN

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21926194

Country of ref document: EP

Kind code of ref document: A1