CN116888960A - Encoding method, decoding method, encoder, decoder, and storage medium - Google Patents

Encoding method, decoding method, encoder, decoder, and storage medium Download PDF

Info

Publication number
CN116888960A
CN116888960A CN202180093813.8A CN202180093813A CN116888960A CN 116888960 A CN116888960 A CN 116888960A CN 202180093813 A CN202180093813 A CN 202180093813A CN 116888960 A CN116888960 A CN 116888960A
Authority
CN
China
Prior art keywords
state
coefficient
quantizer
quantization
value
Prior art date
Legal status (The legal status 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 status listed.)
Pending
Application number
CN202180093813.8A
Other languages
Chinese (zh)
Inventor
虞露
章致好
王东
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang University ZJU
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Zhejiang University ZJU
Guangdong Oppo Mobile Telecommunications Corp Ltd
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 Zhejiang University ZJU, Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Zhejiang University ZJU
Publication of CN116888960A publication Critical patent/CN116888960A/en
Pending legal-status Critical Current

Links

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

Landscapes

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

Abstract

The embodiment of the application discloses an encoding method, a decoding method, an encoder, a decoder and a storage medium, wherein the method comprises the following steps: analyzing the code stream and determining the quantization coefficient of the current block; if the quantized coefficient selects a first quantizer to perform inverse quantization processing, determining that a reconstructed transformation coefficient obtained after the inverse quantization processing is a first reconstruction value under the condition that the quantized coefficient is 0; if the quantized coefficient selects a second quantizer to perform inverse quantization processing, determining that a reconstructed transform coefficient obtained after the inverse quantization processing is a second reconstructed value under the condition that the quantized coefficient is 0; wherein the first reconstruction value is different from the second reconstruction value. Thus, by utilizing the dual quantization technology, quantization errors can be reduced, the accuracy of the reconstructed transformation coefficient can be improved, and the coding and decoding performance can be further improved.

Description

