Adaptive quantization for zero coefficients in video coding

Adaptive quantization for zero transform coefficients in video coding improves compression efficiency and reconstruction quality by shifting quantization indices based on neighboring coefficients, addressing inefficiencies in existing standards.

WO2025149016A1PCT designated stage expired Publication Date: 2025-07-17MEDIATEK INC
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2025/071672
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-01-24
Filing Date
2025-01-10
Publication Date
2025-07-17

AI Technical Summary

Technical Problem

Existing video coding standards face challenges in effectively handling zero transform coefficients during quantization, leading to inefficiencies in bitstream compression and reconstruction quality.

Method used

Adaptive quantization is applied to zero transform coefficients by shifting the quantization index based on the signs and neighboring coefficients, using specific shifting parameters and criteria to improve the reconstruction process.

Benefits of technology

Enhances the efficiency of bitstream compression and improves the quality of reconstructed video by optimizing the handling of zero transform coefficients.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025071672_17072025_PF_FP_ABST
    Figure CN2025071672_17072025_PF_FP_ABST
Patent Text Reader

Abstract

A method of applying adaptive quantization to zero transform coefficients when coding pixel blocks is provided. A video coder receives or generates a quantization index corresponding to a current transform coefficient of a transform block. The video coder applies a dequantization function on the quantization index to obtain a first dequantized value. The video coder shifts the quantization index to generate a shifted quantization index. When the quantization index is zero, the quantization index is shifted according to a shifting direction. The video coder applies the dequantization function on the shifted quantization index to obtain a second dequantized value. The video coder computes a reconstructed transform coefficient of the transform block based on the first and second dequantized values and reconstructs a current block of pixels based on the reconstructed transform coefficients.
Need to check novelty before this filing date? Find Prior Art

Description

ADAPTIVE QUANTIZATION FOR ZERO COEFFICIENTS IN VIDEO CODINGCROSS REFERENCE TO RELATED PATENT APPLICATION (S)

[0001] The present disclosure is part of a non-provisional application that claims the priority benefit of U.S. Provisional Patent Application Nos. 63 / 620,198 and 63 / 624,327, filed on 12 January 2024 and 24 January 2024, respectively. Contents of above-listed applications are herein incorporated by reference.TECHNICAL FIELD

[0002] The present disclosure relates generally to video coding. In particular, the present disclosure relates to methods of coding pixel blocks by adaptive quantization.BACKGROUND

[0003] Unless otherwise indicated herein, approaches described in this section are not prior art to the claims listed below and are not admitted as prior art by inclusion in this section.

[0004] High-Efficiency Video Coding (HEVC) is an international video coding standard developed by the Joint Collaborative Team on Video Coding (JCT-VC) . HEVC is based on the hybrid block-based motion-compensated DCT-like transform coding architecture. The basic unit for compression, termed coding unit (CU) , is a 2Nx2N square block of pixels, and each CU can be recursively split into four smaller CUs until the predefined minimum size is reached. Each CU contains one or multiple prediction units (PUs) .

[0005] Versatile video coding (VVC) is the latest international video coding standard developed by the Joint Video Expert Team (JVET) of ITU-T SG16 WP3 and ISO / IEC JTC1 / SC29 / WG11. The input video signal is predicted from the reconstructed signal, which is derived from the coded picture regions. The prediction residual signal is processed by a block transform. The transform coefficients are quantized and entropy coded together with other side information in the bitstream. The reconstructed signal is generated from the prediction signal and the reconstructed residual signal after inverse transform on the de-quantized transform coefficients. The reconstructed signal is further processed by in-loop filtering for removing coding artifacts. The decoded pictures are stored in the frame buffer for predicting the future pictures in the input video signal.

[0006] In VVC, a coded picture is partitioned into non-overlapped square block regions represented by the associated coding tree units (CTUs) . The leaf nodes of a coding tree correspond to the coding units (CUs) . A coded picture can be represented by a collection of slices, each comprising an integer number of CTUs. The individual CTUs in a slice are processed in raster-scan order. A bi-predictive (B) slice may be decoded using intra prediction or inter prediction with at most two motion vectors (MVs) and reference indices to predict the sample values of each block. A predictive (P) slice is decoded using intra prediction or inter prediction with at most one motion vector and reference index to predict the sample values of each block. An intra (I) slice is decoded using intra prediction only.

[0007] A CTU can be partitioned into one or multiple non-overlapped coding units (CUs) using the quadtree (QT) with nested multi-type-tree (MTT) structure to adapt to various local motion and texture characteristics. A CU can be further split into smaller CUs using one of the five split types: quad-tree partitioning, vertical binary tree partitioning, horizontal binary tree partitioning, vertical center-side triple-tree partitioning, horizontal center-side triple-tree partitioning.

[0008] Each CU contains one or more prediction units (PUs) . The prediction unit, together with the associated CU syntax, works as a basic unit for signaling the predictor information. The specified prediction process is employed to predict the values of the associated pixel samples inside the PU. Each CU may contain one or more transform units (TUs) for representing the prediction residual blocks. A transform unit (TU) is comprised of a transform block (TB) of luma samples and two corresponding transform blocks of chroma samples and each TB correspond to one residual block of samples from one color component. An integer transform is applied to a transform block. The level values of quantized coefficients together with other side information are entropy coded in the bitstream. The terms coding tree block (CTB) , coding block (CB) , prediction block (PB) , and transform block (TB) are defined to specify the 2-D sample array of one-color component associated with CTU, CU, PU, and TU, respectively. Thus, a CTU consists of one luma CTB, two chroma CTBs, and associated syntax elements. A similar relationship is valid for CU, PU, and TU.SUMMARY

[0009] The following summary is illustrative only and is not intended to be limiting in any way. That is, the following summary is provided to introduce concepts, highlights, benefits and advantages of the novel and non-obvious techniques described herein. Select and not all implementations are further described below in the detailed description. Thus, the following summary is not intended to identify essential features of the claimed subject matter, nor is it intended for use in determining the scope of the claimed subject matter.

[0010] Some embodiments provide methods of coding pixel blocks in which adaptive quantization is applied to zero transform coefficients. A video coder receives or generates a quantization index corresponding to a current transform coefficient of a transform block. The video coder applies a dequantization function on the quantization index to obtain a first dequantized value. The video coder shifts the quantization index to generate a shifted quantization index. When the quantization index is non-zero, the quantization index is shifted according to a sign of the quantization index. When the quantization index is zero, the quantization index is shifted according to a shifting direction that is determined at least partially based on one or more transform coefficients that is not the current transform coefficient. The video coder applies the dequantization function on the shifted quantization index to obtain a second dequantized value. The video coder computes a reconstructed transform coefficient of the transform block based on the first and second dequantized values and reconstructs a current block of pixels of a current picture based on the reconstructed transform coefficients of the transform block.

[0011] In some embodiments, the shifting direction is determined for each quantization index that is zero. In some embodiments, the shifting direction is determined based on one or more transform coefficients of the same frequency as the current transform coefficient of one or more neighboring blocks. The one or more neighboring blocks may be the ones having the same width, height, and / or transform type as the current block. The shifting direction may be determined based on a majority voting or the sign of the sum or average of the one or more same-frequency transform coefficients of the one or more neighboring blocks.

[0012] In some embodiments, the shifting direction is determined based on transform coefficients neighboring the current transform coefficient in the transform block. The shifting direction may be determined based on non-zero coefficients neighboring the current transform coefficient. The shifting direction may be determined based on a majority voting of the transform coefficients neighboring the current transform coefficients. In some embodiments, the shifting direction is determined by comparing the numbers of positive, negative, and zero transform coefficients neighboring the current transform coefficient. In some embodiments, the shifting direction is determined based on a sum or an average of the neighboring transform coefficients.

[0013] In some embodiments, if the number of positive neighboring coefficients is larger than the number of negative neighboring coefficients, the shifting direction is toward positive infinity; if the number of positive coefficients is smaller than the number of negative coefficients, the shifting direction is toward negative infinity; and if the number of positive coefficients is equal to the number of negative coefficients, the quantization index is not shifted (i.e., the reconstructed transform coefficient is calculated based on the first dequantized values only and the second dequantized value may not be calculated. )

[0014] In some embodiments, if the number of positive neighboring coefficients is the largest among the numbers of neighboring positive, negative, and zero transform coefficients, the shifting direction is toward positive infinity; if the number of negative neighboring coefficients is the largest among the numbers of neighboring positive, negative, and zero transform coefficients, the shifting direction is toward negative infinity; otherwise, the quantization index is not shifted (i.e., the reconstructed transform coefficient is calculated based on the first dequantized values only and the second dequantized value may not be calculated. )

[0015] In some embodiment, a same shifting direction is applied to all zero transform coefficients of the current block. In some embodiments, the shifting direction of the current block is explicitly signaled (e.g., in the bitstream. ) In some embodiments, the shifting direction is determined based on respective costs of applying positive shifting and negative shifting to the quantization index. In some embodiments, a shifting direction that minimizes a boundary matching cost is selected as the shifting direction to be applied when the quantization index is zero.

[0016] In some embodiments, when the quantization index is zero, the quantization index is shifted by a first shifting parameter value, and when the quantization index is non-zero, the quantization index is shifted by a second shifting parameter value. In some embodiments, quantization indices that correspond to different zero transform coefficients of the transform block may be shifted by different shifting parameter values. For example, in some embodiments, zero quantization indices that correspond to the first M zero coefficients in scan order are shifted by a first shifting parameter value and zero quantization indices that correspond to the remaining zero coefficients in scan order are shifted by a second shifting parameter value. For another example, in some embodiments, zero quantization indices that correspond to transform coefficients in particular 2-D positions of the transform block are shifted by a first shifting parameter value and zero quantization indices that correspond to the remaining coefficients in the transform block are shifted by a second shifting parameter value.BRIEF DESCRIPTION OF THE DRAWINGS

[0017] The accompanying drawings are included to provide a further understanding of the present disclosure, and are incorporated in and constitute a part of the present disclosure. The drawings illustrate implementations of the present disclosure and, together with the description, serve to explain the principles of the present disclosure. It is appreciable that the drawings are not necessarily in scale as some components may be shown to be out of proportion than the size in actual implementation in order to clearly illustrate the concept of the present disclosure.

[0018] FIG. 1 conceptually illustrates corresponding quantization and dequantization processes in video coding systems.

[0019] FIGS. 2A-C illustrate a section of the Versatile Video Coding (VVC) specification that specifies the dequantization  / scaling process for transform coefficients.

[0020] FIGS. 3A-B illustrate regions of interest for Low Frequency Non-Separable Transform (LFNST) .

[0021] FIG. 4 shows the mapping from intra prediction modes to LFNST sets.

[0022] FIG. 5 illustrates the reconstructed boundary samples of a current block and the reconstructed neighboring samples.

[0023] FIGS. 6A-B illustrate different N values that can be used for zero coefficients with different x-y coordinate in a transform block.

[0024] FIG. 7 shows the current and neighboring coefficients in a transform block.

[0025] FIGS. 8A-B conceptually illustrate coefficients of neighboring blocks being used to determine the shifting direction of a zero coefficient of a current block.

[0026] FIG. 9 illustrates an example video encoder that may implement adaptive quantization.

[0027] FIG. 10 illustrates portions of the video encoder that implement adaptive quantization for zero coefficients.

