CN116998151A - 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
CN116998151A
CN116998151A CN202180093807.2A CN202180093807A CN116998151A CN 116998151 A CN116998151 A CN 116998151A CN 202180093807 A CN202180093807 A CN 202180093807A CN 116998151 A CN116998151 A CN 116998151A
Authority
CN
China
Prior art keywords
block
quantization
quantized
scanning area
coefficient
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
CN202180093807.2A
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 CN116998151A publication Critical patent/CN116998151A/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
    • H04N19/126Details of normalisation or weighting functions, e.g. normalisation matrices or variable uniform quantisers

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 encoding method comprises the following steps: determining a transformation block corresponding to a current block in an image to be processed; when the scanning area of the transformation block meets the trigger condition of dual quantization, quantizing coefficients in the scanning area based on a first quantization mode; the scanning area is a minimum rectangular area covering all non-zero coefficients in the transformation block; the first quantization mode is dual quantization; and encoding the quantized block after quantization and writing the encoded block into a code stream.

Description

Encoding method, decoding method, encoder, decoder and storage medium
Cross Reference to Related Applications
The present application claims priority from chinese patent office, application number 202110200048.7, application name "a method of encoding, method of decoding, encoder, decoder and storage medium" filed 22 at 2021, 02, the entire contents of which are incorporated herein by reference.
Technical Field
The present application relates to the field of 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, the dual quantization technology is generally applied to all the global coefficient blocks at present; however, the dual quantization is adopted for all the global coefficient blocks, and the improvement of the coding performance cannot be brought.
Disclosure of Invention
The application provides an encoding method, a decoding method, an encoder, a decoder and a storage medium, wherein when the triggering condition of dual quantization is met, the first quantization mode, namely dual quantization is adopted to quantize coefficients in a scanning area, namely, the dual quantization is not applied to all global coefficient blocks any more, and a limiting condition is given for using the dual quantization, so that the encoding performance is improved.
The technical scheme of the application is realized as follows:
in a first aspect, an embodiment of the present application provides an encoding method, including:
determining a transformation block corresponding to a current block in an image to be processed;
when a scanning area of the transformation block meets a trigger condition of dual quantization, quantizing coefficients in the scanning area based on a first quantization mode; the scanning area is a minimum rectangular area covering all non-zero coefficients in the transformation block; the first quantization mode is dual quantization;
and encoding the quantized block after quantization and writing the encoded block into a code stream.
In a second aspect, an embodiment of the present application provides a decoding method, including:
analyzing the code stream to obtain a quantized block;
when the scanning area of the quantization block meets the trigger condition of dual quantization and inverse quantization, performing inverse quantization on the quantization block based on a first inverse quantization mode; the scanning area is the smallest rectangular area covering all non-zero coefficients in the quantization block, and the first inverse quantization mode is dual quantization and inverse quantization.
In a third aspect, an embodiment of the present application provides an encoder, including a determining unit, a first processing unit, and an encoding unit; wherein,
The determining unit is configured to determine a transformation block corresponding to a current block in the image to be processed;
the first processing unit is configured to quantize coefficients in a scanning area of the transformation block based on a first quantization mode when the scanning area meets a trigger condition of dual quantization; the scanning area is a minimum rectangular area covering all non-zero coefficients in the transformation block; the first quantization mode is dual quantization;
the encoding unit is configured to encode the quantized block after quantization and write the quantized block into a code stream.
In a fourth aspect, an embodiment of the present application provides a decoder, including a decoding unit and a second processing unit; wherein,
the decoding unit is configured to parse the code stream to obtain a quantized block;
the second processing unit is configured to dequantize the quantized block based on a first dequantization mode when a scanning area of the quantized block meets a trigger condition of dequantization of dual quantization; the scanning area is the smallest rectangular area covering all non-zero coefficients in the quantization block, and the first inverse quantization mode is dual quantization and inverse quantization.
In a fifth 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 first aspect when the computer program is run.
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 second 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 first aspect or when executed by a second processor implements the method according to the second aspect.
The embodiment of the application provides an encoding method, a decoding method, an encoder, a decoder and a storage medium, wherein the encoding method comprises the steps of determining a transformation block corresponding to a current block in an image to be processed; when the scanning area of the transformation block meets the trigger condition of dual quantization, quantizing coefficients in the scanning area based on a first quantization mode; the scanning area is a minimum rectangular area covering all non-zero coefficients in the transformation block; the first quantization mode is dual quantization; encoding the quantized block after quantization and writing the encoded block into a code stream; in the application, when the trigger condition of dual quantization is satisfied, the first quantization mode, namely dual quantization is adopted to quantize the coefficients in the scanning area, that is, the dual quantization is not applied to all the global coefficient blocks any more, and the limiting condition is given for using the dual quantization, thereby improving the coding performance.
Drawings
FIG. 1 is a schematic diagram of a coding framework provided in the related art;
FIG. 2 is a schematic flow chart of an encoding method according to an embodiment of the present application;
FIG. 3 is a schematic flow chart of an encoding method according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of a dual quantizer Q0 and Q1 and corresponding reconstructed transform coefficients thereof according to an embodiment of the present application;
FIG. 5 is a schematic diagram of a scan region within a transform block according to an embodiment of the present application;
FIG. 6 is a schematic flow chart of an encoding method according to an embodiment of the present application;
FIG. 7 is a state transition diagram of a quantizer used for decision quantization coefficients according to an embodiment of the present application;
FIG. 8 is a schematic diagram of a state transition table according to an embodiment of the present application;
FIG. 9 is a diagram of 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. 10 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. 11 is a schematic flow chart of a decoding method according to an embodiment of the present application;
fig. 12 is a flow chart of a decoding method according to an embodiment of the present application;
Fig. 13 is a schematic flow chart of a decoding method according to an embodiment of the present application;
FIG. 14 is a schematic diagram of an encoder according to an embodiment of the present application;
fig. 15 is a schematic structural diagram of a decoder according to an embodiment of the present application;
FIG. 16 is a schematic diagram of a hardware configuration of an encoder according to an embodiment of the present application;
fig. 17 is a schematic diagram of a hardware structure of a decoder according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. It is to be understood that the specific embodiments described herein are merely illustrative of the application and not limiting of the application. It should be noted that, for convenience of description, only a portion related to the related application is shown in the drawings.
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)
The related art scheme for current video coding will be described below.
Digital video compression technology mainly compresses huge digital video data so as to facilitate transmission, storage and the like. 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.
Referring to fig. 1, video compression includes a plurality of modules such as loop filtering and entropy coding for reducing or extracting intra-frame prediction (spatial domain) and/or inter-frame prediction (temporal domain) of video intrinsic redundancy, and for increasing subjective and objective reconstruction quality by quantization and inverse quantization of changes in residual information. The mainstream video compression standards mostly describe block-based compression techniques. A video slice, a frame of pictures or a series of pictures is divided into basic units in coding tree units (CodingTreeUnit, CTU), on the basis of which it is further divided into blocks in Coding Units (CU). 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 quantized and entropy-encoded into a code stream by transformation in units of blocks, as opposed to a prediction signal.
Embodiments of the present application will be described in detail below with reference to the accompanying drawings.
In one embodiment of the present application, referring to fig. 2, a schematic flow chart of an encoding method provided by the embodiment of the present application is shown. As shown in fig. 2, the encoding method is applied to an encoder, and the encoding method may include:
S201: and determining a transformation block corresponding to the current block in the image to be processed.
It should be noted that, the encoding method may be applied to an encoder of the h.265/HEVC standard, an encoder of the h.266/multifunctional video coding (Versatile Video Coding, VVC) standard, and even an encoder of other standards, such as an encoder of the AVS standard, an encoder of the basic video coding (Essential Video Coding, EVC) standard, etc., and embodiments of the present application are not limited in particular.
Here, determining a transform block corresponding to a current block in an image to be processed includes:
predicting a current block of an image to be processed to obtain a current predicted block;
determining residual blocks of the current block and the current prediction block;
and determining a transformation block corresponding to the residual block.
S202: and when the scanning area of the transformation block meets the trigger condition of dual quantization, quantizing the coefficients in the scanning area based on a first quantization mode.
The scanning area is a minimum rectangular area covering all non-zero coefficients in the transformation block; the first quantization mode is dual quantization. The scan region is at least a partial region in the transform block.
S203: and encoding the quantized block after quantization and writing the encoded block into a code stream.
The coding method provided by the embodiment of the application comprises the steps of determining a transformation block corresponding to a current block in an image to be processed; when the scanning area of the transformation block meets the trigger condition of dual quantization, quantizing coefficients in the scanning area based on a first quantization mode; the scanning area is a minimum rectangular area covering all non-zero coefficients in the transformation block; the first quantization mode is dual quantization; encoding the quantized block after quantization and writing the encoded block into a code stream; in the application, when the trigger condition of dual quantization is satisfied, the first quantization mode, namely dual quantization is adopted to quantize the coefficients in the scanning area, that is, the dual quantization is not applied to all the global coefficient blocks any more, and the limiting condition is given for using the dual quantization, thereby improving the coding performance.
In another embodiment of the present application, referring to fig. 3, a schematic flow chart of an encoding method provided by an embodiment of the present application is shown. As shown in fig. 3, the encoding method is applied to an encoder, and the encoding method may include:
s301: and determining a transformation block corresponding to the current block in the image to be processed.
S302: and when the scanning area of the transformation block meets the trigger condition of dual quantization, quantizing the coefficients in the scanning area based on a first quantization mode.
The scanning area is a minimum rectangular area covering all non-zero coefficients in the transformation block; the first quantization mode is dual quantization.
In the embodiment of the present application, in video coding, the transformed coefficients and the non-transformed coefficients may be collectively referred to as coefficients (coefficients). Quantization is typically used to reduce the dynamic range of coefficients, thereby achieving the goal of expressing video with fewer codewords. The quantized values are often referred to as levels, reconstruction levels or reconstruction levels (levels). The quantization operation includes dividing the coefficients by a quantization step size, which is determined by a quantization factor conveyed in the code stream. The inverse quantization is accomplished by multiplying the reconstruction level by the quantization step size. For an nxm block, quantization of all coefficients can be done independently, and this technique is also widely used in many international video compression standards, such as h.264, HEVC.
At the same time, a particular scan order may transform a two-dimensional block of coefficients into a one-dimensional stream of coefficients. The scanning sequence may be Z-type, horizontal, vertical or any other sequence of scanning. The quantization operation can utilize the correlation among the coefficients and select a better quantization mode by utilizing the characteristics of the quantized coefficients, thereby achieving the purpose of optimizing quantization.
Dual quantization is a quantization scheme defined in VVC. The dual quantization acts on the transformed block, unlike conventional quantization, the dual quantization includes two quantizers, which have the same quantization step size (i.e., 2×Δ), but which are interleaved with respect to each other, but with respect to the reconstructed transform coefficients. Referring to fig. 4, fig. 4 is a schematic diagram of a dual quantized quantizer Q0 and quantizer Q1 and their respective reconstructed transform coefficients.
As shown in fig. 4, 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 quantizer Q0; for 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.
The quantizer Q0 corresponds to a delta (the quantization step sizes of the two quantizers Q0 and Q1 are both 2×delta, the quantization step sizes of the two quantizers Q0 and Q1 are combined together to be equal to delta in the dual quantizer) (i.e. the number corresponding to the point a and B), and the quantizer Q1 corresponds to a delta (i.e. the number corresponding to the point C and D) of the reconstructed transform coefficient level being an odd multiple.
The dual quantization leads the quantizer with large step length to be combined to finish finer quantization by introducing two staggered quantizers and the principle of jumping between the quantizers, thereby reducing the loss between the reconstructed transformation coefficient and the original transformation coefficient and improving the coding efficiency.
For each transform coefficient, the present application may choose to quantize using one of the two quantizers Q0, Q1 depicted in fig. 4, each in a similar manner to the conventional quantizer (quantization in HEVC). The reconstructed transform coefficients of both quantizers can be represented by multiples of the quantization step size Δ, which are defined as follows:
q0 the quantization step size delta of the quantizer, which is an even multiple (including zero) of the level of the reconstructed transform coefficient, when this quantizer is used, the reconstructed transform coefficient t' can be calculated according to the following formula,
t′=2·k·Δ,
where k represents the associated transform coefficient level described in fig. 4.
Q1 the quantizer, the reconstructed transform coefficient level is an odd or zero-times quantization step size delta, when this quantizer is used, the reconstructed transform coefficient t' can be calculated according to the following formula,
t′=(2·k-sgn(k))·Δ,
wherein sgn (·) represents the sign function,
Where x is the quantized transform coefficient.
The choice to use Q0 or Q1 for quantization is not controlled by encoding a flag bit. Instead, the parity of the transform coefficient level of the last coefficient in the coefficient scan order (the transform coefficient level described in fig. 4) is used to determine whether the current transform coefficient uses Q0 or Q1.
In some embodiments, the scan region meeting the trigger condition for dual quantification includes: the value of the area of the scanning area satisfies a first preset condition.
The first preset condition may be a first parameter range.
In other embodiments, the scan region satisfying the trigger condition for dual quantification further comprises: the length of the scanning area meets a second preset condition; and/or the width of the scanning area meets a third preset condition.
The second preset condition may be a second parameter range. The third preset condition may be a third parameter range.
S303: the length of the scan region is determined based on the abscissa of the rightmost non-zero coefficient in the quantized scan region.
S304: the width of the scan region is determined based on the ordinate of the lowest non-zero coefficient in the quantized scan region.
S305: and encoding the quantized blocks after quantization, writing the encoded blocks into a code stream, and writing the length of the scanning area and the width of the scanning area into the code stream.
Referring to fig. 5, fig. 5 shows that a scan region-based coefficient coding Scheme (SRCC) is used in AVS3, and the technique uses (SRx, SRy) to determine a quantized coefficient region to be scanned in a transform unit, where SRx is the abscissa of the rightmost non-zero coefficient in the coefficient matrix, and SRy is the ordinate of the bottommost non-zero coefficient in the coefficient matrix. Only the coefficients within the scan area determined by (SRx, SRy) need to be encoded. The encoded scan order is a reverse zig-zag scan from the lower right corner to the upper left corner.
In another embodiment of the present application, referring to fig. 6, a schematic flow chart of an encoding method provided by an embodiment of the present application is shown. As shown in fig. 6, the encoding method is applied to an encoder, and the encoding method may include:
s501: and determining a transformation block corresponding to the current block in the image to be processed.
In some embodiments, S501 determines a transform block corresponding to a current block in an image to be processed, which may be implemented by:
predicting the current block to obtain a current predicted block;
determining residual blocks of the current block and the current prediction block;
and determining a transformation block corresponding to the residual block.
S502: at least some of the coefficients of the transform block are traversed.
S503: the scan region is determined based on coordinates of the traversed target non-zero coefficient.
In some embodiments, when traversing each coefficient of the transform block, S503 determines the scan area based on the coordinates of the traversed target non-zero coefficient, which may be achieved by:
determining the abscissa of the non-zero coefficient positioned at the rightmost side of the transformation block in each traversed coefficient;
determining the ordinate of a non-zero coefficient positioned at the bottommost side of the transformation block in each traversed coefficient;
the scan region is determined based on the abscissa of the rightmost non-zero coefficient and the ordinate of the bottommost non-zero coefficient.
In other embodiments, when performing the coefficient traversal in the direction from the right edge to the left edge of the transform block and performing the coefficient traversal in the direction from the lower edge to the upper edge of the transform block, S503 determines the scan area based on the coordinates of the traversed target non-zero coefficient, which may be achieved by:
respectively determining coordinates of a first non-zero coefficient corresponding to the right edge and the lower edge obtained through traversing;
a scan region is determined from the transform block based on the coordinates of the first non-zero coefficient.
Here, the coefficient traversal may be performed first in a direction from the right edge to the left edge of the transform block, and then in a direction from the lower edge to the upper edge of the transform block; the coefficient traversal may be performed along the direction from the lower edge to the upper edge of the transform block, and then along the direction from the right edge to the left edge of the transform block; it is also possible to perform the coefficient traversal in the direction from the right edge to the left edge of the transform block, while performing the coefficient traversal in the direction from the lower edge to the upper edge of the transform block.
S504: and when the scanning area of the transformation block meets the trigger condition of dual quantization, quantizing the coefficients in the scanning area based on a first quantization mode.
The scanning area is a minimum rectangular area covering all non-zero coefficients in the transformation block; the first quantization mode is dual quantization.
In the embodiment of the present application, when the scan area of the transform block meets the trigger condition of dual quantization, S504 quantizes the coefficients in the scan area based on the first quantization mode, which can be implemented by the following steps:
determining a quantizer corresponding to the current coefficient in the scan region based on parity of quantized values of the reference coefficient in the scan region; wherein the reference coefficient and the current coefficient have adjacent coefficient scanning sequences;
the current coefficient is quantized based on a quantizer corresponding to the current coefficient. Wherein the reference coefficient is a coefficient preceding the current coefficient in the coefficient scan order.
Referring to fig. 7 and 8, in the coefficient scan sequence, the reconstructed value of the current coefficient may determine the state of the next coefficient by the transition methods shown in fig. 7 and 8, and the states are represented by four values of 0,1,2, and 3, respectively. 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 also determine which quantizer is used for the current coefficient, states 0,1 correspond to quantizer Q0, and states 2,3 correspond to quantizer Q1.
Further, the decision process of the encoder for dual quantization is described:
similar to the implementation of 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,
t k and q k Representing the original table transform coefficient and transform coefficient level, t' k (q k I …) represents 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.
As previously described for state machine transitions, the present application may represent the dependencies between the quantizer and the transform coefficient levels as a trellis diagram as shown in fig. 9, the trellis structure representing the dependencies of states and transform coefficient levels, the coding sequence from left to right, the four states of each column representing the possible four states of the current coefficient, each node being connected to the possible two state nodes of the next coefficient in the coding sequence. For a given current state and current transform coefficient t k The present application can quantize the corresponding transform coefficient level by using the current quantizer, and the encoder can select to use either an odd transform coefficient level corresponding to B (Q0 with space 1) and D (Q1 with space 1) or an even transform coefficient level corresponding to a (Q0 with space 0) and C (Q1 with space 0) in fig. 9. 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 can be determined by finding a way to minimize the sum of costs, and determining the minimum sum of costs can be accomplished by viterbi algorithm (Viterbi algorithm).
The further implementation consists of two steps:
referring to fig. 10, 4 candidate transform coefficient levels from Q0 and Q1, respectively, corresponding to the original transform coefficients are found.
Determining a series of transform coefficient levels q for a current node using a Viterbi algorithm with an estimated rate-reduction sum (cost synthesis corresponding to the transform coefficient levels determined by previous nodes) k
S505: and when the scanning area does not meet the trigger condition of dual quantization, quantizing the coefficients in the scanning area based on a second quantization mode to obtain quantized blocks.
The first quantization mode includes at least two quantizers including a first quantizer and a second quantizer, quantizes coefficients in a scan region based on the first quantization mode, including:
determining to use a first quantizer or a second quantizer for the coefficients, and quantizing the coefficients by using the determined quantizer to obtain quantized values;
when the quantized value is the target quantized value, the reconstructed coefficient value corresponding to the target quantized value when quantized by using the first quantizer is different from the reconstructed coefficient value corresponding to the target quantized value when quantized by using the second quantizer.
The coefficients in the quantized blocks corresponding to the second quantization mode are in one-to-one correspondence with the quantized values.
S506: and encoding the quantized block after quantization and writing the encoded block into a code stream.
In other embodiments of the present application, when the scan area does not satisfy the trigger condition of dual quantization in step S505, after the coefficients in the scan area are quantized based on the second quantization mode to obtain the quantized block, the following steps may be further performed:
generating identification information; the identification information is used for indicating whether the quantization mode of the quantization block is a first quantization mode or not;
and writing the identification information into the code stream.
In one achievable scenario, in block-based video coding, the difference between the original video signal and its predicted block is called the residual. The residual may be further transformed in two dimensions or not, and in lossy compression, the transformed or untransformed blocks need further quantization, where the residual transformed or untransformed blocks are collectively referred to as transformed blocks. The transform block is a rectangular block of (N, M) size, where N and M are both integers greater than zero. The scan area of the transform block refers to a minimum rectangular area (SRx, SRy) of the transform block covering all non-zero coefficients, where SRx and SRy are integers greater than or equal to zero but less than or equal to N or M, and the scan area of the transform block is hereinafter referred to as the scan area.
In the scene, the application provides that the dual quantization is only applied to a scanning area with more than or equal to a specific area, and the scanning area with less than the specific area does not use the dual quantization. The specific area S is of a predetermined size and has an integer value greater than zero. For example, s=10, when the size of the coefficient scan area is srx=6 and sry=2, the area of the scan area is satisfactory (i.e., 12 is greater than 10), and dual quantization can be used; when the size of the coefficient scan area is srx=3, sry=3. The area of the scan area is not satisfactory (i.e., 9 is not greater than 10) and no dual quantization is used.
The decoding end of one embodiment of the application is realized as follows:
the decoding end obtains the code stream information and analyzes the identification bit of the current coding block.
The way in which the coding unit is divided into transform blocks is determined.
The transform block is decoded. And acquiring the coefficient scanning range information in the current coding block transformation block, wherein the coefficient scanning range information comprises an abscissa SRx at the right end of a scanning area and an ordinate SRy at the lower end of the scanning area. And judging whether the use condition of the dual quantization technology for limiting the scanning area is met. And if the value of SRx is SRy is greater than S, performing inverse quantization by a dual quantization technology. Otherwise, default dequantization is performed.
The change of the syntax structure of the transformation block in this scheme is shown in table 1.
Table 1 transform block definition
The coding end in one embodiment of the application is realized as follows:
the current coding block predicts the current block through a prediction part, or through inter prediction, intra prediction or other modes to obtain the current prediction block. And taking an image block of the corresponding position of the original image and the coordinates of the current predicted block, and the like, and performing difference with the current predicted block to obtain a residual block of the current coding unit. The residual block is then transformed, either two-dimensionally or without transformation, to obtain a transformed block or non-transformed block of coefficients, collectively referred to herein as a block of coefficients. The right-hand abscissa SRx of the scanning area and the lower-hand ordinate SRy of the scanning area are determined according to the coefficient scanning technique. And judging whether the use condition of the dual quantization technology for limiting the scanning area is met. If the value of SRx SRy is greater than S, quantization is performed using a dual quantization technique. Otherwise, default quantization is performed.
The present scheme proposes another condition using dual quantization. If the scan area length SRy is greater than or equal to Y and/or SRx is greater than or equal to X, Y and X are a determined integer, this scan area is also quantized using dual. For example, x=3, y=3, and dual quantization is used if and only if the scan area SRx is 3 or more and/or SRy is 3 or more.
From this, the present application uses dual quantization for transform blocks whose scan area is within a specific range. The dual quantization technique is not applied to all the global coefficient blocks any more, and a limiting condition is given to the DQ technique, so that the coding performance is improved. The technique can be extended to other standards such as MPEG, AOM or any custom coefficient block coding.
In one embodiment of the present application, referring to fig. 11, a schematic flow chart of a decoding method provided by the embodiment of the present application is shown. As shown in fig. 11, the decoding method is applied to a decoder, and the decoding method may include:
s601: and analyzing the code stream to obtain a quantized block.
S602: and when the scanning area of the quantized block meets the trigger condition of dual quantization and inverse quantization, performing inverse quantization on the quantized block based on the first inverse quantization mode.
The scanning area is the smallest rectangular area covering all non-zero coefficients in the quantization block, and the first inverse quantization mode is dual quantization and inverse quantization.
The application provides a decoding method, which analyzes a code stream to obtain a quantized block; when the scanning area of the quantized block meets the trigger condition of dual quantization and inverse quantization, performing inverse quantization on the quantized block based on a first inverse quantization mode; the scanning area is the smallest rectangular area covering all non-zero coefficients in the quantization block, and the first inverse quantization mode is dual quantization and inverse quantization, so that the decoding efficiency is improved.
In one embodiment of the present application, referring to fig. 12, a schematic flow chart of a decoding method according to an embodiment of the present application is shown. As shown in fig. 12, the decoding method is applied to a decoder, and the decoding method may include:
s701: and analyzing the code stream to obtain a quantized block, and obtaining the length of the scanning area and the width of the scanning area.
S702: and when the scanning area of the quantized block meets the trigger condition of dual quantization and inverse quantization, performing inverse quantization on the quantized block based on the first inverse quantization mode.
The scanning area is the smallest rectangular area covering all non-zero coefficients in the quantization block, and the first inverse quantization mode is dual quantization and inverse quantization.
Here, the decoder may determine whether the scan region satisfies a trigger condition for dual quantization inverse quantization based on the length of the scan region and the width of the scan region.
Further, the trigger conditions for dual quantization and inverse quantization include: the length of the scanning area meets a second preset condition; and/or the width of the scanning area meets a third preset condition.
Further, the trigger conditions for dual quantization and inverse quantization include: the product of the length of the scanning area and the width of the scanning area meets a fourth preset condition, and the length of the scanning area meets a second preset condition; and/or the product satisfies a fourth preset condition, and the width of the scanning area satisfies the third preset condition.
S703: when the scanning area does not meet the trigger condition of dual quantization and inverse quantization, performing inverse quantization on the quantization block based on a second inverse quantization mode; the second inverse quantization mode is different from the first inverse quantization mode.
Wherein the first inverse quantization mode comprises at least two inverse quantizers, the at least two inverse quantizers including a first inverse quantizer and a second inverse quantizer, and inverse quantizing the quantized block based on the first inverse quantization mode, including:
determining to use a first inverse quantizer or a second inverse quantizer for quantized values in the quantized block, and performing inverse quantization on the quantized values by using the determined inverse quantizer to obtain reconstructed transform coefficients;
wherein, when the quantized value is the target quantized value, the reconstructed transform coefficient obtained by using the first inverse quantizer is different from the reconstructed coefficient obtained by using the second inverse quantizer.
Here, as shown with reference to fig. 4, the target quantized values may be all quantized values, or may be all quantized values excluding 0.
Wherein, the reconstructed transformation coefficient in the reconstructed transformation block corresponding to the second inverse quantization mode is in one-to-one correspondence with the quantization value.
S704: after all the quantized coefficients of the quantized block are subjected to inverse quantization, the obtained reconstructed transform coefficients are formed into a reconstructed transform block.
S705: and carrying out inverse transformation on the reconstructed transformation block to obtain a reconstructed residual block.
S706: and carrying out prediction processing on the quantized block to obtain a predicted block of the quantized block.
S707: and determining a reconstruction block of the quantized block according to the reconstruction residual block and the prediction block.
In one embodiment of the present application, referring to fig. 13, a schematic flow chart of a decoding method provided by the embodiment of the present application is shown. As shown in fig. 13, the decoding method is applied to a decoder, and the decoding method may include:
s801: and analyzing the code stream to obtain the quantized block and the identification information.
Wherein the identification information is used to indicate whether the first quantization mode is used.
S802: based on the identification information, determining that the scanning area meets a trigger condition of dual quantization and dequantization, and dequantizing the quantized block based on the first dequantization mode.
S803: based on the identification information, determining that the scanning area does not meet the trigger condition of dual quantization and dequantization, and dequantizing the quantized block based on the second dequantization mode.
The decoding end of another embodiment of the application is realized as follows:
the decoding end obtains the code stream information and analyzes the identification bit of the current coding block.
The way in which the coding unit is divided into transform blocks is determined.
The transform block is decoded. And acquiring the coefficient scanning range information in the current coding block transformation block, wherein the coefficient scanning range information comprises an abscissa SRx at the right end of a scanning area and an ordinate SRy at the lower end of the scanning area. And judging whether the use condition of the dual quantization technology for limiting the scanning area is met. If SRx is greater than X and/or SRy is greater than Y, performing inverse quantization by a dual quantization technique. Otherwise, default dequantization is performed.
The change to the transform block syntax structure of this scheme is shown in table 2.
Table 2 transform block definition
In another embodiment of the present application, the encoding end is implemented as follows:
the current coding block predicts the current block through a prediction part, or through inter prediction, intra prediction or other modes to obtain the current prediction block. And taking an image block of the corresponding position of the original image and the coordinates of the current predicted block, and the like, and performing difference with the current predicted block to obtain a residual block of the current coding unit. The residual block is then transformed, either two-dimensionally or without transformation, to obtain a transformed block or non-transformed block of coefficients, collectively referred to herein as a block of coefficients. The right-hand abscissa SRx of the scanning area and the lower-hand ordinate SRy of the scanning area are determined according to the coefficient scanning technique. And judging whether the use condition of the dual quantization technology for limiting the scanning area is met. If SRx is greater than X and/or SRy is greater than Y, quantization is performed using a dual quantization technique. Otherwise, default quantization is performed.
In the embodiment of the present application, based on the same inventive concept as the previous embodiment, referring to fig. 14, a schematic diagram of the composition structure of an encoder 90 provided in the embodiment of the present application is shown. As shown in fig. 14, the encoder 90 may include a determination unit 901, a first processing unit 902, and an encoding unit 903; wherein,
A determining unit 901, configured to determine a transform block corresponding to a current block in an image to be processed;
a first processing unit 902 configured to quantize coefficients in a scan region of the transform block based on a first quantization mode when the scan region satisfies a trigger condition for dual quantization; the scanning area is a minimum rectangular area covering all non-zero coefficients in the transformation block; the first quantization mode is dual quantization;
the encoding unit 903 is configured to encode the quantized block after quantization and write the encoded block into a code stream.
In some embodiments, the scan region meeting the trigger condition for dual quantification includes: the value of the area of the scanning area satisfies a first preset condition.
In some embodiments, the scan region meeting the trigger condition for dual quantification further comprises: the length of the scanning area meets a second preset condition; and/or the width of the scanning area meets a third preset condition.
In some embodiments, the determining unit 901 is further configured to determine the length of the scan region based on the abscissa of the rightmost non-zero coefficient in the quantized scan region;
determining the width of the scanning area based on the ordinate of the bottommost non-zero coefficient in the quantized scanning area;
The first processing unit 902 is further configured to write the length of the scanning area and the width of the scanning area to the code stream.
In some embodiments, the determining unit 901 is further configured to traverse at least part of the coefficients of the transform block;
the scan region is determined based on coordinates of the traversed target non-zero coefficient.
In some embodiments, the determining unit 901 is further configured to traverse the respective coefficients of the transform block;
determining the abscissa of the non-zero coefficient positioned at the rightmost side of the transformation block in each traversed coefficient;
determining the ordinate of a non-zero coefficient positioned at the bottommost side of the transformation block in each traversed coefficient;
the scan region is determined based on the abscissa of the rightmost non-zero coefficient and the ordinate of the bottommost non-zero coefficient.
In some embodiments, the determining unit 901 is further configured to perform a coefficient traversal in a direction from a right edge to a left edge of the transform block, and perform a coefficient traversal in a direction from a lower edge to an upper edge of the transform block;
respectively determining coordinates of a first non-zero coefficient corresponding to the right edge and the lower edge obtained through traversing;
a scan region is determined from the transform block based on the coordinates of the first non-zero coefficient.
In some embodiments, the first processing unit 902 is further configured to quantize the coefficients in the scan area based on the second quantization mode to obtain a quantized block when the scan area does not satisfy the trigger condition of dual quantization; wherein the second quantization mode is different from the first quantization mode.
Wherein the first quantization mode comprises at least two quantizers, the at least two quantizers including a first quantizer and a second quantizer, quantizing coefficients in the scan region based on the first quantization mode, comprising:
determining to use a first quantizer or a second quantizer for the coefficients, and quantizing the coefficients by using the determined quantizer to obtain quantized values;
when the quantized value is the target quantized value, the reconstructed coefficient value corresponding to the target quantized value when quantized by using the first quantizer is different from the reconstructed coefficient value corresponding to the target quantized value when quantized by using the second quantizer.
The coefficients in the quantized blocks corresponding to the second quantization mode are in one-to-one correspondence with the quantized values.
In some embodiments, the first processing unit 902 is further configured to determine a quantizer corresponding to the current coefficient in the scan area based on parity of quantized values of the reference coefficient in the scan area; wherein the reference coefficient and the current coefficient have adjacent coefficient scanning sequences;
The current coefficient is quantized based on a quantizer corresponding to the current coefficient.
In some embodiments, the encoding unit 903 is further configured to encode the quantized blocks after quantization in a scanning order in a direction from a lower right corner to an upper left corner and write the encoded blocks into a bitstream.
In some embodiments, the determining unit 901 is further configured to predict the current block to obtain a current predicted block;
determining residual blocks of the current block and the current prediction block;
and determining a transformation block corresponding to the residual block.
In some embodiments, the first processing unit 902 is further configured to generate identification information; the identification information is used for indicating whether the quantization mode of the quantization block is a first quantization mode or not;
and writing the identification information into the code stream.
In the 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 100 according to the embodiment of the present application is shown. As shown in fig. 15, the decoder 100 may include a decoding unit 1001 and a second processing unit 1002; wherein,
a decoding unit 1001 configured to parse the code stream to obtain a quantized block;
a second processing unit 1002 configured to dequantize the quantized block based on the first dequantization mode when a scan area of the quantized block satisfies a trigger condition for dequantization of the dequantization; the scanning area is the smallest rectangular area covering all non-zero coefficients in the quantization block, and the first inverse quantization mode is dual quantization and inverse quantization.
In some embodiments, the second processing unit 1002 is further configured to dequantize the quantized block based on the second dequantization mode when the scan area does not satisfy a trigger condition for dequantization of the dual quantization; the second inverse quantization mode is different from the first inverse quantization mode.
Wherein the first inverse quantization mode comprises at least two inverse quantizers, the at least two inverse quantizers including a first inverse quantizer and a second inverse quantizer, and inverse quantizing the quantized block based on the first inverse quantization mode, including:
determining to use a first inverse quantizer or a second inverse quantizer for quantized values in the quantized block, and performing inverse quantization on the quantized values by using the determined inverse quantizer to obtain reconstructed transform coefficients;
wherein, when the quantized value is the target quantized value, the reconstructed transform coefficient obtained by using the first inverse quantizer is different from the reconstructed coefficient obtained by using the second inverse quantizer.
Wherein, the reconstructed transformation coefficient in the reconstructed transformation block corresponding to the second inverse quantization mode is in one-to-one correspondence with the quantization value.
In some embodiments, the decoding unit 1001 is further configured to parse the code stream to obtain a length of the scan region and a width of the scan region;
the second processing unit 1002 is further configured to determine, based on the length of the scanning area and the width of the scanning area, whether the scanning area satisfies a trigger condition for dual quantization inverse quantization.
In some embodiments, the scan region meeting the trigger condition for dual quantization and inverse quantization comprises: the length of the scanning area meets a second preset condition; and/or the width of the scanning area meets a third preset condition.
In some embodiments, the scan region meeting the trigger condition for dual quantization and inverse quantization comprises: the product of the length of the scanning area and the width of the scanning area meets a fourth preset condition, and the length of the scanning area meets a second preset condition; and/or the product satisfies a fourth preset condition, and the width of the scanning area satisfies the third preset condition.
In some embodiments, the decoding unit 1001 is further configured to parse the code stream to obtain the identification information; the identification information is used for indicating whether the first quantization mode is used or not;
the second processing unit 1002 is further configured to determine, based on the identification information, that the scan area satisfies or does not satisfy a trigger condition for dual quantization inverse quantization.
In some embodiments, the second processing unit 1002 is further configured to compose the obtained reconstructed transform coefficients into a reconstructed transform block based on after performing dequantization processing on all quantization coefficients of the quantized block;
and carrying out inverse transformation on the reconstructed transformation block to obtain a reconstructed residual block.
In some embodiments, the second processing unit 1002 is further configured to perform prediction processing on the quantized block to obtain a predicted block of the quantized block;
and determining a reconstruction block of the quantized block according to the reconstruction residual block and the prediction block.
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, 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 this understanding, the technical solution of the present embodiment may be embodied essentially or partly in the form of a software product, or all or part of the technical solution may be embodied in a storage medium, which includes several instructions to cause a computer device (which may be a personal computer, a server, or a network device, etc.) or processor (processor) to perform all or part of the steps of the method of 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 90, 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-described composition of the encoder 90 and the computer storage medium, referring to fig. 16, a schematic diagram of the hardware structure of the encoder 90 according to an embodiment of the present application is shown. As shown in fig. 16, may include: a first communication interface 1101, a first memory 1102, and a first processor 1103; the various components are coupled together by a first bus system 1104. It is appreciated that the first bus system 1104 is operable to enable connected communications between these components. The first bus system 1104 includes a power bus, a control bus, and a status signal bus in addition to a data bus. But for clarity of illustration, the various buses are labeled as a first bus system 1104 in fig. 16. Wherein,
a first communication interface 1101, configured to receive and transmit signals during a process of receiving and transmitting information with other external network elements;
a first memory 1102 for storing a computer program capable of running on the first processor 1103;
A first processor 1103, configured to, when executing a computer program, perform:
determining a transformation block corresponding to a current block in an image to be processed;
when the scanning area of the transformation block meets the trigger condition of dual quantization, quantizing coefficients in the scanning area based on a first quantization mode; the scanning area is a minimum rectangular area covering all non-zero coefficients in the transformation block; the first quantization mode is dual quantization;
and encoding the quantized block after quantization and writing the encoded block into a code stream.
It will be appreciated that the first memory 1102 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 1102 of the systems and methods described herein is intended to comprise, without being limited to, these and any other suitable types of memory.
And the first processor 1103 may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the method described above may be performed by integrated logic circuits of hardware or instructions in software form in the first processor 1103. The first processor 1103 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. The storage medium is located in the first memory 1102, and the first processor 1103 reads information in the first memory 1102, and combines the hardware thereof to perform 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 of the application, or a combination thereof. For a software implementation, the techniques of the present application may be implemented with modules (e.g., procedures, functions, and so on) that perform the functions of the present application. 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.
The integrated units may be stored in a computer readable storage medium if implemented in the form of software functional modules, rather than being sold or used as stand-alone products. Based on such understanding, the present embodiment provides a computer storage medium, applied to the decoder 100, storing a computer program that when executed by the second processor implements the method of any of the foregoing embodiments.
Based on the above-mentioned composition of the decoder 100 and the computer storage medium, referring to fig. 17, a schematic diagram of the hardware structure of the decoder 100 according to an embodiment of the present application is shown. As shown in fig. 17, may include: a second communication interface 1201, a second memory 1202 and a second processor 1203; the various components are coupled together by a second bus system 1204. It is appreciated that the second bus system 1204 is used to enable connected communications between these components. The second bus system 1204 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 in fig. 17 as the second bus system 1204. Wherein,
a second communication interface 1201, configured to receive and send signals during the process of receiving and sending information with other external network elements;
a second memory 1202 for storing a computer program capable of running on the second processor 1203;
the second processor 1203 is configured to execute, when the computer program is executed:
the decoding unit is configured to analyze the code stream to obtain a quantized block;
the second processing unit is configured to dequantize the quantized block based on the first dequantization mode when the scanning area of the quantized block meets the trigger condition of dequantization of dual quantization; the scanning area is the smallest rectangular area covering all non-zero coefficients in the quantization block, and the first inverse quantization mode is dual quantization and inverse quantization.
Optionally, as another embodiment, the second processor 1203 is further configured to perform the method of any of the previous embodiments when running a computer program.
It is understood that the second memory 1202 is similar to the hardware functionality of the first memory 1102, and the second processor 1203 is similar to the hardware functionality of the first processor 1103; and will not be described in detail herein.
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
The coding method provided by the embodiment of the application comprises the steps of determining a transformation block corresponding to a current block in an image to be processed; when the scanning area of the transformation block meets the trigger condition of dual quantization, quantizing coefficients in the scanning area based on a first quantization mode; the scanning area is a minimum rectangular area covering all non-zero coefficients in the transformation block; the first quantization mode is dual quantization; encoding the quantized block after quantization and writing the encoded block into a code stream; in the application, when the trigger condition of dual quantization is satisfied, the first quantization mode, namely dual quantization is adopted to quantize the coefficients in the scanning area, that is, the dual quantization is not applied to all the global coefficient blocks any more, and the limiting condition is given for using the dual quantization, thereby improving the coding performance.