Encoding method, decoding method, encoder, decoder, and storage medium
Cross Reference to Related Applications
The present application claims priority from chinese patent application filed 22 at 2021, 02 and 22 under the application number 202110199674.9, entitled "encoding method, decoding method, encoder, decoder and storage medium", the entire contents of which are incorporated herein by reference.
Technical Field
The present application relates to the field of video encoding and decoding technologies, and in particular, to an encoding method, a decoding method, an encoder, a decoder, and a storage medium.
Background
With the increasing demand of people for video display quality, the related field of computer vision is getting more and more attention. In recent years, image processing techniques have been successfully applied to various industries. For the encoding and decoding process of video images, at an encoding end, image data to be encoded is sent to a traditional video encoder for compression encoding after passing through a transformation module and a quantization module, and a code stream generated by the traditional video encoder is transmitted to a decoding end; and then the video data is sent to a traditional video decoder for decoding after passing through an inverse quantization module and an inverse transformation module so as to recover the original input image data.
In the related art, quantization and inverse quantization processes in video codec are currently generally implemented using one quantizer, and reconstructed transform coefficients after the inverse quantization process may be inaccurate due to limitations of a single quantizer, so that quantization errors are large.
Disclosure of Invention
The application provides an encoding method, a decoding method, an encoder, a decoder and a storage medium, which can reduce quantization errors, improve the accuracy of reconstructed transformation coefficients and further improve the encoding and decoding performance.
In order to achieve the above purpose, the technical scheme of the application is realized as follows:
in a first aspect, an embodiment of the present application provides a decoding method, applied to a decoder, including:
analyzing the code stream and determining the quantization coefficient of the current block;
if the quantized coefficient selects a first quantizer to perform inverse quantization processing, determining that a reconstructed transformation coefficient obtained after the inverse quantization processing is a first reconstruction value under the condition that the quantized coefficient is 0;
if the quantized coefficient selects a second quantizer to perform inverse quantization processing, determining that a reconstructed transform coefficient obtained after the inverse quantization processing is a second reconstructed value under the condition that the quantized coefficient is 0;
wherein the first reconstruction value is different from the second reconstruction value.
In a second aspect, an embodiment of the present application provides an encoding method, applied to an encoder, including:
determining a transformation block of the current block; wherein the transform block comprises at least one transform coefficient;
if the transformation coefficient selects a first quantizer to carry out quantization processing, determining a reconstruction transformation coefficient corresponding to the quantized coefficient 0 obtained after the quantization processing as a first reconstruction value;
if the transformation coefficient selects a second quantizer to carry out quantization processing, determining a reconstruction transformation coefficient corresponding to the quantized coefficient 0 obtained after the quantization processing as a second reconstruction value; wherein the first reconstruction value is different from the second reconstruction value.
In a third aspect, an embodiment of the present application provides an encoder including a first determining unit and a quantizing unit; wherein,
the first determining unit is configured to determine a transformation block of the current block; wherein the transform block comprises at least one transform coefficient;
the quantization unit is configured to determine that a reconstructed transform coefficient corresponding to a quantized coefficient 0 obtained after quantization processing is a first reconstructed value if the transform coefficient is quantized by selecting a first quantizer; if the transformation coefficient selects a second quantizer to carry out quantization processing, determining a reconstruction transformation coefficient corresponding to the quantized coefficient 0 obtained after the quantization processing as a second reconstruction value; wherein the first reconstruction value is different from the second reconstruction value.
In a fourth aspect, an embodiment of the present application provides an encoder including a first memory and a first processor; wherein,
the first memory is used for storing a computer program capable of running on the first processor;
the first processor is configured to perform the method according to the second aspect when the computer program is run.
In a fifth aspect, an embodiment of the present application provides a decoder, including a parsing unit and an inverse quantization unit; wherein,
The analysis unit is configured to analyze the code stream and determine the quantization coefficient of the current block;
the inverse quantization unit is configured to determine that a reconstructed transform coefficient obtained after the inverse quantization is a first reconstructed value if the quantized coefficient is subjected to inverse quantization by selecting a first quantizer; and if the quantized coefficient selects a second quantizer to perform inverse quantization processing, determining that the reconstructed transform coefficient obtained after the inverse quantization processing is a second reconstructed value under the condition that the quantized coefficient is 0; wherein the first reconstruction value is different from the second reconstruction value.
In a sixth aspect, an embodiment of the present application provides a decoder including a second memory and a second processor; wherein,
the second memory is used for storing a computer program capable of running on the second processor;
the second processor is configured to perform the method according to the first aspect when the computer program is run.
In a seventh aspect, embodiments of the present application provide a computer storage medium storing a computer program which when executed by a first processor implements the method according to the second aspect or which when executed by a second processor implements the method according to the first aspect.
The embodiment of the application provides an encoding method, a decoding method, an encoder, a decoder and a storage medium, wherein a transformation block of a current block is determined at the encoder side; wherein the transform block comprises at least one transform coefficient; if the transformation coefficient selects a first quantizer to carry out quantization processing, determining a reconstruction transformation coefficient corresponding to the quantized coefficient 0 obtained after the quantization processing as a first reconstruction value; if the transformation coefficient selects a second quantizer to carry out quantization processing, determining a reconstruction transformation coefficient corresponding to the quantized coefficient 0 obtained after the quantization processing as a second reconstruction value; wherein the first reconstruction value is different from the second reconstruction value. At the decoder side, analyzing the code stream and determining the quantization coefficient of the current block; if the quantized coefficient selects a first quantizer to perform inverse quantization processing, determining that a reconstructed transformation coefficient obtained after the inverse quantization processing is a first reconstruction value under the condition that the quantized coefficient is 0; if the quantized coefficient selects a second quantizer to perform inverse quantization processing, determining that a reconstructed transform coefficient obtained after the inverse quantization processing is a second reconstructed value under the condition that the quantized coefficient is 0; wherein the first reconstruction value is different from the second reconstruction value. In this way, the application adopts the dual quantization technical scheme composed of the first quantizer and the second quantizer, and also carries out offset correction for the corresponding reconstruction transformation coefficient under the condition that the quantization coefficient is 0, so that the reconstruction values obtained under the two quantizers are different (for example, one quantizer is zero, and the other quantizer is non-zero), thereby reducing quantization error, improving accuracy of the reconstruction transformation coefficient and further improving coding and decoding performance.
Drawings
FIG. 1 is a schematic diagram of an application of a coding framework provided in the related art;
FIG. 2 is a schematic diagram of a system configuration of an encoder according to an embodiment of the present application;
FIG. 3 is a schematic diagram illustrating a system configuration of a decoder according to an embodiment of the present application;
fig. 4 is a schematic flow chart of a decoding method according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of a dual quantizer and its corresponding reconstructed transform coefficients according to an embodiment of the present application;
FIG. 6 is a state transition diagram of a quantizer used for deciding quantization coefficients according to an embodiment of the present application;
FIG. 7 is a diagram illustrating a grid structure of a dependency relationship between states of a quantizer and transform coefficient levels according to an embodiment of the present application;
FIG. 8 is a schematic diagram of a matching relationship between an original transform coefficient and a candidate transform coefficient according to an embodiment of the present application;
FIG. 9 is a schematic diagram of another dual quantizer and its corresponding reconstructed transform coefficients according to an embodiment of the present application;
FIG. 10 is a schematic diagram of a structure of a dual quantizer and corresponding reconstructed transform coefficients according to an embodiment of the present application;
FIG. 11 is a schematic diagram illustrating a transition relationship between states of a quantizer according to an embodiment of the present application;
FIG. 12 is a schematic flow chart of an encoding method according to an embodiment of the present application;
FIG. 13 is a schematic diagram of an encoder according to an embodiment of the present application;
FIG. 14 is a schematic diagram of a specific hardware structure of an encoder according to an embodiment of the present application;
fig. 15 is a schematic diagram of a decoder according to an embodiment of the present application;
fig. 16 is a schematic diagram of a specific hardware structure of a decoder according to an embodiment of the present application.
Detailed Description
For a more complete understanding of the nature and the technical content of the embodiments of the present application, reference should be made to the following detailed description of embodiments of the application, taken in conjunction with the accompanying drawings, which are meant to be illustrative only and not limiting of the embodiments of the application.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of the application only and is not intended to be limiting of the application.
In the following description, reference is made to "some embodiments" which describe a subset of all possible embodiments, but it is to be understood that "some embodiments" can be the same subset or different subsets of all possible embodiments and can be combined with one another without conflict. It should also be noted that the term "first\second\third" in relation to embodiments of the present application is merely to distinguish similar objects and does not represent a particular ordering for the objects, it being understood that the "first\second\third" may be interchanged in a particular order or sequence, where allowed, to enable embodiments of the present application described herein to be practiced in an order other than that illustrated or described herein.
In video images, a first image component, a second image component, and a third image component are generally employed to characterize Coding Blocks (CBs). Wherein the three image components are a luminance component, a blue chrominance component and a red chrominance component, respectively, and in particular, the luminance component is generally represented by the symbol Y, the blue chrominance component is generally represented by the symbol Cb or U, and the red chrominance component is generally represented by the symbol Cr or V; thus, the video image may be represented in YCbCr format or YUV format.
Before further describing embodiments of the present application in detail, the terms and terminology involved in the embodiments of the present application will be described, and the terms and terminology involved in the embodiments of the present application are suitable for the following explanation:
dynamic picture expert group (Moving Picture Experts Group, MPEG)
International organization for standardization (International Standardization Organization, ISO)
International electrotechnical Commission (International Electrotechnical Commission, IEC)
Joint video expert group (Joint Video Experts Team, JVET)
Open media alliance (Alliance for Open Media AOM)
Next-generation video coding Standard H.266/multifunctional video coding (Versatile Video Coding, VVC)
Reference software Test platform of VVC (VVC Test Model, VTM)
Audio and video coding standard (Audio Video Standard, AVS)
High performance test model of AVS (High-Performance Model, HPM)
Dual quantization (Dependent Quantization, DQ)
Quantization parameter (Quantization Parameter, QP)
Transform coefficient (Transform coefficients)
Quantization step size (Quantization step)
Transform coefficient level (Transform coefficient levels)
State machine (State machine)
State transition (State transition)
Lagrangian rate distortion costs (Lagrangian rate-distortion costs)
Scanning region-based coefficient coding (Scan Region based Coefficient Coding, SRCC)
It will be appreciated that digital video compression techniques mainly compress huge amounts of digital video data for transmission, storage, etc. With the proliferation of internet video and the increasing demand of people for video definition, although existing digital video compression standards can save a lot of video data, better digital video compression technology is still required to be pursued at present so as to reduce the bandwidth and traffic pressure of digital video transmission.
The video compression includes a plurality of modules such as loop filtering and entropy coding for reducing or taking out intra-frame prediction (spatial domain) and/or inter-frame prediction (time domain) of video intrinsic redundancy, and transforming/quantizing and inverse quantizing/inverse transforming residual information, which can improve subjective and objective reconstruction quality, as shown in fig. 1. The mainstream video compression standards basically describe block-based compression techniques. A video slice (slice), a frame of pictures or a series of pictures is divided into basic units in Coding Tree Units (CTUs), on the basis of which it is further divided into blocks in Coding Units (CUs). Intra blocks are predicted by using the block peripheral pixels as references, and inter blocks reference adjacent block information in space and reference information in other frames. The residual information is transformed/quantized and entropy-encoded in block units, and then a code stream is generated, as opposed to the prediction signal. These techniques are described in the standard and implemented in various fields related to video compression. Internationally, the mainstream standards include the h.264/advanced video coding (Advanced Video Coding, AVC) standard, the h.265/high efficiency video coding (High Efficiency Video Coding, HEVC) standard, the h.266/multifunctional video coding (Versatile Video Coding, VVC) standard, and extensions of these standards, etc., and video devices can implement these techniques to achieve more efficient video encoding and decoding and transmission storage.
Specifically, on the encoder side, a transform unit and a quantization unit may be included. First, a transform coefficient matrix (or referred to as a "transform block") is obtained after transforming an image block, such as a prediction residual (which may be represented by residual), by a transform unit, and then a quantization process is performed on the transform coefficient matrix by a quantization unit, and a final quantization coefficient is written into a video stream (bitstream).
On the decoder side, an inverse quantization unit and an inverse transformation unit may be included. Firstly, a quantized coefficient corresponding to a transformation coefficient matrix can be obtained by analyzing a code stream, and the quantized coefficient is subjected to inverse quantization (also called Scaling) by an inverse quantization unit, so that a reconstructed value of the transformation coefficient matrix can be obtained, and a coefficient matrix is obtained; and then, performing inverse transformation corresponding to the encoder-side transformation unit on the coefficient matrix through an inverse transformation unit, and finally obtaining a reconstruction block of the prediction residual.
However, in the related art, it is currently common to implement quantization and inverse quantization processes in video codec using one quantizer, and the reconstructed transform coefficients after the inverse quantization process may be inaccurate due to the limitation of a single quantizer, so that quantization errors are large.
The embodiment of the application provides a coding method, which has the following basic ideas: determining a transformation block of the current block; wherein the transform block comprises at least one transform coefficient; if the transformation coefficient selects a first quantizer to carry out quantization processing, determining a reconstruction transformation coefficient corresponding to the quantized coefficient 0 obtained after the quantization processing as a first reconstruction value; if the transformation coefficient selects a second quantizer to carry out quantization processing, determining a reconstruction transformation coefficient corresponding to the quantized coefficient 0 obtained after the quantization processing as a second reconstruction value; wherein the first reconstruction value is different from the second reconstruction value.
The embodiment of the application also provides a decoding method, and the basic idea of the decoding method is as follows: analyzing the code stream and determining the quantization coefficient of the current block; if the quantized coefficient selects a first quantizer to perform inverse quantization processing, determining that a reconstructed transformation coefficient obtained after the inverse quantization processing is a first reconstruction value under the condition that the quantized coefficient is 0; if the quantized coefficient selects a second quantizer to perform inverse quantization processing, determining that a reconstructed transform coefficient obtained after the inverse quantization processing is a second reconstructed value under the condition that the quantized coefficient is 0; wherein the first reconstruction value is different from the second reconstruction value.
In this way, the application adopts the dual quantization technical scheme composed of the first quantizer and the second quantizer, and also carries out offset correction for the corresponding reconstruction transformation coefficient under the condition that the quantization coefficient is 0, so that the reconstruction values obtained under the two quantizers are different (for example, one quantizer is zero, and the other quantizer is non-zero), thereby reducing quantization error, improving accuracy of the reconstruction transformation coefficient and further improving coding and decoding performance.
Embodiments of the present application will be described in detail below with reference to the accompanying drawings.
Referring to fig. 2, a system block diagram of an encoder according to an embodiment of the present application is shown. As shown in fig. 2, the encoder 100 may include: a segmentation unit 101, a prediction unit 102, a first adder 107, a transformation unit 108, a quantization unit 109, an inverse quantization unit 110, an inverse transformation unit 111, a second adder 112, a filtering unit 113, a decoded picture buffer (Decoded Picture Buffer, DPB) unit 114, and an entropy encoding unit 115. Here, the input of the encoder 100 may be a video composed of a series of pictures or a still picture, and the output of the encoder 100 may be a bit stream (may also be referred to as "code stream") for representing a compressed version of the input video.
Wherein the segmentation unit 101 segments pictures in the input video into one or more coding tree units (Coding Tree Units, CTUs). The segmentation unit 101 may divide the picture into a plurality of tiles (or tiles), and may further divide a tile into one or more bricks (tiles), where one tile or a tile may include one or more complete and/or partial CTUs. In addition, the segmentation unit 101 may form one or more slices (slices), where a slice may include one or more tiles in a picture arranged in a grid order, or one or more tiles covering a rectangular area in the picture. The segmentation unit 101 may also form one or more sub-pictures, wherein a sub-picture may comprise one or more sles, tiles or bricks.
During the encoding process of the encoder 100, the partition unit 101 transfers CTUs to the prediction unit 102. In general, the prediction unit 102 may be composed of a block division unit 103, a motion estimation (Motion Estimation, ME) unit 104, a motion compensation (Motion Compensation, MC) unit 105, and an intra prediction unit 106. Specifically, the block division unit 103 iteratively uses quadtree division, binary tree division, and trigeminal tree division to further divide the input CTU into smaller Coding Units (Coding Units, CUs). Prediction unit 102 may obtain an inter prediction block of a CU using ME unit 104 and MC unit 105. Intra-prediction unit 106 may obtain an intra-prediction block of the CU using various intra-prediction modes including MIP mode. In an example, the motion estimation mode of rate-distortion optimization may be invoked by ME unit 104 and MC unit 105 to obtain inter-prediction blocks, and the mode determination mode of rate-distortion optimization may be invoked by intra-prediction unit 106 to obtain intra-prediction blocks.
The prediction unit 102 outputs a prediction block of a CU, and the first adder 107 calculates a difference between the CU in the output of the partition unit 101 and the prediction block of the CU, i.e., a residual CU. The transform unit 108 reads the residual CU and performs one or more transform operations on the residual CU to obtain coefficients. The quantization unit 109 quantizes the coefficients and outputs quantized coefficients (i.e., levels). The inverse quantization unit 110 performs a scaling operation on the quantized coefficients to output reconstructed coefficients. The inverse transform unit 111 performs one or more inverse transforms corresponding to the transforms in the transform unit 108 and outputs a reconstructed residual. The second adder 112 calculates a reconstructed CU by adding the reconstructed residual and the prediction block of the CU from the prediction unit 102. The second adder 112 also sends its output to the prediction unit 102 for use as an intra prediction reference. After all CUs in the picture or sub-picture are reconstructed, the filtering unit 113 performs loop filtering on the reconstructed picture or sub-picture. Here, the filtering unit 113 includes one or more filters, such as a deblocking filter, a sampling adaptive offset (Sample Adaptive Offset, SAO) filter, an adaptive loop filter (Adaptive Loop Filter, ALF), a luminance mapping and chrominance scaling (Luma Mapping with Chroma Scaling, LMCS) filter, and a neural network-based filter, etc. Alternatively, when the filtering unit 113 determines that the CU is not used as a reference when encoding other CUs, the filtering unit 113 performs loop filtering on one or more target pixels in the CU.
The output of the filtering unit 113 is a decoded picture or sub-picture, which is buffered to the DPB unit 114.DPB unit 114 outputs decoded pictures or sub-pictures according to timing and control information. Here, the picture stored in the DPB unit 114 may also be used as a reference for the prediction unit 102 to perform inter prediction or intra prediction. Finally, the entropy encoding unit 115 converts parameters (such as control parameters and supplementary information, etc.) necessary for decoding pictures from the encoder 100 into a binary form, and writes such binary form into the bitstream according to the syntax structure of each data unit, i.e., the encoder 100 finally outputs the bitstream.
Further, the encoder 100 may be a first memory having a first processor and recording a computer program. When the first processor reads and runs the computer program, the encoder 100 reads the input video and generates a corresponding code stream. In addition, encoder 100 may also be a computing device having one or more chips. These units, implemented on a chip as integrated circuits, have similar connection and data exchange functions as the corresponding units in fig. 2.
Referring to fig. 3, a system block diagram of a decoder according to an embodiment of the present application is shown. As shown in fig. 3, the decoder 200 may include: parsing unit 201, prediction unit 202, inverse quantization unit 205, inverse transformation unit 206, adder 207, filtering unit 208, and decoded picture buffer unit 209. Here, the input of the decoder 200 is a bit stream for representing a compressed version of video or one still picture, and the output of the decoder 200 may be a decoded video or one decoded still picture composed of a series of pictures.
The input code stream of the decoder 200 may be the code stream generated by the encoder 100. The parsing unit 201 parses an input code stream and acquires values of syntax elements from the input code stream. Parsing unit 201 converts the binary representation of the syntax element into digital values and sends the digital values to units in decoder 200 to obtain one or more decoded pictures. Parsing unit 201 may also parse one or more syntax elements from the input bitstream to display the decoded picture.
In the decoding process of the decoder 200, the parsing unit 201 transmits the values of the syntax elements and one or more variables set or determined according to the values of the syntax elements for acquiring one or more decoded pictures to a unit in the decoder 200.
The prediction unit 202 determines a prediction block of a current decoded block (e.g., CU). Here, the prediction unit 202 may include a motion compensation unit 203 and an intra prediction unit 204. Specifically, when the inter decoding mode is indicated for decoding the current decoded block, the prediction unit 202 passes the relevant parameters from the parsing unit 201 to the motion compensation unit 203 to obtain an inter prediction block; when intra prediction modes (including MIP modes indicated based on the MIP mode index value) are indicated for decoding the current decoded block, the prediction unit 202 transfers the relevant parameters from the parsing unit 201 to the intra prediction unit 204 to acquire the intra prediction block.
The dequantization unit 205 has the same function as the dequantization unit 110 in the encoder 100. The inverse quantization unit 205 performs a scaling operation on the quantized coefficients (i.e., levels) from the parsing unit 201 to obtain reconstructed coefficients.
The inverse transform unit 206 has the same function as the inverse transform unit 111 in the encoder 100. The inverse transform unit 206 performs one or more transform operations (i.e., inverse operations of one or more transform operations performed by the inverse transform unit 111 in the encoder 100) to obtain a reconstructed residual.
The adder 207 performs an addition operation on its inputs (the prediction block from the prediction unit 202 and the reconstructed residual from the inverse transformation unit 206) to obtain a reconstructed block of the current decoded block. The reconstructed block is also sent to the prediction unit 202 to be used as a reference for other blocks encoded in intra prediction mode.
After all CUs in the picture or sub-picture are reconstructed, the filtering unit 208 performs loop filtering on the reconstructed picture or sub-picture. The filtering unit 208 includes one or more filters, such as deblocking filters, sampling adaptive compensation filters, adaptive loop filters, luma mapping and chroma scaling filters, neural network based filters, and the like. Alternatively, when the filtering unit 208 determines that the reconstructed block is not used as a reference when decoding other blocks, the filtering unit 208 performs loop filtering on one or more target pixels in the reconstructed block. Here, the output of the filtering unit 208 is a decoded picture or sub-picture, which is buffered to the DPB unit 209. The DPB unit 209 outputs a decoded picture or a sub-picture according to the timing and control information. The pictures stored in DPB unit 209 may also be used as references for performing inter prediction or intra prediction by prediction unit 202.
Further, the decoder 200 may be a second memory having a second processor and a recorded computer program. When the first processor reads and runs the computer program, the decoder 200 reads the input code stream and generates a corresponding decoded video. In addition, decoder 200 may also be a computing device having one or more chips. These units, implemented on a chip as integrated circuits, have similar connection and data exchange functions as the corresponding units in fig. 3.
It should be further noted that, when the embodiment of the present application is applied to the encoder 100, the "current block" specifically refers to an image block (may also be referred to as an "encoding block") to be currently encoded in a video image; when embodiments of the present application are applied to decoder 200, the "current block" specifically refers to the image block (which may also be referred to as a "decoding block") in a video image that is currently to be decoded.
In an embodiment of the present application, referring to fig. 4, a schematic flow chart of a decoding method provided in an embodiment of the present application is shown. As shown in fig. 4, the method may include:
s401: and analyzing the code stream to determine the quantization coefficient of the current block.
S402: and if the quantized coefficient selects a first quantizer to perform inverse quantization processing, determining that the reconstructed transform coefficient obtained after the inverse quantization processing is a first reconstructed value under the condition that the quantized coefficient is 0.
S403: and if the quantized coefficient selects a second quantizer to perform inverse quantization processing, determining that the reconstructed transform coefficient obtained after the inverse quantization processing is a second reconstructed value under the condition that the quantized coefficient is 0.
In the embodiment of the application, the first quantizer and the second quantizer form a dual quantizer structure, and the first reconstruction value and the second reconstruction value are different.
It should be noted that, the decoding method in the embodiment of the present application is mainly applied to a decoder. Specifically, based on the composition structure of the decoder 200 shown in fig. 3, the decoding method according to the embodiment of the present application is applied to the "dequantization unit 205" in the decoder 200, and for this dequantization unit 205, a dual quantization technique may be used to implement dequantization processing of quantized coefficients.
In the video codec, the transformed coefficients and the non-transformed coefficients may be collectively referred to as transform coefficients (also simply referred to as "coefficients"). Quantization is typically used to reduce the dynamic range of the transform coefficients, thereby achieving the goal of expressing video with fewer codewords. The quantized values may be referred to as "quantized coefficients" and may also be generally referred to as levels, quantization levels, or quantization levels (levels). The quantization is typically performed by dividing the transform coefficients by a quantization step size, which is determined by the quantization factor conveyed in the code stream. The inverse quantization is performed by multiplying the quantized coefficients by a quantization step to obtain reconstructed transform coefficients. For an nxm block, the quantization process of all transform coefficients may be done independently.
At the same time, a particular scan order may transform a two-dimensional block of transform coefficients into a one-dimensional stream of transform coefficients. Wherein the scanning order may be Z-type, horizontal, vertical or any other order of scanning. The quantization operation can utilize the correlation between the transformation coefficients and the characteristics of the quantized coefficients to select a better quantization mode, thereby achieving the purpose of optimizing quantization.
It will be appreciated that dual quantization is one quantization approach. The dual quantization acts on transformed blocks, unlike conventional quantization, which includes two quantizers having the same quantization step size (i.e., 2×Δ), but interleaved with their corresponding reconstructed transform coefficients.
In the embodiment of the present application, the two quantizers may be a first quantizer and a second quantizer; wherein the first quantizer is denoted by Q0 and the second quantizer is denoted by Q1. Exemplary, referring to fig. 5, a schematic structural diagram of a dual quantizer Q0 and Q1 and corresponding reconstructed transform coefficients are shown. As shown in fig. 5, in the dual quantizer, the reconstructed transform coefficients are-8Δ, -6Δ, -4Δ, -2Δ, 0, 2Δ, 4Δ, 6Δ, 8Δ, etc., and the quantization coefficients are at the level of-4, -3, -2, -1, 0, 1, 2, 3, 4, etc. for the sub-quantizer Q0; for the sub-quantizer Q1, the reconstructed transform coefficients are-9 Δ, -7 Δ, -5 Δ, -3 Δ, - Δ, 0, Δ, 3 Δ, 5 Δ, 7 Δ, 9 Δ, etc., and the quantization coefficients are at the level of-5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, etc.
That is, the sub-quantizer Q0 corresponds to a delta of the reconstructed transform coefficient level that is an even multiple (note: the quantization step sizes of both quantizers are 2×Δ, and the combination of Q0 and Q1 in the dual quantizer corresponds to a quantization step size of 2Δ) (i.e., the number corresponding to the point A, B in FIG. 5), and the sub-quantizer Q1 corresponds to a delta of the reconstructed transform coefficient level that is an odd multiple (i.e., the number corresponding to the point C, D in FIG. 5).
It should be noted that, by introducing two staggered quantizers (such as Q0 and Q1) and a skip principle between the quantizers, the quantizers with large steps can be combined to complete finer quantization, so as to reduce the loss between the reconstructed transform coefficient and the original transform coefficient, thereby improving the coding and decoding efficiency and improving the coding and decoding performance.
In the decoder, for each reconstructed transform coefficient, one of the two sub-quantizers Q0 and Q1 described in fig. 5 may be selected for inverse quantization, each in a similar manner as a conventional quantizer (such as inverse quantization in HEVC). The reconstructed transform coefficients of both quantizers can be represented by multiples of the quantization step size Δ, the reconstructed transform coefficients of both quantizers being defined as follows:
Q0 the quantization step size delta of the quantizer, which is an even multiple (including zero multiple) of the level of the reconstructed transform coefficient, when this quantizer is used, the reconstructed transform coefficient t' can be calculated according to equation (1), as follows,
t′=2·k·Δ (1)
where k represents the level of the associated quantization coefficient shown in fig. 5.
Q1 the quantizer has a quantization step size delta with an odd or zero-multiple level of the reconstructed transform coefficient, and when this quantizer is used, the reconstructed transform coefficient t' can be calculated according to equation (2), as follows,
t′=(2·k-sgn(k))·Δ (2)
where sgn (·) represents the sign function, as shown below,
where x is the quantized coefficient that is dequantized.
Further, the choice of using Q0 or Q1 for dequantization is not controlled by decoding the flag bit. Instead, the parity of the level of the last quantized coefficient in the coefficient scan order (the transform coefficient level as described in fig. 5) is used to determine whether the current transform coefficient uses Q0 or Q1.
Referring to fig. 6, a state transition diagram of a quantizer used for decision quantization coefficients according to an embodiment of the present application is shown. In fig. 6, (a) shows a usage pattern selected using a state machine decision quantizer, and (b) shows an example in a state transition table (which may also be referred to as a "state transition table").
Taking fig. 6 as an example, in the coefficient scan sequence, the reconstructed value of the current coefficient may determine the state (state) of the next coefficient by the transition method shown in fig. 6, and the states are represented by four values, namely, 0, 1, 2 and 3. That is, the state machine may include four states: state 0, state 1, state 2, and state 3. For example, when the state of the current coefficient is 2 and the current transform coefficient level is 5, since 5 is an odd number, it is determined that the state of the next coefficient jumps to state 3. The state of the first coefficient of each transform block in the scan order is set to the initial state 0. States 0, 1, 2, 3 may also determine which quantizer is used for the current coefficient, e.g., states 0 and 1 correspond to sub-quantizer Q0, and states 2 and 3 correspond to sub-quantizer Q1.
Furthermore, for the encoder side, similar to the implementation of Rate-distortion optimized quantization (Rate-Distortion Optimized quantization, RDOQ), the transform coefficient level { q } k The value of is one process that minimizes the rate distortion cost such as the lagrangian,
J=D+λ·R=∑ k (t k -t′ k (q k |q k-1 ,q k-2 ,…)) 2 +λ·R k (q k |q k-1 ,q k-2 ,…) (4)
wherein t is k And q k Representing the original transform coefficients and the transform coefficient levels, t' k (q k I …) at the current transform coefficient level q k Lower reconstructed transform coefficient value, R k (q k I …) represents the estimated code q k The number of bits that need to be consumed.
The state transitions of the state machine as described above may represent the dependencies between states of the quantizer and the transform coefficient levels as a trellis diagram as shown in fig. 7, with four states of each column representing the four possible states of the current transform coefficient, each node being connected to two possible state nodes of the next coefficient in the coding order (the coding order going from left to right). For a given current state and current transform coefficient t k The current quantizer may be used to quantize the corresponding transform coefficient levels, and the encoder may choose to use either the odd transform coefficient levels or the even transform coefficient levels; the odd transform coefficient levels correspond to B (Q0 with space 1) and D (Q1 with space 1) in fig. 7, and the even transform coefficient levels correspond to a (Q0 with space 0) and C (Q1 with space 0) in fig. 7. When calculating the cost J of all nodes k (q k )=(t k -t′ k (q k |…)) 2 +λ·R k (q k I …), transform coefficient level q k It is possible to find a route with the smallest sum of costsThe decision, while the determination of the minimum cost sum may be achieved by a viterbi algorithm (Viterbi algorithm).
Specifically, the implementation can consist of the following two steps:
(1) 4 candidate transform coefficient levels from Q0 and Q1, respectively, corresponding to the original transform coefficients are found.
(2) Determining a series of transform coefficient levels q for a current node using a rate-distortion (rate-reduction) sum (a cost sum corresponding to a transform coefficient level determined by a previous node) estimated by a viterbi algorithm k
Illustratively, as shown in fig. 8, the candidate transform coefficient levels of the sub-quantizer Q0 are denoted by a and B, and the candidate transform coefficient levels of the sub-quantizer Q1 are denoted by C and D. For these four candidate transform coefficient levels (A, B, C, D), for Q0 and Q1, the two transform coefficient levels that will best match the original transform coefficient are selected.
Briefly, in one possible implementation, the first quantizer and the second quantizer are dual quantizers, but in the case that the quantized coefficient is 0, the reconstructed transform coefficient obtained after the inverse quantization according to the first quantizer is 0, and the reconstructed transform coefficient obtained after the inverse quantization according to the second quantizer is also 0, as shown in fig. 5.
In another possible implementation manner of the embodiment of the present application, the first quantizer and the second quantizer are dual quantizers, but in the case that the quantized coefficient is 0, the reconstructed transform coefficient obtained after the inverse quantization according to the first quantizer is the first reconstructed value, and the reconstructed transform coefficient obtained after the inverse quantization according to the second quantizer is the second reconstructed value.
Here, for the first reconstruction value and the second reconstruction value, in a specific example, the first reconstruction value is 0 and the second reconstruction value is 1; alternatively, the first reconstruction value is 1 and the second reconstruction value is 0.
In another specific example, in the case where the quantization coefficient is 0, the first reconstruction value is 0 and the second reconstruction value is a smaller number related to Δ (delta); alternatively, the first reconstruction value is a smaller number related to Δ (delta) and the second reconstruction value is 0.
In yet another specific example, in the case where the quantization coefficient is 0, the first reconstruction value is set to +1 and the second reconstruction value is set to-1; alternatively, the first reconstruction value is set to-1 and the second reconstruction value is set to +1. Alternatively, in the case where the quantization coefficient is 0, the first reconstruction value is set to +Δ/(2 ζ), and the second reconstruction value is set to- Δ/(2 ζ); alternatively, the first reconstruction value is set to- Δ/(2≡N) and the second reconstruction value is set to +Δ/(2≡N). In this way, the positive and negative symmetry of the reconstructed values of all the reconstructed coefficients of the dual quantizer can be maintained. Here, N is a numerical value greater than or equal to 1, and 2Δ represents a quantization step size.
That is, the corresponding reconstructed transform coefficient is offset-corrected so that the corresponding reconstructed transform coefficient is non-zero and is a value very close to zero when the quantized coefficient is 0, but the embodiment of the present application is not particularly limited.
In some embodiments, for S401, the parsing the code stream to determine the quantization coefficients of the current block may include:
analyzing the code stream to obtain the related information of the current block; wherein the related information includes at least one of: identification information, scanning sequence information, initial scanning position and quantization parameters;
and determining the quantization coefficient of the current block according to the related information.
Further, in some embodiments, the identification information may include at least one of: identification information of the first syntax element, identification information of the second syntax element, identification information of the third syntax element, identification information of the fourth syntax element, and identification information of the fifth syntax element;
the identification information of the first syntax element is used for indicating whether the value of the quantized coefficient is non-zero, the identification information of the second syntax element is used for indicating whether the amplitude of the value of the quantized coefficient is larger than 1, the identification information of the third syntax element is used for indicating whether the amplitude of the value of the quantized coefficient is larger than 2, the identification information of the fourth syntax element is used for indicating whether the amplitude of the value of the quantized coefficient exceeds an overflow value of 2, and the identification information of the fifth syntax element is used for indicating positive and negative characteristics of the quantized coefficient.
It should be noted that the first syntax element may be represented by a signaling flag, the second syntax element may be represented by a GT1 flag, the third syntax element may be represented by a GT2 flag, the fourth syntax element may be represented by a remaining level, and the fifth syntax element may be represented by a sign.
It should be noted that, in the decoder, the code stream needs to be parsed first, and other identification information of the current block is obtained until the inverse quantization process is entered. In this process, inverse quantization related information such as a coefficient scan order, an initial scan position, and quantization parameters (such as quantization step size) needs to be determined in order to determine a quantization coefficient to be currently decoded according to the scan order.
Further, for dual quantization techniques, whether the current quantization coefficient is selected for the first quantizer (Q0) or the second quantizer (Q1) may be determined by the state of the state machine (here, the state at the current time). Specifically, in some embodiments, the method may further include:
determining the state of a state machine;
if the state of the state machine indicates that the first quantizer is selected, determining that the quantized coefficient selects the first quantizer for inverse quantization;
and if the state of the state machine indicates that the second quantizer is selected, determining that the quantized coefficient selects the second quantizer for inverse quantization.
Here, the state machine may include four states: a first state, a second state, a third state, and a fourth state; wherein the value of the first state is set to 0, the value of the second state is set to 1, the value of the third state is set to 2, and the value of the fourth state is set to 3;
accordingly, in some embodiments, the method may further comprise:
if the state machine is in the first state and the second state, determining that the state of the state machine indicates to select a first quantizer;
and if the state machine is in the third state and the fourth state, determining that the state of the state machine indicates to select a second quantizer.
The first state may be represented by the S00 state, the second state may be represented by the S01 state, the third state may be represented by the S10 state, and the fourth state may be represented by the S11 state.
Specifically, if the state machine is in the first state or the second state, it may be determined that the state of the state machine indicates that the first quantizer is selected for inverse quantization; if the state machine is in the third state or the fourth state, it may be determined that the state machine's state indicates that the second quantizer is selected for dequantization.
In one possible embodiment, for the case where the quantized coefficient has a value (may also be referred to as "level") of 0, the value of the reconstructed transform coefficient after the inverse quantization process by the second quantizer may be shifted. Specifically, in some embodiments, the method may further comprise:
if the state of the state machine indicates that the first quantizer is selected, determining to perform inverse quantization processing by using the formula (5);
if the state of the state machine indicates that the second quantizer is selected, determining to perform inverse quantization processing by using the formula (6);
coeff=x·2Δ (5)
wherein 2Δ represents the quantization step size, x represents the value of the quantized coefficient, coeff represents the value of the reconstructed transform coefficient.
It should be noted that, taking fig. 9 as an example, the dual quantizer shown in fig. 9 is used, and the dual quantizer is composed of two sub-quantizers (Q0, Q1), and two sets of quantization levels (V0, V1) corresponding to the two sub-quantizers are staggered with each other except for the quantization level 0. Each set of quantization levels may further comprise two groups of quantization levels, one group of quantization levels having an odd index value (V01, V11, respectively) and the other group of quantization levels having an even index value (V00, V10, respectively).
As shown in fig. 9, both sub-quantizers contain 0 quantization level, the value of the reconstructed transform coefficient corresponding to the 0 quantization level in Q0 is 0, the reconstructed transform coefficient corresponding to the 0 quantization level in Q1 is a value very close to 0 but not 0, for M 1 ×M 2 The value of the reconstructed transform coefficient corresponding to the 0 quantization level in the two-dimensional quantization coefficient matrix Q1 is coeff= (2×2) ((ShiftTable(QPx)+shift1)-1) )>>(ShiftTable(QP X ) +shift 1))=1; where shift1 is equal to m+BitDepth-14, bitDepth is the encoded sample precision. m=log (M 1 ×M 2 )/2,M 1 And M 2 For the size parameter of the transform block, shiftTable (QPx) represents a mapping table between the preset shift number and QPx to determine the shift number corresponding to QPx.
Here, according to fig. 9, when Q0 is selected, the quantization formula shown in the above formula (5) is used; if Q1 is selected, the quantization formula shown in the above formula (6) is used.
In another possible embodiment, for the case where the quantized coefficient has a value (may also be referred to as "level") of 0, the value of the reconstructed transform coefficient after the inverse quantization process of the first quantizer may be shifted. Specifically, in some embodiments, the method may further comprise:
if the state of the state machine indicates that the first quantizer is selected, determining to perform inverse quantization processing by using a formula (7);
If the state of the state machine indicates that the second quantizer is selected, determining to perform inverse quantization processing by using the formula (8);
wherein 2Δ represents the quantization step size, x represents the value of the quantized coefficient, coeff represents the value of the reconstructed transform coefficient.
It should be noted that, taking fig. 10 as an example, the dual quantizer shown in fig. 10 is used, and the dual quantizer is composed of two sub-quantizers (Q0, Q1), and two sets of quantization levels (V0, V1) corresponding to the two sub-quantizers are staggered with each other except for the quantization level 0. Each set of quantization levels may further comprise two groups of quantization levels, one group of quantization levels having an odd index value (V01, V11, respectively) and the other group of quantization levels having an even index value (V00, V10, respectively).
As shown in fig. 10, both sub-quantizers contain 0 quantization level, the value of the reconstructed transform coefficient corresponding to the 0 quantization level in Q1 is 0, the reconstructed transform coefficient corresponding to the 0 quantization level in Q0 is a value very close to 0 but not 0, for M 1 ×M 2 The value of the reconstructed transform coefficient corresponding to the 0 quantization level in the two-dimensional quantization coefficient matrix Q0 is coeff= (2×2) ((ShiftTable(QPx)+shift1)-1) )>>(ShiftTable(QP X ) +shift 1))=1; where shift1 is equal to m+BitDepth-14, bitDepth is the encoded sample precision. m=log (M 1 ×M 2 )/2,M 1 And M 2 For the size parameter of the transform block, shiftTable (QPx) represents a mapping table between the preset shift number and QPx to determine the shift number corresponding to QPx.
Here, according to fig. 10, when Q0 is selected, the quantization formula shown in the above formula (7) is used; if Q1 is selected, the quantization formula shown in the above formula (8) is used.
It should be further noted that, for the case of x=0, in addition to setting one reconstruction value to 0 and the other reconstruction value to 1 for distinguishing the reconstruction transform coefficients of the two sub-quantizers Q0 and Q1, it is also possible to consider setting a smaller number associated with Δ, such as Δ/64, Δ/1024, etc., in addition to setting the corresponding reconstruction value of one of Q0 or Q1 to 1 as a constant when x=0; the corresponding reconstruction value when the other x=0 in Q0 or Q1 is still 0.
Further, when x=0, one corresponding reconstruction value of Q0 or Q1 may be set to +1, and the other corresponding reconstruction value may be set to-1; or one set to +Δ/(2≡N) and the other set to- Δ/(2≡N); or one set to + delta/N and the other set to-delta/N, so that the positive and negative symmetry of all reconstructed values of the dual quantizer can be maintained. Here, N is a numerical value greater than or equal to 1, and 2Δ represents a quantization step size.
It should be further noted that there are two states in each sub-quantizer (the first quantizer or the second quantizer), the first quantizer includes a first state and a second state, and the second quantizer includes a third state and a fourth state, so that the two sub-quantizers share four states. Determining which quantizer to use according to the state of the quantizer at the current moment during the inverse quantization process; since the state of the quantizer is implemented by the state machine, in other words, it is also possible to decide which quantizer to use according to the state of the state machine at the current time.
Further, the state of the state machine is continuously updated. In some embodiments, the method may further comprise:
after the quantization coefficient is subjected to inverse quantization processing, determining a migration state of the state machine according to the state of the state machine and the parity characteristic of the quantization coefficient;
and updating the migration state into the state of the state machine corresponding to the next quantization coefficient.
In a specific example, the determining the migration state of the state machine according to the state of the state machine and the parity characteristic of the quantization coefficient may include:
inquiring and obtaining the migration state of the state machine by using a preset state migration table according to the state of the state machine and the parity characteristic of the quantization coefficient;
The preset state transition table comprises a state of a state machine, parity characteristics of a quantization coefficient and a corresponding relation between transition states.
In the embodiment of the present application, the quantization coefficient x is subjected to inverse quantization operation, and the quantizer used is determined to be Q0 or Q1 according to the state of the state machine at the current moment. If the state at this time is state 0 and state 1, then the sub-quantizer Q0 is used; if the states at this time are state 2 and state 3, then the sub-quantizer Q1 is used. For each transform block, the initial state of the state machine is state 0. That is, the method may further include: the initial state of the state machine is set to the first state.
In one possible implementation manner, the state machine or the state transition table shown in fig. 6 may be used to query and obtain the transition state of the state machine and update the state according to the state of the state machine and the parity characteristic of the quantization coefficient at the current moment, so as to determine the state corresponding to the next quantization coefficient.
In another possible implementation manner, after the current coefficient is dequantized in the dequantization process, an updated quantizer state is obtained according to the state of the state machine at the current moment and the parity of the quantized value of the coefficient, and the state determines the quantizer selection of the next coefficient. As shown in fig. 11, the quantizer state transition relationship is: when the quantizer is in state 0, if the selected quantization level value belongs to V00, updating the quantizer state to 0, and if the selected quantization level value belongs to V01, updating the quantizer state to 2; when the quantizer is in state 1, if the selected quantization level value belongs to V00, updating the quantizer state to 2, and if the selected quantization level value belongs to V01, updating the quantizer state to 0; when the quantizer is in state 2, if the selected quantization level value belongs to V10, updating the quantizer state to 1, and if the selected quantization level value belongs to V11, updating the quantizer state to 3; when the quantizer is in state 3, the quantizer state is updated to 3 if the selected quantization level value belongs to V10, and to 1 if the selected quantization level value belongs to V11. Here, it should be noted that the state of the state machine is not limited to these four states, nor is it limited to performing state transition according to the parity characteristic of the previous quantization coefficient, which is just a specific example, and the embodiment of the present application is not limited in any way.
In some embodiments, the method may further comprise:
after all the quantized coefficients of the current block are subjected to inverse quantization, determining a reconstructed transformation block according to the obtained reconstructed transformation coefficients;
and carrying out inverse transformation on the reconstructed transformation block to obtain a reconstructed residual block.
Further, in some embodiments, the method may further comprise:
analyzing the code stream to obtain prediction mode parameters;
performing prediction processing on the current block by using the prediction mode parameters to obtain a prediction block of the current block;
and determining a reconstruction block of the current block according to the reconstruction residual block and the prediction block.
It should be noted that, after all the quantized coefficients of the current block are dequantized, the obtained reconstructed transform coefficients may be formed into a reconstructed transform block, which has a size parameter of M 1 ×M 2 . And then carrying out inverse transformation on the reconstructed transformation block to obtain a reconstructed residual block. Wherein the reconstructed transform block is subjected to an inverse transform process, which is an inverse of the transform process in the encoder. It should be noted that if the encoder does not perform the transform processing on some coefficients at the time of the transform processing, the coefficients do not need to perform the inverse transform processing.
It should be noted that, by parsing the code stream, the prediction mode parameters may also be obtained. Here, the prediction mode parameter may include an intra prediction mode parameter or an inter prediction mode parameter. Then, predicting the current block by using the intra-frame prediction mode parameter or the inter-frame prediction mode parameter to obtain a predicted block of the current block; and then the reconstructed residual block and the predicted block are subjected to addition processing, so that the reconstructed block of the current block can be obtained.
In summary, the design of dual quantization mainly comprises three parts:
(1) Two interleaved sub-quantizers (Q0 and Q1);
(2) Controlling state transitions using a state machine;
(3) Coding of transform coefficient levels.
In the embodiment of the present application, a new dual quantizer is mainly provided in the dual quantization technology, where both sub-quantizers contain 0 quantization level, the reconstruction value of the reconstruction transform coefficient corresponding to the 0 quantization level in the sub-quantizer Q0 is 0, and the reconstruction value of the reconstruction transform coefficient corresponding to the 0 quantization level in the sub-quantizer Q1 is a value very close to 0, but not 0, as shown in fig. 9.
Here, a reconstruction value of the reconstructed transform coefficient is defined as coeff, and a level of the quantized coefficient is defined as x. In the embodiment of the application, for M 1 ×M 2 The reconstruction value of the reconstruction transform coefficient corresponding to 0 in the two-dimensional quantization coefficient matrix Q1 is coeff= (2×2) ((ShiftTable(QPx)+shift1)-1) )>>(ShiftTable(QP x ) +shift 1))) =1, where shift1 is equal to m+bitdepth-14 (BitDepth is the encoded sample precision, m=log (M) 1 ×M 2 )/2)。
If the sub-quantizer Q0 is used in the dequantization processing, coeff=x·2Δ,
if the sub-quantizer Q1 is used in the dequantization process, there are
In a specific example, the implementation of the embodiments of the present application in a decoder is as follows:
the decoder acquires the code stream information, analyzes the identification bit of the current block, and then enters a dequantization process.
And determining inverse quantization related information such as coefficient scanning sequence, initial scanning position, quantization parameters and the like.
The state of the state machine is initialized to 0.
And acquiring the current quantization coefficient according to the scanning sequence.
And determining a quantizer used by the current quantization coefficient according to the current state of the state machine.
And performing inverse quantization processing on the current quantized coefficient by using the selected quantizer.
The state of the state machine is updated.
And acquiring the next quantization coefficient until the inverse quantization process is finished.
For the decoding process described above, the text change description of the embodiment of the present application for the dequantization decoding process is shown in table 1.
TABLE 1
Here, the quantizer that modifies the 0-point reconstruction value in the dual quantization may also be a Q0 quantizer, the structure of which is shown in fig. 10. Here, both sub-quantizers contain 0 quantization level, and the reconstruction value of the reconstruction transform coefficient corresponding to 0 quantization level in the sub-quantizer Q0 is a value very close to 0, but is not 0, and the reconstruction value of the reconstruction transform coefficient corresponding to 0 quantization level in Q1 is 0.
That is, the technical solution of the embodiment of the present application provides an offset correction for 0 point of a quantizer in an even quantizer, where the corresponding coefficient is not zero, but is a value very close to 0. In addition, the technical scheme of the embodiment of the application can be also applied to other standards, such as MPEG, AOM or any custom coefficient block coding and decoding standard.
Illustratively, in an implementation, for a transform block, its definition is as shown in table 2.
TABLE 2
Wherein isQ [ i ] [ j ] defines its assignment in the syntax table.
For the inverse quantization process, we define here that M will be 1 ×M 2 Conversion of two-dimensional quantization coefficient matrix QuantCoeffMatrix to M 1 ×M 2 A process of two-dimensional transformation coefficient matrix CoeffMatrix. The range of values of the elements of QuantCoeffMatrix decoded from the bitstream conforming to this part should be-2 15 ~2 15 –1。
If the Intra prediction mode is neither 'intra_luma_pcm' nor 'intra_chroma_pcm', the calculation of the two-dimensional transform coefficient matrix CoeffMatrix is shown in table 3.
TABLE 3 Table 3
If the Intra prediction mode is 'intra_luma_pcm' or 'intra_chroma_pcm', the calculation of the two-dimensional transform coefficient matrix CoeffMatrix is shown in table 4.
TABLE 4 Table 4
For quantization parameter QP X The relationship between (X is Y, cb or Cr) and DequatTable and Shift Table is shown in Table 5.
TABLE 5
QP < X > value Value of DequatTable (QP X) Value of Shift Table (QP X)
0 32768 14
1 36061 14
2 38968 14
3 42495 14
4 46341 14
5 50535 14
6 55437 14
7 60424 14
8 32932 13
9 35734 13
10 38968 13
11 42495 13
12 46177 13
13 50535 13
14 55109 13
15 59933 13
16 65535 13
17 35734 12
18 38968 12
19 42577 12
20 46341 12
21 50617 12
22 55027 12
23 60097 12
24 32809 11
25 35734 11
26 38968 11
27 42454 11
28 46382 11
29 50576 11
30 55109 11
31 60056 11
32 65535 11
33 35734 10
34 38968 10
35 42495 10
36 46320 10
37 50515 10
38 55109 10
39 60076 10
40 65535 10
41 35744 9
42 38968 9
43 42495 9
44 46341 9
45 50535 9
46 55099 9
47 60087 9
48 65535 9
49 35734 8
50 38973 8
51 42500 8
52 46341 8
53 50535 8
54 55109 8
55 60097 8
56 32771 7
57 35734 7
58 38965 7
59 42497 7
60 46341 7
61 50535 7
62 55109 7
63 60099 7
64 32768 6
65 36061 6
66 38968 6
67 42495 6
68 46341 6
69 50535 6
70 55437 6
71 60424 6
72 32932 5
73 35734 5
74 38968 5
75 42495 5
76 46177 5
77 50535 5
78 55109 5
79 59933 5
In the embodiment of the present application, the proposed implementation scheme is as follows, and other parts are consistent with the above scheme, except the following parts, so as to ensure that the implementation can be realized within a constrained bit width during the dequantization process. Here, the calculation of the two-dimensional transformation coefficient matrix CoeffMatrix is shown in table 6.
TABLE 6
The embodiment of the application provides a decoding method, which determines the quantization coefficient of a current block by analyzing a code stream; if the quantized coefficient selects a first quantizer to perform inverse quantization processing, determining that a reconstructed transformation coefficient obtained after the inverse quantization processing is a first reconstruction value under the condition that the quantized coefficient is 0; if the quantized coefficient selects a second quantizer to perform inverse quantization processing, determining that a reconstructed transform coefficient obtained after the inverse quantization processing is a second reconstructed value under the condition that the quantized coefficient is 0; wherein the first reconstruction value is different from the second reconstruction value. In this way, the embodiment of the application adopts the dual quantization technical scheme formed by the first quantizer and the second quantizer, and also carries out offset correction on the corresponding reconstruction transformation coefficient under the condition that the quantization coefficient is 0, so that the reconstruction values obtained under the two quantizers are different (for example, one quantizer is zero, and the other quantizer is non-zero), thereby reducing quantization errors, improving the accuracy of the reconstruction transformation coefficient and further improving decoding performance.
In another embodiment of the present application, referring to fig. 12, a schematic flow chart of an encoding method provided by an embodiment of the present application is shown. As shown in fig. 12, the method may include:
s1201: determining a transformation block of the current block; wherein the transform block comprises at least one transform coefficient.
S1202: and if the transformation coefficient selects a first quantizer to perform quantization processing, determining a reconstruction transformation coefficient corresponding to the quantized coefficient 0 obtained after the quantization processing as a first reconstruction value.
S1203: and if the transformation coefficient selects a second quantizer to perform quantization processing, determining a reconstruction transformation coefficient corresponding to the quantized coefficient 0 obtained after the quantization processing as a second reconstruction value.
In the embodiment of the application, the first quantizer and the second quantizer form a dual quantizer structure, and the first reconstruction value and the second reconstruction value are different.
It should be noted that, the encoding method of the embodiment of the present application is mainly applied to an encoder. Specifically, based on the constituent structure of the encoder 100 shown in fig. 2, the encoding method of the embodiment of the present application is applied to the "quantization unit 109" part or the "inverse quantization unit 110" part in the encoder 100, and for this quantization unit 109, a dual quantization technique may be used to implement quantization processing on transform coefficients; for the inverse quantization unit 110, a dual quantization technique may be employed to implement the inverse quantization process for the reconstructed transform coefficients.
In a possible implementation manner, the first quantizer and the second quantizer are dual quantizers, but in the case that the quantized coefficient is 0, the reconstructed transform coefficient corresponding to the first quantizer is 0, and the reconstructed transform coefficient corresponding to the second quantizer is also 0, as shown in fig. 5.
In another possible implementation manner of the embodiment of the present application, the first quantizer and the second quantizer are dual quantizers, but in the case that the quantized coefficient is 0, the reconstructed transform coefficient corresponding to the first quantizer is a first reconstructed value, and the reconstructed transform coefficient corresponding to the second quantizer is a second reconstructed value.
Here, for the first reconstruction value and the second reconstruction value, in a specific example, the first reconstruction value is 0 and the second reconstruction value is 1; alternatively, the first reconstruction value is 1 and the second reconstruction value is 0.
In another specific example, in the case where the quantization coefficient is 0, the first reconstruction value is 0 and the second reconstruction value is a smaller number related to Δ (delta); alternatively, the first reconstruction value is a smaller number related to Δ (delta) and the second reconstruction value is 0.
In yet another specific example, in the case where the quantization coefficient is 0, the first reconstruction value is set to +1 and the second reconstruction value is set to-1; alternatively, the first reconstruction value is set to-1 and the second reconstruction value is set to +1. Alternatively, in the case where the quantization coefficient is 0, the first reconstruction value is set to +Δ/(2 ζ), and the second reconstruction value is set to- Δ/(2 ζ); alternatively, the first reconstruction value is set to- Δ/(2≡N) and the second reconstruction value is set to +Δ/(2≡N); even or, in the case where the quantization coefficient is 0, the first reconstruction value is set to +Δ/N, and the second reconstruction value is set to- Δ/N; alternatively, the first reconstruction value is set to- Δ/N and the second reconstruction value is set to +Δ/N. In this way, the positive and negative symmetry of the dual quantizer input transform coefficients can be maintained. Here, N is a numerical value greater than or equal to 1, and 2Δ represents a quantization step size.
That is, the reconstructed transform coefficient corresponding to the quantized coefficient 0 obtained by performing quantization processing on a quantizer is offset-corrected so that the reconstructed transform coefficient corresponding to the quantized coefficient is non-zero and is a value very close to zero, but the embodiment of the present application is not particularly limited.
In some embodiments, for S1201, the determining the transform block of the current block may include:
determining a current block in a video image and a prediction mode parameter of the current block;
performing prediction processing on the current block by utilizing the prediction mode parameters, and determining a prediction block of the current block;
obtaining a residual block of the current block according to the current block and the prediction block;
and carrying out transformation processing on the residual block to obtain a transformation block of the current block.
In an embodiment of the present application, the method may further include: and writing the prediction mode parameters into a code stream.
It should be noted that, the prediction mode parameter herein is used to indicate the prediction mode adopted by the current block, and different prediction modes correspond to different prediction mode parameters. Here, the determination of the prediction mode parameter may be determined according to the magnitude of the distortion value, or may be determined according to the result of rate distortion optimization (Rate Distortion Optimization, RDO), which is not limited in any way. In general, the prediction mode parameters of the current block may be determined in an RDO manner. Specifically, in some embodiments, determining the prediction mode parameter of the current block may include: precoding the current block by utilizing a plurality of prediction modes to obtain rate distortion cost values corresponding to the plurality of prediction modes; and selecting an optimal rate-distortion cost value from the plurality of obtained rate-distortion cost values, and determining a prediction mode corresponding to the optimal rate-distortion cost value as a prediction mode parameter of the current block.
That is, in the encoder, the current block may be separately precoded using a plurality of prediction modes with respect to the current block. Here, the plurality of prediction modes generally include inter prediction modes, conventional intra prediction modes, and non-conventional intra prediction modes. Among them, the conventional intra prediction mode may include a Direct Current (DC) mode, a PLANAR (PLANAR) mode, an angular intra prediction mode, and the like. Non-conventional Intra prediction modes may include MIP mode, cross-component linear model prediction (CCLM) mode, intra Block Copy (IBC) mode, and PLT (Palette) mode, etc. And the inter prediction mode may include a conventional inter prediction mode, an inter geometric partition prediction (Geometrical partitioning for inter blocks, GEO) mode, and the like.
Illustratively, after the current block is precoded with multiple prediction modes, respectively, rate-distortion cost values corresponding to the multiple prediction modes may be obtained. And then selecting an optimal rate-distortion cost value from the obtained multiple rate-distortion cost values (in general, the minimum rate-distortion cost value is the optimal rate-distortion cost value), and determining a prediction mode corresponding to the optimal rate-distortion cost value as a prediction mode parameter of the current block. In this way, the encoder performs predictive coding on the current block by using the prediction mode indicated by the prediction mode parameter, so that the prediction residual error is smaller, and the coding efficiency can be improved. It should be noted that the prediction mode parameters need to be written into the bitstream so that the decoder can obtain the prediction mode parameters by parsing the bitstream.
In addition, the transform block of the current block may be obtained by performing a subtraction operation on the current block and a prediction block obtained by using a prediction mode parameter, determining a residual block, and then performing a transform process on the residual block. Here, the residual block may be subjected to two-dimensional transformation entirely or partially, or may not be subjected to two-dimensional transformation, and the residual block after transformation or the block not subjected to transformation is referred to as a transformation block in the embodiment of the present application.
In some embodiments, the method may further comprise: and coding the quantized coefficients obtained after the quantization processing of the transformation blocks, and writing the quantized coefficients into a code stream.
It should be noted that, after all transform coefficients of the current block are quantized, the obtained quantized coefficients are encoded and written into a code stream; so that a subsequent decoder can obtain these quantized coefficients by parsing the code stream.
Further, in some embodiments, the method may further comprise:
determining relevant information of the current block; wherein the related information includes at least one of: identification information, scanning sequence information, initial scanning position and quantization parameters;
And encoding the related information and writing the related information into a code stream.
It should be noted that, the identification information at least includes one of the following: identification information of the first syntax element, identification information of the second syntax element, identification information of the third syntax element, identification information of the fourth syntax element, and identification information of the fifth syntax element;
the identification information of the first syntax element is used for indicating whether the value of the quantized coefficient is non-zero, the identification information of the second syntax element is used for indicating whether the amplitude of the value of the quantized coefficient is larger than 1, the identification information of the third syntax element is used for indicating whether the amplitude of the value of the quantized coefficient is larger than 2, the identification information of the fourth syntax element is used for indicating whether the amplitude of the value of the quantized coefficient exceeds an overflow value of 2, and the identification information of the fifth syntax element is used for indicating positive and negative characteristics of the quantized coefficient.
In the embodiment of the present application, the first syntax element may be represented by a signaling flag, the second syntax element may be represented by a GT1 flag, the third syntax element may be represented by a GT2 flag, the fourth syntax element may be represented by a remaining level, and the fifth syntax element may be represented by a sign.
It should be noted that, in the encoder, the relevant information of the current block needs to be determined first, including but not limited to the identification information, the scanning order information, the initial scanning position, the quantization parameter (such as quantization step), and the like, and may even further include the size parameter of the transform block, which needs to be written into the code stream, so that the subsequent decoder can obtain these inverse quantization relevant information by parsing the code stream, so that the decoder can determine the quantization coefficient to be decoded.
Further, for dual quantization techniques, whether the current quantized coefficients are selected from the first quantizer (Q0) or the second quantizer (Q1) may be determined by the state of the state machine. Specifically, in some embodiments, the method may further include:
determining the state of a state machine;
if the state of the state machine indicates that the first quantizer is selected, determining that the quantized coefficient obtained after quantization processing is selected from the first quantizer for inverse quantization processing;
and if the state of the state machine indicates that the second quantizer is selected, the quantized coefficient obtained after the quantization processing is determined to be selected from the second quantizer for inverse quantization processing.
Here, the state machine may include four states: a first state, a second state, a third state, and a fourth state; wherein the value of the first state is set to 0, the value of the second state is set to 1, the value of the third state is set to 2, and the value of the fourth state is set to 3;
Accordingly, in some embodiments, the method may further comprise:
if the state machine is in the first state and the second state, determining that the state of the state machine indicates to select a first quantizer;
and if the state machine is in the third state and the fourth state, determining that the state of the state machine indicates to select a second quantizer.
The first state may be represented by the S00 state, the second state may be represented by the S01 state, the third state may be represented by the S10 state, and the fourth state may be represented by the S11 state.
Specifically, if the state machine is in the first state or the second state, it may be determined that the state of the state machine indicates that the first quantizer is selected for inverse quantization; if the state machine is in the third state or the fourth state, it may be determined that the state machine's state indicates that the second quantizer is selected for dequantization.
In one possible implementation, for the case where the quantized coefficient has a value (may also be referred to as "level") of 0, the value of the reconstructed transform coefficient corresponding to the second quantizer may be shifted. Specifically, in some embodiments, the method may further comprise:
If the state of the state machine indicates that the first quantizer is selected, determining that the quantized coefficient obtained after quantization processing is subjected to inverse quantization processing by using a formula (5);
if the state of the state machine indicates that the second quantizer is selected, determining that the quantized coefficient obtained after quantization processing is subjected to inverse quantization processing by using a formula (6);
wherein 2Δ represents the quantization step size, x represents the value of the quantized coefficient, coeff represents the value of the reconstructed transform coefficient.
It should be noted that, this embodiment may refer to fig. 9, and the details thereof are the same as those of the decoder, and will not be described in detail herein.
In another possible implementation, for the case that the quantized coefficient has a value (may also be referred to as "level") of 0, the value of the reconstructed transform coefficient corresponding to the first quantizer may be shifted. Specifically, in some embodiments, the method may further comprise:
if the state of the state machine indicates that the first quantizer is selected, determining that the quantized coefficient obtained after quantization processing is subjected to inverse quantization processing by using a formula (7);
if the state of the state machine indicates that the second quantizer is selected, determining that the quantized coefficient obtained after quantization processing is subjected to inverse quantization processing by using a formula (8);
Wherein 2Δ represents the quantization step size, x represents the value of the quantized coefficient, coeff represents the value of the reconstructed transform coefficient.
It should be noted that, this embodiment may refer to fig. 10, and the details thereof are the same as those of the decoder, and will not be described in detail herein. In addition, the inverse quantization process is an inverse process of converting quantized coefficients into reconstructed transform coefficients by a quantizer, and the quantization process is an inverse process of inverse quantization, specifically converting transform coefficients into quantized coefficients by a quantizer. Wherein in the quantization process, one or more transform coefficients (even transform coefficients within a range of intervals) may be converted into one quantization coefficient; in the inverse quantization, the inverse quantization is calculated according to any one of the formulas (5) to (8).
It should be further noted that there are two states in each sub-quantizer (the first quantizer or the second quantizer), the first quantizer includes a first state and a second state, and the second quantizer includes a third state and a fourth state, so that the two sub-quantizers share four states. The quantization/inverse quantization process can determine which quantizer to use according to the state of the quantizer at the current moment; since the state of the quantizer is implemented by the state machine, in other words, it is also possible to decide which quantizer to use according to the state of the state machine at the current time.
Further, the state of the state machine is continuously updated. In some embodiments, the method may further comprise:
after the transformation coefficient is quantized, determining a migration state of the state machine according to the state of the state machine and the parity characteristic of the quantized coefficient;
and updating the migration state into the state of the state machine corresponding to the next quantization coefficient.
In a specific example, the determining the migration state of the state machine according to the state of the state machine and the parity characteristic of the quantization coefficient may include:
inquiring and obtaining the migration state of the state machine by using a preset state migration table according to the state of the state machine and the parity characteristic of the quantization coefficient;
the preset state transition table comprises a state of the state machine, parity characteristics of quantization coefficients and a corresponding relation between transition states.
In a more specific example, the preset state transition table is determined by performing a preset cost policy calculation based on the state of the state machine and the parity characteristic of the quantization coefficient, which is specifically described in the grid structure example shown in fig. 7. It should be noted that the state of the state machine is not limited to these four states and is not limited to state transitions according to the parity characteristic of the previous quantization coefficient, which is just a specific example, and the embodiment of the present application is not limited in any way.
In the embodiment of the application, quantization operation is performed on the transform coefficient, and the quantizer used is determined to be Q0 or Q1 according to the state of the state machine at the current moment. If the state at this time is state 0 and state 1, then the sub-quantizer Q0 is used; if the states at this time are state 2 and state 3, then the sub-quantizer Q1 is used. For each transform block, the initial state of the state machine is state 0. That is, the method may further include: the initial state of the state machine is set to the first state.
For example, the state corresponding to the next quantization coefficient may be determined according to the state of the state machine and the parity characteristic of the quantization coefficient according to the state machine or the state transition table shown in fig. 6 or according to the state transition relationship shown in fig. 11.
In other words, the technical solution of the embodiment of the present application provides an offset correction for 0 point of a quantizer in an even quantizer, where the corresponding reconstructed transform coefficient is not zero, but is a value very close to 0. In addition, the technical scheme of the embodiment of the application can be also applied to other standards, such as MPEG, AOM or any custom coefficient block coding and decoding standard.
The present embodiment provides an encoding method by determining a transform block of a current block; wherein the transform block comprises at least one transform coefficient; if the transformation coefficient selects a first quantizer to carry out quantization processing, determining a reconstruction transformation coefficient corresponding to the quantized coefficient 0 obtained after the quantization processing as a first reconstruction value; if the transformation coefficient selects a second quantizer to carry out quantization processing, determining a reconstruction transformation coefficient corresponding to the quantized coefficient 0 obtained after the quantization processing as a second reconstruction value; wherein the first reconstruction value is different from the second reconstruction value. In this way, the embodiment of the application adopts the dual quantization technical scheme formed by the first quantizer and the second quantizer, and also carries out offset correction on the corresponding reconstruction transformation coefficient under the condition that the quantization coefficient is 0, so that the reconstruction values obtained under the two quantizers are different (for example, one quantizer is zero, and the other quantizer is non-zero), thereby reducing quantization errors, improving the accuracy of the transformation coefficient and further improving the coding performance.
In still another embodiment of the present application, referring to fig. 13, a schematic diagram of the composition structure of an encoder 130 according to an embodiment of the present application is shown, based on the same inventive concept as the previous embodiment. As shown in fig. 13, the encoder 130 may include: a first determination unit 1301 and a quantization unit 1302; wherein,
A first determining unit 1301 configured to determine a transform block of the current block; wherein the transform block comprises at least one transform coefficient;
a quantization unit 1302, configured to determine, if the transform coefficient selects the first quantizer to perform quantization processing, that a reconstructed transform coefficient corresponding to the quantized coefficient obtained after quantization processing being 0 is a first reconstructed value; if the transformation coefficient selects a second quantizer to carry out quantization processing, determining a reconstruction transformation coefficient corresponding to the quantized coefficient 0 obtained after the quantization processing as a second reconstruction value; wherein the first reconstruction value is different from the second reconstruction value.
In some embodiments, the neighboring sample values of the current block include a left neighboring sample value and an up neighboring sample value of the current block.
In some embodiments, the first reconstruction value is 0 and the second reconstruction value is 1; alternatively, the first reconstruction value is 1 and the second reconstruction value is 0.
In some embodiments, referring to fig. 13, the encoder 130 may further include an encoding unit 1303 configured to encode quantized coefficients obtained by subjecting the transform block to quantization processing, and write the encoded quantized coefficients into a code stream.
In some embodiments, the first determining unit 1301 is further configured to determine a state of the state machine; and if the state of the state machine indicates that the first quantizer is selected, determining that the quantized coefficient obtained after quantization processing is selected from the first quantizer for inverse quantization processing; and if the state of the state machine indicates that the second quantizer is selected, the quantized coefficient obtained after the quantization processing is determined to be selected from the second quantizer for inverse quantization processing.
In some embodiments, the first determining unit 1301 is further configured to determine that the quantized coefficient obtained after the quantization processing is subjected to inverse quantization processing by using the formula (5) if the state of the state machine indicates that the first quantizer is selected; if the state of the state machine indicates that the second quantizer is selected, determining that the quantized coefficient obtained after quantization processing is subjected to inverse quantization processing by using a formula (6); wherein 2Δ represents the quantization step size, x represents the value of the quantized coefficient, coeff represents the value of the reconstructed transform coefficient.
In some embodiments, the first determining unit 1301 is further configured to determine that the quantized coefficient obtained after the quantization processing is subjected to inverse quantization processing by using the formula (7) if the state of the state machine indicates that the first quantizer is selected; if the state of the state machine indicates that the second quantizer is selected, determining that the quantized coefficient obtained after quantization processing is subjected to inverse quantization processing by using a formula (8); wherein 2Δ represents the quantization step size, x represents the value of the quantized coefficient, coeff represents the value of the reconstructed transform coefficient.
In some embodiments, the state machine includes four states; wherein the value of the first state is set to 0, the value of the second state is set to 1, the value of the third state is set to 2, and the value of the fourth state is set to 3;
Correspondingly, the first determining unit 1301 is further configured to determine that the state of the state machine indicates that the first quantizer is selected if the state machine is in the first state and the second state; and if the state machine is in the third state and the fourth state, determining that the state of the state machine indicates to select a second quantizer.
In some embodiments, referring to fig. 13, the encoder 130 may further include a first updating unit 1304;
the first determining unit 1301 is further configured to determine, after performing quantization processing on the transform coefficient, a migration state of the state machine according to a state of the state machine and parity characteristics of the quantized coefficient;
a first updating unit 1304, configured to update the migration state to the state of the state machine corresponding to the next quantization coefficient.
In some embodiments, the first determining unit 1301 is further configured to query, according to the state of the state machine and the parity characteristic of the quantization coefficient, a migration state of the state machine by using a preset state migration table; the preset state transition table comprises a state of the state machine, parity characteristics of quantization coefficients and a corresponding relation between transition states.
In some embodiments, the preset state transition table is determined by a preset cost policy calculation based on a state of the state machine and a parity characteristic of the quantization coefficient.
In some embodiments, referring to fig. 13, the encoder 130 may further include a first setting unit 1305 configured to set an initial state of the state machine to the first state.
In some embodiments, the first determining unit 1301 is further configured to determine a current block in the video image and a prediction mode parameter of the current block; and predicting the current block by utilizing the prediction mode parameter to determine a prediction block of the current block; obtaining a residual block of the current block according to the current block and the prediction block; and carrying out transformation processing on the residual block to obtain a transformation block of the current block.
In some embodiments, the encoding unit 1303 is further configured to write the prediction mode parameter into a bitstream.
In some embodiments, the first reconstruction value is set to +1 and the second reconstruction value is set to-1; alternatively, the first reconstruction value is set to-1 and the second reconstruction value is set to +1.
In some embodiments, the first reconstruction value is set to +Δ/(2ζ), and the second reconstruction value is set to- Δ/(2ζ); alternatively, the first reconstruction value is set to- Δ/(2ζ), the second reconstruction value is set to +Δ/(2ζ), N is a number greater than or equal to 1, and 2Δ represents a quantization step size.
It will be appreciated that in embodiments of the application, a "unit" may be a part of a circuit, a part of a processor, a part of a program or software, etc., and may of course also be a module, or may be non-modular. Furthermore, the components in the present embodiment may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional modules.
The integrated units, if implemented in the form of software functional modules, may be stored in a computer-readable storage medium, if not sold or used as separate products, and based on such understanding, the technical solution of the present embodiment may be embodied essentially or partly in the form of a software product, which is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, a server, or a network device, etc.) or processor to perform all or part of the steps of the method described in the present embodiment. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
Accordingly, an embodiment of the present application provides a computer storage medium, for use in an encoder 130, storing a computer program which, when executed by a first processor, implements a method according to any of the preceding embodiments.
Based on the above-mentioned composition of the encoder 130 and the computer storage medium, referring to fig. 14, a specific hardware structure diagram of the encoder 130 according to an embodiment of the present application is shown. As shown in fig. 14, may include: a first communication interface 1401, a first memory 1402 and a first processor 1403; the various components are coupled together by a first bus system 1404. It is appreciated that the first bus system 1404 is used to enable connection communications between these components. The first bus system 1404 includes a power bus, a control bus, and a status signal bus in addition to the data bus. But for clarity of illustration, the various buses are labeled as first bus system 1404 in fig. 14. Wherein,
a first communication interface 1401, configured to receive and transmit signals during information transceiving with other external network elements;
a first memory 1402 for storing a computer program capable of running on the first processor 1403;
A first processor 1403 for, when running the computer program, performing:
determining a transformation block of the current block; wherein the transform block comprises at least one transform coefficient;
if the transformation coefficient selects a first quantizer to carry out quantization processing, determining a reconstruction transformation coefficient corresponding to the quantized coefficient 0 obtained after the quantization processing as a first reconstruction value;
if the transformation coefficient selects a second quantizer to carry out quantization processing, determining a reconstruction transformation coefficient corresponding to the quantized coefficient 0 obtained after the quantization processing as a second reconstruction value; wherein the first reconstruction value is different from the second reconstruction value.
It is to be appreciated that the first memory 1402 in embodiments of the present application can be either volatile memory or nonvolatile memory, or can include both volatile and nonvolatile memory. The nonvolatile Memory may be a Read-Only Memory (ROM), a Programmable ROM (PROM), an Erasable PROM (EPROM), an Electrically Erasable EPROM (EEPROM), or a flash Memory. The volatile memory may be random access memory (Random Access Memory, RAM) which acts as an external cache. By way of example, and not limitation, many forms of RAM are available, such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double Data Rate SDRAM (Double Data Rate SDRAM), enhanced SDRAM (ESDRAM), synchronous DRAM (SLDRAM), and Direct RAM (DRRAM). The first memory 1402 of the systems and methods described herein is intended to comprise, without being limited to, these and any other suitable types of memory.
While the first processor 1403 may be an integrated circuit chip with signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware or instructions in software form in the first processor 1403. The first processor 1403 described above may be a general purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), an off-the-shelf programmable gate array (Field Programmable Gate Array, FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components. The disclosed methods, steps, and logic blocks in the embodiments of the present application may be implemented or performed. 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 connection with the embodiments of the present application may be embodied directly in the execution of a hardware decoding processor, or in the execution of a combination of hardware and software modules in a decoding processor. The software modules may be located in a random access memory, flash memory, read only memory, programmable read only memory, or electrically erasable programmable memory, registers, etc. as well known in the art. Which is located in a first memory 1402 and a first processor 1403 reads information in the first memory 1402 and in combination with its hardware performs the steps of the above method.
It is to be understood that the embodiments described herein may be implemented in hardware, software, firmware, middleware, microcode, or a combination thereof. For a hardware implementation, the processing units may be implemented within one or more application specific integrated circuits (Application Specific Integrated Circuits, ASIC), digital signal processors (Digital Signal Processing, DSP), digital signal processing devices (DSP devices, DSPD), programmable logic devices (Programmable Logic Device, PLD), field programmable gate arrays (Field-Programmable Gate Array, FPGA), general purpose processors, controllers, microcontrollers, microprocessors, other electronic units designed to perform the functions described herein, or a combination thereof. For a software implementation, the techniques described herein may be implemented with modules (e.g., procedures, functions, and so on) that perform the functions described herein. The software codes may be stored in a memory and executed by a processor. The memory may be implemented within the processor or external to the processor.
Optionally, as another embodiment, the first processor 1403 is further configured to perform the method of any of the previous embodiments when the computer program is run.
The present embodiment provides an encoder, which may include a first determination unit and a quantization unit. In this way, the embodiment of the application adopts the dual quantization technical scheme formed by the first quantizer and the second quantizer, and also carries out offset correction on the corresponding reconstruction transformation coefficient under the condition that the quantization coefficient is 0, so that the reconstruction values obtained under the two quantizers are different (for example, one quantizer is zero, and the other quantizer is non-zero), thereby reducing quantization errors, improving the accuracy of the transformation coefficient and further improving the coding performance.
In still another embodiment of the present application, based on the same inventive concept as the previous embodiment, referring to fig. 15, a schematic diagram of the composition structure of a decoder 150 according to an embodiment of the present application is shown. As shown in fig. 15, the decoder 150 may include: a parsing unit 1501 and an inverse quantization unit 1502; wherein,
an parsing unit 1501 configured to parse the code stream and determine a quantization coefficient of the current block;
an inverse quantization unit 1502 configured to determine that, if the quantized coefficient selects the first quantizer to perform inverse quantization, a reconstructed transform coefficient obtained after the inverse quantization is a first reconstructed value if the quantized coefficient is 0; and if the quantized coefficient selects a second quantizer to perform inverse quantization processing, determining that the reconstructed transform coefficient obtained after the inverse quantization processing is a second reconstructed value under the condition that the quantized coefficient is 0; wherein the first reconstruction value is different from the second reconstruction value.
In some embodiments, the first reconstruction value is 0 and the second reconstruction value is 1; alternatively, the first reconstruction value is 1 and the second reconstruction value is 0.
In some embodiments, referring to fig. 15, the decoder 150 may further include a second determination unit 1503;
the parsing unit 1501 is further configured to parse the code stream and obtain related information of the current block; wherein the related information includes at least one of: identification information, scanning sequence information, initial scanning position and quantization parameters;
the second determining unit 1503 is configured to determine the quantization coefficient of the current block according to the related information.
In some embodiments, the second determining unit 1503 is further configured to determine a state of the state machine; and if the state of the state machine indicates that the first quantizer is selected, determining that the quantized coefficient selects the first quantizer for inverse quantization; and if the state of the state machine indicates that the second quantizer is selected, determining that the quantized coefficient selects the second quantizer for inverse quantization.
In some embodiments, the second determining unit 1503 is further configured to determine to perform the inverse quantization process using the formula (5) if the state of the state machine indicates that the first quantizer is selected; if the state of the state machine indicates that the second quantizer is selected, determining to perform inverse quantization processing by using the formula (6); wherein 2Δ represents the quantization step size, x represents the value of the quantized coefficient, coeff represents the value of the reconstructed transform coefficient.
In some embodiments, the second determining unit 1503 is further configured to determine to perform the inverse quantization process using the formula (7) if the state of the state machine indicates that the first quantizer is selected; if the state of the state machine indicates that the second quantizer is selected, determining to perform inverse quantization processing by using the formula (8); wherein 2Δ represents the quantization step size, x represents the value of the quantized coefficient, coeff represents the value of the reconstructed transform coefficient.
In some embodiments, the state machine includes four states; wherein the value of the first state is set to 0, the value of the second state is set to 1, the value of the third state is set to 2, and the value of the fourth state is set to 3;
correspondingly, the second determining unit 1503 is further configured to determine that the state of the state machine indicates that the first quantizer is selected if the state machine is in the first state and the second state; and if the state machine is in the third state and the fourth state, determining that the state of the state machine indicates to select a second quantizer.
In some embodiments, referring to fig. 15, the decoder 150 may further include a second updating unit 1504;
the second determining unit 1503 is further configured to determine a transition state of the state machine according to the state of the state machine and the parity characteristic of the quantized coefficient after performing dequantization processing on the quantized coefficient;
The second updating unit 1504 is further configured to update the migration state to the state of the state machine corresponding to the next quantization coefficient.
In some embodiments, the second determining unit 1503 is further configured to query, according to the state of the state machine and the parity characteristic of the quantization coefficient, a migration state of the state machine by using a preset state migration table; the preset state transition table comprises a state of the state machine, parity characteristics of quantization coefficients and a corresponding relation between transition states.
In some embodiments, referring to fig. 15, the decoder 150 may further include a second setting unit 1505 configured to set an initial state of the state machine to the first state.
In some embodiments, the second determining unit 1503 is further configured to determine a reconstructed transform block according to the obtained reconstructed transform coefficient after performing inverse quantization on all quantization coefficients of the current block; and carrying out inverse transformation processing on the reconstructed transformation block to obtain a reconstructed residual block.
In some embodiments, the parsing unit 1501 is further configured to parse the code stream to obtain prediction mode parameters;
the second determining unit 1503 is further configured to perform prediction processing on the current block by using the prediction mode parameter to obtain a predicted block of the current block; and determining a reconstructed block of the current block according to the reconstructed residual block and the prediction block.
In some embodiments, the first reconstruction value is set to +1 and the second reconstruction value is set to-1; alternatively, the first reconstruction value is set to-1 and the second reconstruction value is set to +1.
In some embodiments, the first reconstruction value is set to +Δ/(2ζ), and the second reconstruction value is set to- Δ/(2ζ); alternatively, the first reconstruction value is set to- Δ/(2ζ), the second reconstruction value is set to +Δ/(2ζ), N is a number greater than or equal to 1, and 2Δ represents a quantization step size.
It will be appreciated that in this embodiment, the "unit" may be a part of a circuit, a part of a processor, a part of a program or software, etc., and may of course be a module, or may be non-modular. Furthermore, the components in the present embodiment may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional modules.
The integrated units may be stored in a computer readable storage medium if implemented in the form of software functional modules, and not sold or used as stand-alone products. Based on such understanding, the present embodiment provides a computer storage medium, applied to the decoder 150, storing a computer program that when executed by the second processor implements the method of any of the previous embodiments.
Based on the above-mentioned composition of the decoder 150 and the computer storage medium, referring to fig. 16, a specific hardware structure diagram of the decoder 150 according to an embodiment of the present application is shown. As shown in fig. 16, may include: a second communication interface 1601, a second memory 1602, and a second processor 1603; the various components are coupled together by a second bus system 1604. It is appreciated that the second bus system 1604 is used to enable connected communications between these components. The second bus system 1604 includes a power bus, a control bus, and a status signal bus in addition to the data bus. But for clarity of illustration, the various buses are labeled as a second bus system 1604 in fig. 16. Wherein,
a second communication interface 1601, configured to receive and send signals during information receiving and sending with other external network elements;
a second memory 1602 for storing a computer program capable of running on the second processor 1603;
a second processor 1603 for, when running the computer program, performing:
analyzing the code stream and determining the quantization coefficient of the current block;
if the quantized coefficient selects a first quantizer to perform inverse quantization processing, determining that a reconstructed transformation coefficient obtained after the inverse quantization processing is a first reconstruction value under the condition that the quantized coefficient is 0;
If the quantized coefficient selects a second quantizer to perform inverse quantization processing, determining that a reconstructed transform coefficient obtained after the inverse quantization processing is a second reconstructed value under the condition that the quantized coefficient is 0;
wherein the first reconstruction value is different from the second reconstruction value.
Optionally, as another embodiment, the second processor 1603 is further configured to perform the method of any of the preceding embodiments when running the computer program.
It is appreciated that the second memory 1602 is similar to the hardware functionality of the first memory 1402 and the second processor 1603 is similar to the hardware functionality of the first processor 1403; and will not be described in detail herein.
The present embodiment provides a decoder that may include a parsing unit and an inverse quantization unit. In this way, the application adopts the dual quantization technical scheme composed of the first quantizer and the second quantizer, and also carries out offset correction on the corresponding reconstruction transformation coefficient under the condition that the quantization coefficient is 0, so that the reconstruction values obtained under the two quantizers are different (for example, one quantizer is zero, and the other quantizer is non-zero), thereby reducing quantization errors, improving the accuracy of the reconstruction transformation coefficient and further improving decoding performance.
It should be noted that, in the present application, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The foregoing embodiment numbers of the present application are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments.
The methods disclosed in the method embodiments provided by the application can be arbitrarily combined under the condition of no conflict to obtain a new method embodiment.
The features disclosed in the several product embodiments provided by the application can be combined arbitrarily under the condition of no conflict to obtain new product embodiments.
The features disclosed in the embodiments of the method or the apparatus provided by the application can be arbitrarily combined without conflict to obtain new embodiments of the method or the apparatus.
The foregoing is merely illustrative of the present application, and the present application is not limited thereto, and any person skilled in the art will readily recognize that variations or substitutions are within the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.
Industrial applicability
In the embodiment of the application, at the encoder side, a transformation block of a current block is determined; wherein the transform block comprises at least one transform coefficient; if the transformation coefficient selects a first quantizer to carry out quantization processing, determining a reconstruction transformation coefficient corresponding to the quantized coefficient 0 obtained after the quantization processing as a first reconstruction value; if the transformation coefficient selects a second quantizer to carry out quantization processing, determining a reconstruction transformation coefficient corresponding to the quantized coefficient 0 obtained after the quantization processing as a second reconstruction value; wherein the first reconstruction value is different from the second reconstruction value. At the decoder side, analyzing the code stream and determining the quantization coefficient of the current block; if the quantized coefficient selects a first quantizer to perform inverse quantization processing, determining that a reconstructed transformation coefficient obtained after the inverse quantization processing is a first reconstruction value under the condition that the quantized coefficient is 0; if the quantized coefficient selects a second quantizer to perform inverse quantization processing, determining that a reconstructed transform coefficient obtained after the inverse quantization processing is a second reconstructed value under the condition that the quantized coefficient is 0; wherein the first reconstruction value is different from the second reconstruction value. In this way, the application adopts the dual quantization technical scheme composed of the first quantizer and the second quantizer, and also carries out offset correction for the corresponding reconstruction transformation coefficient under the condition that the quantization coefficient is 0, so that the reconstruction values obtained under the two quantizers are different (for example, one quantizer is zero, and the other quantizer is non-zero), thereby reducing quantization error, improving accuracy of the reconstruction transformation coefficient and further improving coding and decoding performance.

Claims (34)

  1. A decoding method applied to a decoder, the method comprising:
    analyzing the code stream and determining the quantization coefficient of the current block;
    if the quantized coefficient selects a first quantizer to perform inverse quantization processing, determining that a reconstructed transformation coefficient obtained after the inverse quantization processing is a first reconstruction value under the condition that the quantized coefficient is 0;
    if the quantized coefficient selects a second quantizer to perform inverse quantization processing, determining that a reconstructed transform coefficient obtained after the inverse quantization processing is a second reconstructed value under the condition that the quantized coefficient is 0;
    wherein the first reconstruction value is different from the second reconstruction value.
  2. The method of claim 1, wherein the first reconstruction value is 0 and the second reconstruction value is 1; alternatively, the first reconstruction value is 1 and the second reconstruction value is 0.
  3. The method of claim 1, wherein the parsing the bitstream, determining quantization coefficients for the current block, comprises:
    analyzing the code stream to obtain the related information of the current block; wherein the related information includes at least one of: identification information, scanning sequence information, initial scanning position and quantization parameters;
    and determining the quantization coefficient of the current block according to the related information.
  4. The method of claim 1, wherein the method further comprises:
    determining the state of a state machine;
    if the state of the state machine indicates that the first quantizer is selected, determining that the quantized coefficient selects the first quantizer for inverse quantization;
    and if the state of the state machine indicates that the second quantizer is selected, determining that the quantized coefficient selects the second quantizer for inverse quantization.
  5. The method of claim 4, wherein the method further comprises:
    if the state of the state machine indicates that the first quantizer is selected, determining to perform inverse quantization processing by using the following formula;
    coeff=x·2Δ
    if the state of the state machine indicates that the second quantizer is selected, determining to perform inverse quantization processing by using the following formula;
    wherein 2Δ represents the quantization step size, x represents the value of the quantized coefficient, coeff represents the value of the reconstructed transform coefficient.
  6. The method of claim 4, wherein the method further comprises:
    if the state of the state machine indicates that the first quantizer is selected, determining to perform inverse quantization processing by using the following formula;
    if the state of the state machine indicates that the second quantizer is selected, determining to perform inverse quantization processing by using the following formula;
    wherein 2Δ represents the quantization step size, x represents the value of the quantized coefficient, coeff represents the value of the reconstructed transform coefficient.
  7. The method of claim 4, wherein the state machine comprises four states; wherein the value of the first state is set to 0, the value of the second state is set to 1, the value of the third state is set to 2, and the value of the fourth state is set to 3;
    the method further comprises the steps of:
    if the state machine is in the first state and the second state, determining that the state of the state machine indicates to select a first quantizer;
    and if the state machine is in the third state and the fourth state, determining that the state of the state machine indicates to select a second quantizer.
  8. The method of claim 7, wherein the method further comprises:
    after the quantization coefficient is subjected to inverse quantization processing, determining a migration state of the state machine according to the state of the state machine and the parity characteristic of the quantization coefficient;
    and updating the migration state into the state of the state machine corresponding to the next quantization coefficient.
  9. The method of claim 8, wherein the determining the state machine's migration state based on the state of the state machine and the parity characteristic of the quantization coefficients comprises:
    inquiring and obtaining the migration state of the state machine by using a preset state migration table according to the state of the state machine and the parity characteristic of the quantization coefficient;
    The preset state transition table comprises a state of the state machine, parity characteristics of quantization coefficients and a corresponding relation between transition states.
  10. The method of claim 7, wherein the method further comprises:
    setting the initial state of the state machine to be the first state.
  11. The method according to any one of claims 1 to 10, wherein the method further comprises:
    after all the quantized coefficients of the current block are subjected to inverse quantization, determining a reconstructed transformation block according to the obtained reconstructed transformation coefficients;
    and carrying out inverse transformation on the reconstructed transformation block to obtain a reconstructed residual block.
  12. The method of claim 11, wherein the method further comprises:
    analyzing the code stream to obtain prediction mode parameters;
    performing prediction processing on the current block by using the prediction mode parameters to obtain a prediction block of the current block;
    and determining a reconstruction block of the current block according to the reconstruction residual block and the prediction block.
  13. The method of claim 1, wherein the first reconstruction value is set to +1 and the second reconstruction value is set to-1; alternatively, the first reconstruction value is set to-1 and the second reconstruction value is set to +1.
  14. The method of claim 1, wherein the first reconstruction value is set to +Δ/(2 ζ), and the second reconstruction value is set to- Δ/(2 ζ); alternatively, the first reconstruction value is set to- Δ/(2ζ), the second reconstruction value is set to +Δ/(2ζ), N is a number greater than or equal to 1, and 2Δ represents a quantization step size.
  15. An encoding method applied to an encoder, the method comprising:
    determining a transformation block of the current block; wherein the transform block comprises at least one transform coefficient;
    if the transformation coefficient selects a first quantizer to carry out quantization processing, determining a reconstruction transformation coefficient corresponding to the quantized coefficient 0 obtained after the quantization processing as a first reconstruction value;
    if the transformation coefficient selects a second quantizer to carry out quantization processing, determining a reconstruction transformation coefficient corresponding to the quantized coefficient 0 obtained after the quantization processing as a second reconstruction value; wherein the first reconstruction value is different from the second reconstruction value.
  16. The method of claim 15, wherein the first reconstruction value is 0 and the second reconstruction value is 1; alternatively, the first reconstruction value is 1 and the second reconstruction value is 0.
  17. The method of claim 15, wherein the method further comprises:
    And coding the quantized coefficients obtained after the quantization processing of the transformation blocks, and writing the quantized coefficients into a code stream.
  18. The method of claim 15, wherein the method further comprises:
    determining the state of a state machine;
    if the state of the state machine indicates that the first quantizer is selected, determining that the quantized coefficient obtained after quantization processing is selected from the first quantizer for inverse quantization processing;
    and if the state of the state machine indicates that the second quantizer is selected, the quantized coefficient obtained after the quantization processing is determined to be selected from the second quantizer for inverse quantization processing.
  19. The method of claim 18, wherein the method further comprises:
    if the state of the state machine indicates that the first quantizer is selected, determining that the quantized coefficient obtained after quantization processing is subjected to inverse quantization processing by using the following formula;
    coeff=x·2Δ
    if the state of the state machine indicates that the second quantizer is selected, determining that the quantized coefficient obtained after quantization processing is subjected to inverse quantization processing by using the following formula;
    wherein 2Δ represents the quantization step size, x represents the value of the quantized coefficient, coeff represents the value of the reconstructed transform coefficient.
  20. The method of claim 18, wherein the method further comprises:
    if the state of the state machine indicates that the first quantizer is selected, determining that the quantized coefficient obtained after quantization processing is subjected to inverse quantization processing by using the following formula;
    If the state of the state machine indicates that the second quantizer is selected, determining that the quantized coefficient obtained after quantization processing is subjected to inverse quantization processing by using the following formula;
    wherein 2Δ represents the quantization step size, x represents the value of the quantized coefficient, coeff represents the value of the reconstructed transform coefficient.
  21. The method of claim 18, wherein the state machine comprises four states; wherein the value of the first state is set to 0, the value of the second state is set to 1, the value of the third state is set to 2, and the value of the fourth state is set to 3;
    the method further comprises the steps of:
    if the state machine is in the first state and the second state, determining that the state of the state machine indicates to select a first quantizer;
    and if the state machine is in the third state and the fourth state, determining that the state of the state machine indicates to select a second quantizer.
  22. The method of claim 21, wherein the method further comprises:
    after the transformation coefficient is quantized, determining a migration state of the state machine according to the state of the state machine and the parity characteristic of the quantized coefficient;
    and updating the migration state into the state of the state machine corresponding to the next quantization coefficient.
  23. The method of claim 22, wherein the determining the state machine's migration state based on the state of the state machine and the parity characteristic of the quantization coefficients comprises:
    inquiring and obtaining the migration state of the state machine by using a preset state migration table according to the state of the state machine and the parity characteristic of the quantization coefficient;
    the preset state transition table includes a corresponding relation between states of the state machine, parity characteristics of quantization coefficients and transition states.
  24. The method of claim 23, wherein the preset state transition table is determined by a preset cost policy calculation based on a state of the state machine and a parity characteristic of the quantization coefficients.
  25. The method of claim 21, wherein the method further comprises:
    setting the initial state of the state machine to be the first state.
  26. The method of any of claims 15 to 25, wherein the determining a transform block of the current block comprises:
    determining a current block in a video image and a prediction mode parameter of the current block;
    performing prediction processing on the current block by utilizing the prediction mode parameters, and determining a prediction block of the current block;
    Obtaining a residual block of the current block according to the current block and the prediction block;
    and carrying out transformation processing on the residual block to obtain a transformation block of the current block.
  27. The method of claim 26, wherein the method further comprises:
    and writing the prediction mode parameters into a code stream.
  28. The method of claim 15, wherein the first reconstruction value is set to +1 and the second reconstruction value is set to-1; alternatively, the first reconstruction value is set to-1 and the second reconstruction value is set to +1.
  29. The method of claim 15, wherein the first reconstruction value is set to +Δ/(2 n), and the second reconstruction value is set to- Δ/(2 n); alternatively, the first reconstruction value is set to- Δ/(2ζ), the second reconstruction value is set to +Δ/(2ζ), N is a number greater than or equal to 1, and 2Δ represents a quantization step size.
  30. An encoder, the encoder comprising a first determination unit and a quantization unit; wherein,
    the first determining unit is configured to determine a transformation block of the current block; wherein the transform block comprises at least one transform coefficient;
    the quantization unit is configured to determine that a reconstructed transform coefficient corresponding to a quantized coefficient 0 obtained after quantization processing is a first reconstructed value if the transform coefficient is quantized by selecting a first quantizer; if the transformation coefficient selects a second quantizer to carry out quantization processing, determining a reconstruction transformation coefficient corresponding to the quantized coefficient 0 obtained after the quantization processing as a second reconstruction value; wherein the first reconstruction value is different from the second reconstruction value.
  31. An encoder, the encoder comprising a first memory and a first processor; wherein,
    the first memory is used for storing a computer program capable of running on the first processor;
    the first processor being configured to perform the method of any of claims 15 to 29 when the computer program is run.
  32. A decoder comprising a parsing unit and an inverse quantization unit; wherein,
    the analysis unit is configured to analyze the code stream and determine the quantization coefficient of the current block;
    the inverse quantization unit is configured to determine that a reconstructed transform coefficient obtained after the inverse quantization is a first reconstructed value if the quantized coefficient is subjected to inverse quantization by selecting a first quantizer; and if the quantized coefficient selects a second quantizer to perform inverse quantization processing, determining that the reconstructed transform coefficient obtained after the inverse quantization processing is a second reconstructed value under the condition that the quantized coefficient is 0; wherein the first reconstruction value is different from the second reconstruction value.
  33. A decoder, wherein the decoder comprises a second memory and a second processor; wherein,
    the second memory is used for storing a computer program capable of running on the second processor;
    The second processor being adapted to perform the method of any of claims 1 to 14 when the computer program is run.
  34. A computer storage medium storing a computer program which when executed implements the method of any one of claims 1 to 14 or implements the method of any one of claims 15 to 29.
CN202180093813.8A 2021-02-22 2021-03-04 Encoding method, decoding method, encoder, decoder, and storage medium Pending CN116888960A (en)

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
CN202110199674 2021-02-22
CN2021101996749 2021-02-22
PCT/CN2021/079170 WO2022174478A1 (en) 2021-02-22 2021-03-04 Encoding method, decoding method, encoder, decoder, and storage medium

Publications (1)

Publication Number Publication Date
CN116888960A true CN116888960A (en) 2023-10-13

Family

ID=82932076

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202180093813.8A Pending CN116888960A (en) 2021-02-22 2021-03-04 Encoding method, decoding method, encoder, decoder, and storage medium

Country Status (2)

Country Link
CN (1) CN116888960A (en)
WO (1) WO2022174478A1 (en)

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7580584B2 (en) * 2003-07-18 2009-08-25 Microsoft Corporation Adaptive multiple quantization
US11153594B2 (en) * 2016-08-29 2021-10-19 Apple Inc. Multidimensional quantization techniques for video coding/decoding systems
US11019346B2 (en) * 2018-07-02 2021-05-25 Qualcomm Incorporated Coefficient coding with grouped bypass remaining levels for dependent quantization
EP3742730A1 (en) * 2019-05-20 2020-11-25 InterDigital VC Holdings, Inc. Scalar quantizer decision scheme for dependent scalar quantization

Also Published As

Publication number Publication date
WO2022174478A1 (en) 2022-08-25

Similar Documents

Publication Publication Date Title
CN108605126B (en) Method and apparatus for filtering decoded blocks of video data and storage medium
TWI818064B (en) Quantized difference used for weighting parameters derivation in bilateral filters
US11190765B2 (en) Method and apparatus for video encoding and decoding using pattern-based block filtering
CN110933411A (en) Selection of adjacent neighboring blocks for intra-coding
US11979554B2 (en) Intra prediction-based video signal processing method and device
CN112075082A (en) Method and apparatus for video encoding and decoding for CABAC-based neural network implementation
US11683505B2 (en) Method and a device for picture encoding and decoding
KR20140098209A (en) Largest coding unit (lcu) or partition-based syntax for adaptive loop filter and sample adaptive offset in video coding
JP2022538747A (en) Method and system for processing luma and chroma signals
CN110944198A (en) Chroma mode intra coding
EP3462744A1 (en) Method and apparatus for encoding a picture block
Zhang et al. New chroma intra prediction modes based on linear model for HEVC
US10764577B2 (en) Non-MPM mode coding for intra prediction in video coding
CN116888960A (en) Encoding method, decoding method, encoder, decoder, and storage medium
CN113497935A (en) Video coding and decoding method and device
CN114598873B (en) Decoding method and device for quantization parameter
RU2817405C1 (en) Method, equipment and devices for encoding and decoding
WO2022179414A1 (en) Transform and quantization on non-dyadic blocks
WO2022174762A1 (en) Transforms on non-dyadic blocks
US20240031613A1 (en) Duplicate partitioning prevention
US20230396779A1 (en) Residual coding on non-dyadic blocks
WO2022193394A1 (en) Coefficient coding/decoding method, encoder, decoder, and computer storage medium
WO2022188239A1 (en) Coefficient coding/decoding method, encoder, decoder, and computer storage medium
CN116998151A (en) Encoding method, decoding method, encoder, decoder and storage medium
JP2024513551A (en) Residual and coefficient coding decoding for video coding and decoding

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination