CN110944179B - Video data decoding method and device - Google Patents

Video data decoding method and device Download PDF

Info

Publication number
CN110944179B
CN110944179B CN201911129314.0A CN201911129314A CN110944179B CN 110944179 B CN110944179 B CN 110944179B CN 201911129314 A CN201911129314 A CN 201911129314A CN 110944179 B CN110944179 B CN 110944179B
Authority
CN
China
Prior art keywords
reconstructed
quantization
data block
determining
inversely quantized
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.)
Active
Application number
CN201911129314.0A
Other languages
Chinese (zh)
Other versions
CN110944179A (en
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.)
Beijing Dajia Internet Information Technology Co Ltd
Original Assignee
Beijing Dajia Internet Information Technology Co 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 Beijing Dajia Internet Information Technology Co Ltd filed Critical Beijing Dajia Internet Information Technology Co Ltd
Publication of CN110944179A publication Critical patent/CN110944179A/en
Application granted granted Critical
Publication of CN110944179B publication Critical patent/CN110944179B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/124Quantisation
    • 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/13Adaptive entropy coding, e.g. adaptive variable length coding [AVLC] or context adaptive binary arithmetic coding [CABAC]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/17Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
    • H04N19/176Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a block, e.g. a macroblock
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/90Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using coding techniques not provided for in groups H04N19/10-H04N19/85, e.g. fractals
    • H04N19/96Tree coding, e.g. quad-tree coding

Landscapes

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

Abstract

The application discloses a video data decoding method and a device, aiming at the problem of precision loss caused by less objects to be inversely quantized in the prior art, the method comprises the following steps: the method comprises the steps of determining an object to be inversely quantized based on a data block to be reconstructed, inversely quantizing the object to be inversely quantized based on a conventional scalar quantization method when the effective number of the object to be inversely quantized is determined to be smaller than a set threshold, and inversely quantizing the object to be inversely quantized based on a dependent scalar quantization method when the effective number of the object to be inversely quantized is determined to be not smaller than the set threshold. Therefore, when the effective number of the objects to be subjected to inverse quantization is determined to be smaller than the set threshold value, the conventional scalar quantization method is adopted for inverse quantization, MSE distortion caused by too few objects to be subjected to inverse quantization is avoided, potential precision loss is reduced, and the video quality is improved.

Description

Video data decoding method and device
Cross reference to related applications and priority claims
This application claims priority from us patent application 62/768, 914 filed by us patent and trademark office (USPTO) on 18/11/2018, the entire contents of which are incorporated herein by reference.
Technical Field
The present application relates to the field of video coding technologies, and in particular, to a method and an apparatus for decoding video data.
Background
Video encoding is performed according to one or more video encoding standards. For example, Video Coding standards include multifunctional Video Coding (VVC), joint exploration test model (JEM), High Efficiency Video Coding (HEVC), Advanced Video Coding (AVC), Moving Picture Expert Group (MPEG) Coding, and the like. Video coding typically uses prediction methods that exploit redundancy in video images or video sequences, e.g., inter prediction, intra prediction, etc. An important goal of video coding techniques is to compress video data into a lower bit rate form while avoiding or minimizing degradation of video quality. With the ongoing development of video services, there is a need for coding techniques with better coding efficiency.
During a 10 th Joint Video Experts Team (jmet) conference, the jmet defines an initial draft of VCC and VVC test model 1(VTM1) encoding methods, and decides to use binary and trigeminal partition encoding block structures as initial new encoding features of VVCs, including a quadtree with nested multi-type trees. Thereafter, during the jfet conference, a reference software VTM for implementing the VTM encoding method and the draft VVC decoding process was also developed. VTM-based reference sets (BMS) have also been developed to include coding tools that have not been adopted by VVCs but require further research.
The image partition structure divides an input video into blocks called Coding Tree Units (CTUs). A CTU is divided into Coding Units (CUs) having leaf Coding Units (CU) defining regions (e.g., intra prediction modes or inter prediction modes) sharing the same prediction mode using a quad-tree having a nested multi-type tree structure. In this document, the term "unit" defines a region of an image covering all components, the term "block" is used to define a region covering a particular component (e.g., luminance), and may differ in spatial position when considering a chroma sampling format such as 4:2: 0.
In the encoding process, residual error data are obtained based on a data block to be reconstructed and a reference data block corresponding to the data block to be reconstructed, the residual error data are transformed to form a transformation coefficient, and then the transformation coefficient is quantized to generate a corresponding quantization value. In the decoding process, inverse quantization is carried out on the corresponding quantized value to obtain a reconstructed change coefficient, then inverse transformation is carried out to obtain reconstructed residual data, and a reconstructed data block is obtained based on the reconstructed residual data.
In the prior art, the following two methods are generally used for quantization:
the first method comprises the following steps: conventional scalar quantization.
Conventional scalar quantization requires quantization processing using a uniform quantization step size for all objects to be quantized.
One implementation of the object to be quantized is to transform residual data to form transform coefficients, the transform coefficients are usually recorded as 4 × 4 matrices, 16 transform coefficients in total, and after the transform coefficients are quantized by using a conventional scalar quantization method, the quantized transform coefficients are determined as the object to be dequantized, and then the object to be dequantized is described by taking the quantized transform coefficients as an example.
The second method comprises the following steps: relying on scalar quantization.
Dependent scalar quantization refers to the fact that the set of admissible reconstruction values of an object to be quantized depends on the quantized value of the previous object to be quantized in reconstruction order. Taking the example that the object to be quantized is a transform coefficient, when inverse quantization is performed for each quantized transform coefficient, the reconstructed transform coefficient depends on the quantized value of the previous transform coefficient.
The main effect of relying on scalar quantization compared to conventional scalar quantization (as used in HEVC and VTM-1) is that it can be tolerated that the reconstructed vectors, which consist of all reconstructed transform coefficients of the current data block to be quantized, which may be a CU, CTU, etc., are packed more densely in the N-dimensional vector space, where N represents the number of reconstructed transform coefficients in the data block to be quantized. This means that for a typical distribution of input vectors, which consist of all transform coefficients of the current block of data to be quantized, the average distance or Mean Squared Error (MSE) distortion between the input vector and the closest reconstruction vector will be reduced for a given average number of reconstruction vectors per N-dimensional unit volume. Finally, the rate-distortion efficiency can be optimized.
Dependent scalar quantization is achieved by:
(a) defining two scalar quantizers with different reconstruction levels;
(b) a switching process between the two scalar quantizers is defined.
Referring to fig. 1, Q0 and Q1 represent the two scalar quantizers used. The position of the available reconstruction level is uniquely specified by the quantization step size Δ. Ignoring the fact that the actual reconstructed transform coefficients of the transform coefficients use an integer algorithm, the two scalar quantizers Q0 and Q1 are characterized as follows:
q0: the reconstruction level of the first scalar quantizer Q0 is derived from an even integer multiple of the quantization step size, and when using this quantizer the reconstructed transform coefficient t is calculated according to the following formula
t′=2·k·Δ
Where k denotes a corresponding transform coefficient level, which refers to a quantization value (transmitted quantization index) of a transform coefficient.
Q1: the reconstruction level of the second scalar quantizer Q1 is derived from an odd integer multiple of the quantization step size and is equal to zero. The reconstructed transform coefficient t' is calculated according to the following formula:
t′=(2·k-sgn(k))·Δ
wherein sgn (·) expresses the signaling function
Figure GDA0002376609570000031
The scalar quantizer (Q0 or Q1) used for the current transform coefficient is not explicitly signaled in the bitstream, but is determined by the parity check of the transform coefficient level preceding the current transform coefficient in encoding or reconstruction order.
Referring to fig. 2, switching between two scalar quantizers (Q0 and Q1) is accomplished by a state machine having four states. The state may take four different values: 0. 1, 2 and 3. The state of the current transform coefficient is uniquely determined by the parity of the level of the transform coefficient preceding the current transform coefficient in the encoding or reconstruction order.
When inverse quantization is performed, the state is set to 0. The transform coefficients are reconstructed in scan order (i.e., the order in which they were entropy decoded). After reconstruction of the current transform coefficient, the state is updated as shown in fig. 2, where k represents the transform coefficient level. Where the next state depends only on the current state and the parity (k &1) of the current transform coefficient level. The state update can be written as:
Figure GDA0002376609570000041
wherein stateTransTable represents the table, operator shown in FIG. 2
Figure GDA0002376609570000042
A bitwise and operation in a two's complement operation is specified. Alternatively, state transitions can also be specified without a table lookup:
Figure GDA0002376609570000043
at this time, 16-bit value 32040 specifies a state transition table.
The state uniquely specifies the scalar quantizer used, scalar quantizer Q0 if the state for the current transform coefficient is equal to 0 or 1, otherwise (state is equal to 2 or 3), scalar quantizer Q1.
Given the transform coefficient level, the transform coefficients may be reconstructed by the following process:
for each transform coefficient to be reconstructed, a corresponding transform coefficient level is given, then, based on the transform coefficient level and the current state of the transform coefficient to be reconstructed, the state of the next transform coefficient to be reconstructed is determined, and then, based on a scaling factor and a shift parameter, the reconstructed transform coefficient is determined.
Where the transform coefficients are reconstructed in the scan order, the corresponding mapping from the scan indices to the respective positions of the transform coefficients may be specified by an array. The updating of the state (which specifies the scalar quantizer used) is performed by mapping the transform coefficient levels onto the multiplication factor for the quantization step.
Given the multiplicative factor for the quantization step size Δ, the inverse quantization is the same as in HEVC and VTM-1. The multiplication with the quantization step is performed by a scaling factor and a shift parameter. Finally, the computed reconstructed transform coefficient "tree" is clipped to the supported dynamic range and stored in the reconstructed transform coefficient array.
Furthermore, the transform coefficient level k may also be mapped onto a multiplication factor for the quantization step size Δ before the actual reconstruction of the transform coefficients. In this case, a conventional scaling procedure for varying the coefficient level may be used. The mapping from transform coefficients to multiplication factors for quantization steps may be implemented as part of entropy decoding at the transform coefficient level or between entropy decoding and reconstructing the transform coefficients.
Furthermore, the difference between two adjacent reconstructed transform coefficients is twice the quantization step (except for the center of Q1). Thus, for a given Quantization Parameter (QP), the half quantization step size of conventional quantization should be used. But since dependent scalar quantization usually results in less distortion, a slightly different relationship is chosen between the quantization parameter and the quantization step size. The quantization step size (actually represented by the scaling factor and the shift parameter) is derived in the same way as in HEVC and VTM-1, generally using a quantization parameter given by QP, but in dependent scalar quantization using a quantization parameter given by QP + 1.
However, when only the dependent scalar quantization method is used to reconstruct the transform coefficients, if too few transform coefficients are to be reconstructed, precision loss may result. When the transform coefficients are reconstructed only by using the conventional scalar quantization method, if too many transform coefficients to be reconstructed exist, the MSE distortion may be caused by too large error between the object before quantization and the object after inverse quantization.
It follows that a new solution needs to be devised to overcome the above drawbacks.
Disclosure of Invention
The application provides a video data decoding method and device, which are used for reducing precision loss caused by fewer objects to be quantized and improving video quality.
The technical scheme provided by the embodiment of the application is as follows:
a method of decoding video data, comprising:
acquiring a data block to be reconstructed based on video data to be decoded, and determining an object to be dequantized based on the data block to be reconstructed;
when the effective number of the objects to be inversely quantized is determined to be smaller than a set threshold value, inversely quantizing the objects to be inversely quantized based on a conventional scalar quantization method;
when the effective number of the objects to be inversely quantized is determined to be not less than the set threshold, inversely quantizing the objects to be inversely quantized based on a dependent scalar quantization method;
and decoding the data block to be reconstructed based on the obtained inverse quantization result.
Optionally, determining an object to be dequantized based on the data block to be reconstructed includes:
determining pixels contained in the data block to be reconstructed as the object to be dequantized; alternatively, the first and second electrodes may be,
determining corresponding residual data as an object to be inversely quantized based on a data block to be reconstructed; alternatively, the first and second electrodes may be,
and determining the corresponding transformation coefficient as the object to be inversely quantized based on the data block to be reconstructed.
Optionally, further comprising:
based on a conventional scalar quantity quantization method, when the object to be subjected to inverse quantization is subjected to inverse quantization, a first quantization parameter is adopted to determine a corresponding quantization step length;
based on a dependent scalar quantization method, when the object to be subjected to inverse quantization is subjected to inverse quantization, a second quantization parameter is adopted to determine a corresponding quantization step;
and the difference value of the first quantization parameter and the second quantization parameter is N, wherein N is any integer.
Optionally, further comprising:
after determining an object to be inversely quantized based on a data block to be reconstructed, encoding the object to be inversely quantized by adopting a first context model before inversely quantizing the object to be inversely quantized based on a conventional scalar quantization method;
after determining an object to be inversely quantized based on a data block to be reconstructed, encoding the object to be inversely quantized by adopting a second context model before inversely quantizing the object to be inversely quantized based on a dependent scalar quantization method;
wherein the first context model is different from the second context model.
Optionally, decoding the data block to be reconstructed based on the obtained inverse quantization result specifically includes:
and obtaining reconstructed residual data based on the inverse quantization result, and decoding the data block to be reconstructed based on the reconstructed residual data and the corresponding reference data block.
A method of decoding video data, comprising:
acquiring a data block to be reconstructed based on video data to be decoded, and determining an object to be dequantized based on the data block to be reconstructed;
acquiring preset configuration information, wherein the configuration information carries a set initial state;
carrying out inverse quantization on the object to be subjected to inverse quantization based on the initial state and a dependent scalar quantization method;
and decoding the data block to be reconstructed based on the obtained inverse quantization result.
Optionally, before determining the object to be dequantized based on the data block to be reconstructed, the method further includes:
uniformly setting corresponding initial states aiming at the images to which the data blocks to be reconstructed belong, and setting configuration information according to the uniformly set initial states; alternatively, the first and second electrodes may be,
and setting an exclusive initial state for the data block to be reconstructed, and setting configuration information according to the exclusive initial state.
Optionally, setting a dedicated initial state for the data block to be reconstructed, where the setting includes:
and when the effective number of the objects to be inversely quantized contained in the data block to be reconstructed is determined to be less than a set threshold value, setting an exclusive initial state for the data block to be reconstructed.
Optionally, decoding the data block to be reconstructed based on the obtained inverse quantization result specifically includes:
and obtaining reconstructed residual data based on the inverse quantization result, and decoding the data block to be reconstructed based on the reconstructed residual data and the corresponding reference data block.
A video data decoding apparatus, comprising:
the device comprises a determining unit, a reconstruction unit and a processing unit, wherein the determining unit is used for acquiring a data block to be reconstructed based on video data to be decoded and determining an object to be inversely quantized based on the data block to be reconstructed;
the first quantization unit is used for determining that the effective number of the objects to be subjected to inverse quantization is smaller than a set threshold value, and carrying out inverse quantization on the objects to be subjected to inverse quantization based on a conventional scalar quantization method;
a second quantization unit, configured to perform inverse quantization on the object to be inverse quantized based on a dependent scalar quantization method when it is determined that the effective number of the object to be inverse quantized is not less than the set threshold;
and the decoding unit is used for decoding the data block to be reconstructed based on the obtained inverse quantization result.
Optionally, when determining the object to be dequantized based on the data block to be reconstructed, the determining unit is configured to:
determining pixels contained in the data block to be reconstructed as the object to be dequantized; alternatively, the first and second electrodes may be,
determining corresponding residual data as an object to be inversely quantized based on a data block to be reconstructed; alternatively, the first and second electrodes may be,
and determining the corresponding transformation coefficient as the object to be inversely quantized based on the data block to be reconstructed.
Optionally, the first quantization unit is specifically configured to, based on a conventional scalar quantization method, determine a corresponding quantization step size by using a first quantization parameter when performing inverse quantization on the object to be inverse-quantized;
the second quantization unit is specifically configured to, based on a dependent scalar quantization method, determine a corresponding quantization step size by using a second quantization parameter when performing inverse quantization on the object to be inverse-quantized;
and the difference value of the first quantization parameter and the second quantization parameter is N, wherein N is any integer.
Optionally, the first quantization unit is further configured to, after determining an object to be inverse quantized based on a data block to be reconstructed, encode the object to be inverse quantized using a first context model before inverse quantization of the object to be inverse quantized based on a conventional scalar quantization method;
the second quantization unit is further configured to, after determining an object to be inversely quantized based on a data block to be reconstructed, encode the object to be inversely quantized with a second context model based on a dependent scalar quantization method before inversely quantizing the object to be inversely quantized;
wherein the first context model is different from the second context model.
Optionally, when the data block to be reconstructed is decoded based on the obtained inverse quantization result, the decoding unit is specifically configured to:
and obtaining reconstructed residual data based on the inverse quantization result, and decoding the data block to be reconstructed based on the reconstructed residual data and the corresponding reference data block.
A video data decoding apparatus, comprising:
the device comprises a determining unit, a reconstruction unit and a processing unit, wherein the determining unit is used for acquiring a data block to be reconstructed based on video data to be decoded and determining an object to be inversely quantized based on the data block to be reconstructed;
the device comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for acquiring preset configuration information which carries a set initial state;
a quantization unit, configured to perform inverse quantization on the object to be inverse quantized based on the initial state and a dependent scalar quantization method;
and the decoding unit is used for decoding the data block to be reconstructed based on the obtained inverse quantization result.
Optionally, before determining the object to be dequantized based on the data block to be reconstructed, the method further includes a configuration unit, where the configuration unit is configured to:
uniformly setting corresponding initial states aiming at the images to which the data blocks to be reconstructed belong, and setting configuration information according to the uniformly set initial states; alternatively, the first and second electrodes may be,
and setting an exclusive initial state for the data block to be reconstructed, and setting configuration information according to the exclusive initial state.
Optionally, when setting a dedicated initial state for the data block to be reconstructed, the configuration unit is configured to:
and when the effective number of the objects to be inversely quantized contained in the data block to be reconstructed is determined to be less than a set threshold value, setting an exclusive initial state for the data block to be reconstructed.
Optionally, when the data block to be reconstructed is decoded based on the obtained inverse quantization result, the decoding unit is specifically configured to:
and obtaining reconstructed residual data based on the inverse quantization result, and decoding the data block to be reconstructed based on the reconstructed residual data and the corresponding reference data block.
A video data decoding apparatus, comprising:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the video data decoding method of any one of the above.
A video data decoding apparatus, comprising:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the video data decoding method of any one of the above.
A storage medium in which instructions, when executed by a processor of a video data decoding apparatus, enable the processor of the video data decoding apparatus to perform a video data decoding method as in any one of the above.
A storage medium in which instructions, when executed by a processor of a video data decoding apparatus, enable the processor of the video data decoding apparatus to perform a video data decoding method as in any one of the above.
In the embodiment of the application, a data block to be reconstructed is obtained based on video data to be decoded, an object to be dequantized is determined based on the data block to be reconstructed, when the effective number of the object to be dequantized is smaller than a set threshold value, dequantization is performed on the object to be dequantized based on a conventional scalar quantization method, otherwise, dequantization is performed on the object to be dequantized based on a scalar-dependent quantization method, and then the data block to be reconstructed is decoded based on an obtained dequantization result. The technical scheme provided by the embodiment of the application at least has the following beneficial effects: when the effective number of the objects to be inversely quantized is too small, the objects to be inversely quantized are inversely quantized based on a conventional scalar quantization method instead of a dependent scalar quantization method, so that MSE distortion caused by too few objects to be inversely quantized is avoided, potential precision loss is reduced, and the video coding quality is improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a diagram of two scalar quantizers used in a dependent scalar quantization method;
FIG. 2 is a schematic diagram of state transitions and selection of scalar quantizers for a dependent scalar quantization method;
fig. 3 is a flowchart illustrating a video data decoding method according to an embodiment of the present application;
fig. 4 is a flowchart illustrating another video data decoding method according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of a video data decoding apparatus according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of another video data decoding apparatus according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of a video data decoding apparatus according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of another video data decoding apparatus according to an embodiment of the present application.
Detailed Description
In order to reduce the precision loss and improve the video quality, in the embodiment of the present application, a solution for decoding video data is provided. The scheme is as follows: the method comprises the steps of obtaining a data block to be reconstructed based on video data to be decoded, determining an object to be inversely quantized based on the data block to be reconstructed, inversely quantizing the object to be inversely quantized based on a conventional scalar quantization method when the number of the objects to be inversely quantized is smaller than a set threshold value, or inversely quantizing the object to be inversely quantized based on a dependent scalar quantization method, and then decoding the data block to be reconstructed based on an obtained inverse quantization result.
In order to make the technical solutions of the present application better understood by those of ordinary skill in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings.
Referring to fig. 3, in the embodiment of the present application, a detailed flow of video data decoding is as follows:
step S301: and acquiring a data block to be reconstructed based on the video data to be decoded, and determining an object to be dequantized based on the data block to be reconstructed.
In this embodiment of the present application, the video data to be decoded may be a video data stream to be decoded, and the data block to be reconstructed may be a CTU, a CU, or the like, which is not limited in this application.
For example, the video data to be decoded includes a data block CU to be reconstructed, the data block CU to be reconstructed includes pixel 1, pixel 2, pixel 3, … …, and pixel 16, and the data block CU to be reconstructed is obtained based on the video data to be decoded.
Specifically, the object to be dequantized may be determined in, but not limited to, the following ways:
mode 1: and quantizing the pixels contained in the data block to be reconstructed, and determining the pixels as the object to be inversely quantized.
For example, the data block to be reconstructed is CU, and assuming that the CU includes pixel 1, pixel 2, pixel 3, … …, and pixel 16, the pixel 1, pixel 2, pixel 3, … …, and pixel 16 included in the CU are quantized and then determined as the object to be dequantized.
Mode 2: and obtaining residual data based on the data block to be reconstructed and the corresponding reference data block, and determining the residual data as an object to be inversely quantized after quantizing the residual data.
For example, the data block to be reconstructed is CU, and it is assumed that the CU includes a pixel 1, a pixel 2, a pixel 3, … …, and a pixel 16, and the corresponding reference data block is a reference data block 1, a reference data block 2, a reference data block 3, … …, and a reference data block 16, then, based on the pixel 1 and the reference data block 1, obtaining residual data 1, based on the pixel 2 and the reference data block 2, obtaining residual data 2, and so on, based on the pixel and the corresponding reference data block in turn, obtaining residual data 1, residual data 2, and … …, and after quantizing the residual data 1, the residual data 2, and … …, determining the data block as the object to be dequantized.
Mode 3: obtaining residual error data based on the data block to be reconstructed and the corresponding reference data block, transforming the residual error data to obtain a corresponding transformation coefficient, and determining the transformation coefficient as an object to be inversely quantized after the transformation coefficient is quantized.
For example, a data block to be reconstructed is CU, and it is assumed that the CU includes a pixel 1, a reference data block corresponding to the pixel 1 is a reference data block 1, residual data 1 is obtained based on the pixel 1 and the reference data block 1, then transform is performed on the residual data 1 to obtain transform coefficients, the transform coefficients are matrices of 4 × 4, and 16 in total, and the transform coefficients 1, 2, … …, and 16 are quantized and then determined to be objects to be dequantized.
For convenience of description, the object to be dequantized is a quantized transform coefficient, which is taken as an example, and all the transform coefficients described below are quantized transform coefficients.
Step S302: and judging whether the effective number of the objects to be inversely quantized is smaller than a set threshold value, if so, executing the step S303, otherwise, executing the step S304.
In the embodiment of the present application, the effective number of objects to be dequantized refers to the number of objects to be dequantized having a non-zero value.
For example, in the transform coefficient 1, the transform coefficient 2, … …, and the transform coefficient 16, assuming that the threshold is set to 3, and the transform coefficient 1 and the transform coefficient 2 have non-zero values, the significant number of the transform coefficient is 2, and the significant number of the transform coefficient is smaller than the threshold 3, step S303 is performed.
For another example, assuming that transform coefficient 1, transform coefficient 2, transform coefficient 3, and transform coefficient 4 have non-zero values, the significant number of transform coefficients is 4, the significant number of transform coefficients is not less than the set threshold 3, and step S304 is performed.
In the embodiment of the present application, how to implement inverse quantization of video data will be specifically described by the following pseudo codes:
Figure GDA0002376609570000131
and if yes, carrying out inverse quantization on the transformation coefficient by adopting a conventional scalar quantization method, otherwise, carrying out inverse quantization on the transformation coefficient by adopting a scalar-dependent quantization method.
Step S303: and carrying out inverse quantization on the object to be subjected to inverse quantization based on a conventional scalar quantization method.
Specifically, a corresponding first quantization step is determined based on a first quantization parameter, a corresponding first scaling factor and a first shift parameter are determined based on the first quantization step, and each object to be dequantized is dequantized based on the first scaling factor and the first shift parameter.
For example, assuming that only the DC coefficient among the transform coefficients has a nonzero value of 20, the DC coefficient refers to the first transform coefficient in the upper left corner of a 4 × 4 matrix, at which time the significant number of transform coefficients is less than a set threshold of 3, the DC coefficient is inverse quantized based on the conventional scalar quantization method, i.e., a corresponding first quantization step size of 6.5 is determined based on the first quantization parameter 20, a corresponding first scaling factor (levelScale0) and first shift parameter (shift0) are determined based on the first quantization step size of 6.5, and as shown in the above pseudo code, a corresponding mapping from the scan index (scanIdx) to the position of the DC coefficient is specified by arrays scanidxtox and scanidxypop, and then, based on levelScale0 and shift0, the reconstructed transform coefficient is calculated using the following formula:
trec=(w[x][y]*levelScale0*n+(1<<(shift0-1)))>>shift0 (1)
the dynamic range of clipping support is then given again by the parameters coeffMin and coeffMax and the reconstructed DC coefficients are stored in the reconstructed transform coefficient array d [ ] [ ].
For another example, assuming that only the non-zero-value transform coefficient 1 other than the DC coefficient is included in the transform coefficient and the value of the transform coefficient 1 is 30, in this case, the significant number of transform coefficients is less than a set threshold 3, the transform coefficients 1 are dequantized based on a conventional scalar quantization method, i.e. based on the first quantization parameter 20, a corresponding first quantization step size 6.5 is determined, based on the first quantization step size 6.5, a corresponding first scaling factor (levelScale0) and first shift parameter (shift0) are determined, as indicated in the above pseudo code, the corresponding mapping from the scan index (scanIdx) to the position of transform coefficient 1 is specified by the arrays scanIdxToXpos and scanIdxToYpos, then, based on levelScale0 and shift0, the reconstructed transformation coefficient is calculated by formula (1), then, the dynamic range of clipping support is given again by coeffMin and coeffMax, and the reconstructed transform coefficient 1 is stored in the reconstructed transform coefficient array d [ ] [ ].
For another example, assuming that only transform coefficient 1 and transform coefficient 2 among the transform coefficients have nonzero values, the transform coefficient 1 has a value of 30, and the transform coefficient 2 has a value of 35, at which the effective number of transform coefficients is less than a set threshold 3, inverse quantization is performed on the transform coefficient 1 and the transform coefficient 2, respectively, based on a conventional scalar quantization method, that is, a corresponding first quantization step 6.5 is determined based on the first quantization parameter 20, a corresponding first scaling factor (levelScale0) and a first shift parameter (shift0) are determined based on the first quantization step 6.5, as indicated by the above pseudo code, a corresponding mapping from a scan index (scanidxpos) to the positions of the transform coefficient 1 and the transform coefficient 2 is specified sequentially by arrays scanidxpos and scanidxypops, then, based on levelScale0 and shift0, the reconstructed transform coefficient is calculated by equation (1), then, a cofefmin and a supported clipping range of the transform coefficient 1 is given by cofeffmin, and the reconstructed transform coefficient 1 is clipped, The reconstructed transform coefficient 2 is stored in the reconstructed transform coefficient array d [ ] [ ]
Step S304: and carrying out inverse quantization on the object to be inversely quantized based on a dependent scalar quantization method.
Specifically, when step S304 is executed, an initial state is read for a first object to be dequantized, then a scalar quantizer used by the first object to be dequantized in the initial state is determined, a corresponding second quantization step is determined based on a second quantization parameter corresponding to the scalar quantizer used in the initial state, a corresponding second scaling factor and a second shift parameter are determined based on the second quantization step, and dequantization is performed on the first object to be dequantized;
next, starting from the second object to be dequantized, the following operations are performed for each object to be dequantized in turn, including:
a1, reading an object to be dequantized, and determining the quantization value of the last object to be dequantized;
a2, determining the current state of the object to be dequantized based on the quantization value, and determining that the object to be dequantized adopts a scalar quantizer corresponding to the current state based on the current state of the object to be dequantized;
and A3, determining a quantization step size corresponding to the scalar quantizer corresponding to the current state based on the scalar quantizer corresponding to the current state, determining a scaling factor and a shift parameter corresponding to the scalar quantizer corresponding to the current state based on the quantization step size, and performing inverse quantization on the object to be inverse quantized.
It should be noted that, when performing inverse quantization for each object to be inverse quantized in sequence starting from the second object to be inverse quantized, the scalar quantizer used may be the same as the first object to be inverse quantized, that is, the second quantization parameter is used, but different from the first object to be inverse quantized, that is, the third quantization parameter is used.
For example, it is possible to repeatedly switch between the scalar quantizers Q0 and Q1 based on the current state of the object to be dequantized, and if the current state of the second object to be dequantized is state 1, the scalar quantizer Q0 is used, and the current state of the third object to be dequantized is state 2, the scalar quantizer Q1 is used.
For example, first, referring to fig. 2, it is determined that the initial state is state 0, the current state of the transform coefficient 1 is state 0, and thus it is determined that the transform coefficient 1 uses the scalar quantizer Q0 in state 0, then, based on the second quantization parameter 21 corresponding to the scalar quantizer Q0, the corresponding second quantization step is determined to be 7, and based on the second quantization step 7, the second scaling factor and the second shift parameter corresponding to Q0 are determined, as shown in the above pseudo code, the second scaling factor is levelScale, and the second shift parameter is shift, the corresponding mapping from the scan index (scanIdx) to the position of the transform coefficient 1 is specified by the arrays scanidxtox and scanidtoypos, and based on the levelScale and shift, the reconstructed transform coefficient is calculated using the following formula:
trec=(w[x][y]*levelScale*n+(1<<(shift-1)))>>shift (2)
then, the dynamic range of clipping support is given again by coeffMin and coeffMax, and the reconstructed transform coefficient 1 is stored in the reconstructed transform coefficient array d [ ] [ ].
Then, the transform coefficient 2 is read, and the quantized value of the transform coefficient 1 is determined by the array TransCoeffLevel [ ], then, based on the quantized value of the transform coefficient 1, the current state of the transform coefficient 2 is determined to be state 2, and based on the state 2, it is determined that the transform coefficient 2 adopts the scalar quantizer Q1 corresponding to the state 2. The quantization step corresponding to Q1 is determined based on the scalar quantizer Q1, thereby determining a third scaling factor and a third shift parameter corresponding to Q1, as indicated by the above pseudo code, the third scaling factor being levelScale and the third shift parameter being shift, specifying a correspondence mapping from the scan index (scanIdx) to the position of the transform coefficient 1 by the arrays scanIdxToXpos and scanidxttytoypos, and calculating the reconstructed transform coefficient by using formula (2) based on levelScaleshift, then giving the dynamic range of clipping support by coeffMin and coeffMax, and storing the reconstructed transform coefficient 2 in the reconstruction transform coefficient array d [ ].
Then, the transform coefficient 3 is read, and the quantized value of the transform coefficient 2 is determined by the array TransCoeffLevel [ ], then, based on the quantized value of the transform coefficient 2, the current state of the transform coefficient 3 is determined to be state 3, and based on state 3, it is determined that state 3 adopts the scalar quantizer Q1 corresponding to state 3. The quantization step corresponding to Q1 is determined based on scalar quantizer Q1, thereby determining a third scaling factor and a third shift parameter corresponding to Q1, as indicated by the above pseudo code, the third scaling factor being levelScale and the third shift parameter being shift, specifying a correspondence mapping from scan index (scanIdx) to position of transform coefficient 1 by the arrays scanIdxToXpos and scanidxttoypos, and calculating a reconstructed transform coefficient using equation (2) based on levelScale and shift, then giving a dynamic range of clipping support by coeffMin and coeffMax, and storing reconstructed transform coefficient 3 in reconstructed transform coefficient array d [ ] [ ].
Finally, the transform coefficient 4 is read, and the quantized value of the transform coefficient 3 is determined by the array TransCoeffLevel [ ], then, based on the quantized value of the transform coefficient 3, the current state of the transform coefficient 4 is determined to be state 1, and based on state 1, it is determined that the transform coefficient 4 adopts the scalar quantizer Q0 corresponding to state 1. The quantization step corresponding to Q0 is determined based on scalar quantizer Q0, thereby determining a second scaling factor and a second shift parameter corresponding to Q0, the second scaling factor being levelScale and the second shift parameter being shift, as indicated by the above pseudo code, the corresponding mapping from scan index (scanIdx) to the position of transform coefficient 1 is specified by the arrays scanIdxToXpos and scanidxttoypos, and the reconstructed transform coefficient is calculated using equation (2) based on levelScale and shift, then the dynamic range of clipping support is given by coeffMin and coeffMax, and reconstructed transform coefficient 4 is stored in the reconstructed transform coefficient array d [ ] [ ].
It should be noted that, in the embodiment of the present application, a difference between the first quantization parameter and the second quantization parameter is N, where N is an arbitrary integer, for example, the first quantization parameter is QP, and the second quantization parameter is QP + 1.
For example, when inverse quantization is performed on the DC coefficient based on the conventional scalar quantization method, the corresponding quantization step is determined using the first quantization parameter 20, and when quantization is performed on the transform coefficient 1 based on the dependent scalar quantization method, the corresponding quantization step is determined using the second quantization parameter 21.
In the embodiment of the application, after an object to be inversely quantized is determined based on a data block to be reconstructed, the object to be inversely quantized is encoded by adopting a first context model based on a dependent scalar quantization method before the object to be inversely quantized is inversely quantized;
after determining an object to be inversely quantized based on a data block to be reconstructed, encoding the object to be inversely quantized by adopting a second context model before inversely quantizing the object to be inversely quantized based on a dependent scalar quantization method;
wherein the first context model is different from the second context model.
For example, after determining that an object to be inverse-quantized is a DC coefficient based on a data block to be reconstructed, the DC coefficient is encoded using a context model for transform coefficient level encoding before inverse-quantizing the DC coefficient based on a dependent scalar quantization method.
For another example, after determining the transform coefficient 1 to be dequantized based on the data block to be reconstructed, the transform coefficient 1 is encoded using the original context model used in the dependent scalar quantization before dequantizing the transform coefficient 1 based on the dependent scalar quantization method.
Step S305: and decoding the data block to be reconstructed based on the obtained inverse quantization result.
In the embodiments of the present application, for convenience of description, only the inverse quantization result is taken as an example of a reconstructed variation coefficient.
Specifically, based on the inverse quantization result, reconstructed residual data is obtained, and based on the reconstructed residual data and the corresponding reference data block, the data block to be reconstructed is decoded.
For example, the inverse quantization results in: the method comprises the steps of reconstructing a transform coefficient 1, a reconstructed transform coefficient 2, a reconstructed transform coefficient 3 and a reconstructed transform coefficient 4, inverse transforming the reconstructed transform coefficient 1, the reconstructed transform coefficient 2, the reconstructed transform coefficient 3 and the reconstructed transform coefficient 4 to obtain reconstructed residual data 1, and then decoding a data block CU to be reconstructed based on the reconstructed residual data 1 and a corresponding reference data block 1.
Based on the same inventive concept, the embodiment of the present application provides another solution for video data decoding.
In the embodiment of the present application, before performing inverse quantization on video data, a corresponding initial state is set for the data block to be reconstructed, and configuration information is set according to the initial state, including but not limited to the following two cases:
in the first case: and uniformly setting corresponding initial states aiming at the images to which the data blocks to be reconstructed belong, and setting configuration information according to the uniformly set initial states.
For example, for images to which CTUs belong, the corresponding initial state is set to be state 1 in a unified manner, and according to the state 1, configuration information 1 is set, and the state 1 is carried in the configuration information 1.
In the second case: and setting an exclusive initial state for the data block to be reconstructed, and setting configuration information according to the exclusive initial state.
For another example, for a CTU, the initial state of the CTU is set to be state 3, and according to state 3, configuration information 2 is set, where the initial state of the CTU is carried in configuration information 2.
Specifically, when it is determined that the effective number of objects to be dequantized included in a data block to be quantized is smaller than a set threshold, a dedicated initial state is set for the data block to be reconstructed.
For example, the data block to be reconstructed is a CTU, the object to be dequantized is a quantized transform coefficient, the effective number of the quantized transform coefficient is 4, and is smaller than the set threshold 3, then an exclusive initial state, i.e., state 3, is set for the CTU, and then configuration information 2 is set according to state 3, where the initial state of the CTU is carried in configuration information 2.
Referring to fig. 4, in the embodiment of the present application, a detailed flow of a video data dequantization method is as follows:
step S401: and acquiring a data block to be reconstructed based on the video data to be decoded, and determining an object to be dequantized based on the data block to be reconstructed.
In this embodiment of the application, step S401 is implemented in the same manner as step S301, and the object to be dequantized may be determined by using, but not limited to, manner 1, manner 2, and manner 3, which are not described herein again.
Step S402: acquiring preset configuration information, wherein the configuration information carries a set initial state.
For example, configuration information 1 is obtained, where configuration information 1 carries state 1, and the state 1 representation is dequantized by using a scalar quantizer Q0.
For another example, configuration information 2 is obtained, where configuration information 2 carries state 3, and the state 3 representation is dequantized by using a scalar quantizer Q1.
Step S403: and carrying out inverse quantization on the object to be subjected to inverse quantization based on the initial state and a dependent scalar quantization method.
Specifically, when step S403 is executed, an initial state is read for a first object to be dequantized, then a scalar quantizer used by the first object to be dequantized in the initial state is determined, a corresponding second quantization step is determined based on a second quantization parameter corresponding to the scalar quantizer used in the initial state, a corresponding second scaling factor and a second shift parameter are determined based on the second quantization step, and dequantization is performed on the first object to be dequantized;
next, starting from the second object to be dequantized, the following operations are performed for each object to be dequantized in turn, including:
a1, reading an object to be dequantized, and determining the quantization value of the last object to be dequantized;
a2, determining the current state of the object to be dequantized based on the quantization value, and determining that the object to be dequantized adopts a scalar quantizer corresponding to the current state based on the current state of the object to be dequantized;
and A3, determining a quantization step size corresponding to the scalar quantizer corresponding to the current state based on the scalar quantizer corresponding to the current state, determining a scaling factor and a shift parameter corresponding to the scalar quantizer corresponding to the current state based on the quantization step size, and performing inverse quantization on the object to be inverse quantized.
It should be noted that, when performing inverse quantization on each object to be inverse quantized in sequence starting from the second object to be inverse quantized, the scalar quantizer used may be the same as the first object to be inverse quantized, that is, the second quantization parameter is used, and the third quantization parameter is used, which is different from the first object to be inverse quantized.
For example, the switch between the scalar quantizers Q0 and Q1 may be repeated based on the current state of the object to be dequantized, e.g., the current state of the second object to be dequantized is state 1, using scalar quantizer Q0, the current state of the third object to be dequantized is state 2, using scalar quantizer Q1.
For example, configuration information 2 is acquired, configuration information 1 carries a set initial state, i.e., state 3, and based on state 3, inverse quantization is performed on the transform coefficients by using a scalar quantization method, and it is assumed that inverse quantization is performed on transform coefficients 5, 6, and 7 in this order.
Firstly, reading that the initial state is state 3, determining that the current state of the transform coefficient 5 is state 3, thereby determining that the transform coefficient 5 adopts the scalar quantizer Q1 in state 3, then determining the quantization step corresponding to the scalar quantizer Q1, thereby determining the third scaling factor and the third shift parameter corresponding to Q1, then, as shown in the above pseudo code, the third scaling factor is levelScale, the third shift parameter is shift, and based on levelScale and shift, calculating the reconstructed transform coefficient by using the following formula:
trec=(w[x][y]*levelScale*n+(1<<(shift-1)))>>shift (2)
then, the dynamic range of clipping support is given again by coeffMin and coeffMax, and the reconstructed transform coefficient 5 is stored in the reconstructed transform coefficient array d [ ] [ ].
Then, after that, the transform coefficient 6 is read, and the quantized value of the transform coefficient 5 is determined by the array TransCoeffLevel [ ], then, based on the quantized value of the transform coefficient 5, the current state corresponding to the transform coefficient 6 is determined to be state 1, and based on the state 1, it is determined that the transform coefficient 6 adopts the scalar quantizer Q0 corresponding to the state 1. The quantization step corresponding to Q0 is determined based on scalar quantizer Q0, thereby determining a second scaling factor and a second shift parameter corresponding to Q0, the second scaling factor being levelScale and the second shift parameter being shift, as indicated by the above pseudo code, the corresponding mapping from scan index (scanIdx) to the position of transform coefficient 1 is specified by the arrays scanIdxToXpos and scanidxttoypos, and the reconstructed transform coefficient is calculated using equation (2) based on levelScale and shift, then the dynamic range of clipping support is given by coeffMin and coeffMax, and reconstructed transform coefficient 6 is stored in the reconstructed transform coefficient array d [ ] [ ].
Then, the transform coefficient 7 is read, and the quantized value of the transform coefficient 6 is determined by the array TransCoeffLevel [ ], then, based on the quantized value of the transform coefficient 6, the current state corresponding to the transform coefficient 7 is determined to be 2, and based on the state 2, it is determined that the transform coefficient 7 adopts the scalar quantizer Q1 corresponding to the state 2. The quantization step corresponding to Q1 is determined based on scalar quantizer Q1, thereby determining a third scaling factor and a third shift parameter corresponding to Q1, as indicated by the above pseudo code, the third scaling factor being levelScale and the third shift parameter being shift, specifying a correspondence mapping from scan index (scanIdx) to the position of transform coefficient 1 by the arrays scanIdxToXpos and scanidxttoypos, and calculating the reconstructed transform coefficient using equation (2) based on levelScale and shift, then giving the dynamic range of clipping support by coeffMin and coeffMax, and storing reconstructed transform coefficient 7 in reconstructed transform coefficient array d [ ] [ ].
Step S404: and decoding the data block to be reconstructed based on the obtained inverse quantization result.
In the embodiments of the present application, for convenience of description, only the inverse quantization result is taken as an example of a reconstructed variation coefficient.
Specifically, based on the inverse quantization result, reconstructed residual data is obtained, and based on the reconstructed residual data and the corresponding reference data block, the data block to be reconstructed is decoded.
For example, the inverse quantization results in: the reconstructed transform coefficients 5, 6, 7 are inverse transformed to obtain reconstructed residual data 2, and then the data block to be reconstructed CTU is decoded based on the reconstructed residual data 2 and the corresponding reference data block 2.
Based on the same inventive concept, in the embodiment of the present application, there is provided a video data decoding apparatus 500, as shown in fig. 5, comprising at least a determining unit 501, a first quantizing unit 502, a second quantizing unit 503, and a decoding unit 504, wherein,
a determining unit 501, configured to obtain a data block to be reconstructed based on video data to be decoded, and determine an object to be dequantized based on the data block to be reconstructed;
a first quantization unit 502, configured to perform inverse quantization on the object to be inverse quantized based on a conventional scalar quantization method when it is determined that the effective number of the object to be inverse quantized is smaller than a set threshold;
a second quantization unit 503, configured to perform inverse quantization on the object to be inverse quantized based on a dependent scalar quantization method when it is determined that the effective number of the object to be inverse quantized is not less than the set threshold;
a decoding unit 504, configured to decode the data block to be reconstructed based on the obtained inverse quantization result.
Optionally, when determining the object to be dequantized based on the data block to be reconstructed, the determining unit 501 is configured to:
determining pixels contained in the data block to be reconstructed as the object to be dequantized; alternatively, the first and second electrodes may be,
determining corresponding residual data as an object to be inversely quantized based on a data block to be reconstructed; alternatively, the first and second electrodes may be,
and determining the corresponding transformation coefficient as the object to be inversely quantized based on the data block to be reconstructed.
Optionally, the first quantization unit 502 is specifically configured to, based on a conventional scalar quantization method, determine a corresponding quantization step size by using a first quantization parameter when performing inverse quantization on the object to be inverse-quantized;
the second quantization unit 503 is specifically configured to, based on a dependent scalar quantization method, determine a corresponding quantization step size by using a second quantization parameter when performing inverse quantization on the object to be inverse-quantized;
and the difference value of the first quantization parameter and the second quantization parameter is N, wherein N is any integer. Optionally, the first quantization unit 502 is further configured to, after determining an object to be inverse quantized based on a data block to be reconstructed, encode the object to be inverse quantized with a first context model based on a conventional scalar quantization method before inverse quantization of the object to be inverse quantized;
the second quantization unit 503 is further configured to, after determining an object to be dequantized based on a data block to be reconstructed, encode the object to be dequantized with a second context model based on a dependent scalar quantization method before dequantizing the object to be dequantized;
wherein the first context model is different from the second context model.
Optionally, when the data block to be reconstructed is decoded based on the obtained inverse quantization result, the decoding unit 504 is specifically configured to:
and obtaining reconstructed residual data based on the inverse quantization result, and decoding the data block to be reconstructed based on the reconstructed residual data and the corresponding reference data block.
Based on the same inventive concept, in the embodiment of the present application, there is provided a video data decoding apparatus 600, as shown in fig. 6, which at least includes a determining unit 601, an obtaining unit 602, a quantizing unit 603, and a decoding unit 604, wherein,
a determining unit 601, configured to obtain a data block to be reconstructed based on video data to be decoded, and determine an object to be dequantized based on the data block to be reconstructed;
an obtaining unit 602, configured to obtain preset configuration information, where the configuration information carries a set initial state;
a quantization unit 603 configured to perform inverse quantization on the object to be inverse-quantized based on the initial state and depending on a scalar quantization method;
a decoding unit 604, configured to decode the data block to be reconstructed based on the obtained inverse quantization result.
Optionally, before determining the object to be dequantized based on the data block to be reconstructed, the method further includes a configuration unit 605, where the configuration unit 605 is configured to:
uniformly setting corresponding initial states aiming at the images to which the data blocks to be reconstructed belong, and setting configuration information according to the uniformly set initial states; alternatively, the first and second electrodes may be,
and setting an exclusive initial state for the data block to be reconstructed, and setting configuration information according to the exclusive initial state.
Optionally, when setting a dedicated initial state for the data block to be reconstructed, the configuration unit 605 is configured to:
and when the effective number of the objects to be inversely quantized contained in the data block to be reconstructed is determined to be less than a set threshold value, setting an exclusive initial state for the data block to be reconstructed.
Optionally, when the data block to be reconstructed is decoded based on the obtained inverse quantization result, the decoding unit 604 is specifically configured to:
and obtaining reconstructed residual data based on the inverse quantization result, and decoding the data block to be reconstructed based on the reconstructed residual data and the corresponding reference data block.
Fig. 7 is a block diagram illustrating an apparatus 700 for video data decoding according to an example embodiment. For example, the apparatus 700 may be provided as a server. Referring to fig. 7, apparatus 700 includes a processing component 722 that further includes one or more processors and memory resources, represented by memory 732, for storing instructions, such as applications, that are executable by processing component 722. The application programs stored in memory 732 may include one or more modules that each correspond to a set of instructions. Further, the processing component 722 is configured to execute instructions to perform the above-described method:
acquiring a data block to be reconstructed based on video data to be decoded, and determining an object to be inversely quantized based on the data block to be reconstructed;
when the effective number of the objects to be inversely quantized is determined to be smaller than a set threshold value, inversely quantizing the objects to be inversely quantized based on a conventional scalar quantization method;
when the effective number of the objects to be inversely quantized is determined to be not less than the set threshold, inversely quantizing the objects to be inversely quantized based on a dependent scalar quantization method;
and decoding the data block to be reconstructed based on the obtained inverse quantization result.
Optionally, when determining the object to be dequantized based on the data block to be reconstructed, the processing component 722 is configured to:
determining pixels contained in the data block to be reconstructed as the object to be dequantized; alternatively, the first and second electrodes may be,
determining corresponding residual data as an object to be inversely quantized based on a data block to be reconstructed; alternatively, the first and second electrodes may be,
and determining the corresponding transformation coefficient as the object to be inversely quantized based on the data block to be reconstructed.
Optionally, based on a conventional scalar quantization method, when performing inverse quantization on the object to be inverse quantized, the processing component 722 is configured to determine a corresponding quantization step size by using a first quantization parameter;
when the object to be dequantized is dequantized based on the dependent scalar quantization method, the processing component 722 is configured to determine a corresponding quantization step using the second quantization parameter;
and the difference value of the first quantization parameter and the second quantization parameter is N, wherein N is any integer.
Optionally, after determining the object to be dequantized based on the data block to be reconstructed, based on a conventional scalar quantization method, before dequantizing the object to be dequantized, the processing component 722 is configured to encode the object to be dequantized by using a first context model;
after determining the object to be dequantized based on the data block to be reconstructed, the processing component 722 is configured to encode the object to be dequantized with a second context model based on a dependent scalar quantization method before dequantizing the object to be dequantized;
wherein the first context model is different from the second context model.
Optionally, when the data block to be reconstructed is decoded based on the obtained inverse quantization result, the processing component 722 is configured to:
and obtaining reconstructed residual data based on the inverse quantization result, and decoding the data block to be reconstructed based on the reconstructed residual data and the corresponding reference data block.
The apparatus 700 may also include a power component 726 configured to perform power management of the apparatus 700, a wired or wireless network interface 750 configured to connect the apparatus 700 to a network, and an input output (I/O) interface 758. The apparatus 700 may operate based on an operating system stored in memory 732, such as a Windows Server, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, or similar operating system.
Fig. 8 is a block diagram illustrating another apparatus 800 for video data decoding according to an example embodiment. For example, the apparatus 800 may be provided as a server. Referring to FIG. 8, the apparatus 800 includes a processing component 822, which further includes one or more processors, and memory resources, represented by memory 832, for storing instructions, such as applications, that are executable by the processing component 822. The application programs stored in memory 832 may include one or more modules that each correspond to a set of instructions. Further, the processing component 822 is configured to execute instructions to perform the above-described method:
acquiring a data block to be reconstructed based on video data to be decoded, and determining an object to be inversely quantized based on the data block to be reconstructed;
acquiring preset configuration information, wherein the configuration information carries a set initial state;
carrying out inverse quantization on the object to be subjected to inverse quantization based on the initial state and a dependent scalar quantization method;
and decoding the data block to be reconstructed based on the obtained inverse quantization result.
Optionally, before determining the object to be dequantized based on the data block to be reconstructed, the processing component 822 is configured to:
uniformly setting corresponding initial states aiming at the images to which the data blocks to be reconstructed belong, and setting configuration information according to the uniformly set initial states; alternatively, the first and second electrodes may be,
and setting an exclusive initial state for the data block to be reconstructed, and setting configuration information according to the exclusive initial state.
Optionally, a dedicated initial state is set for the data block to be reconstructed, and the processing component 822 is configured to:
and when the effective number of the objects to be inversely quantized contained in the data block to be reconstructed is determined to be less than a set threshold value, setting an exclusive initial state for the data block to be reconstructed.
Optionally, based on the obtained inverse quantization result, the data block to be reconstructed is decoded, and the processing component 822 is configured to:
and obtaining reconstructed residual data based on the inverse quantization result, and decoding the data block to be reconstructed based on the reconstructed residual data and the corresponding reference data block.
The device 800 may also include a power component 826 configured to perform power management of the device 800, a wired or wireless network interface 850 configured to connect the device 800 to a network, and an input/output (I/O) interface 858. The apparatus 800 may operate based on an operating system stored in the memory 832, such as a Windows Server, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, or the like.
In an exemplary embodiment, a storage medium comprising instructions, such as memory 732 comprising instructions, executable by a processor of device 700 to perform the above-described method is also provided. Alternatively, the storage medium may be a non-transitory computer readable storage medium, which may be, for example, a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
In an exemplary embodiment, a storage medium comprising instructions, such as the memory 832 comprising instructions, executable by the processor of the apparatus 800 to perform the method described above is also provided. Alternatively, the storage medium may be a non-transitory computer readable storage medium, which may be, for example, a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
In the embodiment of the application, a data block to be reconstructed is obtained based on video data to be decoded, an object to be dequantized is determined based on the data block to be reconstructed, when the effective number of the object to be dequantized is smaller than a set threshold value, dequantization is performed on the object to be dequantized based on a conventional scalar quantization method, otherwise, dequantization is performed on the object to be dequantized based on a dependent scalar quantization method, and then the data block to be reconstructed is decoded based on an obtained dequantization result. When the effective number of the objects to be inversely quantized is too small, the objects to be inversely quantized are inversely quantized based on a conventional scalar quantization method instead of a dependent scalar quantization method, so that MSE distortion caused by too few objects to be inversely quantized is avoided, potential precision loss is reduced, and the video quality is improved.
For the system/apparatus embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and reference may be made to some descriptions of the method embodiments for relevant points.
It is to be noted that, in this document, relational terms such as first and second, and the like are used solely to distinguish one entity or operation from another entity or operation without necessarily requiring or implying any actual such relationship or order between such entities or operations.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While the preferred embodiments of the present application have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all alterations and modifications as fall within the scope of the application.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is intended to include such modifications and variations as well.

Claims (12)

1. A method for decoding video data, comprising:
acquiring a data block to be reconstructed based on video data to be decoded, and determining an object to be dequantized based on the data block to be reconstructed;
when the effective number of the objects to be inversely quantized is determined to be smaller than a set threshold value, inversely quantizing the objects to be inversely quantized based on a conventional scalar quantization method;
when the effective number of the objects to be inversely quantized is determined to be not less than the set threshold, inversely quantizing the objects to be inversely quantized based on a dependent scalar quantization method;
decoding the data block to be reconstructed based on the obtained inverse quantization result;
wherein the effective number is used to characterize the number of objects to be dequantized having a non-zero value.
2. The method of claim 1, wherein determining the object to be dequantized based on the block of data to be reconstructed comprises:
determining pixels contained in the data block to be reconstructed as the object to be dequantized; alternatively, the first and second electrodes may be,
determining corresponding residual data as an object to be inversely quantized based on a data block to be reconstructed; alternatively, the first and second electrodes may be,
and determining the corresponding transformation coefficient as the object to be inversely quantized based on the data block to be reconstructed.
3. The method of claim 1 or 2, further comprising:
based on a conventional scalar quantity quantization method, when the object to be subjected to inverse quantization is subjected to inverse quantization, a first quantization parameter is adopted to determine a corresponding quantization step length;
based on a dependent scalar quantization method, when the object to be subjected to inverse quantization is subjected to inverse quantization, a second quantization parameter is adopted to determine a corresponding quantization step;
and the difference value of the first quantization parameter and the second quantization parameter is N, wherein N is any integer.
4. The method of claim 1 or 2, further comprising:
after determining an object to be inversely quantized based on a data block to be reconstructed, encoding the object to be inversely quantized by adopting a first context model before inversely quantizing the object to be inversely quantized based on a conventional scalar quantization method;
after determining an object to be inversely quantized based on a data block to be reconstructed, encoding the object to be inversely quantized by adopting a second context model before inversely quantizing the object to be inversely quantized based on a dependent scalar quantization method;
wherein the first context model is different from the second context model.
5. The method of claim 1, wherein decoding the data block to be reconstructed based on the obtained inverse quantization result comprises:
and obtaining reconstructed residual data based on the inverse quantization result, and decoding the data block to be reconstructed based on the reconstructed residual data and the corresponding reference data block.
6. An apparatus for decoding video data, comprising:
the device comprises a determining unit, a reconstruction unit and a processing unit, wherein the determining unit is used for acquiring a data block to be reconstructed based on video data to be decoded and determining an object to be inversely quantized based on the data block to be reconstructed;
the first quantization unit is used for determining that the effective number of the objects to be subjected to inverse quantization is smaller than a set threshold value, and carrying out inverse quantization on the objects to be subjected to inverse quantization based on a conventional scalar quantization method;
a second quantization unit, configured to perform inverse quantization on the object to be inverse quantized based on a dependent scalar quantization method when it is determined that the effective number of the object to be inverse quantized is not less than the set threshold;
a decoding unit, configured to decode the data block to be reconstructed based on the obtained inverse quantization result;
wherein the effective number is used to characterize the number of objects to be dequantized having a non-zero value.
7. The apparatus of claim 6, wherein when determining the object to be dequantized based on the block of data to be reconstructed, the determination unit is to:
determining pixels contained in the data block to be reconstructed as the object to be dequantized; alternatively, the first and second electrodes may be,
determining corresponding residual data as an object to be inversely quantized based on a data block to be reconstructed; alternatively, the first and second electrodes may be,
and determining the corresponding transformation coefficient as the object to be inversely quantized based on the data block to be reconstructed.
8. The apparatus of claim 6 or 7,
the first quantization unit is specifically configured to, based on a conventional scalar quantization method, determine a corresponding quantization step size by using a first quantization parameter when performing inverse quantization on the object to be inverse-quantized;
the second quantization unit is specifically configured to, based on a dependent scalar quantization method, determine a corresponding quantization step size by using a second quantization parameter when performing inverse quantization on the object to be inverse-quantized;
and the difference value of the first quantization parameter and the second quantization parameter is N, wherein N is any integer.
9. The apparatus of claim 6 or 7,
the first quantization unit is further used for encoding the object to be inversely quantized by adopting a first context model before inversely quantizing the object to be inversely quantized based on a conventional scalar quantization method after determining the object to be inversely quantized based on the data block to be reconstructed;
the second quantization unit is further configured to, after determining an object to be inversely quantized based on a data block to be reconstructed, encode the object to be inversely quantized with a second context model based on a dependent scalar quantization method before inversely quantizing the object to be inversely quantized;
wherein the first context model is different from the second context model.
10. The apparatus as claimed in claim 9, wherein, when decoding the data block to be reconstructed based on the obtained dequantization result, the decoding unit is specifically configured to:
and obtaining reconstructed residual data based on the inverse quantization result, and decoding the data block to be reconstructed based on the reconstructed residual data and the corresponding reference data block.
11. An apparatus for decoding video data, comprising:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the video data decoding method of any of claims 1 to 5.
12. A storage medium, wherein instructions in the storage medium, when executed by a processor of a video data decoding apparatus, enable the processor of the video data decoding apparatus to perform the video data decoding method according to any one of claims 1 to 5.
CN201911129314.0A 2018-11-18 2019-11-18 Video data decoding method and device Active CN110944179B (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
US201862768914P 2018-11-18 2018-11-18
US62/768,914 2018-11-18

Publications (2)

Publication Number Publication Date
CN110944179A CN110944179A (en) 2020-03-31
CN110944179B true CN110944179B (en) 2022-01-25

Family

ID=69907070

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911129314.0A Active CN110944179B (en) 2018-11-18 2019-11-18 Video data decoding method and device

Country Status (1)

Country Link
CN (1) CN110944179B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111770338B (en) * 2020-07-22 2022-05-13 腾讯科技(深圳)有限公司 Method, device and equipment for determining index value of coding unit and storage medium
CN113068033B (en) * 2021-03-11 2022-05-31 腾讯科技(深圳)有限公司 Multimedia inverse quantization processing method, device, equipment and storage medium
WO2023004590A1 (en) * 2021-07-27 2023-02-02 Oppo广东移动通信有限公司 Video decoding and encoding methods and devices, and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2005032117A3 (en) * 2003-09-24 2005-06-02 Texas Instruments Inc 8x8 transform and quantization
CN101043633A (en) * 2006-06-05 2007-09-26 华为技术有限公司 Quantization matrix selecting method, apparatus of coding and coding/decoding method and system
CN101938654A (en) * 2010-08-17 2011-01-05 浙江大学 Method and device for optimizing and quantifying conversion coefficients
US10356443B2 (en) * 2015-11-20 2019-07-16 Thales Image compression method allowing a set compression quality to be obtained

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2005032117A3 (en) * 2003-09-24 2005-06-02 Texas Instruments Inc 8x8 transform and quantization
CN101043633A (en) * 2006-06-05 2007-09-26 华为技术有限公司 Quantization matrix selecting method, apparatus of coding and coding/decoding method and system
CN101938654A (en) * 2010-08-17 2011-01-05 浙江大学 Method and device for optimizing and quantifying conversion coefficients
US10356443B2 (en) * 2015-11-20 2019-07-16 Thales Image compression method allowing a set compression quality to be obtained

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Non-CE7: Alternative Entropy Coding for Dependent Quantization;Heiko Schwarz;《JVET》;20180718;全文 *
Universal Trellis Coded Quantization;James H. Kasner;《IEEE》;19911201;全文 *

Also Published As

Publication number Publication date
CN110944179A (en) 2020-03-31

Similar Documents

Publication Publication Date Title
US11694125B2 (en) Image encoder using machine learning and data processing method of the image encoder
KR102165340B1 (en) Methods of determination for chroma quantization parameter and apparatuses for using the same
US11936884B2 (en) Coded-block-flag coding and derivation
US11750841B2 (en) Methods and apparatuses for coding transform blocks
US11265558B2 (en) Cross-component adaptive loop filter
WO2020253828A1 (en) Coding and decoding method and device, and storage medium
US20180288416A1 (en) Method and apparatus of context modelling for syntax elements in image and video coding
US11070812B2 (en) Coefficient domain block differential pulse-code modulation in video coding
US11451840B2 (en) Trellis coded quantization coefficient coding
US11245897B2 (en) Methods and apparatuses for signaling partioning information for picture encoding and decoding
CN110944179B (en) Video data decoding method and device
CN114930817A (en) Signaling technique for quantizing related parameters
US20200260122A1 (en) Apparatus and method for picture coding with asymmetric partitioning
JP2022172137A (en) Method and apparatus for image filtering with adaptive multiplier coefficients
US10992937B2 (en) Coefficient coding with grouped bypass bins
CN114257810A (en) Context model selection method, device, equipment and storage medium
CN113709459B (en) Intra-frame prediction method, device and computer storage medium
WO2021263251A1 (en) State transition for dependent quantization in video coding
WO2022191947A1 (en) State based dependent quantization and residual coding in video coding
WO2020000487A1 (en) Transformation method, inverse transformation method and apparatus
CN116965033A (en) Residual and coefficient coding for video coding

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
GR01 Patent grant
GR01 Patent grant