Claims (27)

  1. A method of encoding, the method comprising:
    determining a transformation block corresponding to a current block in an image to be processed;
    when a scanning area of the transformation block meets a trigger condition of dual quantization, quantizing coefficients in the scanning area based on a first quantization mode; the scanning area is a minimum rectangular area covering all non-zero coefficients in the transformation block; the first quantization mode is dual quantization;
    and encoding the quantized block after quantization and writing the encoded block into a code stream.
  2. The method of claim 1, wherein the scan region meeting the dual quantized trigger condition comprises: the value of the area of the scanning area meets a first preset condition.
  3. The method of claim 1 or 2, wherein the scan region meeting the dual quantized trigger condition further comprises: the length of the scanning area meets a second preset condition; and/or the width of the scanning area meets a third preset condition.
  4. The method of claim 1, wherein the method further comprises:
    determining the length of the scanning area based on the abscissa of the rightmost non-zero coefficient in the quantized scanning area;
    Determining the width of the scanning area based on the ordinate of the bottommost non-zero coefficient in the quantized scanning area;
    and writing the length of the scanning area and the width of the scanning area into the code stream.
  5. The method according to claim 1, wherein the method comprises:
    traversing at least part of coefficients of the transform block;
    and determining the scanning area based on the coordinates of the traversed target non-zero coefficient.
  6. The method of claim 5, wherein said traversing at least some coefficients of the transform block comprises:
    traversing each coefficient of the transformation block;
    correspondingly, the determining the scanning area based on the coordinates of the target non-zero coefficient obtained by traversing comprises the following steps:
    determining the abscissa of the non-zero coefficient positioned at the rightmost side of the transformation block in the traversed coefficients;
    determining the ordinate of the non-zero coefficient positioned at the bottommost side of the transformation block in the traversed coefficients;
    the scan region is determined based on the abscissa of the rightmost non-zero coefficient and the ordinate of the bottommost non-zero coefficient.
  7. The method of claim 5, wherein said traversing at least some coefficients of the transform block comprises:
    Performing coefficient traversal in a direction from a right edge to a left edge of the transform block, and performing coefficient traversal in a direction from a lower edge to an upper edge of the transform block;
    correspondingly, the determining the scanning area based on the coordinates of the target non-zero coefficient obtained by traversing comprises the following steps:
    respectively determining coordinates of a first non-zero coefficient corresponding to the right edge and the lower edge obtained through traversing;
    the scan region is determined from the transform block based on coordinates of the first non-zero coefficient.
  8. The method of claim 1, wherein the method further comprises:
    when the scanning area does not meet the trigger condition of the dual quantization, quantizing the coefficients in the scanning area based on a second quantization mode to obtain the quantized block; wherein the second quantization mode is different from the first quantization mode.
  9. The method of claim 1, wherein the first quantization mode comprises at least two quantizers including a first quantizer and a second quantizer, the quantizing coefficients in the scan region based on the first quantization mode comprising:
    determining, for the coefficients, whether to use the first quantizer or the second quantizer, and quantizing the coefficients using the determined quantizer to obtain quantized values;
    And when the quantized value is a target quantized value, the reconstructed coefficient value corresponding to the target quantized value when quantized by using the first quantizer is different from the reconstructed coefficient value corresponding to the target quantized value when quantized by using the second quantizer.
  10. The method of claim 1, wherein the quantizing the transform block based on the first quantization mode comprises:
    determining a quantizer corresponding to a current coefficient in the scanning area based on a quantized value of a reference coefficient in the scanning area; wherein the reference coefficient and the current coefficient have adjacent coefficient scanning sequences;
    and quantizing the current coefficient based on a quantizer corresponding to the current coefficient.
  11. The method of claim 10, wherein the determining a quantizer corresponding to a current coefficient in the scan region based on quantized values of reference coefficients in the scan region comprises:
    and determining a quantizer corresponding to the current coefficient based on the parity of the quantized value of the reference coefficient.
  12. The method of claim 1, wherein the encoding and writing the quantized blocks into a bitstream comprises:
    And encoding the quantized blocks according to the scanning sequence from the lower right corner to the upper left corner and writing the encoded blocks into the code stream.
  13. The method according to claim 1, wherein the determining a transform block corresponding to a current block in the image to be processed includes:
    predicting the current block to obtain a current predicted block;
    determining residual blocks of the current block and the current prediction block;
    and determining a transformation block corresponding to the residual block.
  14. The method according to claim 1 or 8, wherein the method further comprises:
    generating identification information; the identification information is used for indicating whether the quantization mode of the quantization block is the first quantization mode or not;
    and writing the identification information into the code stream.
  15. A decoding method, wherein the method comprises:
    analyzing the code stream to obtain a quantized block;
    when the scanning area of the quantization block meets the trigger condition of dual quantization and inverse quantization, performing inverse quantization on the quantization block based on a first inverse quantization mode; the scanning area is the smallest rectangular area covering all non-zero coefficients in the quantization block, and the first inverse quantization mode is dual quantization and inverse quantization.
  16. The method of claim 15, wherein the method further comprises:
    when the scanning area does not meet the trigger condition of the dual quantization inverse quantization, performing inverse quantization on the quantization block based on a second inverse quantization mode; the second inverse quantization mode is different from the first inverse quantization mode.
  17. The method of claim 15, wherein the first inverse quantization mode comprises at least two inverse quantizers including a first inverse quantizer and a second inverse quantizer, the dequantizing the quantized block based on the first inverse quantization mode comprising:
    determining whether to use the first inverse quantizer or the second inverse quantizer for quantized values in the quantized block, and performing inverse quantization on the quantized values by using the determined inverse quantizer to obtain reconstructed transform coefficients;
    wherein, when the quantized value is a target quantized value, the reconstructed transform coefficient obtained using the first inverse quantizer is different from the value of the reconstructed coefficient obtained using the second inverse quantizer.
  18. The method of claim 15, wherein the method further comprises:
    analyzing the code stream to obtain the length of the scanning area and the width of the scanning area;
    Based on the length of the scan region and the width of the scan region, it is determined whether the scan region satisfies the trigger condition for dual quantization inverse quantization.
  19. The method of claim 15, wherein the scan region meeting the trigger condition for dual quantization dequantization comprises:
    the length of the scanning area meets a second preset condition; and/or
    The width of the scanning area meets a third preset condition.
  20. The method of claim 15, wherein the method further comprises:
    analyzing the code stream to obtain identification information; the identification information is used for indicating whether a first quantization mode is used or not;
    and determining that the scanning area meets or does not meet the trigger condition of the dual quantization inverse quantization based on the identification information.
  21. The method of claim 15, wherein the method further comprises:
    after all the quantized coefficients of the quantized block are subjected to inverse quantization, the obtained reconstructed transform coefficients are formed into a reconstructed transform block;
    and carrying out inverse transformation on the reconstructed transformation block to obtain a reconstructed residual block.
  22. The method of claim 21, wherein the method further comprises:
    Carrying out prediction processing on the quantized block to obtain a predicted block of the quantized block;
    and determining a reconstruction block of the quantization block according to the reconstruction residual block and the prediction block.
  23. An encoder, wherein the encoder comprises a determination unit, a first processing unit and an encoding unit; wherein,
    the determining unit is configured to determine a transformation block corresponding to a current block in the image to be processed;
    the first processing unit is configured to quantize coefficients in a scanning area of the transformation block based on a first quantization mode when the scanning area meets a trigger condition of dual quantization; the scanning area is a minimum rectangular area covering all non-zero coefficients in the transformation block; the first quantization mode is dual quantization;
    the encoding unit is configured to encode the quantized block after quantization and write the quantized block into a code stream.
  24. A decoder, wherein the decoder comprises a decoding unit and a second processing unit; wherein,
    the decoding unit is configured to parse the code stream to obtain a quantized block;
    the second processing unit is configured to dequantize the quantized block based on a first dequantization mode when a scanning area of the quantized block meets a trigger condition of dequantization of dual quantization; the scanning area is the smallest rectangular area covering all non-zero coefficients in the quantization block, and the first inverse quantization mode is dual quantization and inverse quantization.
  25. An encoder, wherein the encoder comprises 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 one of claims 1 to 14 when the computer program is run.
  26. 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 15 to 22 when the computer program is run.
  27. A computer storage medium storing a computer program which when executed by a first processor implements the method of any one of claims 1 to 14 or when executed by a second processor implements the method of any one of claims 15 to 22.
CN202180093807.2A 2021-02-22 2021-03-04 Encoding method, decoding method, encoder, decoder and storage medium Pending CN116998151A (en)

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
CN202110200048 2021-02-22
CN2021102000487 2021-02-22
PCT/CN2021/079064 WO2022174477A1 (en) 2021-02-22 2021-03-04 Encoding method, decoding method, encoder, decoder, and storage medium

Publications (1)

Publication Number Publication Date
CN116998151A true CN116998151A (en) 2023-11-03

Family

ID=82932077

Family Applications (1)

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

Country Status (2)

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

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112236999B (en) * 2018-03-29 2022-12-13 弗劳恩霍夫应用研究促进协会 Dependency quantization
KR102527184B1 (en) * 2018-03-29 2023-05-03 프라운호퍼 게젤샤프트 쭈르 푀르데룽 데어 안겐반텐 포르슝 에. 베. Transform coefficient block coding
CN113302924A (en) * 2018-11-22 2021-08-24 交互数字Vc控股公司 Quantization for video encoding and decoding
EP3664449A1 (en) * 2018-12-05 2020-06-10 InterDigital VC Holdings, Inc. Method and device for picture encoding and decoding
CN113453002B (en) * 2020-03-25 2022-08-09 浙江大学 Quantization and entropy coding method and apparatus
CN111787324B (en) * 2020-06-29 2021-05-04 北京大学 Method for rate distortion optimization quantization, encoding method and device