[0028] FIG. 11 conceptually illustrates a process uses adaptive quantization when encoding a pixel block.

[0029] FIG. 12 illustrates an example video decoder that may implement adaptive quantization.

[0030] FIG. 13 illustrates portions of the video decoder that implement adaptive quantization for zero coefficients.

[0031] FIG. 14 conceptually illustrates a process uses adaptive quantization when decoding a pixel block.

[0032] FIG. 15 conceptually illustrates an electronic system with which some embodiments of the present disclosure are implemented.DETAILED DESCRIPTION

[0033] In the following detailed description, numerous specific details are set forth by way of examples in order to provide a thorough understanding of the relevant teachings. Any variations, derivatives and / or extensions based on teachings described herein are within the protective scope of the present disclosure. In some instances, well-known methods, procedures, components, and / or circuitry pertaining to one or more example implementations disclosed herein may be described at a relatively high level without detail, in order to avoid unnecessarily obscuring aspects of teachings of the present disclosure. I. Transforms

[0034] HEVC, like its predecessors, employs transform coding of the prediction error residual. The residual block is divided into several square transform blocks (TBs) , which can be of varying sizes ranging from 4x4 to 32x32. To calculate two-dimensional transforms, 1-D transforms are performed separately in both the horizontal and vertical directions. The core transform matrices are designed by approximating scaled DCT (discrete cosine transform) basis functions while taking into account factors such as reducing the required dynamic range for transform computation and optimizing the accuracy and orthogonality of the matrix entries when represented as integer values.

[0035] VVC not only utilizes separable square transforms with kernel sizes ranging from 4x4 to 32x32, VVC also support non-square transforms by combining various kernel sizes that increase dyadically from length-2 to length-64 both horizontally and vertically.

[0036] The fundamental idea of utilizing an integer transform to the prediction residual and then quantizing the resulting coefficients is still utilized in VVC. However, VVC also implements extended transforms, refined quantization, and residual coding to achieve superior energy compaction of the prediction residual. VVC utilizes more advanced designs on transforms and quantization to achieve better coding performance.

[0037] Alternative transforms may be more effective at decorrelating the prediction residual, particularly in the case of the intra prediction residual where the prediction error tends to increase as the distance from the boundary samples increases. In HEVC, this is addressed by incorporating an additional 4x4 integer approximation of the DST type-VII for intra prediction luma residuals. VVC takes this a step further by introducing four additional horizontal / vertical combinations of separate DST type-VII and DCT type-VIII integer kernels for all square and non-square luma block sizes ranging from 4x4 to 32x32. This is known as multiple transform set (MTS) . The selection of which transform to use is either explicitly signaled per CU or implicitly derived based on the width and height of the transform block. Similar to the DCT type-II based transform of length 64, the non-DCT type-II coefficients outside a 16x16 area are zeroed out to reduce the implementation complexity of the additional transforms.

[0038] The encoder has the ability to apply a set of non-separable mode-dependent transforms to the low frequency coefficients of the DCT type-II based primary transform in intra-coded blocks. This is known as Low Frequency Non-Separable Transform (LFNST) . These additional inverse transform kernels were derived from training data to take advantage of the remaining directionality characteristics present in the intra-picture prediction residual signals.

[0039] When coding inter-predicted CUs, a sub-partition of the residual block is selected to be coded while the remaining portion is skipped. This is known as Subblock Transform (SBT) Mode. The coded residual sub-partition can be either half or one-quarter the size of the CU, with an MTS transform type for the coded residual being implicitly inferred. The left, right, top, or bottom part of the coded half or quarter sub-partition can be selected, resulting in a total of 8 modes that need to be signaled per CU.

[0040] In some embodiments, both CTU size and maximum transform size (i.e., all MTS transform kernels) are extended to 256, where the maximum intra coded block can have a size of 128x128. The maximum CTU size is set to 256 for UHD sequences and it is set to 128, otherwise. In the primary transformation process, there is no normative zeroing out operation applied on transform coefficients. However, if LFNST is applied, the primary transform coefficients outside the LFNST region are normatively zeroed-out.

[0041] In some embodiments, for MTS, only DST7 and DCT8 transform kernels are utilized which are used for intra and inter coding. Additional primary transforms including DCT5, DST4, DST1, and identity transform (IDT) may be employed. Also MTS set is made dependent on the TU size and intra mode information. 16 different TU sizes are considered, and for each TU size 5 different classes are considered depending on intra-mode information. For each class, 1, 4 or 6 different transform pairs are considered. Number of intra MTS candidates are adaptively selected (between 1, 4 and 6 MTS candidates) depending on the sum of absolute value of transform coefficients. The sum is compared against the two fixed thresholds to determine the total number of allowed MTS candidates: 1 candidate: sum ≤ th0; 4 candidates: th0 < sum ≤ th1; 6 candidates: sum > th1.

[0042] Although a total of 80 different classes are considered, some of those different classes often share exactly same transform set. So there are 58 (less than 80) unique entries in the resultant LUT. For angular modes, a joint symmetry over TU shape and intra prediction is considered. So, a mode i (i > 34) with TU shape A×B will be mapped to the same class corresponding to the mode j = (68 –i) with TU shape B×A. However, for each transform pair the order of the horizontal and vertical transform kernel is swapped. For example, for a 16x4 block with mode 18 (horizontal prediction) and a 4x16 block with mode 50 (vertical prediction) are mapped to the same class. However, the vertical and horizontal transform kernels are swapped. For the wide-angle modes the nearest conventional angular mode is used for the transform set determination. For example, mode 2 is used for all the modes between -2 and -14. Similarly, mode 66 is used for mode 67 to mode 80.

[0043] For the MTS of inter-coded CUs, four candidates: { (DST7, DST7) , (DST7, DCT8) , (DCT8, DST7) , (DCT8, DCT8) } are used for every CU. For the larger resolution sequences (width >1080) maximum CU size for Inter-MTS usage is set to 32 (i.e., Inter-MTS is used for CU with width ≤ 32 and height ≤ 32) , and for the remaining sequences (smaller resolution) it is set to 16. For 4-pt, 8-pt and 16-pt transforms, the current AMT transform cores, i.e., DST-7 and DCT-8, is replaced with separable KLTs.

[0044] In some embodiments, the LFNST is extended according to the following: the number of LFNST sets (S) and candidates (C) are extended to S=35 and C=3, and the LFNST set (lfnstTrSetIdx) for a given intra mode (predModeIntra) is derived according to the following formula: · For predModeIntra < 2, lfnstTrSetIdx is equal to 2 · lfnstTrSetIdx = predModeIntra, for predModeIntra in [0, 34] · lfnstTrSetIdx = 68 –predModeIntra, for predModeIntra in [35, 66]

[0045] Three different kernels, LFNST4, LFNST8, and LFNST16, are defined to indicate LFNST kernel sets, which are applied to 4xN / Nx4 (N≥4) , 8xN / Nx8 (N≥8) , and MxN (M, N≥16) , respectively. In some embodiments, the kernel dimensions are specified by: (LFSNT4, LFNST8*, LFNST16*) = (16x16, 32x64, 32x96)

[0046] The forward LFNST is applied to top-left low frequency region, which is called Region-Of-Interest (ROI) . When LFNST is applied, primary-transformed coefficients that exist in the region other than ROI are zeroed out. FIGS. 3A-B illustrate regions of interest for LFNST, specifically for LFNST16 and LFNST8. The figure illustrates a ROI 310 for LFNST16, which consists of six 4x4 sub-blocks that are consecutive in scan order. Since the number of input samples is 96, transform matrix for forward LFNST16 can be Rx96. R is chosen to be 32 in this contribution, 32 coefficients (two 4x4 sub-blocks) are generated from forward LFNST16 accordingly, which are placed following coefficient scan order. The figure also illustrates a ROI 320 for LFNST8. The forward LFNST8 matrix can be Rx64 and R is chosen to be 32. The generated coefficients are located in the same manner as with LFNST16.

[0047] In some embodiments, intra prediction mode that is used to encode a block can be used to determine which set of LFNST is used. FIG. 4 shows the mapping from intra prediction modes to LFNST sets. II. Scaling and Quantization

[0048] HEVC employs a quantization scheme known as Uniform Reconstruction Quantization (URQ) , which is similar to the one used in H. 264 / MPEG-4 AVC, and is governed by a quantization parameter (QP) . The QP values range from 0 to 51, and each increment of 6 results in a doubling of the quantization step size, thus providing a roughly logarithmic mapping of QP values to step sizes. Additionally, HEVC supports quantization scaling matrices. An increment of 1 in the quantization parameter results in a step size increase of roughly 12% (i.e., 21 / 6) . Meanwhile, an increase of 6 results in a doubling of the step size. The resulting relationship between and the equivalent quantization step size for an orthonormal transform is now given by Qstep (QP) = (21 / 6) QP-4, which could also be expressed as Qstep (QP) =GQP%6<< (QP / 6) , where G= [G0, G1, …G5] = [2-4 / 6, 2-3 / 6, 2-2 / 6, 2-1 / 6, 20, 21 / 6] . Qstep is then used to perform quantization in the encoding process, by scaling the transform coefficient C to get the quantized transform coefficient level L: L=C / Qstep      (1)

[0049] At the decoder, the quantization step size Qstep is used to perform dequantization in the decoding process, by scaling the quantized coefficient level L to get the transform coefficient C: C=L*Qstep       (2)

[0050] Eq. (1) can also be written as y = Q (x) , where x are the transform coefficients, Q (. ) is the quantization function (that applies the stepsize Qstep) , and y is the quantized transform coefficient levels (also known as quantization indices, yi represent an individual quantization index. ) Correspondingly, Eq. (2) can be written as x=Q-1 (y) , where Q-1 (. ) is the corresponding dequantization function for Q (. ) . For systems with finite precisions, the dequantization function Q-1 (y) can only be used to obtain reconstructed transform coefficients

[0051] In some embodiments, quantization and dequantization can be performed by scaling (e.g., bitwise shifting) and rounding (with a rounding offset. ) In other words, the formula for quantization (y = Q (x) ) can be written as: yi = round ( (T + offsetround)  / stepsize)   (3)  where yi is a quantization index calculated during the encoding process, T is the transform coefficient  value (or C in Eq. (1) , offsetround is a value for adjusting the rounding of the coefficients, stepsize is the quantization step size (or Qstep in Eq. (1) . The corresponding formula for dequantization (also termed scaling process) is: Q-1 (yi) = round (yi × stepsize + offsetround)  (4) where Q-1 (yi) is the dequantized transform coefficient (or reconstructed transform coefficient) . Since  yi and stepsize have finite precision, the dequantized transform coefficient Q-1 (yi) (or reconstructed transform coefficient  ) is not expected to be exactly the same as the original transform coefficient value T.

[0052] For some embodiments, FIG. 1 conceptually illustrates corresponding quantization and dequantization processes in video coding systems. As illustrated, a video encoder 110 generates transform coefficients (based on e.g., prediction residuals in pixel domain) . The transform coefficients (T or C or x) are quantized by a quantization function 115 to produce quantized coefficients or quantization indices (L or y) . A video decoder 120 receives the quantization indices. A dequantization function 125 performs dequantization to generate reconstructed transform coefficients (Q-1 (y) or  ) The video encoder 110 also receives the quantization indices and performs the same dequantization function 125 to generate the same reconstructed transform coefficients.

[0053] In some embodiments, the dequantization function 125 (in the encoder and the decoder) performs dequantization by scaling the quantization indices based on a stepsize (or Qstep) (with rounding and rounding offsets) . In some embodiments, the dequantization function 125 uses shifted quantization indices and adaptive quantization as described by Sections III and IV below.

[0054] FIGS. 2A-C illustrate a section of the Versatile Video Coding (VVC) specification that specifies the dequantization  / scaling process for transform coefficients. The illustrated section of VVC shows a dequantization process that includes equations (1123) through (1146) . For example, according to the equation (1145) dnc [x ] [y ] = (dz [x ] [y ] *ls [x ] [y ] + bdOffset ) >> bdShift

[0055] Q-1 (yi) corresponds to the dnc [x] [y] , yi corresponds to the dz [x] [y] , and Qstep is expressed as ls [x] [y] >>bdShift. ( [x] [y] indicate 2-D positions, not transform coefficients x or quantized indices y. ) The bdOffset is a value for adjusting the rounding effect. The quantization stepsize ls [x] [y] (or scaling factor or invQScale) is calculated based on the values of the quantization parameter (qP) and the quantization matrix m [x] [y] .

[0056] In order to achieve lower bit rates, VVC supports extended quantization control by supporting a larger maximum QP value than HEVC. While the maximum QP value in HEVC is 51, VVC can support QP values up to 63, resulting in a maximum inverse quantization scaling step size that is four times larger. The QP can be adjusted locally for rate control and perceptual optimization. To facilitate this, VVC retains the concept of quantization groups for signaling a luma QP offset and scaling lists for frequency-dependent inverse quantization scaling from HEVC, which has been adapted to support non-square block structures. The only difference from HEVC is a constant offset of 6* (b-8) which depends on the bit depth b of the decoded video samples.

[0057] In some embodiments, in LFNST, quantization is performed using integer arithmetic, with quantizer step size doubling for every increase of QP by 6. The QP remainder (QP%6) specifies a fractional scaling of the quantizer step size normalized at 16384 (corresponding to 2QUANT_SHIFT, with QUANT_SHIFT equal to 14) and using a table f [x] . When scaling lists are used, an additional fractional scaling is performed that depends on the position of the transform coefficient in the TB, with either a default scaling list used, or a scaling list supplied via a file. The additional fractional scaling is normalized at 16. Scaling lists can be derived for different sized TBs and prediction modes. When scaling lists are not used, the quantized transform coefficients qij (i, j=0.. nS-1) are derived from the transform coefficients dij (i, j=0.. nS-1) and the scaling list sij (i, j = 0.. nS-1) as qij = (dij*f [QP%6] + offset ) >> (QUANT_SHIFT +MAX_TR_DYNAMIC_RANGE + QP / 6 –log2 (nS) -BitDepth) ,

[0058] with i, j = 0, ..., nS-1, where, f[x] = {26214, 23302, 20560, 18396, 16384, 14564} , x=0, …, 5 228+QP / 6-nS-BitDepth < offset < 229+QP / 6-nS-BitDepth QUANT_SHIFT = 14 MAX_TR_DYNAMIC_RANGE = 15 when extended_precision_processing_flag is equal to 0.

[0059] When scaling lists are used, the quantized transform coefficients qij (i, j=0.. nS-1) are derived from the transform coefficients dij (i, j=0.. nS-1) and the scaling list sij (i, j = 0.. nS-1) as qij = (dij * (f [QP%6] << 4  / sij ) + offset  ) >> (QUANT_SHIFT + MAX_TR_DYNAMIC_RANGE + QP / 6 –log2 (nS) -BitDepth) , with i, j = 0, ..., nS-1

[0060] The value offset is set at 171  / 512 for I slices and 85  / 512 for P or B slices. When scaling lists are not applied, sij = 16 for all i and j. III. Shifting Quantization Centers

[0061] In some embodiments, the dequantized transform coefficients (or quantization centers) are adaptively shifted in an amount proportional to the gradient of the rate. It is assumed that rate increases by logarithm of the absolute value of the quantization centers. Thus, a simple proxy of rate prediction is assumed where the quantization indices are independent, and rate increases by logarithm of the absolute value of the quantization index:

[0062] Here, yi is the quantization index of i-th transform coefficient and a and b are constants. Using this assumption, the gradient of the rate can be written as:

[0063] In some embodiments, a look up table T = [0, α, α / 2, α / 3…, α / α] is used, where each element is the shifting amount for each possible unique absolute quantization indices. For 10-bit representation, the shifting of dequantized coefficients is performed as:

[0064] Here, |T| is length of the lookup table, yi ∈ Z is the quantization index of i-th transform coefficient, Q-1 (yi) is the dequantized value of the i-th transform coefficient,   is the shifted dequantized coefficient, yi is the auxiliary quantization index that can be calculated as: y′i = yi + (yi > 0 ? 1: -1)       (6)

[0065] The value of α is fixed to 63. The corresponding lookup table is: T = [0, 63, 31, 21, 15, 12, 10, 9, 7, 7, 6, 5, 5, 4, 4, 4, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, …, 1]

[0066] If the absolute quantization index is 0 or above 63, this method is not applied and the default dequantization is used. IV. Adaptive Quantization

[0067] In some embodiments, the y′i is extended according to: y′i = yi + (yi > 0? N: –N)    (7)

[0068] N is also referred to as shifting parameter. N can be any integer and is not limited to 1. Different N values can be utilized for a block, where a block here can be a coding unit (CU) , coding block (CB) , prediction unit (PU) , prediction block (PB) , transform unit (TU) , transform block (TB) , coding tree unit (CTU) or a coding tree block (CTB) , according to the coding information associated with the block. The coding information includes but not limited to the coding modes of the block, the size of the block, the shape of the block, the height and / or width of the block, the slice type associated with the block, the quantization parameter (QP) associated with the block and so on. The coding modes include but not limited to the following: (1) Intra mode. (2) Inter mode (and / or inter prediction direction) . (3) Intra block copy mode (IBC) . (4) Inter affine mode. (5) Inter merge mode. (6) Inter non-merge mode. (7) MTS applied block. (8) LFNST applied block. (9) SBT applied block.

[0069] In one example, different N values can be utilized for different coefficient in a block. The coefficient in different scan position or scan index or diagonal position may have different N. In some embodiments, the coefficient with different coded / decoded levels or yi may have different N. For example, N1 is used for the first M coefficients, in the order indicated by the scan index, and N2 is used for the other coefficients. For another example, the last significant coefficient is identified by last_sig_coeff_x_prefix, last_sig_coeff_x_suffix last_sig_coeff_y_prefix, and last_sig_coeff_y_suffix. N1 is used by the last M significant coefficient, in the order of scan index, and N2 is used by other coefficients.

[0070] For example, N1 may be used as the N in Eq. (7) for the TB associated with an intra mode coded block while N2 is used as the N for the TB associated with a non-intra mode coded block. N1 and N2 can be any non-negative integer. For example, N1 is 2 and N2 is 1. It is noted that N can be 0 and when N is assigned as equal to 0, it is equivalent to disabling the quantization center shift. The one or multiple N values can be predefined at both the encoder and decoder. Alternatively, the one or multiple N values can be signaled into the bitstream at different levels such as sequence level (e.g., video parameter set and sequence parameter set) , picture level (e.g., picture parameter set and picture header) , slice level (e.g., slice header) and / or block level (e.g., CTU, CU, PU, TU, CTB, CB, PB, TB) .

[0071] In some embodiments, the N value of Eq. (7) used can be implicitly determined by e.g., boundary matching. Specifically, the N value that minimizes the difference between boundary samples and neighboring samples is selected from among multiple pre-defined N values. FIG. 5 illustrates the reconstructed boundary samples 510 of a current block 500 and the reconstructed neighboring samples 520 and 522. If there are multiple pre-defined N values, the N value that minimizes the difference between the reconstructed boundary samples 510 and the reconstructed neighboring samples 520 and 522 is selected as the N value for the current block 500.

[0072] In some embodiments, different N values can be utilized depending on different yi values. It is noted that N can be 0 and when N is assigned as equal to 0, it is equivalent to disabling the quantization center shift. In some embodiments, different N values can be used for different sets of yi. Specifically, N1 is used for yi ≤ M while N2 is used for the other yi values. In some embodiment, N1 is used for | yi | ≤ M, while N2 is used for | yi | > M, where M is a positive integer. For example, M = 1, N2 = 0, N1 = 1. In this case, quantization center shift is disabled for | yi | > M.

[0073] In some embodiments, the reconstructed coefficient in Eq. (5) can be extended to the equation below:

[0074] where b is any non-negative integer (e.g 10) and w0 is also a non-negative integer while w1 is also a non-negative integer and w1 can be constrained to be (1<<b) –w0. In one example, b is 10, w0 is 984 and w1 is 40.

[0075] Different w0, w1 and b can be utilized for a block, where a block here can be a coding unit (CU) , coding block (CB) , prediction unit (PU) , prediction block (PB) , transform unit (TU) , transform block (TB) , coding tree unit (CTU) or a coding tree block (CTB) , according to the coding information associated with the block. The coding information includes but not limited to the coding modes of the block, the size of the block, the shape of the block, the height and / or width of the block, the slice type associated with the block, the quantization parameter (QP) associated with the block and so on. The coding modes include but not limited to the following: (1) Intra mode. (2) Inter mode (and / or inter prediction direction) . (3) Intra block copy mode (IBC) . (4) Inter affine mode. (5) Inter merge mode. (6) Inter non-merge mode. (7) MTS applied block. (8) LFNST applied block. (9) SBT applied block.

[0076] In some embodiments, different weight (w0 / w1) can be utilized for different coefficient in a block. The coefficient in different scan position or scan index or diagonal position can have different weight. The coefficient with different coded / decoded levels or qIdx (yi) can have different weight. For example, one pre-defined set of w0, w1 and b values is used for the first M coefficients, in the order indicated by the scan index, and another pre-defined set of w0, w1 and b values is used for the other coefficients. For another example, the last significant coefficient is identified by last_sig_coeff_x_prefix, last_sig_coeff_x_suffix last_sig_coeff_y_prefix, and last_sig_coeff_y_suffix. one pre-defined set of w0, w1 and b values is used by the last M significant coefficient, in the order of scan index, and another pre-defined set of w0, w1 and b values is used by other coefficients.

[0077] In one example, 940, 84 and 10 are used as the w0, w1 and b in Eq. (8) for the TB associated with an intra mode coded block while 982, 42 and 10 are used as the w0, w1 and b for the TB associated with a non-intra mode coded block. The one or multiple w0, w1 and b values can be predefined at both the encoder and the decoder. Alternatively, the one or multiple w0, w1 and b values can be signaled into the bitstream at different levels such as sequence level (e.g., video parameter set and sequence parameter set) , picture level (e.g. picture parameter set and picture header) , slice level (e.g. slice header) and / or block level (e.g. CTU, CU, PU, TU, CTB, CB, PB, TB) .

[0078] In some embodiments, the w0, w1 and b values used can be implicitly determined. For example, the w0, w1 and b values can be determined by boundary matching. If there are multiple sets of pre-defined w0, w1 and b values, the set of w0, w1 and b values that can minimize the difference between the reconstructed boundary samples 510 of the current block and the reconstructed neighboring samples (520 and 522) is selected.

[0079] In some embodiments, different values of w0, w1 and b can be utilized depending on different yi values. In one example, different w0, w1 and b values can be used for different sets of yi. Specifically, one predefined set of w0, w1 and b values is used for yi ≤ M while another predefined set of w0, w1 and b values is used for the other yi values. It is noted that when w0 is assigned as equal to 1<<b, it is equivalent to disabling the quantization center shift. For another example, one pre-defined set of w0, w1 and b values is used for |yi| ≤ M while another predefined set of w0, w1 and b values is used for the other yi values.

[0080] In some embodiments, the reconstructed coefficient in Eq (8) can be extended to the equation below:

[0081] where offsetBias is one integer, b is any non-negative integer (e. g 10) and w0 is also a non-negative integer while w1 is also a non-negative integer and w1 can be constrained to be (1<<b) –w0. In one example, offsetBias is (1<< (b-1) ) , b is 10, w0 is 984 and w1 is 40. In another example, offsetBias is one integer value and the sign is dependent on yi.

[0082] Different offsetBias, w0, w1, and b can be utilized for a block, where a block here can be a coding unit (CU) , coding block (CB) , prediction unit (PU) , prediction block (PB) , transform unit (TU) , transform block (TB) , coding tree unit (CTU) or a coding tree block (CTB) , according to the coding information associated with the block. The coding information includes but not limited to the coding modes of the block, the size of the block, the shape of the block, the height and / or width of the block, the slice type associated with the block, the quantization parameter (QP) associated with the block and so on. The coding modes include but not limited to the following: (1) Intra mode. (2) Inter mode (and / or inter prediction direction) . (3) Intra block copy mode (IBC) . (4) Inter affine mode. (5) Inter merge mode. (6) Inter non-merge mode. (7) MTS applied block. (8) LFNST applied block. (9) SBT applied block.

[0083] In some embodiments, different weighting (w0 / w1) and offsetBias can be utilized for different coefficient in a block. The coefficient in different scan position or scan index or diagonal position can have different weights. The coefficient with different coded / decoded levels or yi can have different weight. In one example, 512, 940, 84 and 10 are used as the offsetBias, w0, w1 and b (in Eq. (9) ) for the TB associated with an intra mode coded block while 511, 982, 42 and 10 are used as the offsetBias, w0, w1 and b for the TB associated with a non-intra mode coded block. The one or multiple offsetBias, w0, w1 and b values can be predefined at both the encoder and the decoder. Alternatively, the one or multiple offsetBias, w0, w1 and b values can be signaled into the bitstream at different levels such as sequence level (e.g., video parameter set and sequence parameter set) , picture level (e.g., picture parameter set and picture header) , slice level (e.g., slice header) and / or block level (e.g., CTU, CU, PU, TU, CTB, CB, PB, TB) .

[0084] Quantization involves rounding the transform coefficients provided by the transform block to integers and then dividing them by a scaling factor. This truncation and scaling of the coefficients' values result in some loss of information and introduces distortion in the reconstructed video frame. However, the quantization step ensures that the bitstream has a lower bitrate, making it possible to transmit the video data efficiently. Dequantization (or termed as scaling process) , on the other hand, involves multiplying the quantized coefficients by the same scaling factor and then rounding them to the nearest integer. This operation effectively reverses the quantization process and restores some of the lost information from the compressed data. The following is the quantization and dequantization operations specified for VVC: Quantization: yi = round ( (T + offset)  / stepsize) Dequantization: Q-1 (yi) = round (yi × stepsize )

[0085] yi is the quantized value calculated during the encoding process, T is the transform coefficient value, offset is a value for adjusting the rounding of the coefficients, stepsize is the quantization step size, and Q-1 (yi) is the dequantized transform coefficient. The dequantization process (also termed as scaling process) of VVC specification is described in Section II above. Q-1(yi) may correspond to the dnc [x] [y] in the equation (1145) in the VVC spec (shown in FIGS. 2A-C) , yi can correspond to the dz [x] [y] in the equation (1145) , stepsize can be expressed as ls[x] [y] >>bdShift, and the bdOffset is a value for adjusting the rounding effect. It is also noted that the quantization stepsize ls [x] [y] is calculated based on the values of the quantization parameter (qP) and the quantization matrix m [x] [y] .

[0086] In some embodiments, the determination of the stepsize value is additionally based on the the coding information associated with the block. The coding information includes but not limited to the coding modes of the block, the size of the block, the shape of the block, the height and / or width of the block, the slice type associated with the block, and so on. The coding modes include but not limited to the following: (1) Intra mode. (2) Inter mode (and / or inter prediction direction) . (3) Intra block copy mode (IBC) . (4) Inter affine mode. (5) Inter merge mode. (6) Inter non-merge mode. (7) MTS applied block. (8) LFNST applied block. (9) SBT applied block.

[0087] For example, in some embodiments, different stepsize can be utilized for different coefficient in a block. The coefficient in different scan position or scan index or diagonal position can have different stepsize. The coefficient with different coded / decoded levels or yi can have different stepsize. In some embodiments, the stepsize is scaling up / down by the equation below: stepsize = (stepsize *M )  / N,

[0088] where M and N can be any integer values. When current block is intra mode coded, the quantization stepsize is scaled up by setting N being equal to 1024 and setting M to a larger value such as 1024+64=1088.

[0089] In some embodiments, in the above mentioned methods, the “stepsize” may be replaced by levelScale or bdOffset or deQuantOffset. The coefficients in different mode / scan position / scan index / diagonal position / coded / decoded levels can have different levelScale or bdOffset or deQuantOffset. In some embodiments, for a coefficient with a coded / decoded current coefficient level, if the difference between the number of required bins / bits of the current level and its next level (e.g., coefficient level equal to the current level + 1) is smaller than a threshold (can be multiple threshold or an adaptive threshold) , the N / weight / stepsize / levelScale / bdOffset / deQuantOffset can be different from the values when the difference between the number of required bins / bits of the current level and its next level is not smaller than a threshold. V. Adaptive Quantization for Zero Coefficients

[0090] The quantization center shifting (described in Section III above) is only applied when |yi|>0, where yi is the quantization index of the i-th transform coefficients as shown in Eq. (5) (repeated here)

[0091] The various extensions of quantization center shifting described in Section IV are also only applied when |yi|>0. In Sections III and IV, the sign of yi is used to determine the shifting direction of y′i. According to Eq. (7) (repeated here) y′i = yi + (yi > 0? N: –N)    (7)

[0092] where N is a non-negative integer. If yi > 0, y′i is shifted toward positive infinity (y′i =yi + N) . If yi < 0, y′i is shifted toward negative infinity (y′i = yi –N) .

[0093] Quantization center shifting can also applied for zero coefficients, i.e., when y′i = 0. Specifically, a criterion, specified in some embodiments following, is used to determine the shifting direction of y′i, such that when yi = 0, y′i = N or y′i = –N. If y′i is shifted toward positive infinity, y′i = N. If y′i is shifted towards negative infinity, y′i = –N. Thus, y′i is calculated as: If yi ≠ 0, y′i = yi + (yi > 0? N: –N) If yi = 0, y’ i = N or -N according to a criterion   (10)

[0094] And for 10-bit representation, according to Eq. (5) , the shifting of dequantized coefficients for when yi = 0 can be performed as:

[0095] In some embodiments, zero coefficients (i.e., the transform coefficients with zero quantization index, yi = 0) and non-zero coefficients can use different N values in Eq. (10) . For example, in some embodiments, N1 is used as N value for zero coefficients and N2 is used as N value for non-zero coefficients. N1 and N2 are non-negative integers. (Note when N value is set to 0, the quantization center shift is disabled. ) So y′i is calculated as: If yi ≠ 0, y′i = yi + (yi > 0? N2: –N2) If yi = 0, y’ i = N1 or -N1 according to a criterion   (12)

[0096] In some embodiments, different N values can also be used for different zero coefficients in a block. The zero coefficient in different scan position, scan index or diagonal position can have different N. For example, N1 is used for the first M zero coefficients, in the order indicated by the scan index, and N2 is used for the other zero coefficients. For another example, the last significant coefficient is identified by last_sig_coeff_x_prefix, last_sig_coeff_x_suffix, last_sig_coeff_y_prefix, and last_sig_coeff_y_suffix. N1 is used by the last M significant zero coefficient, in the order of scan index, and N2 is used by other coefficients.

[0097] In some embodiments, different N values can also be used for zero coefficients with different x-y coordinate in a transform block. As illustrated in FIGS. 6A-B, w and h are the width and height of a transform block 600, x and y are the local x-y coordinate of a transform coefficient in the transform block. FIG. 6A shows an example in which N1 is used for coefficients at positions with x ≤ w / 4 and y ≤ h / 4. N2 is used otherwise. FIG. 6B shows an example in which N1 is used for coefficients at positions with w*y + h*x ≤ w*h / 2. N2 is used otherwise.

[0098] In some embodiments, the shifting direction of the zero coefficients is determined per coefficient. That is, the shifting direction of each zero coefficient is determined individually. In some of these embodiments, the shifting direction of each zero coefficient is determined based on its neighboring coefficients (instead of the quantization index of the current coefficients) . FIG. 7 shows the current and neighboring coefficients. As illustrated, a current coefficient in a transform block 700 is denoted as “C” , or C coefficient. The shifting direction can be determined based on the N, E, W and S coefficients. For another example, the shifting direction can be determined based on the NW, N, NE, W, E, SW, S and SE coefficients. For another example, the neighboring coefficients are taken into consideration only if they are non-zero coefficients (i.e., with |yi| > 0. )

[0099] In some embodiments, the shifting direction of a zero coefficient is determined based on the majority voting of its neighboring coefficients. For example, in some embodiments, if the number of positive coefficients is larger than the number of negative coefficients neighboring a zero coefficient, the shifting direction of the zero coefficient is toward positive infinity. If the number of positive coefficients is smaller than the number of negative coefficients neighboring the zero coefficient, the shifting direction of the zero coefficient is toward negative infinity. If the number of positive coefficients is equal to than the number of negative coefficients, the zero coefficient is not shifted (i.e., y′i = yi) . For another example, in some embodiments, by comparing the number of positive, negative, and zero coefficients neighboring the current zero coefficient, if the number of positive coefficients is the largest, the shifting direction is toward positive infinity. If the number of negative coefficients is the largest, the shifting direction is toward negative infinity. Otherwise, the coefficient is not shifted.

[0100] In some embodiments, the shifting direction of a zero coefficient is determined based on the sum or the average of the neighboring coefficients. If the sum or the average is greater than a threshold Th1, the shifting direction is toward positive infinity. If the sum or the average is smaller than another threshold Th2, the shifting direction is toward negative infinity, where Th1 ≥ Th2. If the sum or the average is between Th1 and Th2, the coefficient is not shifted. For example, Th1 and Th2 can both be zero. For another example, Th1 can be 0.5 and Th2 can be -0.5.

[0101] In some embodiments, the shifting direction is determined based on the coefficients of the neighboring block with the same frequency. For one example, only the coefficients from neighboring blocks with the same width and height as that of the current block are considered. For another example, only the coefficients from neighboring blocks with the same width, height and transform (e.g., MTS, LFNST, …) as that of the current block are considered.

[0102] FIGS. 8A-B conceptually illustrate coefficients of neighboring blocks being used to determine the shifting direction of a zero coefficient of a current block 800. FIG. 8A illustrates using coefficients of both above and left neighboring blocks 810 and 820 to determine the shifting direction of the current zero coefficient. FIG. 8B illustrates using only the coefficients of left neighboring block 810 to determine the shifting direction of the current zero coefficient. As illustrated, yic is the i-th transform coefficient of the current block 800, yia is the i-th transform coefficient of the above block 820 and yil is the i-th transform coefficient of the left neighboring block 810. (So yic, yia, and yil are transform coefficients of a same frequency in different transform blocks. )

[0103] The shifting direction yic can be determined based on yia and yil. The decision can be made based on majority voting, or the sign of the sum or the average of on yia and yil. For example, in some embodiments, if the number of positive coefficients is larger than the number of negative coefficients (e.g., both yia and yil are positive, or one is positive and one is zero, or one is positive and one is not available) , the shifting direction is toward positive infinity. If the number of positive coefficients is smaller than the number of negative coefficients, the shifting direction is toward negative infinity. If the number of positive coefficients is equal to than the number of negative coefficients, the coefficient is not shifted. For another example, in some embodiments, by comparing the number of positive, negative, and zero coefficients, if the number of positive coefficients is the largest, the shifting direction is toward positive infinity. If the number of negative coefficients is the largest, the shifting direction is toward negative infinity. Otherwise, the coefficient is not shifted.

[0104] In some embodiments, the shifting direction of the zero coefficients is determined per block. That is, the shifting direction of all the zero coefficient in the same block is the same. In some embodiments, the zero-coefficient shifting direction of a block is explicitly signaled. A flag is explicitly signaled to indicate the zero-coefficient shifting direction. The flag can be signaled at block level (e.g., CTU, CU, PU, TU, CTB, CB, PB, TB) .

[0105] In some embodiments, the zero-coefficient shifting direction of a block is implicitly derived. The shifting direction can be determined based on the cost of applying positive and negative shifting. The cost may be the boundary matching cost. The boundary matching cost is the difference between the reconstructed boundary samples of the current block and the reconstructed neighboring samples. The shifting direction that minimizes the boundary matching cost is selected as the zero-coefficient shifting direction of the block. The boundary matching cost may be computed with SAD (Sum of Absolute Differences) or SATD (Sum of Absolute Transformed Differences) in some embodiments.

[0106] For example, the boundary samples and neighboring samples of the current block 500 illustrated in FIG. 5 above can be used to determine the zero-coefficient shifting direction of the current block 500. Specifically, the zero-coefficient shifting direction can be determined based on the minimization of the boundary matching cost between the boundary samples 510 and the left and top neighboring samples 520 and 522.

[0107] In some embodiments, the quantization center shift for zero coefficients can be adaptively disabled. The decision of enabling or disabling can be made for each block. The decision of enabling or disabling the quantization center shift for zero coefficients can be explicitly signaled. A flag can be signaled for each block to determine if the quantization center shift is enabled or disabled.

[0108] In some embodiments, the decision of enabling or disabling the quantization center shift for zero coefficients may be implicitly derived. The correlation between the non-zero coefficients can be used to determine if the quantization center shift for zero coefficients is enabled or disabled. The probability of correctly predicting the sign of the non-zero coefficient by using its neighboring non-zero coefficients can be computed. If the probability is higher than a threshold, the quantization coefficient shift is enabled. Otherwise, it’s disabled. To predict the sign of the non-zero coefficients, methods described above can be used. If the shifting direction decided based on the neighboring coefficients matches the sign of the current coefficient, the sign is correctly predicted.

[0109] In some embodiments, the decision of enabling or disabling may also be made based on the coding information associated with the block. The coding information includes but not limited to the coding modes of the block, the size of the block, the shape of the block, the height and / or width of the block, the slice type associated with the block, the quantization parameter (QP) associated with the block and so on. The coding modes include but not limited to the following: (1) Intra mode. (2) Inter mode (and / or inter prediction direction) . (3) Intra block copy mode (IBC) . (4) Inter affine mode. (5) Inter merge mode. (6) Inter non-merge mode. (7) MTS applied block. (8) LFNST applied block. (9) SBT applied block.

[0110] In some embodiments, the decision of enabling or disabling quantization center shift can be made for each coefficient. The decision of enabling or disabling the quantization center shift for zero coefficients can be made according to the scan position, scan index or diagonal position of the coefficient.

[0111] Any of the foregoing proposed methods can be applied independently or jointly. Any of the parameters used in the proposed methods can be predefined at both the encoder and the decoder. Alternatively, the parameters can also be signaled into the bitstream at different levels such as sequence level (e.g., video parameter set and sequence parameter set) , picture level (e.g. picture parameter set and picture header) , slice level (e.g. slice header) and / or block level (e.g. CTU, CU, PU, TU, CTB, CB, PB, TB) . VI. Example Video Encoder

[0112] FIG. 9 illustrates an example video encoder 900 that may implement adaptive quantization. As illustrated, the video encoder 900 receives input video signal from a video source 905 and encodes the signal into bitstream 995. The video encoder 900 has several components or modules for encoding the signal from the video source 905, at least including some components selected from a transform module 910, a quantization module 911, an inverse quantization module 914, an inverse transform module 915, an intra-picture estimation module 924, an intra-prediction module 925, a motion compensation module 930, a motion estimation module 935, an in-loop filter 945, a reconstructed picture buffer 950, a MV buffer 965, and a MV prediction module 975, and an entropy encoder 990. The motion compensation module 930 and the motion estimation module 935 are part of an inter-prediction module 940. The intra-prediction module 925 and the intra-prediction estimation module 924 are part of a current picture prediction module 920, which uses current picture reconstructed samples as reference samples for prediction of the current block.

[0113] In some embodiments, the modules 910 –990 are modules of software instructions being executed by one or more processing units (e.g., a processor) of a computing device or electronic apparatus. In some embodiments, the modules 910 –990 are modules of hardware circuits implemented by one or more integrated circuits (ICs) of an electronic apparatus. Though the modules 910 –990 are illustrated as being separate modules, some of the modules can be combined into a single module.

[0114] The video source 905 provides a raw video signal that presents pixel data of each video frame without compression. A subtractor 908 computes the difference between the raw video pixel data of the video source 905 and the predicted pixel data 913 from the motion compensation module 930 or intra-prediction module 925 as prediction residual 909. The transform module 910 converts the difference (or the residual pixel data or residual signal 908) into transform coefficients (e.g., by performing Discrete Cosine Transform, or DCT) . The quantization module 911 quantizes the transform coefficients into quantized data (or quantized coefficients) 912, which is encoded into the bitstream 995 by the entropy encoder 990.

[0115] The inverse quantization module 914 de-quantizes the quantized data (or quantized coefficients) 912 to obtain transform coefficients 918, and the inverse transform module 915 performs inverse transform on the transform coefficients 918 to produce reconstructed residual 919. The reconstructed residual 919 is added with the predicted pixel data 913 to produce reconstructed pixel data 917. In some embodiments, the reconstructed pixel data 917 is temporarily stored in a line buffer 927 (or intra prediction buffer) for intra-picture prediction and spatial MV prediction. The reconstructed pixels are filtered by the in-loop filter 945 and stored in the reconstructed picture buffer 950. In some embodiments, the reconstructed picture buffer 950 is a storage external to the video encoder 900. In some embodiments, the reconstructed picture buffer 950 is a storage internal to the video encoder 900.

[0116] The intra-picture estimation module 924 performs intra-prediction based on the reconstructed pixel data 917 to produce intra prediction data. The intra-prediction data is provided to the entropy encoder 990 to be encoded into bitstream 995. The intra-prediction data is also used by the intra-prediction module 925 to produce the predicted pixel data 913.

[0117] The motion estimation module 935 performs inter-prediction by producing MVs to reference pixel data of previously decoded frames stored in the reconstructed picture buffer 950. These MVs are provided to the motion compensation module 930 to produce predicted pixel data.

[0118] Instead of encoding the complete actual MVs in the bitstream, the video encoder 900 uses MV prediction to generate predicted MVs, and the difference between the MVs used for motion compensation and the predicted MVs is encoded as residual motion data and stored in the bitstream 995.

[0119] The MV prediction module 975 generates the predicted MVs based on reference MVs that were generated for encoding previously video frames, i.e., the motion compensation MVs that were used to perform motion compensation. The MV prediction module 975 retrieves reference MVs from previous video frames from the MV buffer 965. The video encoder 900 stores the MVs generated for the current video frame in the MV buffer 965 as reference MVs for generating predicted MVs.

[0120] The MV prediction module 975 uses the reference MVs to create the predicted MVs. The predicted MVs can be computed by spatial MV prediction or temporal MV prediction. The difference between the predicted MVs and the motion compensation MVs (MC MVs) of the current frame (residual motion data) are encoded into the bitstream 995 by the entropy encoder 990.

[0121] The entropy encoder 990 encodes various parameters and data into the bitstream 995 by using entropy-coding techniques such as context-adaptive binary arithmetic coding (CABAC) or Huffman encoding. The entropy encoder 990 encodes various header elements, flags, along with the quantized transform coefficients 912, and the residual motion data as syntax elements into the bitstream 995. The bitstream 995 is in turn stored in a storage device or transmitted to a decoder over a communications medium such as a network.

[0122] The in-loop filter 945 performs filtering or smoothing operations on the reconstructed pixel data 917 to reduce the artifacts of coding, particularly at boundaries of pixel blocks. In some embodiments, the filtering or smoothing operations performed by the in-loop filter 945 include deblock filter (DBF) , sample adaptive offset (SAO) , and / or adaptive loop filter (ALF) . In some embodiments, luma mapping chroma scaling (LMCS) is performed before the loop filters.

[0123] FIG. 10 illustrates portions of the video encoder 900 that implement adaptive quantization for zero coefficients. Specifically, the figure illustrates the inverse quantization module 914 in greater detail. As illustrated, the inverse quantization module 914 receives quantization coefficients 912 from the quantization module 911 and outputs the reconstructed transform coefficients 918 for the inverse transform module 915.

[0124] As illustrated, the inverse quantization module 914 performs dequantization based on Eq.(5) or Eq. (8) or Eq. (9) or Eq. (11) , described above in Sections III, IV and V. Specifically, each quantized coefficients 912 is used as a quantization index 1020 (y) . A quantization shifter 1005 processes the quantization index 1020 of the current transform coefficient to produce a shifted quantization index 1025 according to Eq. (10) or Eq. (12) . An adaptive quantization control 1010 provides the N or N1 or N2 shifting parameter of Eq. (10) or (12) based on whether the quantization index 912 is zero, greater than zero, or less than zero. (N / N1 / N2 can also be determined based on other factors such as scan position or 2D position of the quantization index. ) Specifically, a shifting direction is applied when quantization index 912 is zero (correspond to a zero transform coefficient) , the shifting direction may be determined at least partially based on one or more transform coefficients that is not the current transform coefficient (described in Section V above. )

[0125] A scaling operation Q-1 (. ) (or dequantization operation according to Eq. (4) ) is applied to both the quantization index 1020 and the shifted quantization index 1025 to respectively produce a first dequantized value 1030 and a second dequantized value 1035. A coefficient reconstructor 1040 of the inverse quantization module 914 produces the reconstructed transform coefficient 918 according to Eq. (5) or Eq. (8) or Eq. (9) or Eq. (11) as a weighted sum of the first and second dequantized values 1030 and 1035. The reconstructed transform coefficient 918 is provided to the inverse transform module 915.

[0126] The adaptive quantization control module 1010 also controls various dequantization parameters, such as Qstep, N, w0, w1, and b. Among these, N is applied to the quantization index shifting module 1005 performing Eq. (10) or (12) to generate the shifted quantization index 1025. Qstep is applied to the Q-1 (. ) functions for scaling on the quantization index 1020 and the shifted quantization index 1025. When computing the weighted sum or average according to Eq. (5) (8) (9) or (11) , w0 and w1 are weighting factors applied to the first and second dequantized values 1030 and 1035, and b controls how many bit positions to shift. An adaptive quantization control module 1010 may set these values adaptively based on coding information (e.g., coding tools used, block size, block shape) for the current block, and / or based on the value of the incoming quantized coefficient 912, and / or based on scan position or 2D position of the incoming quantized coefficient, and / or is provided by the entropy encoder 990, which may also signal these parameters in the bitstream 995 in any of the various video coding hierarchies (slice header, picture header, etc. )

[0127] FIG. 11 conceptually illustrates a process 1100 uses adaptive quantization when encoding a pixel block. In some embodiments, one or more processing units (e.g., a processor) of a computing device implementing the encoder 900 performs the process 1100 by executing instructions stored in a computer readable medium. In some embodiments, an electronic apparatus implementing the encoder 900 performs the process 1100.

[0128] The encoder generates (at block 1110) a quantization index by quantizing a current transform coefficient in a transform block that includes multiple transform coefficients of the current block. The encoder applies (at block 1120) a dequantization function on the quantization index (y) to obtain a first dequantized value.

[0129] The encoder determines (at block 1125) whether the quantization index (y) is zero. If the quantization index is non-zero, the process proceeds to 1130 to generate a shifted quantization index (y’ ) . If the quantization index is zero (i.e., correspond to a zero transform coefficient) , the process proceeds to 1135 to generate the shifted quantization index (y’ ) .

[0130] At block 1130, the quantization index is non-zero and the quantization index is shifted according to a sign of the quantization index to generate the shifted quantization index.

[0131] At block 1135, the quantization index is zero and the quantization index is shifted according to a shifting direction to generate the shifted quantization index. The shifting direction may be determined at least partially based on one or more transform coefficients that is not the current transform coefficient. In some embodiments, the shifting direction is determined for each quantization index that is zero. In some embodiments, the shifting direction is determined based on one or more transform coefficients of the same frequency as the current transform coefficient of one or more neighboring blocks. The one or more neighboring blocks may be the ones having the same width, height, and / or transform type as the current block. The shifting direction may be determined based on a majority voting or the sign of the sum or average of the one or more same-frequency transform coefficients of the one or more neighboring blocks.

[0132] In some embodiments, the shifting direction is determined based on transform coefficients neighboring the current transform coefficient in the transform block. The shifting direction may be determined based on non-zero coefficients neighboring the current transform coefficient. The shifting direction may be determined based on a majority voting of the transform coefficients neighboring the current transform coefficients. In some embodiments, the shifting direction is determined by comparing the numbers of positive, negative, and zero transform coefficients neighboring the current transform coefficient. In some embodiments, the shifting direction is determined based on a sum or an average of the neighboring transform coefficients.

[0133] In some embodiments, if the number of positive neighboring coefficients is larger than the number of negative neighboring coefficients, the shifting direction is toward positive infinity; if the number of positive coefficients is smaller than the number of negative coefficients, the shifting direction is toward negative infinity; and if the number of positive coefficients is equal to the number of negative coefficients, the quantization index is not shifted (i.e., the reconstructed transform coefficient is calculated based on the first dequantized values only and the second dequantized value may not be calculated. )

[0134] In some embodiments, if the number of positive neighboring coefficients is the largest among the numbers of neighboring positive, negative, and zero transform coefficients, the shifting direction is toward positive infinity; if the number of negative neighboring coefficients is the largest among the numbers of neighboring positive, negative, and zero transform coefficients, the shifting direction is toward negative infinity; otherwise, the quantization index is not shifted (i.e., the reconstructed transform coefficient is calculated based on the first dequantized values only and the second dequantized value may not be calculated. )

[0135] In some embodiment, a same shifting direction is applied to all zero transform coefficients of the current block. In some embodiments, the shifting direction of the current block is explicitly signaled (e.g., in the bitstream. ) In some embodiments, the shifting direction is determined based on respective costs of applying positive shifting and negative shifting to the quantization index. In some embodiments, a shifting direction that minimizes a boundary matching cost is selected as the shifting direction to be applied when the quantization index is zero.

[0136] In some embodiments, when the quantization index is zero, the quantization index is shifted by a first shifting parameter value (e.g., N1 of Eq. (12) ) , and when the quantization index is non-zero, the quantization index is shifted by a second shifting parameter value (e.g., N2 of Eq. (12) ) . In some embodiments, quantization indices that correspond to different zero transform coefficients of the transform block may be shifted by different shifting parameter values. For example, in some embodiments, zero quantization indices that correspond to the first M zero coefficients in scan order are shifted by a first shifting parameter value and zero quantization indices that correspond to the remaining coefficients in scan order are shifted by a second shifting parameter value. For another example, in some embodiments, zero quantization indices that correspond to transform coefficients in particular 2-D positions of the transform block are shifted by a first shifting parameter value and zero quantization indices that correspond to the remaining coefficients in the transform block are shifted by a second shifting parameter value.

[0137] The encoder applies (at block 1140) the dequantization function on the shifted quantization index (y’ ) to obtain a second dequantized value. The encoder computes (at block 1150) a reconstructed transform coefficient of the transform block based on the first and second dequantized values.

[0138] The encoder reconstructs (at block 1160) a current block of pixels of a current picture based on the reconstructed transform coefficients of the transform block. The encoder encodes (at block 1170) one or more subsequent blocks of pixels based on the reconstructed current block. VII. Example Video Decoder

[0139] In some embodiments, an encoder may signal (or generate) one or more syntax element in a bitstream, such that a decoder may parse said one or more syntax element from the bitstream.

[0140] FIG. 12 illustrates an example video decoder 1200 that may implement adaptive quantization. As illustrated, the video decoder 1200 is an image-decoding or video-decoding circuit that receives a bitstream 1295 and decodes the content of the bitstream into pixel data of video frames for display. The video decoder 1200 has several components or modules for decoding the bitstream 1295, including some components selected from an inverse quantization module 1214, an inverse transform module 1215, an intra-prediction module 1225, a motion compensation module 1230, an in-loop filter 1245, a decoded picture buffer 1250, a MV buffer 1265, a MV prediction module 1275, and a parser 1290. The motion compensation module 1230 is part of an inter-prediction module 1240. The intra-prediction module 1225 is part of a current picture prediction module 1220, which uses current picture reconstructed samples as reference samples for prediction of the current block.

[0141] In some embodiments, the modules 1214 –1290 are modules of software instructions being executed by one or more processing units (e.g., a processor) of a computing device. In some embodiments, the modules 1214 –1290 are modules of hardware circuits implemented by one or more ICs of an electronic apparatus. Though the modules 1214 –1290 are illustrated as being separate modules, some of the modules can be combined into a single module.

[0142] The parser 1290 (or entropy decoder) receives the bitstream 1295 and performs initial parsing according to the syntax defined by a video-coding or image-coding standard. The parsed syntax element includes various header elements, flags, as well as quantized data (or quantized coefficients) 1212. The parser 1290 parses out the various syntax elements by using entropy-coding techniques such as context-adaptive binary arithmetic coding (CABAC) or Huffman encoding.

[0143] The inverse quantization module 1214 de-quantizes the quantized data (or quantized coefficients) 1212 to obtain transform coefficients, and the inverse transform module 1215 performs inverse transform on the transform coefficients 1218 to produce reconstructed residual signal 1219. The reconstructed residual signal 1219 is added with predicted pixel data 1213 from the intra-prediction module 1225 or the motion compensation module 1230 to produce decoded pixel data 1217. The decoded pixels data are filtered by the in-loop filter 1245 and stored in the decoded picture buffer 1250. In some embodiments, the decoded picture buffer 1250 is a storage external to the video decoder 1200. In some embodiments, the decoded picture buffer 1250 is a storage internal to the video decoder 1200.

[0144] The intra-prediction module 1225 receives intra-prediction data from bitstream 1295 and according to which, produces the predicted pixel data 1213 from the decoded pixel data 1217 stored in the decoded picture buffer 1250. In some embodiments, the decoded pixel data 1217 is also stored in a line buffer 1227 (or intra prediction buffer) for intra-picture prediction and spatial MV prediction.

[0145] In some embodiments, the content of the decoded picture buffer 1250 is used for display. A display device 1205 either retrieves the content of the decoded picture buffer 1250 for display directly, or retrieves the content of the decoded picture buffer to a display buffer. In some embodiments, the display device receives pixel values from the decoded picture buffer 1250 through a pixel transport.

[0146] The motion compensation module 1230 produces predicted pixel data 1213 from the decoded pixel data 1217 stored in the decoded picture buffer 1250 according to motion compensation MVs (MC MVs) . These motion compensation MVs are decoded by adding the residual motion data received from the bitstream 1295 with predicted MVs received from the MV prediction module 1275.

[0147] The MV prediction module 1275 generates the predicted MVs based on reference MVs that were generated for decoding previous video frames, e.g., the motion compensation MVs that were used to perform motion compensation. The MV prediction module 1275 retrieves the reference MVs of previous video frames from the MV buffer 1265. The video decoder 1200 stores the motion compensation MVs generated for decoding the current video frame in the MV buffer 1265 as reference MVs for producing predicted MVs.

[0148] The in-loop filter 1245 performs filtering or smoothing operations on the decoded pixel data 1217 to reduce the artifacts of coding, particularly at boundaries of pixel blocks. In some embodiments, the filtering or smoothing operations performed by the in-loop filter 1245 include deblock filter (DBF) , sample adaptive offset (SAO) , and / or adaptive loop filter (ALF) . In some embodiments, luma mapping chroma scaling (LMCS) is performed before the loop filters.

[0149] FIG. 13 illustrates portions of the video decoder 1200 that implement adaptive quantization for zero coefficients. Specifically, the figure illustrates the inverse quantization module 1214 in greater detail. As illustrated, the inverse quantization module 1214 receives quantized coefficients 1212 from the parser 1290 and outputs reconstructed transform coefficients 1218 for the inverse transform module 1215.

[0150] As illustrated, the inverse quantization module 1214 performs dequantization based on Eq. (5) or Eq. (8) or Eq. (9) or Eq. (11) , described above in Sections III, IV and V. Specifically, each quantized coefficients 1212 is used as a quantization index 1320 (y) . A quantization shifter 1305 processes the quantization index 1320 of the current transform coefficient to produce a shifted quantization index 1325 according to Eq. (10) or Eq. (12) . An adaptive quantization control 1310 provides the N or N1 or N2 shifting parameter of Eq. (10) or (12) based on whether the quantization index 1212 is zero, greater than zero, or less than zero. (N / N1 / N2 can also be determined based on other factors such as scan position or 2D position of the quantization index. ) Specifically, a shifting direction is applied when quantization index 1212 is zero (correspond to a zero transform coefficient) , the shifting direction may be determined at least partially based on one or more transform coefficients that is not the current transform coefficient (described in Section V above. )

[0151] A scaling operation Q-1 (. ) (or dequantization operation according to Eq. (4) ) is applied to both the quantization index 1320 and the shifted quantization index 1325 to respectively produce a first dequantized value 1330 and a second dequantized value 1335. A coefficient reconstructor 1340 of the inverse quantization module 1214 produces the reconstructed transform coefficient 1218 according to Eq. (5) or Eq. (8) or Eq. (9) or Eq. (11) as a weighted sum of the first and second dequantized values 1330 and 1335. The reconstructed transform coefficient 1218 is provided to the inverse transform module 1215.

[0152] The adaptive quantization control module 1310 also controls various dequantization parameters, such as Qstep, N, w0, w1, and b. Among these, N is applied to the quantization index shifting module 1305 performing Eq. (10) or (12) to generate the shifted quantization index 1325. Qstep is applied to the Q-1 (. ) functions for scaling on the quantization index 1320 and the shifted quantization index 1325. When computing the weighted sum or average according to Eq. (5) (8) (9) or (11) , w0 and w1 are weighting factors applied to the first and second dequantized values 1330 and 1335, and b controls how many bit positions to shift. An adaptive quantization control module 1310 may set these values adaptively based on coding information (e.g., coding tools used, block size, block shape) for the current block, and / or based on the value of the incoming quantized coefficient 1212, and / or based on scan position or 2D position of the incoming quantized coefficient, and / or is provided by the entropy decoder 1290, which may receive these parameters from the bitstream 1295 in any of the various video coding hierarchies (slice header, picture header, etc. )

[0153] FIG. 14 conceptually illustrates a process 1400 uses adaptive quantization when decoding a pixel block. In some embodiments, one or more processing units (e.g., a processor) of a computing device implementing the decoder 1200 performs the process 1400 by executing instructions stored in a computer readable medium. In some embodiments, an electronic apparatus implementing the decoder 1200 performs the process 1400.

[0154] The decoder receives (at block 1410) a quantization index that correspond to (quantized version of) a current transform coefficient in a transform block that includes multiple transform coefficients of the current block.

[0155] The decoder applies (at block 1420) a dequantization function on the quantization index (y) to obtain a first dequantized value.

[0156] The decoder determines (at block 1425) whether the quantization index (y) is zero. If the quantization index is non-zero, the process proceeds to 1430 to generate a shifted quantization index (y’ ) . If the quantization index is zero (i.e., correspond to a zero transform coefficient) , the process proceeds to 1435 to generate the shifted quantization index (y’ ) .

[0157] At block 1430, the quantization index is non-zero and the quantization index is shifted according to a sign of the quantization index to generate the shifted quantization index.

[0158] At block 1435, the quantization index is zero and the quantization index is shifted according to a shifting direction to generate the shifted quantization index. The shifting direction may be determined at least partially based on one or more transform coefficients that is not the current transform coefficient. In some embodiments, the shifting direction is determined for each quantization index that is zero. In some embodiments, the shifting direction is determined based on one or more transform coefficients of the same frequency as the current transform coefficient of one or more neighboring blocks. The one or more neighboring blocks may be the ones having the same width, height, and / or transform type as the current block. The shifting direction may be determined based on a majority voting or the sign of the sum or average of the one or more same-frequency transform coefficients of the one or more neighboring blocks.

[0159] In some embodiments, the shifting direction is determined based on transform coefficients neighboring the current transform coefficient in the transform block. The shifting direction may be determined based on non-zero coefficients neighboring the current transform coefficient. The shifting direction may be determined based on a majority voting of the transform coefficients neighboring the current transform coefficients. In some embodiments, the shifting direction is determined by comparing the numbers of positive, negative, and zero transform coefficients neighboring the current transform coefficient. In some embodiments, the shifting direction is determined based on a sum or an average of the neighboring transform coefficients.

[0160] In some embodiments, if the number of positive neighboring coefficients is larger than the number of negative neighboring coefficients, the shifting direction is toward positive infinity; if the number of positive coefficients is smaller than the number of negative coefficients, the shifting direction is toward negative infinity; and if the number of positive coefficients is equal to the number of negative coefficients, the quantization index is not shifted (i.e., the reconstructed transform coefficient is calculated based on the first dequantized values only and the second dequantized value may not be calculated. )

[0161] In some embodiments, if the number of positive neighboring coefficients is the largest among the numbers of neighboring positive, negative, and zero transform coefficients, the shifting direction is toward positive infinity; if the number of negative neighboring coefficients is the largest among the numbers of neighboring positive, negative, and zero transform coefficients, the shifting direction is toward negative infinity; otherwise, the quantization index is not shifted (i.e., the reconstructed transform coefficient is calculated based on the first dequantized values only and the second dequantized value may not be calculated. )

[0162] In some embodiment, a same shifting direction is applied to all zero transform coefficients of the current block. In some embodiments, the shifting direction of the current block is explicitly signaled (e.g., in the bitstream. ) In some embodiments, the shifting direction is determined based on respective costs of applying positive shifting and negative shifting to the quantization index. In some embodiments, a shifting direction that minimizes a boundary matching cost is selected as the shifting direction to be applied when the quantization index is zero.

[0163] In some embodiments, when the quantization index is zero, the quantization index is shifted by a first shifting parameter value (e.g., N1 of Eq. (12) ) , and when the quantization index is non-zero, the quantization index is shifted by a second shifting parameter value (e.g., N2 of Eq. (12) ) . In some embodiments, quantization indices that correspond to different zero transform coefficients of the transform block may be shifted by different shifting parameter values. For example, in some embodiments, zero quantization indices that correspond to the first M zero coefficients in scan order are shifted by a first shifting parameter value and zero quantization indices that correspond to the remaining coefficients in scan order are shifted by a second shifting parameter value. For another example, in some embodiments, zero quantization indices that correspond to transform coefficients in particular 2-D positions of the transform block are shifted by a first shifting parameter value and zero quantization indices that correspond to the remaining coefficients in the transform block are shifted by a second shifting parameter value.

[0164] The decoder applies (at block 1440) the dequantization function on the shifted quantization index (y’ ) to obtain a second dequantized value. The decoder computes (at block 1450) a reconstructed transform coefficient of the transform block based on the first and second dequantized values.

[0165] The decoder reconstructs (at block 1460) a current block of pixels of a current picture based on the reconstructed transform coefficients of the transform block. The decoder may then provide the reconstructed current block for display as part of the reconstructed current picture. VIII. Example Electronic System

[0166] Many of the above-described features and applications are implemented as software processes that are specified as a set of instructions recorded on a computer readable storage medium (also referred to as computer readable medium) . When these instructions are executed by one or more computational or processing unit (s) (e.g., one or more processors, cores of processors, or other processing units) , they cause the processing unit (s) to perform the actions indicated in the instructions. Examples of computer readable media include, but are not limited to, CD-ROMs, flash drives, random-access memory (RAM) chips, hard drives, erasable programmable read only memories (EPROMs) , electrically erasable programmable read-only memories (EEPROMs) , etc. The computer readable media does not include carrier waves and electronic signals passing wirelessly or over wired connections.

[0167] In this specification, the term “software” is meant to include firmware residing in read-only memory or applications stored in magnetic storage which can be read into memory for processing by a processor. Also, in some embodiments, multiple software inventions can be implemented as sub-parts of a larger program while remaining distinct software inventions. In some embodiments, multiple software inventions can also be implemented as separate programs. Finally, any combination of separate programs that together implement a software invention described here is within the scope of the present disclosure. In some embodiments, the software programs, when installed to operate on one or more electronic systems, define one or more specific machine implementations that execute and perform the operations of the software programs.

[0168] FIG. 15 conceptually illustrates an electronic system 1500 with which some embodiments of the present disclosure are implemented. The electronic system 1500 may be a computer (e.g., a desktop computer, personal computer, tablet computer, etc. ) , phone, PDA, or any other sort of electronic device. Such an electronic system includes various types of computer readable media and interfaces for various other types of computer readable media. Electronic system 1500 includes a bus 1505, processing unit (s) 1510, a graphics-processing unit (GPU) 1515, a system memory 1520, a network 1525, a read-only memory 1530, a permanent storage device 1535, input devices 1540, and output devices 1545.

[0169] The bus 1505 collectively represents all system, peripheral, and chipset buses that communicatively connect the numerous internal devices of the electronic system 1500. For instance, the bus 1505 communicatively connects the processing unit (s) 1510 with the GPU 1515, the read-only memory 1530, the system memory 1520, and the permanent storage device 1535.

[0170] From these various memory units, the processing unit (s) 1510 retrieves instructions to execute and data to process in order to execute the processes of the present disclosure. The processing unit (s) may be a single processor or a multi-core processor in different embodiments. Some instructions are passed to and executed by the GPU 1515. The GPU 1515 can offload various computations or complement the image processing provided by the processing unit (s) 1510.

[0171] The read-only-memory (ROM) 1530 stores static data and instructions that are used by the processing unit (s) 1510 and other modules of the electronic system. The permanent storage device 1535, on the other hand, is a read-and-write memory device. This device is a non-volatile memory unit that stores instructions and data even when the electronic system 1500 is off. Some embodiments of the present disclosure use a mass-storage device (such as a magnetic or optical disk and its corresponding disk drive) as the permanent storage device 1535.

[0172] Other embodiments use a removable storage device (such as a floppy disk, flash memory device, etc., and its corresponding disk drive) as the permanent storage device. Like the permanent storage device 1535, the system memory 1520 is a read-and-write memory device. However, unlike storage device 1535, the system memory 1520 is a volatile read-and-write memory, such a random access memory. The system memory 1520 stores some of the instructions and data that the processor uses at runtime. In some embodiments, processes in accordance with the present disclosure are stored in the system memory 1520, the permanent storage device 1535, and / or the read-only memory 1530. For example, the various memory units include instructions for processing multimedia clips in accordance with some embodiments. From these various memory units, the processing unit (s) 1510 retrieves instructions to execute and data to process in order to execute the processes of some embodiments.

[0173] The bus 1505 also connects to the input and output devices 1540 and 1545. The input devices 1540 enable the user to communicate information and select commands to the electronic system. The input devices 1540 include alphanumeric keyboards and pointing devices (also called “cursor control devices” ) , cameras (e.g., webcams) , microphones or similar devices for receiving voice commands, etc. The output devices 1545 display images generated by the electronic system or otherwise output data. The output devices 1545 include printers and display devices, such as cathode ray tubes (CRT) or liquid crystal displays (LCD) , as well as speakers or similar audio output devices. Some embodiments include devices such as a touchscreen that function as both input and output devices.

[0174] Finally, as shown in FIG. 15, bus 1505 also couples electronic system 1500 to a network 1525 through a network adapter (not shown) . In this manner, the computer can be a part of a network of computers (such as a local area network ( “LAN” ) , a wide area network ( “WAN” ) , or an Intranet, or a network of networks, such as the Internet. Any or all components of electronic system 1500 may be used in conjunction with the present disclosure.

[0175] Some embodiments include electronic components, such as microprocessors, storage and memory that store computer program instructions in a machine-readable or computer-readable medium (alternatively referred to as computer-readable storage media, machine-readable media, or machine-readable storage media) . Some examples of such computer-readable media include RAM, ROM, read-only compact discs (CD-ROM) , recordable compact discs (CD-R) , rewritable compact discs (CD-RW) , read-only digital versatile discs (e.g., DVD-ROM, dual-layer DVD-ROM) , a variety of recordable / rewritable DVDs (e.g., DVD-RAM, DVD-RW, DVD+RW, etc. ) , flash memory (e.g., SD cards, mini-SD cards, micro-SD cards, etc. ) , magnetic and / or solid state hard drives, read-only and recordable  discs, ultra-density optical discs, any other optical or magnetic media, and floppy disks. The computer-readable media may store a computer program that is executable by at least one processing unit and includes sets of instructions for performing various operations. Examples of computer programs or computer code include machine code, such as is produced by a compiler, and files including higher-level code that are executed by a computer, an electronic component, or a microprocessor using an interpreter.

[0176] While the above discussion primarily refers to microprocessor or multi-core processors that execute software, many of the above-described features and applications are performed by one or more integrated circuits, such as application specific integrated circuits (ASICs) or field programmable gate arrays (FPGAs) . In some embodiments, such integrated circuits execute instructions that are stored on the circuit itself. In addition, some embodiments execute software stored in programmable logic devices (PLDs) , ROM, or RAM devices.

[0177] As used in this specification and any claims of this application, the terms “computer” , “server” , “processor” , and “memory” all refer to electronic or other technological devices. These terms exclude people or groups of people. For the purposes of the specification, the terms display or displaying means displaying on an electronic device. As used in this specification and any claims of this application, the terms “computer readable medium, ” “computer readable media, ” and “machine readable medium” are entirely restricted to tangible, physical objects that store information in a form that is readable by a computer. These terms exclude any wireless signals, wired download signals, and any other ephemeral signals.

[0178] While the present disclosure has been described with reference to numerous specific details, one of ordinary skill in the art will recognize that the present disclosure can be embodied in other specific forms without departing from the spirit of the present disclosure. In addition, a number of the figures (including FIG. 11 and FIG. 14) conceptually illustrate processes. The specific operations of these processes may not be performed in the exact order shown and described. The specific operations may not be performed in one continuous series of operations, and different specific operations may be performed in different embodiments. Furthermore, the process could be implemented using several sub-processes, or as part of a larger macro process. Thus, one of ordinary skill in the art would understand that the present disclosure is not to be limited by the foregoing illustrative details, but rather is to be defined by the appended claims. Additional Notes

[0179] The herein-described subject matter sometimes illustrates different components contained within, or connected with, different other components. It is to be understood that such depicted architectures are merely examples, and that in fact many other architectures can be implemented which achieve the same functionality. In a conceptual sense, any arrangement of components to achieve the same functionality is effectively "associated" such that the desired functionality is achieved. Hence, any two components herein combined to achieve a particular functionality can be seen as "associated with" each other such that the desired functionality is achieved, irrespective of architectures or intermediate components. Likewise, any two components so associated can also be viewed as being "operably connected" , or "operably coupled" , to each other to achieve the desired functionality, and any two components capable of being so associated can also be viewed as being "operably couplable" , to each other to achieve the desired functionality. Specific examples of operably couplable include but are not limited to physically mateable and / or physically interacting components and / or wirelessly interactable and / or wirelessly interacting components and / or logically interacting and / or logically interactable components.

[0180] Further, with respect to the use of substantially any plural and / or singular terms herein, those having skill in the art can translate from the plural to the singular and / or from the singular to the plural as is appropriate to the context and / or application. The various singular / plural permutations may be expressly set forth herein for sake of clarity.

[0181] Moreover, it will be understood by those skilled in the art that, in general, terms used herein, and especially in the appended claims, e.g., bodies of the appended claims, are generally intended as “open” terms, e.g., the term “including” should be interpreted as “including but not limited to, ” the term “having” should be interpreted as “having at least, ” the term “includes” should be interpreted as “includes but is not limited to, ” etc. It will be further understood by those within the art that if a specific number of an introduced claim recitation is intended, such an intent will be explicitly recited in the claim, and in the absence of such recitation no such intent is present. For example, as an aid to understanding, the following appended claims may contain usage of the introductory phrases "at least one" and "one or more" to introduce claim recitations. However, the use of such phrases should not be construed to imply that the introduction of a claim recitation by the indefinite articles "a" or "an" limits any particular claim containing such introduced claim recitation to implementations containing only one such recitation, even when the same claim includes the introductory phrases "one or more" or "at least one" and indefinite articles such as "a" or "an, " e.g., “a” and / or “an” should be interpreted to mean “at least one” or “one or more; ” the same holds true for the use of definite articles used to introduce claim recitations. In addition, even if a specific number of an introduced claim recitation is explicitly recited, those skilled in the art will recognize that such recitation should be interpreted to mean at least the recited number, e.g., the bare recitation of "two recitations, " without other modifiers, means at least two recitations, or two or more recitations. Furthermore, in those instances where a convention analogous to “at least one of A, B, and C, etc. ” is used, in general such a construction is intended in the sense one having skill in the art would understand the convention, e.g., “a system having at least one of A, B, and C” would include but not be limited to systems that have A alone, B alone, C alone, A and B together, A and C together, B and C together, and / or A, B, and C together, etc. In those instances where a convention analogous to “at least one of A, B, or C, etc. ” is used, in general such a construction is intended in the sense one having skill in the art would understand the convention, e.g., “a system having at least one of A, B, or C” would include but not be limited to systems that have A alone, B alone, C alone, A and B together, A and C together, B and C together, and / or A, B, and C together, etc. It will be further understood by those within the art that virtually any disjunctive word and / or phrase presenting two or more alternative terms, whether in the description, claims, or drawings, should be understood to contemplate the possibilities of including one of the terms, either of the terms, or both terms. For example, the phrase “A or B” will be understood to include the possibilities of “A” or “B” or “A and B.”

[0182] From the foregoing, it will be appreciated that various implementations of the present disclosure have been described herein for purposes of illustration, and that various modifications may be made without departing from the scope and spirit of the present disclosure. Accordingly, the various implementations disclosed herein are not intended to be limiting, with the true scope and spirit being indicated by the following claims.

Claims

1.A video coding method comprising:receiving a quantization index corresponding to a current transform coefficient of a transform block;applying a dequantization function on the quantization index to obtain a first dequantized value;shifting the quantization index to generate a shifted quantization index, wherein when the quantization index is zero, the quantization index is shifted according to a shifting direction that is determined at least partially based on one or more transform coefficients that is not the current transform coefficient;applying the dequantization function on the shifted quantization index to obtain a second dequantized value;computing a reconstructed transform coefficient of the transform block based on the first and second dequantized values; andreconstructing a current block of pixels of a current picture based on the reconstructed transform coefficients of the transform block.2.The video coding method of claim 1, wherein the shifting direction is determined for each quantization index that is zero.3.The video coding method of claim 1, wherein the shifting direction is determined based on transform coefficients neighboring the current transform coefficient in the transform block.4.The video coding method of claim 3, wherein the shifting direction is determined based on non-zero coefficients neighboring the current transform coefficient in the transform block.5.The video coding method of claim 3, wherein:if the number of positive neighboring coefficients is larger than the number of negative neighboring coefficients, the shifting direction is toward positive infinity; orif the number of positive coefficients is smaller than the number of negative coefficients, the shifting direction is toward negative infinity; orif the number of positive coefficients is equal to the number of negative coefficients, the quantization index is not shifted.6.The video coding method of claim 3, wherein the shifting direction is determined by comparing the numbers of positive, negative, and zero transform coefficients neighboring the current transform coefficient.7.The video coding method of claim 3, wherein:if the number of positive neighboring coefficients is the largest among the numbers of neighboring positive, negative, and zero transform coefficients, the shifting direction is toward positive infinity;if the number of negative neighboring coefficients is the largest among the numbers of neighboring positive, negative, and zero transform coefficients, the shifting direction is toward negative infinity;otherwise, the quantization index is not shifted.8.The video coding method of claim 3, wherein the shifting direction is determined based on a sum or an average of the neighboring transform coefficients.9.The video coding method of claim 1, wherein the shifting direction is determined based on one or more transform coefficients of the same frequency as the current transform coefficient of one or more neighboring blocks.10.The video coding method of claim 1, wherein a same shifting direction is applied to all zero transform coefficients of the current block.11.The video coding method of claim 10, wherein the shifting direction of the current block is explicitly signaled.12.The video coding method of claim 1, wherein the shifting direction is determined based on respective costs of applying positive shifting and applying negative shifting to the quantization index.13.The video coding method of claim 12, wherein a shifting direction that minimizes a boundary matching cost is selected as the shifting direction to be applied when the quantization index is zero.14.The video coding method of claim 1, wherein:when the quantization index is zero, the quantization index is shifted by a first shifting parameter value; andwhen the quantization index is non-zero, the quantization index is shifted by a second shifting parameter value.15.The video coding method of claim 1, wherein quantization indices that correspond to different zero transform coefficients of the transform block are shifted by different shifting parameter values.16.The video coding method of claim 15, wherein zero quantization indices that correspond to the first M zero coefficients in scan order are shifted by a first shifting parameter value and zero quantization indices that correspond to the remaining zero coefficients in scan order are shifted by a second shifting parameter value.17.The video coding method of claim 15, wherein zero quantization indices that correspond to transform coefficients in particular 2-D positions of the transform block are shifted by a first shifting parameter value and zero quantization indices that correspond to the remaining coefficients in the transform block are shifted by a second shifting parameter value.18.An electronic apparatus comprising:a video coder circuit configured to perform operations comprising:receiving a quantization index corresponding to a current transform coefficient of a transform block;applying a dequantization function on the quantization index to obtain a first dequantized value;shifting the quantization index to generate a shifted quantization index, wherein when the quantization index is zero, the quantization index is shifted according to a shifting direction that is determined at least partially based on one or more transform coefficients that is not the current transform coefficient;applying the dequantization function on the shifted quantization index to obtain a second dequantized value;computing a reconstructed transform coefficient of the transform block based on the first and second dequantized values; andreconstructing a current block of pixels of a current picture based on the reconstructed transform coefficients of the transform block.19.A video encoding method comprising:generating a quantization index by quantizing a current transform coefficient of a transform block;applying a dequantization function on the quantization index to obtain a first dequantized value;shifting the quantization index to generate a shifted quantization index, wherein when the quantization index is zero, the quantization index is shifted according to a shifting direction that is determined at least partially based on one or more transform coefficients that is not the current transform coefficient;applying the dequantization function on the shifted quantization index to obtain a second dequantized value;computing a reconstructed transform coefficient of the transform block based on the first and second dequantized values; andreconstructing a current block of pixels of a current picture based on the reconstructed transform coefficients of the transform block; andencoding one of more subsequent blocks of pixels based on the reconstructed current block.

Citation Information

Patent Citations

  • Method for processing transformation coefficients and device

    CN104270641A

  • Coefficient-level adaptive quantization method

    CN106028032A

  • Video quantization method and device, electronic equipment and computer readable storage medium

    CN113259667A

  • Image coding method and system

    JP2001231041A

  • Image encoding apparatus, image decoding apparatus methods for them and recording medium

    JP2002135781A