Also Published As

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

Similar Documents

Publication Publication Date Title
US11659210B2 (en) Video encoding method for encoding division block, video decoding method for decoding division block, and recording medium for implementing the same
RU2722536C1 (en) Output of reference mode values and encoding and decoding of information representing prediction modes
CN109997361B (en) Low complexity symbol prediction for video coding
US11290736B1 (en) Techniques for decoding or coding images based on multiple intra-prediction modes
US10110899B2 (en) Image coding apparatus, image coding method, and program, and image decoding apparatus, image decoding method, and program
US20230037689A1 (en) Methods and apparatuses for coding transform blocks
KR101108681B1 (en) Frequency transform coefficient prediction method and apparatus in video codec, and video encoder and decoder therewith
CN107396117B (en) Video encoding and decoding methods and non-transitory computer-readable storage medium
US20120128064A1 (en) Image processing device and method
CN114223207B (en) Method and apparatus for encoding and decoding video data using secondary transforms
US10085028B2 (en) Method and device for reducing a computational load in high efficiency video coding
US20140036994A1 (en) Motion picture encoding apparatus and method thereof
US8594189B1 (en) Apparatus and method for coding video using consistent regions and resolution scaling
CN112075082A (en) Method and apparatus for video encoding and decoding for CABAC-based neural network implementation
KR20110017302A (en) Method and apparatus for encoding/decoding image by using motion vector accuracy control
CN110999295B (en) Boundary forced partition improvement
US10638155B2 (en) Apparatus for video encoding, apparatus for video decoding, and non-transitory computer-readable storage medium
KR20090087767A (en) Method for predictive intra coding for image data
KR20200096227A (en) Method and apparatus for video encoding and decoding based on block shape
CN114793280A (en) Method and apparatus for cross-component prediction
CN108028938A (en) Method for video coding and device
JP6528635B2 (en) Moving picture coding apparatus, moving picture coding method, and computer program for moving picture coding
EP3462744A1 (en) Method and apparatus for encoding a picture block
CN116848844A (en) Encoding and decoding method, encoding and decoding device, encoding and decoding system, and computer-readable storage medium
CN116998151A (en) Encoding method, decoding method, encoder, decoder and storage medium

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