Entropy coding of transformation coefficients suitable for dependent scalar quantization
Dependent scalar quantization and context-adaptive entropy coding address the inefficiencies of independent scalar quantization in video coding, improving coding efficiency by leveraging coefficient dependencies and reducing bitrate.
Patent Information
- Application Number
- JP2026093439
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2018-07-02
- Filing Date
- 2026-06-03
- Publication Date
- 2026-08-25
AI Technical Summary
Existing video coding standards face challenges in achieving optimal coding efficiency due to the trade-off between quantization distortion and bitrate, particularly when using independent scalar quantization, which does not effectively leverage dependencies between transformation coefficients.
Implementing dependent scalar quantization, where the set of acceptable reconstruction levels for a transformation coefficient depends on previously quantized coefficients, combined with context-adaptive entropy coding to improve coding efficiency.
Enhances coding efficiency by densely packing reconstruction vectors in the N-dimensional signal space, reducing bitrate while maintaining quality, and allowing for more effective entropy coding.
Smart Images

Figure 2026136364000001_ABST
Abstract
Description
[Technical Field]
[0001] This application relates to entropy coding at the conversion coefficient level, such as for coding pictures or videos. [Background technology]
[0002] In setting quantization parameters, encoders must make compromises. Rendering coarser quantization lowers the bitrate but increases quantization distortion, while rendering finer quantization reduces distortion but increases the bitrate. It is advantageous to have a concept at hand that improves coding efficiency for a given range of available quantization levels. One such possibility is the use of dependent quantization, in which case the quantization is steadily adapted according to previously quantized and coded data, but the dependency in quantization also affects the interrelationships between data items to be quantized and coded, and thus affects the availability of information for context-adaptive entropy coding. It is advantageous to have a concept that is suitable for dependent quantization and, in terms of coding efficiency, allows coding of coefficients in transformation blocks in a way that can be effectively implemented by entropy coding. [Overview of the project] [Problems that the invention aims to solve]
[0003] The object of the present invention is to provide such a concept for coding a block of conversion coefficients. [Means for solving the problem]
[0004] This objective is achieved by the subject matter of the independent claims of this application.
[0005] The advantageous embodiments are the subject matter of the dependent claims. Preferred embodiments of this application are described below with reference to the figures. [Brief explanation of the drawing]
[0006] [Figure 1] This is a block diagram of an exemplary video encoder, as an example for a picture encoder that may be embodied to operate according to any of the embodiments described below. [Figure 2a] This is a block diagram of a transformation encoder to illustrate the basic techniques of block-based transformation coding. [Figure 2b] This is a block diagram of a transform decoder to illustrate the basic techniques of block-based transform coding. [Figure 3] This is a histogram of the distribution showing the uniform reconstruction quantizer. [Figure 4a] Herein, as an example, is a schematic diagram of a re-divided transform block into subblocks to illustrate an example of a transform coefficient level scan used in H.265|MPEG-H HEVC, specifically showing the division of a 16×16 transform block into 4×4 subblocks and the coding order of the subblocks. Re-division may be used exemplary in the embodiments of this application for the paths of their flags and the coefficients in the remaining decoding, as well as for state transitions in the inverse quantization of the same. [Figure 4b] Herein, as an example, is a schematic diagram of a subblock illustrating an example of a scan of conversion coefficient levels used in H.265|MPEG-H HEVC, specifically showing the coding order of conversion coefficient levels within a 4x4 subblock. Subdivision may be used exemplary in the embodiments of this application for the paths of those flags and coefficients in the decoding of the remaining coefficients, as well as for state transitions in the inverse quantization of the same. [Figure 5a]This is a schematic diagram of a multidimensional output space with one axis spanned for each transformation coefficient, and the locations of acceptable reconstruction vectors, for the simple case of two transformation coefficients, which is independent scalar quantization. [Figure 5b] This is a schematic diagram of a multidimensional output space with one axis spanned for each transformation coefficient, and the locations of acceptable reconstruction vectors, for a simple case of two transformation coefficients, which is an example of dependent scalar quantization. [Figure 6] This is a block diagram of a transform decoder that uses dependent scalar quantization, thereby forming one embodiment of the media decoder according to this application. The changes compared to conventional transform coding (using independent scalar quantizers) can be derived by comparison with Figure 2b. Embodiments for encoding the transform block using dependent scalar quantization in a corresponding method can be obtained by similarly modifying the encoder in Figure 2a. [Figure 7] This is a schematic diagram showing two sets of reconstruction levels, fully determined by a single quantization step size Δ, for one embodiment of dependent quantization. The two available sets of reconstruction levels are set 0 (top line) and set 1 (bottom line), highlighted. Examples for quantization indices indicating reconstruction levels within a set are given by the numbers below the circles. The hollow circles and black circles indicate two distinct subsets within the set of reconstruction levels, which can be used to determine the set of reconstruction levels for the next transformation coefficient in the reconstruction order. Both sets contain a reconstruction level equal to zero, but are otherwise disprime, and both sets are symmetric around zero. [Figure 8]This figure shows pseudocode illustrating an example of a reconstruction process for transformation coefficients. k represents an index specifying the reconstruction order of the current transformation coefficient, the quantization index for the current transformation coefficient is indicated by level[k], the quantization step size Δk applied to the current transformation coefficient is indicated by quant_step_size[k], and trec[k] represents the value of the reconstructed transformation coefficient t'k. The variable setId[k] specifies the set of reconstruction levels to apply to the current transformation coefficient. Based on the transformation coefficients preceding it in the reconstruction order, the possible values of setId[k] are determined to be 0 and 1. The variable n specifies an integer coefficient of the quantization step size, given by the selected set of reconstruction levels (i.e., the value of setId[k]) and the transmitted quantization index level[k]. [Figure 9] This figure shows the pseudocode in Figure 8, illustrating an alternative implementation. The main change is that multiplication using quantization steps is represented using an integer implementation that uses scale and shift parameters. Typically, the shift parameter (represented by shift) is constant for the transformation block, and only the scale parameter (given by scale[k]) may depend on the location of the transformation coefficients. The variable add represents the rounding offset and is typically set to add = (1 << (shift-1)). Given that Δk is the nominal quantization step for the transformation coefficients, the parameters shift and scale[k] are chosen such that we have Δk ≈ scale[k] · 2 - shift. [Figure 10] This is a schematic diagram illustrating an example of splitting a set of reconstruction levels into two subsets. The two illustrated quantization sets are the quantization sets in the example in Figure 7. The two subsets of quantization set 0 are labeled using "A" and "B", and the two subsets of quantization set 1 are labeled using "C" and "D". [Figure 11]This figure shows pseudocode illustrating an example of the process for reconstructing transformation coefficients for a transformation block. The array `level` represents the transmitted transformation coefficient level (quantization index) for the transformation block, and the array `trec` represents the corresponding reconstructed transformation coefficient. The 2D table `state_trans_table` specifies the state transition table, and the table `setId` specifies the quantization set associated with the state. [Figure 12] This is a schematic diagram showing state transitions in dependent scalar quantization as a trellis structure. The horizontal axis represents different transformation coefficients in the reconstruction order. The vertical axis represents different possible states in the dependent quantization and reconstruction process. The illustrated connections specify the available paths between states for different transformation coefficients. [Figure 13] This figure shows an example of a basic trellis cell. [Figure 14] This is a schematic diagram of a transformation block illustrating the signaling of the position of the first non-zero quantization index in the coding order, indicated by filling in the background. In addition to the position of the first non-zero transformation coefficient, only the bins for the shaded coefficients are sent, and the coefficients marked in white are inferred to be equal to 0. [Figure 15] This figure shows a pseudocode example illustrating a comparative example of coding at the conversion coefficient level for a block of coefficients, such as a subblock, which can be easily moved over the decoding of a conversion block that is not divided into subblocks, and over the decoding of coefficients (i.e., by replacing "coding" with "decoding"). Here, one pass is used to code all the flags and the rest for the coefficients, except for the sign flag. [Figure 16] This is a schematic diagram of the transformation block, showing the template used to select a probabilistic model. The black squares specify the current scan position, and the shaded squares represent local neighborhoods used to derive the context model. [Figure 17]This is a schematic diagram of an exemplary trellis structure that can be used to determine a sequence (or block) of quantization indices that minimizes a cost measure (such as the Lagrangian cost measure D + λ·R). The trellis is shown for eight transformation coefficients (or quantization indices). The first state (far left) represents the initial state, which is set to equal to 0. [Figure 18] This figure shows pseudocode illustrating one embodiment of coding for a transform coefficient level for a block of coefficients, such as a subblock, which can be easily moved over the decoding of a transform block that is not divided into subblocks, and over the decoding of coefficients (i.e., by replacing "coding" with "decoding"). Here, one pass is used to code all the flags and the rest for the coefficients, except for the sign flag. Here, the common pass in Figure 15 is divided into three passes. [Figure 19] This figure shows pseudocode illustrating one embodiment of coding for a transform coefficient level for a block of coefficients, such as a subblock, which can be easily moved over the decoding of a transform block that is not divided into subblocks, and over the decoding of coefficients (i.e., by replacing "coding" with "decoding"). Here, one pass is used to code all the flags and the rest for the coefficients, except for the sign flag. Here, the common pass in Figure 15 is divided into two passes, one for the rest and the other for the flags other than the sign flag. [Figure 20]This figure shows pseudocode illustrating one embodiment of coding for a transform coefficient level for a block of coefficients, such as a subblock, which can be easily moved over the decoding of a transform block that is not divided into subblocks, and over the decoding of coefficients (i.e., by replacing "coding" with "decoding"). Here, one pass is used to code all the flags for the coefficients and the rest, except for the sign flag. Here, the common pass in Figure 15 is divided into several passes, with the parity flag coded either before the absolute level or before any of the other flags, respectively. [Modes for carrying out the invention]
[0007] According to the embodiments described below, transformation coefficient-level entropy coding is performed in a manner suitable for effective implementations, along with dependent quantization and context-adaptive entropy coding such as context-adaptive binary arithmetic coding. These embodiments are particularly advantageous for transformation coefficient-level entropy coding in the context of transformation coding using dependent scalar quantization. However, these embodiments are also usable and advantageous when used with conventional independent scalar quantization. That is, these embodiments are also applicable for transformation coefficient-level entropy coding in the context of transformation coding using conventional independent scalar quantization. Furthermore, the embodiments described below are applicable for codecs that support switching between transformation coding using dependent quantization and transformation coding using conventional independent quantization (for example, at the sequence, picture, slice, tile, or block level).
[0008] In the embodiments described below, transformation coding is used to transform a set of samples. Quantization, which can be embodied as dependent scalar quantization or alternatively as independent scalar quantization, is used to quantize the resulting transformation coefficients, and entropy coding is performed on the obtained quantization index. On the decoder side, the reconstructed set of samples is obtained by entropy decoding of the quantization index, dependent reconstruction (or alternatively, independent reconstruction) of the transformation coefficients, and inverse transformation. The difference between dependent scalar quantization and conventional independent scalar quantization is that in dependent scalar quantization, the set of acceptable reconstruction levels for the transformation coefficients depends on the transmitted transformation coefficient levels that precede the current transformation coefficient in the reconstruction order. This aspect is leveraged in entropy coding by using different sets of probabilistic models for different sets of acceptable reconstruction levels. To enable efficient hardware implementations, binary decisions (called bins) related to the transformation coefficient levels of a block or subblock are coded in multiple passes. The binarization of the transformation coefficient levels and the distribution of the binary decisions (also called bins) across multiple passes are chosen in such a way that the data coded in the first pass uniquely determines a set of acceptable reconstruction levels for the next scan position. This has the advantage that a probabilistic model for a portion of the bins in the first pass can be selected according to the set of acceptable reconstruction levels (for the corresponding transformation coefficients).
[0009] The following description of embodiments primarily concerns the lossy coding of blocks of prediction error samples in image and video codecs, but these embodiments may also be applicable to lossy coding in other fields. Specifically, there are no restrictions on the set of samples that form the rectangular blocks, nor on the set of samples that represent the prediction error samples (i.e., the difference between the original signal and the predicted signal).
[0010] All state-of-the-art video codecs, such as the international video coding standards H.264|MPEG-4 AVC and H.265|MPEG-H HEVC, follow the fundamental techniques of hybrid video coding. A video picture is divided into blocks, samples of the blocks are predicted using intra-picture prediction or inter-prediction, and the resulting predicted error signal samples (the difference between the original samples and the predicted signal samples) are coded using transform coding.
[0011] Figure 1 shows a simplified block diagram of a typical modern video encoder. Video pictures in a video sequence are coded in a certain order called the coding order. The coding order of pictures may differ from the capture and display order. In actual coding, each video picture is divided into blocks. A block contains a sample of a rectangular area of a particular color component. The entities in a block for all color components corresponding to the same rectangular area are often called units. Depending on the purpose of the block division, H.265|MPEG-H HEVC distinguishes between coding tree blocks (CTB), coding blocks (CB), prediction blocks (PB), and conversion blocks (TB). The associated units are called coding tree units (CTU), coding units (CU), prediction units (PU), and conversion units (TU).
[0012] Typically, a video picture is first divided into fixed-size units (i.e., coordinated fixed-size blocks for all color components). In H.265|MPEG-H HEVC, these fixed-size units are called coding tree units (CTUs). Each CTU can be further divided into multiple coding units (CUs). A coding unit is an entity for which a coding mode (e.g., intra or interpicture coding) is selected. In H.265|MPEG-H HEVC, the decomposition of a CTU into one or more CUs is specified by a quadtree (QT) syntax and transmitted as part of the bitstream. The CUs of a CTU are processed in so-called z-scan order. That is, the four blocks resulting from the decomposition are processed in raster scan order, and if any of those blocks are further divided, the corresponding four blocks (including any smaller blocks contained within) are processed before the next block at a higher decomposition level is processed.
[0013] If a CU is coded in intra-coding mode, an intra-prediction mode for the lumens signal is transmitted, and if the video signal contains chromens, a separate intra-prediction mode for the chromens signal is transmitted. In ITU-T H.265|MPEG-H HEVC, if the CU size is equal to the minimum CU size (as signaled in the sequence parameter set), the lumens block may also be divided into four equally sized blocks, in which case a separate lumens intra-prediction mode is transmitted for each of these blocks. Actual intra-prediction and coding are performed based on the transform blocks. For each transform block of the intra-picture coded CU, the prediction signal is derived using already reconstructed samples of the same color components. The algorithm used to generate the prediction signal for the transform block is determined by the transmitted intra-prediction mode.
[0014] A CU coded in interpicture coding mode can be further divided into multiple prediction units (PUs). A prediction unit is an entity of chroma and, in the case of color video, two associated chroma blocks (covering the same picture area), for which a single set of prediction parameters is used. A CU can be coded as a single prediction unit or divided into two non-square (symmetric and asymmetric divisions are supported) or four square prediction units. For each PU, an individual set of motion parameters is transmitted. Each set of motion parameters includes the number of motion hypotheses (one or two in H.265|MPEG-H HEVC), and for each motion hypothesis, a reference picture (indicated via a reference picture index to a list of reference pictures), and an associated motion vector. In addition, H.265|MPEG-H HEVC offers a so-called merge mode, in which motion parameters are not explicitly transmitted but are derived based on the motion parameters of spatially or temporally adjacent blocks. When a CU or PU is coded in merge mode, only an index to a list of motion parameter candidates (this list is derived using motion data from spatially and temporally adjacent blocks) is sent. The index completely determines the set of motion parameters to be used. The predicted signal for the intercoded PU is formed by motion-compensated prediction. For each motion hypothesis (specified by the reference picture and motion vector), the predicted signal is formed by the displaced blocks in the specified reference picture, where the displacement relative to the current PU is specified by the motion vector. The displacement is typically specified with subsample precision (in H.265|MPEG-H HEVC, the motion vector has 1 / 4 luma-sample precision). For non-integer motion vectors, the predicted signal is generated by interpolating the reconstructed reference picture (typically using a separable FIR filter).The final predicted signal of a PU using multi-hypothesis prediction is formed by a weighted sum of the predicted signals for each individual motion hypothesis. Typically, the same set of motion parameters is used for the rumor and chroma blocks of the PU. Although state-of-the-art video coding standards use translational displacement vectors to specify the motion of the current area (block of samples) relative to the reference picture, it is also possible to employ higher-order motion models (e.g., affine motion models). In that case, additional motion parameters must be transmitted for the motion hypotheses.
[0015] In both intrapicture-encoded and interpicture-encoded CUs, the prediction error signal (also called the residual signal) is transmitted, typically via transform coding. In H.265|MPEG-H HEVC, blocks of lumar residual samples, as well as blocks of chroma residual samples (if present), are divided into transform blocks (TBs). The division of the CU into transform blocks is indicated by a quadtree syntax, also known as a residual quadtree (RQT). The resulting transform blocks are coded using transform coding. A 2d transform is applied to the blocks of residual samples, the resulting transform coefficients are quantized using independent scalar quantization, and the resulting transform coefficient levels (quantization indices) are entropy-coded. Within P-slices and B-slices, a skip_flag is transmitted at the beginning of the CU syntax. If this flag is equal to 1, it indicates that the corresponding CU consists of a single prediction unit coded in merge mode (i.e., merge_flag is inferred to be equal to 1) and that all transformation coefficients are equal to zero (i.e., the reconstructed signal is equal to the prediction signal). In this case, only merge_idx is sent in addition to skip_flag. If skip_flag is equal to 0, the prediction mode (inter or intra) is signaled, followed by the syntax functions described above.
[0016] Since already coded pictures can be used for motion compensation predictions of blocks in subsequent pictures, the pictures must be completely reconstructed in the encoder. The reconstructed prediction error signal for the blocks (obtained by reconstructing the transformation coefficients, given the quantization index and inverse transform) is added to the corresponding prediction signal, and the result is written to the buffer for the current picture. After all blocks of the picture have been reconstructed, one or more in-loop filters may be applied (e.g., a deblocking filter and a sample-adaptive offset filter). The final reconstructed picture is then stored in the decoded picture buffer.
[0017] The embodiments described below present a concept for transformation coding, including transformation coding of prediction error signals. This concept is applicable to both intrapicture coding blocks and interpicture coding blocks. This concept is also applicable to transformation coding of non-rectangular sample regions. In contrast to conventional transformation coding, the transformation coefficients are not quantized independently according to the embodiments described below. At the very least, the transformation coefficients are suitable for quantization using dependent quantization. According to dependent quantization, the set of available reconstruction levels for a particular transformation coefficient depends on the selected quantization index for other transformation coefficients. Modifications for entropy coding of quantization indices are described below, and these modifications improve coding efficiency while maintaining the ability to be combined with dependent scalar quantization.
[0018] All major video coding standards (including the state-of-the-art H.265|MPEG-H HEVC) utilize the concept of transform coding for coding blocks of predictive error samples. A block of predictive error samples represents the difference between a sample of the original signal and a sample of the predictive signal for the block. The predictive signal is obtained either by intra-picture prediction (in which case the predictive signal sample for the current block is derived based on already reconstructed samples of adjacent blocks within the same picture) or by inter-picture prediction (in which case the predictive signal sample is derived based on samples of already reconstructed pictures). The original predictive error signal sample is obtained by subtracting the sample value of the predictive signal from the sample value of the original signal for the current block.
[0019] The transformation coding of the sample block consists of a linear transformation, scalar quantization, and entropy coding of the quantization index. On the encoder side (see Figure 2a), the original N×M block of the sample is transformed using a linear analysis transform A. The result is an N×M block of transformation coefficients t. k This represents the original prediction error sample in a different signal space (or a different coordinate system). The N×M transformation coefficients are quantized using an N×M independent scalar quantizer. Each transformation coefficient t k However, the quantization index q, also called the transformation coefficient level, is also known as the transformation coefficient level. k It is mapped to the obtained quantization index q. k However, it is entropy coded and written to a bitstream.
[0020] On the decoder side shown in Figure 2b, the conversion coefficient level q k However, it is decoded from the received bitstream. Each conversion coefficient level q k However, the reconstructed transformation coefficient t' kis mapped to. The N×M blocks of the reconstructed samples are obtained by transforming a block of the reconstructed transform coefficients using a linear synthesis transform B.
[0021] Although the video coding standard only specifies the synthesis transform B, the inverse of the synthesis transform B is used as the analysis transform A in the encoder, i.e., A = B -1 is a common practice. Moreover, the transforms used in practical video coding systems are orthogonal transforms (B -1 = B T ) or approximately orthogonal transforms. In an orthogonal transform, the mean squared error (MSE) distortion in the signal space is equal to the MSE distortion in the transform domain. Orthogonality has the important advantage that the MSE distortion between the original sample block and the reconstructed sample block can be minimized using an independent scalar quantizer. Even when the actual quantization process used in the encoder takes into account the dependencies between the transform coefficient levels (introduced by the above description of entropy coding), the use of an orthogonal transform significantly simplifies the quantization algorithm.
[0022] In a typical prediction error signal, the transform has the effect that the signal energy is concentrated in a few transform coefficients. The statistical dependency between the obtained transform coefficients is reduced compared to the original prediction error samples.
[0023] In the state-of-the-art video coding standards, the separable discrete cosine transform (type II), or an integer approximation thereof, is used. However, this transform can be easily replaced without changing other aspects of the transform coding system. Examples of improvements suggested in the literature or in the standardization documents include the following.
[0024] • Use of Discrete Sign Trans (DST) for intra-picture predicted blocks (depending on intra-predictive mode and / or block size, if applicable). Note that H.265|MPEG-H HEVC already includes DST for intra-picture predicted 4x4 transformed blocks. • Switched Transform: The encoder selects the transform to be used from a predefined set of transforms. Since the set of available transforms is known to both the encoder and the decoder, it can be efficiently signaled using an index to the list of available transforms. The set of available transforms, and their ordering in the list, may depend on other coding parameters for the block, such as the selected intra-prediction mode. In special cases, the transform used is entirely determined by coding parameters such as the intra-prediction mode, eliminating the need to send a syntax element to specify the transform. • Non-separable transform: Transformations used in encoders and decoders are non-separable transforms. Note that the concept of a switching transform may include one or more non-separable transforms. For reasons of complexity, the use of non-separable transforms may be limited to certain block sizes. • Multilevel transformation: The actual transformation consists of two or more transformation stages. The first transformation stage may consist of a computationally low-complexity separable transformation. In the second stage, a subset of the resulting transformation coefficients is further transformed using an inseparable transformation. Compared to an inseparable transformation for the entire transformation block, the two-stage method has the advantage that the more complex inseparable transformation is applied to a smaller number of samples. The concept of multilevel transformation can be efficiently combined with the concept of switching transformation.
[0025] The transformation coefficients are quantized using a scalar quantizer. As a result of quantization, the set of acceptable values for the transformation coefficients is reduced. In other words, the transformation coefficients are mapped to a countable (actually finite) set of so-called reconstruction levels. The set of reconstruction levels represents a suitable subset of the set of possible transformation coefficient values. To simplify subsequent entropy coding, the acceptable reconstruction levels are represented by quantization indices (also called transformation coefficient levels), which are transmitted as part of the bitstream. On the decoder side, the quantization indices (transformation coefficient levels) are mapped to the reconstructed transformation coefficients. The possible values for the reconstructed transformation coefficients correspond to the set of reconstruction levels. On the encoder side, the result of scalar quantization is a block of transformation coefficient levels (quantization indices).
[0026] State-of-the-art video coding standards use Uniform Reconstruction Quantizers (URQs). Their basic design is shown in Figure 3. URQs have the property that their reconstruction levels s are equally spaced. The distance Δ between two adjacent reconstruction levels is called the quantization step size. One of the reconstruction levels is equal to 0. Thus, the complete set of available reconstruction levels is uniquely specified by the quantization step size Δ. The decoder mapping from the quantization index q to the reconstructed transformation coefficient t' is, in principle, given by a simple formula. t'=q·Δ
[0027] In this context, the term "independent scalar quantization" refers to the property that, given a quantization index q for any transformation coefficient, the associated reconstructed transformation coefficient t' can be determined independently of all the quantization indices for other transformation coefficients.
[0028] Since video decoders typically utilize standard-precision (e.g., 32-bit) integer arithmetic, the actual formulas used in the standard may differ slightly from simple multiplication. Ignoring clipping to the supported dynamic range for conversion coefficients, the reconstructed conversion coefficients in H.265|MPEG-H HEVC are obtained by: t'=(scale·q+(1<<(shift-1)))>>shift However, the operators "<<" and ">>" represent left and right bit shifts, respectively. When we ignore integer arithmetic, the quantization step size Δ corresponds to the following terms. Δ = scale·2 -shift
[0029] Older video coding standards, such as H.262|MPEG-2 Video, also specify a modified URQ in which the distance between reconstruction level zero and the first non-zero reconstruction level increases with respect to the nominal quantization step size (for example, to 3 / 2 of the nominal quantization step size Δ).
[0030] The quantization step size (or scale parameter and shift parameter) for the transformation coefficients is determined by two coefficients.
[0031] • Quantization Parameter QP: The quantization step size can typically be changed on a block-by-block basis. For this purpose, video coding standards provide a predefined set of quantization step sizes. The quantization step size used (or, equivalently, the parameters "scale" and "shift" introduced above) is indicated using an index to a predefined list of quantization step sizes. This index is called the quantization parameter (QP). In H.265|MPEG-H HEVC, the relationship between QP and quantization step size is approximately given by:
[0032]
number
[0033] The slice QP is typically transmitted within the slice header. Generally, it is possible to modify the quantization parameter QP based on the block. For this purpose, the DQP (delta quantization parameter) may be transmitted. The quantization parameter used is determined by the transmitted DQP and the predicted QP value, which is derived using the QP of already coded (typically adjacent) blocks.
[0034] • Quantization weighting matrix: Video coding standards often provide the possibility of using different quantization step sizes for individual transformation coefficients. This is achieved by specifying a so-called quantization weighting matrix w, which can be selected by the encoder, typically at the sequence or picture level, and transmitted as part of the bitstream. The quantization weighting matrix w has the same size as the corresponding block of transformation coefficients t ik Quantization step size Δ ik This is given by the following: Δ ik =w ik ·Δ block However, Δ block represents the quantization step size for the block under consideration (indicated by the block quantization parameter QP), i and k represent coordinates specifying the current transformation coefficients inside the transformation block, and w ik This represents the corresponding entry in the quantization weight matrix w.
[0035] The primary intention of quantization weight matrices is to provide the possibility of introducing quantization noise in a perceptually meaningful way. By using appropriate weight matrices, the spatial contrast sensitivity of human vision can be leveraged to achieve a better trade-off between bitrate and subjective reconstruction quality. Nevertheless, many encoders use so-called flat quantization matrices (which can be efficiently transmitted using high-level syntax elements). In this case, the same quantization step size Δ is used for all transformation coefficients within a block. The quantization step size is then entirely specified by the quantization parameter QP.
[0036] Blocks of transformation coefficient levels (quantization indices for transformation coefficients) are entropy coded (i.e., transmitted in a reversible manner as part of a bitstream). Since linear transformations can only reduce linear dependencies, entropy coding for transformation coefficient levels is typically designed in such a way that the remaining nonlinear dependencies between transformation coefficient levels within a block can be leveraged for efficient coding. Well-known examples include run-level coding in MPEG-2 Video, run-level-last coding in H.263 and MPEG-4 Visual, context-adaptive variable-length coding (CAVLC) in H.264|MPEG-4 AVC, and context-based adaptive binary arithmetic coding (CABAC) in H.264|MPEG-4 AVC and H.265|MPEG-H HEVC.
[0037] The CABAC specified in the state-of-the-art video coding standard H.265|MPEG-H HEVC follows a general concept that can be applied to a wide variety of conversion block sizes. Conversion blocks larger than 4x4 samples are divided into 4x4 subblocks. This division is shown in Figures 4a and 4b for an example of a 16x16 conversion block. The coding order of the 4x4 subblocks shown in Figure 4a, and the coding order of the conversion coefficient levels within the subblocks shown in Figure 4b, are generally specified by the reverse diagonal scan shown in those figures. Some intra-picture prediction blocks use horizontal or vertical scan patterns (depending on the actual intra-prediction mode). The coding order always starts from the high-frequency locations.
[0038] In H.265|MPEG-H HEVC, conversion factor levels are transmitted based on 4x4 subblocks. Lossless coding of conversion factor levels involves the following steps:
[0039] 1. A syntax element, coded_block_flag, is sent, signaling whether any non-zero conversion coefficient levels are present in the conversion block. If coded_block_flag is equal to 0, no further data is coded for the conversion block. 2. The x and y coordinates of the first non-zero conversion coefficient level in the coding order (for example, the inverse diagonal scan order per block shown in Figure 4) are transmitted. The transmission of these coordinates is divided into prefix and suffix parts. The standard uses the syntax elements last_sig_coeff_x_prefix, last_sig_coeff_y_prefix, last_sig_coeff_x_suffix, and last_sig_coeff_y_suffix. 3. Starting with the 4x4 subblock containing the first non-zero conversion coefficient level in the coding order, the 4x4 subblocks are processed in the coding order, however, the coding of the subblocks includes the following main steps: a. The syntax element `coded_sub_block_flag` is sent, indicating whether the subblock contains any non-zero conversion coefficient levels. For the first and last 4x4 subblocks (i.e., the subblocks containing the first non-zero conversion coefficient level or DC level), this flag is not sent but is inferred to be equal to 1. b. For all transformation coefficient levels within a subblock with a coded_sub_block_flag equal to 1, the syntax element significant_coeff_flag indicates whether the corresponding transformation coefficient level is not equal to zero. This flag is sent only if its value cannot be inferred based on data already sent. Specifically, this flag is not sent for the first significant scan position (specified by the sent x and y coordinates), nor for the DC coefficient if the DC coefficient lies in a subblock different from the first non-zero coefficient (in coding order), and all other significant_coeff_flags for the last subblock are equal to zero. c. For the first eight conversion coefficient levels that have a significant_coeff_flag equal to 1 (if any), the flag coeff_abs_level_greater1_flag is sent. This flag indicates whether the absolute value of the conversion coefficient level is greater than 1. d. For the first conversion coefficient level that has a coeff_abs_level_greater1_flag equal to 1 (if any), the flag coeff_abs_level_greater2_flag is sent. This flag indicates whether the absolute value of the conversion coefficient level is greater than 2. e. For all levels with significant_coeff_flag equal to 1 (exceptions are described below), a syntax element coeff_sign_flag specifying the sign of the conversion coefficient level is sent. f. For all conversion coefficient levels whose absolute values are not already fully specified by the values of significant_coeff_flag, coeff_abs_level_greater1_flag, and coeff_abs_level_greater2_flag (if any of the transmitted flags are equal to zero, the absolute values are fully specified), the remainder of the absolute values is transmitted using the multilevel syntax element coeff_abs_level_remaining.
[0040] In H.265|MPEG-H HEVC, all syntax elements are coded using context-based adaptive binary arithmetic coding (CABAC). All non-binary syntax elements are first mapped onto a sequence of binary decisions, also called bins. The resulting bin sequence is coded using binary arithmetic coding. To this end, each bin is associated with a probability model (binary probability mass function), also called a context. For most bins, the context represents an adaptive probability model, meaning that the associated binomial probability mass function is updated based on the actually coded bin values. Conditional probabilities can be leveraged by switching the context for some bins based on data already transmitted. CABAC also includes a so-called bypass mode in which a fixed probability mass function (0.5,0.5) is used.
[0041] The context chosen for coding a coded_sub_block_flag depends on the value of the coded_sub_block_flag for the adjacent subblock that has already been coded. The context for significant_coeff_flag is selected based on the scan position (x and y coordinates) within the subblock, the size of the transform block, and the value of the coded_sub_block_flag in the adjacent subblock. For the flags coeff_abs_level_greater1_flag and coeff_abs_level_greater2_flag, the context selection depends on whether the current subblock contains a DC coefficient and whether any coeff_abs_level_greater1_flag equal to 1 has been sent for the adjacent subblock. For coeff_abs_level_greater1_flag, the context selection further depends on the number and value of the coeff_abs_level_greater1_flag that has already been coded for the subblock.
[0042] The sign `coeff_sign_flag` and the remaining absolute value `coeff_abs_level_remaining` are coded in the bypass mode of the binary arithmetic coder. An adaptive binarization scheme is used to map `coeff_abs_level_remaining` onto a sequence of bins (binary decisions). Binarization is controlled by a single parameter, which is adapted based on already coded values for the subblocks.
[0043] H.265|MPEG-H HEVC also includes a so-called coded data hiding mode, in which (under certain conditions) the transmission of codes for the last non-zero level within a subblock is omitted. Instead, the codes for this level are embedded in the parity of the sum of absolute values for the levels of the corresponding subblock. It should be noted that encoders must take this aspect into consideration when determining the appropriate conversion coefficient levels.
[0044] Video coding standards specify only the bitstream syntax and the reconstruction process. When we consider transformation coding for a given block of original prediction error samples and a given quantization step size, the encoder has considerable freedom. Quantization index q for the transformation block. k Given a quantization index q, the entropy coding must follow a uniquely defined algorithm for writing the data to a bitstream (i.e., constructing an arithmetic codeword). However, given the original block of prediction error samples, the quantization index q k The encoder algorithm for obtaining the original t is outside the scope of the video coding standard. Furthermore, the encoder has the freedom to select the quantization parameter QP on a block basis. In the following description, we assume that the quantization parameter QP and the quantization weight matrix are given. Thus, the quantization step size for each transformation coefficient is known. We assume that the encoder takes the original transformation coefficient t k We further assume that we perform an analytic transformation, which is the inverse (or a very close approximation of the inverse) of the specified composite transformation to obtain . Under these conditions, the encoder also takes the transformation coefficient t of each element. k Quantizer index q for k You have the freedom to choose. The choice of transformation coefficient levels determines both the distortion (or reconstruction / approximation quality) and the bitrate, so the quantization algorithm used has a significant impact on the rate-distortion performance of the resulting bitstream.
[0045] The simplest quantization method is the original transformation coefficient t k Round it to the nearest reconstruction level. In the URQ typically used, the corresponding quantization index q k However, it may be determined according to the following:
[0046]
number
[0047] However, sgn() is a sign function, and the operator [·] returns the largest integer less than or equal to its argument. This quantization method is MSE strain
[0048]
number
[0049] This guarantees that the obtained transformation coefficient level q will be minimized. k Completely ignore the bitrate required to transmit the data. Typically, better results are obtained when rounding is biased towards zero.
[0050]
number
[0051] however,
[0052]
number
[0053] The best results in terms of rate distortion are obtained when the quantization process minimizes the Lagrangian function D + λ·R, where D represents the distortion of the transformation block (e.g., MSE distortion), R specifies the number of bits required to transmit the transformation coefficient level of the block, and λ is the Lagrangian multiplier. Relationship between QP and quantization step size.
[0054]
number
[0055] In codecs that use (such as H.264|MPEG-4 AVC or H.265|MPEG-H HEVC), the following relationship between the Lagrange multiplier λ and the block quantization parameter QP is often used:
[0056]
number
[0057] However, c1 and c2 represent constant coefficients for slices or pictures.
[0058] A quantization algorithm that aims to minimize the Lagrangian function D+λ·R of strain and rate is also called rate-distortion optimized quantization (RDOQ). When we measure strain using MSE or weighted MSE, the quantization index q for the transformation block is k This should be determined in a way that minimizes the following cost measures.
[0059]
number
[0060] Here, the conversion coefficient index k specifies the coding order (or traversal order) of the conversion coefficient levels. Term R(q k |q k-1 ,q k-2 ,...) is the quantization index q k This represents the number of bits (or an estimate thereof) required to transmit. This condition is a specific transformation coefficient level q (for the use of combinatorial or conditional probability). k The number of bits for is typically the preceding conversion coefficient level q in the coding order. k-1 , q k-2 This shows that it depends on the value chosen for purposes such as the above equation. k For example, it can be used to weight the contribution of individual transformation coefficients in order to model the contrast sensitivity of human vision. Below, we generally consider all weighting coefficients α kAssume that is equal to 1 (but the algorithm can be easily modified in a way that can take different weighting factors into account).
[0061] In H.265|MPEG-H HEVC conversion coefficient coding, the calculation of the rate term is extremely complex because most binary decisions are coded using adaptive probabilistic models. However, if we ignore some aspects of probabilistic model selection and ignore the fact that the probabilistic model is adapted within the conversion block, it is possible to design an RDOQ algorithm of reasonable complexity. The RDOQ algorithm implemented in the reference software for H.265|MPEG-H HEVC consists of the following basic processing steps.
[0062] 1. For each scanning position k, the conversion coefficient level q k However, under the assumption that the level is not inferred to be equal to zero, the Lagrange cost D k (q k )+λ·R k (q k It is selected by minimizing ). k (q k ) is the (weighted) squared error D k (q k )=α k ·(t k -Δ k ·q k ) 2 Show, R k (q k ) is q k This represents an estimate of the number of bits required to transmit the data. 2. The flag coded_sub_block_flag for the 4x4 subblock is determined by comparing the Lagrange costs for the following two cases: (a) when the transformation coefficient levels selected in step 1 are used, and (b) when the syntax element coded_sub_block_flag is set to zero, and therefore all transformation coefficient levels for the 4x4 subblock are set to zero. 3. The location of the first non-zero conversion coefficient level is determined by comparing the Lagrangian costs, which are obtained by selecting one of the non-zero conversion coefficient levels (after step 2) as the first non-zero conversion coefficient level in the coding order (where the preceding conversion coefficient level is set to zero). 4. coded_block_flag is determined by comparing the Lagrangian cost for the sequence of transformation coefficient levels obtained after step 3 with the Lagrangian cost for the case where all transformation coefficient levels inside the transformation block are set to equal to zero.
[0063] [3] proposes a modified concept for transformation coding, which is described in more detail below. The main change compared to conventional transformation coding is that the transformation coefficients are not quantized and reconstructed independently. Instead, the acceptable level of reconstruction for the transformation coefficients depends on the selected quantization index for the preceding transformation coefficients in the reconstruction order. The concept of dependent scalar quantization is combined with the modified entropy coding, where the probabilistic model selection (or alternatively, codeword table selection) for the transformation coefficients depends on the set of acceptable reconstruction levels.
[0064] The advantage of dependent quantization of transformation coefficients is that the acceptable reconstruction vectors are more densely packed in N-dimensional signal space (where N represents the number of samples or transformation coefficients in a transformation block). The reconstruction vector for a transformation block refers to the ordered reconstructed transformation coefficients (or alternatively, the ordered reconstructed samples) of the transformation block. This effect is shown in Figures 5a and 5b for the simplest case of two transformation coefficients. Figure 5a shows the acceptable reconstruction vectors (representing points in the 2d plane) for independent scalar quantization. As can be seen, the set of acceptable values for the second transformation coefficient t'1 does not depend on the chosen value for the first reconstructed transformation coefficient t'0. Figure 5b shows an example for dependent scalar quantization. Note that, in contrast to independent scalar quantization, the selectable reconstruction values for the second transformation coefficient t'1 depend on the chosen reconstruction level for the first transformation coefficient t'0. In the example in Figure 5b, there are two different sets of available reconstruction levels for the second transformation coefficient t'1 (indicated by different colors). If the quantization index for the first transformation coefficient t'0 is even (..., -2, 0, 2, ...), any reconstruction level of the first set (blue dots) can be selected for the second transformation coefficient t'1. Also, if the quantization index for the first transformation coefficient t'0 is odd (..., -3, -1, 1, 3, ...), any reconstruction level of the second set (red dots) can be selected for the second transformation coefficient t'1. In this example, the reconstruction levels for the first and second sets are shifted by half the quantization step size (any reconstruction level of the second set lies between two reconstruction levels of the first set).
[0065] Dependent scalar quantization of transformation coefficients has the effect of reducing the expected value of the distance between a given input vector of transformation coefficients and the nearest available reconstruction vector for a given average number of reconstruction vectors per N-dimensional unit quantity. As a result, the average distortion between the input vector of transformation coefficients and the reconstructed vector of transformation coefficients can be reduced with respect to a given average number of bits. In vector quantization, this effect is called space-filling gain. Using dependent scalar quantization for transformation blocks can leverage a large portion of the potential space-filling gain for higher-dimensional vector quantization. Also, in contrast to vector quantization, the complexity of implementing the reconstruction (or decoding) process is comparable to the complexity of implementing conventional transformation coding using independent scalar quantizers.
[0066] A block diagram of a transform decoder using dependent scalar quantization is shown in Figure 6. The main change concerns the dependent quantization, which is linked to the arrows pointing from top to bottom. As indicated by these vertical arrows, the reconstructed transform coefficients t' have a reconstruction order index k>0. k This is the associated quantization index q k Rather than relying solely on the quantization indices q0, q1, ..., q for the preceding transformation coefficients in the reconstruction order, k-1 It also depends on the quantization index q. Note that in dependent quantization, the reconstruction order of the transformation coefficients must be uniquely defined. k Knowledge of the set of reconstruction levels associated with a transformation can also improve the overall performance of the transformation codec when utilized in entropy coding. In other words, it is advantageous to switch between contexts (probabilistic models) or codeword tables based on the set of reconstruction levels applied to the transformation coefficients.
[0067] As with conventional transform coding, the transform coding according to the embodiments outlined herein involves a quantization algorithm and entropy coding in addition to the analytic transform. Typically, the inverse (or a close approximation thereof) of the composite transform is used as the analytic transform, and the entropy coding is usually uniquely specified given the entropy decoding process. However, as with conventional transform coding, given the original transform coefficients, there is much freedom in selecting the quantization index.
[0068] Dependent quantization of transformation coefficients refers to the concept that the set of available reconstruction levels for a transformation coefficient depends on the chosen quantization index for the preceding transformation coefficient in the reconstruction order (within the same transformation block). The set of acceptable reconstruction levels for the current transformation coefficient is selected from two predefined sets of reconstruction levels (based on the quantization index for the preceding transformation coefficient in the coding order).
[0069] As with conventional independent scalar quantization, the block-based quantization parameter (QP) determines the quantization step size Δ (or, as described above, the corresponding scale and shift parameters), and all reconstruction levels (within all sets of reconstruction levels) represent integer multiples of the quantization step size Δ. However, each set of reconstruction levels contains only a subset of integer multiples of the quantization step size Δ. In such a configuration for dependent quantization, all possible reconstruction levels for all sets of reconstruction levels represent integer multiples of the quantization step size, and such a configuration can be considered an extension of the Uniform Reconstruction Quantizer (URQ). Its fundamental advantage is that the reconstructed transformation coefficients can be computed by algorithms of extremely low computational complexity.
[0070] A specific transformation coefficient t k Quantization step size Δ k(where k indicates the reconstruction order) may not be determined solely by the block quantization parameter QP, and may also be determined by certain transformation coefficients t. k Quantization step size Δ k This can also be determined by the quantization weight matrix and block quantization parameters. Typically, the transformation coefficient t k Quantization step size Δ k t is a transformation coefficient (specified by the quantization weight matrix). k Weight coefficient w for k And the block quantization step size Δ (specified by the block quantization parameter) block It is given by the product of the two. Δ k =w k ·Δ block
[0071] Reconstructed transformation coefficient t' k It should be noted that the actual calculation (or the actual calculation at the reconstruction level) may deviate slightly from the ideal multiplication due to the integer implementation or other implementation forms. k However, a specific transformation coefficient t k Let n be the quantization step size for this purpose. k However, (for example, quantization index q k Let's specify a nominal integer coefficient for the quantization step size (given by ). In ideal multiplication, the reconstructed transformation coefficient t' k It is given by the following: t' k =n k ·Δ k
[0072] Due to the constraint to integer implementation form, the reconstructed transformation coefficient t' k (Or the corresponding reconfiguration level) is actually the following t' k =(n k ·scale+(1<<(shift-1)))>>shift, where scale·2 -shift ≒Δ k Alternatively, it can be determined by a similar procedure. When we speak of integer multiples of the quantization step size in the following explanation, the corresponding text also applies to integer approximations similar to those specified above.
[0073] The dependent scalar quantization for the transformation coefficients proposed in [3] uses two different sets of reconstruction levels and the transformation coefficient t k All reconstruction levels for the two sets are determined by the quantization step size Δ for this transformation coefficient (which is at least partially determined by the block-based quantization parameter). k Represents an integer multiple of Δ. Quantization step size Δ k Note that this represents only the scaling factor for acceptable reconstruction values within both sets. Different transformation factors t inside the transformation block k Possible individual quantization step sizes Δ k Except for (and therefore the individual scaling factors), the same two sets of reconstruction levels are used for all transformation factors.
[0074] Figure 7 shows preferred configurations for two sets of reconstruction levels t. The reconstruction levels contained within the first quantization set (labeled Set 0 in the figure) represent multiples of even integers of the quantization step size. The second quantization set (labeled Set 1 in the figure) contains all multiples of odd integers of the quantization step size, and additionally, the reconstruction level equal to zero. Note that both reconstruction sets are symmetric around zero. The reconstruction level equal to zero is contained within both reconstruction sets, otherwise these reconstruction sets are disjoint. The union of both reconstruction sets contains all multiples of integers of the quantization step size.
[0075] The reconstruction level that the encoder selects from among the acceptable reconstruction levels is transmitted within the bitstream. As in the case of conventional independent scalar quantization, this can be achieved using a so-called quantization index, also called a transformation coefficient level. A quantization index (or transformation coefficient level) is an integer that uniquely identifies an available reconstruction level within the quantization set (i.e., within the set of reconstruction levels). The quantization index is sent to the decoder as part of the bitstream (using any entropy coding technique). On the decoder side, the reconstructed transformation coefficient can be uniquely calculated based on the current set of reconstruction levels (determined by the preceding quantization index in the coding / reconstruction order) and the transmitted quantization index for the current transformation coefficient.
[0076] The assignment of quantization indices to reconstruction levels within a set of reconstruction levels (or quantization sets) may follow the following rules, as seen in Figure 7: A quantization index equal to 0 is assigned to a reconstruction level equal to 0. A quantization index equal to 1 is assigned to the smallest reconstruction level greater than 0, a quantization index equal to 2 is assigned to the next reconstruction level greater than 0 (i.e., the second smallest reconstruction level greater than 0), and so on. Alternatively, to put it another way, reconstruction levels greater than 0 are labeled with integers greater than 0 (i.e., 1, 2, 3, etc.) in ascending order of their values. Similarly, a quantization index of -1 is assigned to the largest reconstruction level less than 0, a quantization index of -2 is assigned to the next (i.e., the second largest) reconstruction level less than 0, and so on. Alternatively, to put it another way, reconstruction levels less than 0 are labeled with integers less than 0 (i.e., -1, -2, -3, etc.) in descending order of their values. The reconstruction process for the conversion coefficients can be implemented in a similar manner to the algorithm specified in the pseudocode in Figure 8.
[0077] In the pseudocode of Figure 8, level[k] is the conversion coefficient t.k represents the quantization index transmitted for, and setId[k] (equal to 0 or 1) specifies the identifier of the current set of reconstruction levels (determined based on the quantization index preceding in the reconstruction order, as described in more detail below). The variable n represents an integer multiple of the quantization step size given by the quantization index level[k] and the set identifier setId[k]. When the conversion coefficient is coded using the first set of reconstruction levels that includes even integer multiples of the quantization step size Δ k (setId[k]==0), the variable n is twice the transmitted quantization index. When the conversion coefficient is coded using the second set of reconstruction levels (setId[k]==1), we have the following three cases, namely, (a) when level[k] is equal to 0, n is also equal to 0, (b) when level[k] is greater than 0, n is equal to twice the quantization index level[k] - 1, and (c) when level[k] is less than 0, n is equal to twice the quantization index level[k] + 1. This can be specified using the sign function.
[0078] [Number]
[0079] Then, when the second quantization set is used, the variable n is equal to twice the quantization index level[k] - the sign function of the quantization index sign(level[k]).
[0080] Once the variable n (specifying an integer coefficient of the quantization step size) is determined, the reconstructed conversion coefficient t' k is obtained by multiplying by n with the quantization step size Δ k .
[0081] As described above, instead of exact multiplication using the quantization step size Δ k the reconstructed conversion coefficient t' kcan be obtained by integer approximation. This is shown in the pseudo-code in Figure 9. Here, the variable shift represents a right bit shift. Its value typically depends only on the quantization parameter for the block (although it is also possible that the shift parameter can be changed for different transform coefficients inside the block). The variable scale[k] represents the scaling coefficient for the transform coefficient t k and may depend on, in addition to the block quantization parameter, for example, the corresponding entry of the quantization weight matrix. The variable "add" specifies the rounding offset and is typically set equal to add=(1<<(shift-1)). The integer operations specified in the pseudo-code of Figure 9 (last line), except for rounding, are equal to multiplication using the quantization step size Δ k as noted. Δ k =scale[k]·2 -shift
[0082] Compared to Figure 8, another (purely superficial) change in Figure 9 is that the switching between the two sets of reconstruction levels is implemented using the ternary if-then-else operator (a?b:c) known from programming languages such as the C programming language.
[0083] In addition to the selection of the set of reconstruction levels described above, another task in dependent scalar quantization in transform coding is the algorithm used to switch between the defined quantization sets (sets of reconstruction levels). The algorithm used determines the "packing density" that can be achieved in the N-dimensional space of the transform coefficients (and thus also in the N-dimensional space of the reconstructed samples). A higher packing density ultimately leads to an increase in coding efficiency.
[0084] In the concept presented in [3], the set of reconstruction levels for the next transformation coefficients is determined based on the division of the quantization sets, as shown in Figure 10. Each of the two quantization sets is divided into two subsets. The first quantization set (labeled Set 0) is divided into two subsets (labeled A and B), and the second quantization set (labeled Set 1) is also divided into two subsets (labeled C and D). In Figures 7 and 10, the division of the quantization sets into subsets is indicated by hollow circles and black circles. The following division rules apply.
[0085] Subset A consists of all even quantization indices of quantization set 0. Subset B consists of all odd quantization indices of quantization set 0. Subset C consists of all even quantization indices of quantization set 1. Subset D consists of all odd quantization indices from quantization set 1.
[0086] The subset used is not explicitly indicated within the bitstream. Instead, the subset used can be derived based on the quantization set used (e.g., set 0 or set 1) and the quantization indices actually transmitted. The subset can be derived by a bitwise "and" operation of the transmitted quantization indices level and 1. Subset A consists of all quantization indices of set 0 for which (level&1) is equal to 0, subset B consists of all quantization indices of set 0 for which (level&1) is equal to 1, subset C consists of all quantization indices of set 1 for which (level&1) is equal to 0, and subset D consists of all quantization indices of set 1 for which (level&1) is equal to 1.
[0087] Transitions between quantization sets (set 0 and set 1) are represented by a state variable, which has four possible values (0, 1, 2, 3). On the one hand, the state variable specifies the quantization set to be used for the current transformation coefficient. Quantization set 0 is used when the state variable is equal to 0 or 1, and only in that case, and quantization set 1 is used when the state variable is equal to 2 or 3, and only in that case. On the other hand, the state variable also specifies the possible transitions between quantization sets. Table 1 shows the state transition table used. Given the current state, Table 1 specifies the quantization set (second column) for the current transformation coefficient. Table 1 further specifies state transitions based on the path associated with the chosen quantization index (given a quantization set, the path specifies subset A, B, C, or D to be used). In reconstructing the transformation coefficient for a block, it is sufficient to update the state variable and determine the path of the quantization index to be used.
[0088] [Table 1]
[0089] The path is given by the parity of the quantization index. If level[k] is the current quantization index, the path can be determined by: path=(level[k]&1) However, the operator & represents the bitwise "and" in two's complement integer arithmetic.
[0090] Using the concept of state transitions, the current state, and therefore the current quantization set, is uniquely determined by the previous state (in the reconstruction order) and, in this example, the previous quantization index, such as its parity. The initial state for the transformation block is set to equal to 0.
[0091] The concept of state transitions for dependent scalar quantization enables low-complexity implementations for reconstructing transformation coefficients in the decoder. A preferred example of the transformation coefficient reconstruction process for a single transformation block is shown in Figure 11 using C-style pseudocode.
[0092] In the pseudocode of Figure 11, index k specifies the reconstruction order of the transformation coefficients. Note that in the exemplary code, index k decreases in the reconstruction order. The last transformation coefficient has an index equal to k=0. The first index kstart specifies the reconstruction index (or, more precisely, the inverse reconstruction index) of the first reconstructed transformation coefficient. The variable kstart can be set to equal to the number of transformation coefficients in the transformation block minus 1, or (for example, if the location of the first non-zero quantization index is transmitted in the applied entropy coding method) to equal to the index of the first non-zero quantization index in the coding / reconstruction order. In the latter case, all preceding transformation coefficients (where index k > kstart) are inferred to be equal to 0. The reconstruction process for each single transformation coefficient is the same as in the example in Figure 9. For the example in Figure 9, the quantization index is represented by level[k] and the associated reconstructed transformation is represented by trec[k]. The state variable is represented by state. Note that in the example in Figure 11, state is set to equal to 0 at the beginning of the transformation block. The 1d table setId[] specifies the quantization set associated with different values of the state variable, and the 2d table state_trans_table[][] specifies the state transition given the current state (first argument) and path (second argument). The path is given by the parity of the quantization index (using the bitwise AND operator &).
[0093] Instead of using the table setId[], simple arithmetic operations, such as a bit shift to the right, can be used. setId[state]=state>>1
[0094] Similarly, the table state_trans_table[][] can also be implemented using simple arithmetic operations. For example, as follows: state_trans_table[state][path]= (32040>>((state<<2)+(path<<1)))&3
[0095] Here, the complete state transition table is given by the 16-bit value "32040". Note that by replacing the value "32040" with "0", we can easily switch between dependent and independent quantization. The value "0" represents the state transition table that always selects state 0, and therefore the conventional uniform reconstructor quantizer Q0.
[0096] State transitions in dependent quantization can also be represented using a trellis structure, as shown in Figure 12. The trellis shown in this figure corresponds to the state transitions specified in Table 1. For each state, there are two paths connecting the state for the current transformation coefficient to two possible states for the next transformation coefficient in the reconstruction sequence. These paths are labeled as path 0 and path 1, and this number corresponds to the path variable introduced above (in a preferred embodiment, the path variable is equal to the parity of the quantization index). Note that each path uniquely specifies a subset (A, B, C, or D) for the quantization index. In Figure 12, the subsets are specified in parentheses. Given an initial state (state 0), the path through the trellis is uniquely specified by the transmitted quantization index.
[0097] In the example in Figure 12, states (0, 1, 2, and 3) have the following characteristics:
[0098] State 0: The previous quantization index level[k-1] specifies the reconstruction level of set 0, and the current quantization index level[k] specifies the reconstruction level of set 0. State 1: The previous quantization index level[k-1] specifies the reconstruction level for set 1, and the current quantization index level[k] specifies the reconstruction level for set 0. State 2: The previous quantization index level[k-1] specifies the reconstruction level for set 0, and the current quantization index level[k] specifies the reconstruction level for set 1. State 3: The previous quantization index level[k-1] specifies the reconstruction level of set 1, and the current quantization index level[k] specifies the reconstruction level of set 1.
[0099] The trellis consists of a series of so-called basic trellis cells. The basic trellis cells are shown in Figure 13.
[0100] One aspect of dependent scalar quantization outlined above is the existence of different sets of acceptable reconstruction levels (also called quantization sets) for transformation coefficients. The quantization set for the current transformation coefficient is determined based on the value of the quantization index for the preceding transformation coefficient. When we compare two quantization sets, it is clear that the distance between a reconstruction level equal to zero and an adjacent reconstruction level is greater in set 0 than in set 1. Thus, the probability of a quantization index equal to zero is higher when set 0 is used and lower when set 1 is used. For efficient coding, this aspect is utilized in entropy coding by switching the probabilistic model based on the quantization set (or state) used for the current quantization index.
[0101] It should be noted that, for a suitable switching of the probabilistic model, the paths of all preceding quantization indices (associations with subsets of the quantization set used) should be known when entropy decoding the current quantization index (or the corresponding binary decision of the current quantization index). For this purpose, in the codec proposed in [3], the transformation coefficients are coded in the reconstruction order. The quantization index is coded using binary arithmetic coding similar to H.264|MPEG-4 AVC or H.265|MPEG-H HEVC. The non-binary quantization index is first mapped onto a set of binary decisions (commonly called bins). The quantization index is transmitted as an absolute value, and, in the case of an absolute value greater than 0, as a sign.
[0102] As with HEVC, the conversion coefficient levels of a conversion block are coded based on its subblocks. First, a flag `coded_block_flag` is sent, specifying whether the conversion block contains any non-zero conversion coefficient levels. If `coded_block_flag` is equal to 0 (i.e., the block contains no non-zero levels), no further information for the conversion block is sent. Otherwise (if `coded_block_flag` is equal to 1), the following applies:
[0103] • The x and y coordinates of the first non-zero level in the coding order. As shown in Figure 14, the first non-zero level location transmitted specifies that all transformation coefficients preceding the identified coefficient in the coding order (marked in white in Figure 14) are inferred to be equal to zero. Further data is transmitted only for the coefficient at the specified location (marked in black in Figure 14) and the coefficients following this coefficient in the coding order (marked in shaded in Figure 14). The example in Figure 14 shows a 16x16 transformation block with 4x4 subblocks, but the coding order used is a diagonal scan per subblock as specified in H.265|MPEG-H HEVC. For subblocks preceding the subblock containing the first non-zero level (indicated by the transmitted x and y coordinates), a flag `coded_subblock_flag` is sent, specifying whether the subblock contains any non-zero conversion coefficient levels. As an exception, `coded_subblock_flag` is not sent for subblocks containing DC coefficients. For these subblocks, `coded_subblock_flag` is inferred to be equal to 1.
[0104] Finally, for all subblocks with a coded_subblock_flag equal to 1, and for subblocks containing the first non-zero level in the coding order, the values of the conversion coefficient levels are coded as shown by the pseudocode in Figure 15. Here, firstScanIdSbb represents the first scan index inside the subblock. For subblocks containing the first non-zero level (indicated by the transmitted x and y coordinates), firstScanIdSbb is equal to the scan index firstNonZero corresponding to the transmitted (x,y) coordinates. For other transmitted subblocks, firstScanIdSbb specifies the first scan index inside the subblock. The scan index lastScanIdSbb specifies the last scan index inside the subblock. Note that all coefficients inside a subblock are coded before any coefficients of the next subblock in the coding order are coded.
[0105] The level of a subblock is coded in two passes. For all coefficients with an absolute value that is not equal to zero, the absolute value is sent in the first pass, and the sign is sent in the second pass. The absolute value is coded as follows:
[0106] The flag sig_flag is sent, which specifies whether the absolute level is greater than zero. This flag is not sent if it can be inferred to be equal to 1, i.e., if any of the following conditions are met: ○The current scan index k is equal to the first non-zero level scan index (as indicated by the transmitted x and y coordinates). ○The current scan index is the last scan index inside the subblock, a coded_subblock_flag equal to 1 has been sent for the subblock, and all previous levels within the subblock are equal to 0. If sig_flag is equal to 1 (i.e., the absolute level is greater than 0), another flag gt1_flag is sent, which specifies whether the absolute level is greater than 1. If sig_flag and gt1_flag are equal to 1 (i.e., the absolute level is greater than 1), another flag gt2_flag is sent, specifying whether the absolute level is greater than 2. If sig_flag, gt1_flag, and gt2_flag are equal to 1 (i.e., the absolute level is greater than 2), another flag gt3_flag is sent, specifying whether the absolute level is greater than 3. If sig_flag, gt1_flag, gt2_flag, and gt3_flag are equal to 1 (i.e., the absolute level is greater than 3), another flag gt4_flag is sent, specifying whether the absolute level is greater than 4. If sig_flag, gt1_flag, gt2_flag, gt3_flag, and gt4_flag are equal to 1 (i.e., their absolute levels are greater than 4), then the syntax element gt3_flag, which specifies an absolute value of -5, is sent.
[0107] After the absolute values for all levels of the subblock have been sent, the sign bit sign_flag is sent for all coefficients that have an absolute level that is not equal to zero.
[0108] The flags sig_flag, gt1_flag, gt2_flag, gt3_flag, and gt4_flag are coded using adaptive probabilistic models (also called contexts). For these flags, one of several adaptive probabilistic models is selected as follows:
[0109] Let state be the current value of the state variable for the transformation coefficient (the state variable is determined based on the parity of the levels already coded in the coding order). Let diag specify the diagonal position of the current scan position (diag = x + y, where x and y specify the x and y coordinates of the scan position). Furthermore, let sumAbsTemplate be the sum of the absolute values already coded in the local neighborhood shown in Figure 16, and the corresponding neighborhood is indicated by shading the coefficients belonging to the neighborhood of the coefficients currently coded in black. Also, let numSigTemplate be the number of absolute levels greater than 0 in the same local neighborhood.
[0110] The probabilistic model selected by sig_flag depends on the following: • The diagonal of the current scan position (given by the sum of the x and y coordinates), • The quantizer used for the current transformation coefficient (given by state>>1, Q0 or Q1), The absolute-level sum already coded in the local neighborhood, given by sumAbsTemplate.
[0111] In gt1_flag, the selected probability model depends on the following: • The diagonal of the current scan position (given by the sum of the x and y coordinates), • The quantizer used for the current transformation coefficient (given by state>>1, Q0 or Q1), • The value of sumAbsTemplate - numSigTemplate (i.e., the sum of the absolute values in the local neighborhood minus the number of absolute levels greater than 0 in the local neighborhood).
[0112] The same probabilistic model is used for gt2_flag, gt3_flag, and gt4_flag. The same probabilistic model is selected depending on the following: • The diagonal of the current scan position (given by the sum of the x and y coordinates), • The value of sumAbsTemplate - numSigTemplate (i.e., the sum of the absolute values in the local neighborhood minus the number of absolute levels greater than 0 in the local neighborhood).
[0113] First, the non-binary syntax elements, which are initially binarized (i.e., mapped to a sequence of bins), and the bins are coded in bypass mode of the arithmetic coding engine (using a non-adaptive probabilistic model, along with pmf{0.5,0.5}). For binarization, Ricegolomb codes are used, which are parameterized by so-called Rice parameters. The Rice parameters are selected according to the values of (sumAbsTemplate-numSigTemplate). Finally, the sign flag is coded using bypass mode of the arithmetic coding engine.
[0114] To obtain a bitstream that yields an extremely good trade-off between distortion (reconstruction quality) and bitrate, the quantization index is a Lagrangian cost measure.
[0115]
number
[0116] It should be selected in a way that minimizes it. For independent scalar quantization, such quantization algorithms (called rate-distortion-optimal quantization, or RDOQ) were described above. However, compared to independent scalar quantization, we have additional difficulties. Reconstructed transformation coefficient t' k , and therefore their strain D k =( t k -t' k ) 2 This is the associated quantization index q k It depends not only on that, but also on the value of the preceding quantization index in the coding order.
[0117] However, as we explained above, the dependencies between transformation coefficients can be represented using a trellis structure. For further explanation, we use a preferred embodiment given in Figure 10 as an example. A trellis structure for an example block of eight transformation coefficients is shown in Figure 17. The paths through the trellis (from left to right) represent possible state transitions for the quantization index. Note that each connection between two nodes represents a quantization index for a particular subset (A, B, C, D). k Select from each of the subsets (A, B, C, D) and calculate the corresponding rate strain cost. J k =D k (q k |q k-1 ,q k-2 ,...)+λ·R k (q k |q k-1 ,q k-2 ,...) If we assign to the associated connections between two trellis nodes, the problem of determining the vector / block of quantization indices that minimizes the overall rate-distortion cost D+λ·R is equivalent to finding the path with the minimum cost through the trellis (from left to right in Figure 17). If we ignore some dependencies in entropy coding (similar to RDOQ), this minimization problem can be solved using the well-known Viterbi algorithm.
[0118] An exemplary coding algorithm for selecting a suitable quantization index for a transformation block may consist of the following main steps:
[0119] 1. Set the rate strain cost for the initial state to equal to 0. 2. For all conversion coefficients in the coding order, do the following: a. For each subset A, B, C, and D, determine the quantization index that minimizes the distortion for a given original transformation coefficient. b. For all trellis nodes (0, 1, 2, 3) for the current transformation coefficient, do the following: i. Calculate the rate-strain costs for two paths, connecting the state for the preceding transformation coefficients to the current state. The cost is the cost for the preceding state, and D k +λ·R k It is given as the sum of, where D k and R k This represents the strain and rate for selecting the quantization indices of the subset (A, B, C, D) associated with the connection under consideration. ii. Assign the minimum calculated cost to the current node and prune connections to previous transformation coefficient states that do not represent the minimum cost path.
[0120] Note: After this step, all nodes for the current transformation coefficient will have a single connection to any node for the preceding transformation coefficient.
[0121] 3. Compare the costs of the four final nodes (for the last coefficient in the coding order) and select the node with the minimum cost. Note that this node will be associated with a unique path through the trellis (all other connections have been pruned in the previous step). 4. Follow the selected path (specified by the last node) in reverse order and collect the quantization indices associated with the connections between the trellis nodes.
[0122] Next, embodiments of the present application will be described. Embodiments of the present application are presented independently, but may refer to the figures described above. Specifically, the following description will focus on differences from the examples described above, and these differences may be used to modify the above description to produce further embodiments, and vice versa. Individual tasks described above, such as context selection, quantization, dequantization, transformation, retransformation, and entropy coding / decoding, may be used individually or in combination to modify or further specify the embodiments described later, in order to produce even further embodiments.
[0123] Transform coding using dependent scalar quantization as described above [3] generally improves coding efficiency compared to conventional transform coding using independent scalar quantization. However, the entropy coding of dependent quantization indices (transformation coefficient levels) as described in Figure 15 above has the following two problems that make it difficult to achieve high-throughput hardware design.
[0124] The bins coded in the normal coding mode of the arithmetic coding engine (sig_flag, gt1_flag, gt2_flag, gt3_flag, and gt4_flag) are interleaved with the bins coded in bypass mode (the bin for the syntax element remainder). The bypass mode of the arithmetic coding engine can be implemented more efficiently than the normal mode. Furthermore, the bypass mode of arithmetic coding can be implemented particularly efficiently when a large number of bypass bins are coded sequentially. Frequent switching between normal mode and bypass mode is disadvantageous for hardware implementations.
[0125] • The probabilistic models for most bins directly depend on the value of the preceding bin. For example, the probabilistic model used for sig_flag depends on the parity of the previous absolute level (which is unknown before the last bin for the previous level is read). The value of sig_flag then determines whether the next bin is gt1_flag or another sig_flag. If gt1_flag is read, its value determines whether the next bin is gt2_flag or sig_flag, and so on. These direct dependencies hinder the efficient pipelining of the arithmetic decoding process. It is desirable to reduce the number of direct dependencies so that the arithmetic decoding of bins can be pipelined to some extent.
[0126] A technique to reduce the complexity of state-of-the-art residual coding designs is coding in several scan passes. In each scan pass, partial level information is transmitted, and the complete level information becomes available only after the last scan pass. However, this design is not compatible with dependent quantization techniques. Note that bin reordering is not straightforward for dependent quantization for the following reasons:
[0127] Specifically, for the flag sig_flag, we have significantly different probability mass functions for the two supported quantizers. If we do not know the quantizer (Q0 or Q1) for the current transformation coefficient, the compression efficiency will be significantly reduced. However, the quantizer used depends on the parity of all transformation coefficient levels, and the parity of all transformation coefficient levels is known only if all bins of all previous transformation coefficients are coded before the first bin (sig_flag) for the current transformation coefficient.
[0128] Contextual modeling for bins also relies on knowledge of absolute levels already sent in the local neighborhood. Typically, better knowledge of adjacent transformation coefficient levels leads to improved coding efficiency.
[0129] Frankly speaking, the embodiments described further below overcome the problems mentioned by one or more of the following design modes.
[0130] • The bins associated with the transformation coefficient level of the subblock (or block) are coded across multiple passes on all scan locations. The first pass—or the first multiple passes—on the scan position includes coding for sig_flag, and, if sig_flag is equal to 1, the parity flag par_flag (specifying the parity at the transformation coefficient level). The first pass may or may not include additional data. Note that coding a dedicated parity flag reveals the quantizer used for the transformation coefficients, and this knowledge can be used for efficient contextual modeling of sig_flag. • All bypass bins of the syntax element `remainder` for a subblock (or block) are coded in a separate path. That is, all bypass bins of a subblock (or block) are coded sequentially.
[0131] The following describes a design approach that, firstly, adapts to quantization methods requiring parity information, and secondly, inherits less complexity than coding complete absolute-level information. The central concept is to transmit parity information for each absolute level as a dedicated syntax element. Different locations are possible, for example, before the significance flag, after the significance flag, or after any "is level greater than" information. The semantics of the syntax element following the parity information alternate depending on the chosen location for transmitting the parity syntax element. When parity information is available, the remaining absolute-level information is divided by 2, resulting in different conditional probabilities for the syntax element.
[0132] Further details about the bin coding order and related context modeling are described below.
[0133] In one embodiment, similar to HEVC, the conversion coefficient levels of a conversion block are coded based on subblocks. First, a flag `coded_block_flag` is sent, specifying whether the conversion block contains any non-zero conversion coefficient levels. If `coded_block_flag` is equal to 0 (i.e., the block contains no non-zero levels), no further information for the conversion block is sent. Otherwise (if `coded_block_flag` is equal to 1), the following applies:
[0134] The x and y coordinates of the first non-zero level in the coding order are sent. As shown in Figure 14, the first non-zero level location sent specifies that all transformation coefficients preceding the identified coefficient in the coding order (marked in white in Figure 14) are inferred to be equal to zero. For subblocks following the first subblock containing a non-zero level (indicated by the transmitted x and y coordinates) in the coding sequence, a flag `coded_subblock_flag` is sent, indicating whether the subblock contains any non-zero conversion coefficient levels. As an exception, `coded_subblock_flag` is not sent for subblocks containing DC coefficients. For these subblocks, `coded_subblock_flag` is inferred to be equal to 1.
[0135] Finally, for all subblocks with a coded_subblock_flag equal to 1, and for subblocks that contain the first non-zero level in the coding order, the values of the conversion coefficient levels are coded as described below.
[0136] A preferred embodiment for coding the conversion coefficient levels of a subblock is shown by the pseudocode in Figure 18, where firstScanIdSbb represents the first scan index within the subblock. For a subblock containing the first non-zero level (indicated by the transmitted x and y coordinates), firstScanIdSbb is equal to the scan index firstNonZero corresponding to the transmitted (x,y) coordinates. For other transmitted subblocks, firstScanIdSbb specifies the first scan index within the subblock. The scan index lastScanIdSbb specifies the last scan index within the subblock.
[0137] Let level[k] and absLevel[k]=abs(level[k]) represent the transformation coefficient level and the absolute value of the transformation coefficient level at scan position k. The coding of the transformation coefficient level proceeds over four passes on the scan position within the subblock.
[0138] In the first pass, the binary syntax elements sig_flag, par_flag, and gt1_flag are sent.
[0139] The binary syntax element sig_flag[k] specifies whether the absolute value of the conversion coefficient level at scan position k is greater than 0, i.e., sig_flag[k]=(absLevel[k]>0?1:0).
[0140] sig_flag is not sent if it can be inferred to be equal to 1, i.e., if any of the following conditions are met: ○The current scan index k is equal to the first non-zero level scan index (as indicated by the transmitted x and y coordinates). ○The current scan index is the last scan index inside the subblock, a coded_subblock_flag equal to 1 has been sent for the subblock, and all previous levels within the subblock are equal to 0.
[0141] If sig_flag[k] is equal to 1, the binary syntax elements par_flag[k] and gt1_flag[k] are sent.
[0142] par_flag[k] specifies the parity of the conversion coefficient level. In a preferred embodiment of the present invention, par_flag[k] is set to equal a parity of absolute value -1 (representing the inverse parity of the conversion coefficient level). par_flag[k]=(absLevel[k]-1)&1
[0143] gt1_flag[k] specifies whether the remainder (given by sig_flag[k]=1 and the value of par_flag[k]) is greater than zero. gt1_flag[k]=(((absLevel[k]-1)>>1)>0?1:0) However, the operator ">>" specifies a bit shift to the right (i.e., integer division by 2).
[0144] In the second pass, the binary syntax element gt2_flag is sent. The binary syntax element gt2_flag[k] is coded only for the scan position k for which gt1_flag[k] equal to 1 was sent in the first pass. gt2_flag[k] specifies whether the remainder (given by sig_flag[k]=1 and the value of par_flag[k]) is greater than 1. gt2_flag[k]=(((absLevel[k]-1)>>1)>1?1:0)
[0145] In the third pass, the syntax element `remainder` is sent. The syntax element remainder[k] is coded only for the traversal position k for which a gt2_flag[k] equal to 1 was sent in the second pass. remainder[k] specifies the remainder of the absolute value (given by the values of sig_flag[k]=1, gt1_flag[k]=1, gt2_flag[k]=1, and par_flag[k]). remainder[k]=((absLevel[k]-1)>>1)-2
[0146] Finally, in the fourth pass, the syntax element sign_flag is sent. The syntax element sign_flag[k] is coded only for those scan positions k where a sig_flag[k] equal to 1 for that purpose was sent or inferred in the first pass. sign_flag[k] specifies whether the conversion coefficient level is negative or not. sign_flag[k]=(level[k]<0?1:0)
[0147] On the decoder side, the syntax elements sig_flag[k], par_flag[k], gt1_flag[k], gt2_flag[k], remainder[k], and sign_flag[k] are similarly decoded from the bitstream. Note that all values of the syntax elements par_flag[k], gt1_flag[k], gt2_flag[k], remainder[k], and sign_flag[k] that are not transmitted are inferred to be equal to 0. If sig_flag[k] is not transmitted for a subblock that has a coded_subblock_flag equal to 1, its value is inferred to be equal to 1.
[0148] Given the coded and inferred values, the absolute value of the transformation coefficient level at scan position k can be reconstructed as follows: absLevel[k]= sig_flag[k]+par_flag[k]+2*(gt1_flag[k]+gt2_flag[k]+remainder[k])
[0149] Furthermore, given sign_flag[k] for an absolute level that is not equal to 0, the conversion coefficient level is given by: level[k]=(sign_flag[k]?-absLevel[k]:absLevel[k])
[0150] The specific embodiments described above may be modified, for example, by one or more of the following embodiments.
[0151] • Coefficient level coding may not be based on subblocks. That is, instead of dividing coefficient level coding into subblocks, all coefficient levels of a conversion block may be coded at once. In this case, the path described above represents the path over all scan locations within the complete conversion block. This technique can still be combined with coding of the coded_block_flag, as well as with instructions for the first non-zero level scan location in the coding order (e.g., by sending x and y locations, or by some other means). This technique can also be combined with instructions (similar to the coded_block_flag) specifying that all coefficient levels within a large region are equal to 0. These regions may represent subblocks, consecutive scan locations, or any other distinct subset of coefficient locations. The corresponding instructions may be coded before the actual coefficient levels, or they may be interleaved with the bins of the first pass. The coding order of the flags par_flag and gt1_flag may change. Note that these flags are independent of each other, and therefore par_flag may be coded before gt1_flag, or gt1_flag may be coded before par_flag.
[0152] The meaning of the parity flag `par_flag` can be changed. Instead of signaling absolute level -1 parity, absolute level parity can be sent (which is the same as absolute level -2 parity).
[0153] The meaning of gt1_flag may change. Instead of signaling whether (absLevel-1)>>1 is greater than 0 (see above), we could also signal whether (absLevel-1-par_flag) is greater than 0. Or, if the meaning of par_flag is changed as shown above, gt1_flag could indicate whether (absLevel-1) is greater than 0. In both cases, the reconstruction formula changes as follows: absLevel[k]=sig_flag[k]+par_flag[k]+gt1_flag[k]+ 2*(gt2_flag[k]+remainder[k]) Additionally, the meanings of gt2_flag and remainder will change as follows. gt2_flag[k]=(((absLevel[k]-2)>>1)>0?1:0) remainder[k]=((absLevel[k]-2)>>1)-1
[0154] For example, looking at Figure 19, in this case the flags are distributed differently on the path, and the reconstruction of the quantization index involves absQIdx=sig_flag+gt1_flag+par_flag+2*(gt3_flag+remainder), and the partial reconstruction that can be performed after the first pass shown in Figure 19 is absQIdx1=sig_flag+gt1_flag+par_flag+2*gt3_flag.
[0155] The first path may be modified so that only sig_flag and par_flag are sent on this path. gt1_flag may be moved to the second path, or sent on a separate path between the first and second paths as described. Alternatively, an additional flag (e.g., gt2_flag) can be coded as part of the first pass.
[0156] • The second pass (with gt2_flag) may be omitted, in which case the pass with the syntax element remainr is coded directly after the first pass. In one embodiment, the second pass is omitted because gt2_flag is already coded as part of the first pass (see above). In another embodiment, the second pass is omitted because gt2_flag is not sent at all. In the latter case, the meaning of the syntax element remainr changes as follows: remainder[k]=((absLevel[k]-1)>>1)-1 Furthermore, the reconstruction formula has been changed as follows: absLevel[k]= sig_flag[k]+par_flag[k]+2*(gt1_flag[k]+remainder[k]) Alternatively, when the meaning of gt1_flag changes as explained above, the reconstruction formula changes as follows: absLevel[k]= sig_flag[k]+par_flag[k]+gt1_flag[k]+2*remainder[k]
[0157] Alternatively, the second path may include additional flags. For example, an additional gt3_flag with the following meaning. gt3_flag[k]=(((absLevel[k]-1)>>1)>2?1:0) This may be sent. Alternatively, as mentioned above, gt1_flag may be moved from the first path to the second path. This may also be combined with gt3_flag.
[0158] The maximum number of gtx_flags sent for the current scan position can also be adaptively determined based on already coded data (for example, based on the sum of absolute values in the local neighborhood, which can be derived based on already coded data).
[0159] • One or more additional passes, usually accompanied by coded bins, may be coded between the second pass (with gt2_flag) and the third pass (the syntax element remainder). For example, gt3_flag may be sent in an additional pass.
[0160] • Bypass coding bins and bypass coding sign_flag for syntax elements remainder can be interleaved coding in a single pass.
[0161] Two or more of the points listed above can also be combined.
[0162] After briefly summarizing the embodiments described above, further embodiments will be described again below. In doing so, we will use the reference numerals that indicate the figures described above.
[0163] Specifically, the above embodiment describes a concept for decoding a block (10) of conversion coefficient 12, in which the conversion block 10 may or may not be subdivided into subblocks 14.
[0164] This decoding is performed in a pass. In one or more first passes scanning the transformation coefficients, a significance flag for the current transformation coefficient, indicating whether the quantization index of the transformation coefficient is zero, and a parity flag for the transformation coefficient, indicating the parity of the transformation coefficient, are decoded. The pseudocode in the figure similarly illustrates the decoding procedure by changing "coding" to "decoding," so that the tasks described above are performed in 16 and 18, respectively. In Figure 18, these tasks are contained within a single first pass 20, but according to the alternative, they can be distributed over two separate passes. Both tasks 16 and 18 are performed using context-adaptive entropy decoding, which may be context-adaptive binary arithmetic decoding.
[0165] In one or more second passes 22 scanning the transformation coefficients, decoding 24 of one or more greatness flags for transformation coefficients whose quantization index is non-zero is performed. In Figure 18, there are two such passes 22' and 22''. The one or more greatness flag passes 22 do not need to be separate from one or more first passes 20. In Figure 18, gt1_flag decoding 24' is performed in pass 22', which is also a first pass 20, and gt2_flag decoding 24'' is performed in a separate pass 22''. Figure 19 shows that one or more first passes 20 and one or more second passes 22 can coincide, where decoding 16, 18 and 24 are performed in the same pass. In Figure 19, there is one such pass exemplarily shown, indicated by curly braces indicating that the pass acts as both a significance / parity pass 20 and a greatness flag pass 22. Again, Task 24 is performed using context-adaptive entropy decoding, which may be context-adaptive binary arithmetic decoding. In Figures 18 and 19, two greater-than flags are decoded exemplarily, but this is just one example.
[0166] Tasks 28 and 30 are performed using equirobability entropy decoding, which may be equirobability binary arithmetic decoding. Specifically, decoding 28 may involve using equirobability binary arithmetic decoding of the remaining bins of the binarization and the absolute values of the remaining bins of the binarization of the quantization indices of the transformation coefficients whose greatness is positive, as indicated by one of those coefficients confirming / acknowledging that greatness is great, and decoding 30 of the signs of the quantization indices of the transformation coefficients whose quantization indices are not zero. The advantages of separating paths in any of the above methods are motivated above and are evident, for example, from the following explanation of the possibilities in performing inverse quantization and / or context derivation, but the details should be considered not to limit the scope of the subsequent claims. The advantage lies in providing a basis for explaining transformation blocks that can be effectively coded using dependent quantization and context-adaptive entropy coding, such as context-adaptive binary arithmetic coding.
[0167] As shown in Figures 18 and 19, in one first pass 20, for the transformation coefficient currently being scanned, a significance flag 16 for the transformation coefficient currently being scanned may be decoded 16 using context-adaptive entropy decoding, and then, if the significance flag indicates that the quantization index of the transformation coefficient currently being scanned is not zero, when checked in 32, a parity flag 18 for the transformation coefficient currently being scanned may be decoded 18 for the transformation coefficient currently being scanned, using context-adaptive entropy decoding. Alternatively, a separate first pass 20 may be used for both flags. In one or more second passes 22, i.e., 22' and 22'' in Figure 18, and in the case of Figure 19, one of the 22 that is simultaneously a pass 20, for the transformation coefficient currently being scanned, if the quantization index of the transformation coefficient currently being scanned is not zero, when the situation is checked in 32, a greater-than flag 24', 24'' for the transformation coefficient currently being scanned may be decoded 24', 24'' using context-adaptive entropy decoding. It should be noted that this first greater-than flag may have different definitions, as explained above, and can be either gt1_flag or gt3_flag. Decoding 18 in the case of Figure 19, and even decoding 24'' in the cases of Figures 18 and 19, is performed only if the greater-than flag gt1_flag for the currently scanned transformation coefficient is positive, the situation of which is checked in 34. That is, for the coefficient currently being scanned, the order of flag coding / decoding is significance flag, greater-than flag gt1_flag, parity flag, and in the case of Figure 18, greater-than flag gt2_flag, and in the case of Figure 19, greater-than flag gt3_flag.
[0168] As described above, the calculation of the quantization index for the predetermined transformation coefficients from the flags mentioned may involve a sum in the cases of Figures 18 and 19, the sum of which is formed as follows: one sum is formed by the significance flag of the predetermined transformation coefficients, one sum is formed by the parity flag of the predetermined transformation coefficients, and one sum is formed by twice the sum of the remainder of the predetermined transformation coefficients and one greater-than flag, i.e., gt2_flag in the case of Figure 18 and gt3_flag in the case of Figure 19.
[0169] In one or more second passes 22, i.e., 22'' in Figure 18, and simultaneously in one of the passes 22 in Figure 19, if the greater-than flag before the currently scanned transformation coefficient is positive, a further greater-than flag for the currently scanned transformation coefficient, i.e., gt2_flag in Figure 18, and gt3_flag in Figure 19, is decoded 24'' using context-adaptive entropy decoding. In Figure 18, for the predetermined transformation coefficient, the absolute value of the quantization index is calculated according to a sum, and its addendum is formed by one addendum which is the significance flag of the predetermined transformation coefficient, one addendum which is the parity flag of the predetermined transformation coefficient, and one addendum which is twice the sum of the remainder of the predetermined transformation coefficient, the first greater-than flag, and the second greater-than flag.However, if a different definition of the greater-than flag is used, for example, as shown in Figure 19, then context-adaptive entropy decoding is used to decode the significance flag 16 for the currently scanned transformation coefficient, and then, when checked in 32, if the significance flag indicates that the quantization index of the currently scanned transformation coefficient is not zero, then context-adaptive entropy decoding is used for the currently scanned transformation coefficient to decode the greater-than flag gt1_flag 24' for the currently scanned transformation coefficient, and then, when checked in 34, if this greater-than flag is positive, then context-adaptive entropy decoding is used for the currently scanned transformation coefficient. Then, the parity flag is decoded 18 and, for the transformation coefficient currently being scanned, the greater than flag gt3_flag for the transformation coefficient currently being scanned is decoded 24'' using context-adaptive entropy decoding, the absolute values of the quantization indices for the predetermined transformation coefficients, such as the current ones, are calculated according to a sum, and the addendum is formed by one addendum which is the significance flag of the predetermined transformation coefficient, one addendum which is the parity flag of the predetermined transformation coefficient, one addendum which is the greater than flag gt1_flag of the predetermined transformation coefficient, and one addendum which is twice the sum of the remainder of the predetermined transformation coefficient and the greater than flag gt3_flag. The decoding of the first and second greater than flags 24' and 24'' may be performed in separate second passes 22' and 22'' as shown in Figure 18, or in one as shown in Figure 19.
[0170] As an alternative to Figure 12, it is possible to decode a significance flag for the currently scanned transformation coefficient using context-adaptive entropy decoding in one of one or more first passes, then, after one first pass, in one or more second passes, to decode a sequence of two or more greater-than flags for the transformation coefficient using context-adaptive entropy decoding 24', 24'', and then, after one or more second passes, in one of one or more first passes, to decode a parity flag for the transformation coefficient whose quantization index is not zero using equal-probability entropy decoding.
[0171] As already mentioned above, coding / decoding may be performed in subblocks such that the conversion coefficients are decoded for each subblock, in which case all passes on the scan position of the subblock are decoded before the first pass of the next subblock is decoded.
[0172] The binarization, that is, the decoding of all significance flags, parity flags, and greater-than flags, as well as the remainder and sign, can be reconstructed for each transformation coefficient by dequantizing the quantization index of each transformation coefficient whose quantization index is not zero, by selecting a set of reconstruction levels from among several sets of reconstruction levels, i.e., in the example above, two “set 0” and “set 1” in Figures 7 and 10. This is done by using the current state state, given by “setId[state]”. The state is then derived by updating the state used for previously dequantized coefficients according to the parity of the quantization index of the transformation coefficient preceding each transformation coefficient, i.e., for example, 40 in Figure 11, by the latter parity, in the order of scanning. After selection, each transformation coefficient is dequantized onto one of the selected sets of reconstruction levels, indexed by setId. This level is indexed by the quantization index of each transformation coefficient. As explained, the selection of the set of reconstruction levels from the set of reconstruction levels for each transformation coefficient is performed using state transitions, based on the state that the state transition assumes for each transformation coefficient, i.e., 42 in Figure 11, by uniquely selecting the correct set of reconstruction levels from multiple sets of reconstruction levels, and updating the state of the state transition for subsequent transformation coefficients in the scan order 40 according to the parity of the quantization index of each transformation coefficient. Thus, the scan order is the same one used here for passes 20, 22, 27, and 30. An example is presented above. One is illustrated by arrow 44 in Figure 4. Again, as with decoding the coefficients per subblock, subblock repartition is optional, i.e., each pass may traverse subblocks consecutively before the next pass begins, instead of performing all passes for one subblock before proceeding. There can be four different states for state transitions.The transitions can be implemented using a table like the one shown in Table 1, where a lookup to it is performed to produce a state for a subsequent coefficient, and using a trellis diagram like the one shown in Figure 12, where, for example, a state appears at 45 or 46.
[0173] As described above, multiple reconstruction level sets can be parameterized by a predetermined quantization step size Δ, as shown in Figures 7 and 10. Information about the predetermined quantization step size can be carried in the data stream. Each reconstruction level set can consist of multiples of this predetermined quantization step size that are constant or equal among multiple reconstruction level sets, as shown in Figures 7 and 10, using a common horizontal axis t. There can be two reconstruction level sets, as shown in Figures 7 and 10, where the first reconstruction level set may consist of zero and even multiples of the predetermined quantization step size, such as set 0 in Figures 7 and 10, and the second reconstruction level set may consist of zero and odd multiples of the predetermined quantization step size, such as set 1 in Figures 7 and 10. As shown in Table 1, the first reconstruction level set can be selected for state values 0 and 1, and the second reconstruction level set can be selected for state values 2 and 3.
[0174] Note that when the above dependent quantization scheme is used, after decoding the parity of a given coefficient, a state variable `state` may be defined or determined that defines the quantization set of the next coefficient, and this state may be used to code the significance and parity flags of the next coefficient.
[0175] Next, we focus on context selection for performing decoding 16, 18, and 24, and discuss favorable context modeling concepts.
[0176] In a preferred embodiment, an adaptive probabilistic model, typically used for coded bins, is selected from a set of multiple adaptive probabilistic models. The probabilistic model is also called a context, and the selection of the probabilistic model is also called contextual modeling. In a preferred embodiment, the selected probabilistic model depends on one or more of the following properties:
[0177] • Color planes. Typically, lumern and chroman transformation coefficients have different statistical properties, and therefore, coding efficiency can typically be increased if different sets of probabilistic models are used for lumern and chroman. It is also possible for separate sets of probabilistic models to be used for each color plane (e.g., Y, Cb, Cr).
[0178] The diagonal position, diag = x + y, is given by the sum of the x and y coordinates inside the transformation block. On average, the absolute value of the transformation coefficient increases as the diagonal position diag decreases. For this reason, compression efficiency can typically be increased if the diagonal position is divided into two or more classes and a separate set of probabilistic models is used for each class.
[0179] • The state variable applied to the current transformation coefficient. As mentioned above, the two quantizers Q0 and Q1 have different sets of acceptable reconstruction levels. As a result, the probability mass functions for the two quantizers are significantly different. This aspect has the greatest impact on the probability for sig_flag (indicating whether the transformation coefficient level is not equal to 0 or not). Therefore, if different sets of probabilistic models are used for the two quantizers, the compression efficiency can be increased. As an extension of this concept, different sets of probabilistic models may be used for different values of the state variable (which can take four possible values, i.e., 0, 1, 2, and 3). Or, different sets of probabilistic models may be used for different values of a defined function of the state variable. Note that using different sets of probabilistic models for two different quantizers represents a special case of the latter technique.
[0180] Dependence on state variables may not be suitable for all bins because it increases the total number of probabilistic models and therefore slows down the rate of probabilistic adaptation. Thus, different sets of probabilistic models for different values of the function of state variables can usually only be used for a subset of the coded bins. For example, only for sig_flag, or only for sig_flag and par_flag (or any other subset).
[0181] • An activity measure of the local neighborhood around the current scan location. Typically, the likelihood that the absolute value of the current transformation coefficient exceeds a certain threshold increases with the activity of the local neighborhood, where activity refers, for example, to the sum of absolute transformation coefficient levels in the neighborhood. This aspect can be leveraged to improve compression efficiency by using different probability measures for different local activity measures. However, it should be noted that since we code absolute values in multiple passes, only the data available in a given pass may be used.
[0182] Below, we describe in more detail an exemplary setup for contextual modeling (selection of a probabilistic model). This example refers to the coding order of the bins specified in Figure 18. However, this concept is not limited to this particular example and can easily be applied to changes in the coding order described above, such as those mentioned in Figure 19.
[0183] To derive the local activity measure, the local template shown in Figure 16 may be used in a preferred embodiment. It is also possible to use different templates, for example, templates that include more or fewer adjacent scan positions. Typically, it is preferred that the template used includes only scan positions that precede the current scan position in coding order 44.
[0184] Let T(k) represent a set of scan positions in local template 52. Then, let sumAbs be the sum of absolute values in the local template, given by:
[0185]
number
[0186] Furthermore, let numSig be an absolute-level number greater than zero in the local template.
[0187]
number
[0188] The values of absLevel[i] and sig_flag[i], which refer to positions outside the current transformation block, are inferred to be equal to 0.
[0189] The measure numSig can already be derived based on the value of sig_flag. However, the absolute-level sum sumAbs is only available in the third (and fourth) passes, 26 and 27. In the first pass 20 and the second pass 22'', only a subset of the information is coded, and therefore only this subset of the information can be used for context modeling.
[0190] According to the preferred embodiment shown in the pseudocode of Figure 18, the bins sig_flag, par_flag, and gt1_flag are sent in the first pass 20 / 22'. Based on this data for a certain conversion coefficient level, we can conclude the following:
[0191] If sig_flag is equal to 0, the conversion coefficient level is equal to 0: level=0. · When sig_flag is equal to 1, par_flag is equal to 0, and gt1_flag is equal to 0, the conversion coefficient level is equal to 1: level = 1, · When sig_flag is equal to 1, par_flag is equal to 1, and gt1_flag is equal to 0, the conversion coefficient level is equal to 2: level = 2, · When sig_flag is equal to 1, par_flag is equal to 0, and gt1_flag is equal to 1, the conversion coefficient level is 3 or more: level >= 3, · When sig_flag is equal to 1, par_flag is equal to 1, and gt1_flag is equal to 1, the conversion coefficient level is 4 or more: level >= 4.
[0192] Therefore, we can at least derive the minimum value for the absolute conversion coefficient level according to the following. minAbs1[k] = sig_flag[k] + par_flag[k] + 2 * gt1_flag[k]
[0193] In the second pass, we further know its value of gt2_flag, and therefore can derive the following minimum value. minAbs2[k] = sig_flag[k] + par_flag[k] + 2 * (gt1_flag[k] + gt2_flag[k])
[0194] The corresponding sum of the minimum absolute values is indicated by sumAbs1 and sumAbs2 and is given by the following.
[0195]
Number
[0196] and
[0197]
Number
[0198] The values of minAbs1[i] and minAbs2[i], which refer to positions outside the current transformation block, are inferred to be equal to 0.
[0199] In this context, it should be noted that the exact formulas for calculating minAbs1[k] and minAbs2[k] (and consequently, the final values for sumAbs1[k] and sumAbs2[k]) depend on which bins are included in the first pass, as well as the semantics (i.e., meaning) of those bins. For example, if gt2_flag[k] is included in the first pass, or if the meaning of gt1_flag[k] is changed (as described above for both alternatives), the formula for calculating minAbs1[k] must be changed accordingly. For example, this minimum value is minAbs1=sig_flag+gt1_flag+par_flag+2*(gt3_flag+remainder) during the first pass 20 / 22 in Figure 19. In either case, minAbs1[k] represents the absolute minimum value that can be derived based on the bins coded in the first pass.
[0200] The values sumAbs, numSig, sumAbs1, and sumAbs2, or functions of these values, can be used as local activity measures for context modeling. A detailed example is provided below.
[0201] In an alternative embodiment, the values sumAbs, minAbs1, and minAbs2 are determined based on the associated multiplication coefficient (absolute value) for the quantization step size, rather than based on the transmitted transformation coefficient level. These data can be derived based on the transformation coefficient level and the associated state variable. Given the absolute level absLevel[k] and the associated state variable state[k], the multiplication coefficient qIdx[k] for the quantization step size can be determined as follows: qIdx[k]=2*absLevel[k]-(state[k]>>1)
[0202] Similar values to replace minAbs1 and minAbs2 can be derived as follows: minQIdx1[k]=2*minAbs1[k]-(state[k]>>1) minQIdx2[k]=2*minAbs2[k]-(state[k]>>1)
[0203] Given these values, alternative values sumQAbs, sumQAbs1, and sumQAbs2 that replace sumAbs, sumAbs1, and sumAbs2 can be derived according to the following:
[0204]
number
[0205] In the following explanation, we will use the values sumAbs, sumAbs1, and sumAbs2. However, please note that these values may be replaced with the values sumQAbs, sumQAbs1, and sumQAbs2. When using the values sumQAbs, sumQAbs1, and sumQAbs2, it may be preferable to use different functions of these values in context derivation.
[0206] Contextual modeling for the significance flag sig_flag An adaptive probabilistic model for coding the current sig_flag is selected from a set of probabilistic models. For simplicity, we assume that the available probabilistic models are organized in a 4-dimensional array. probModelSig[cSig][sSig][dSig][aSig] However, cSig specifies an index that depends on the current color channel, sSig specifies an index that depends on the state variable, dSig specifies an index that depends on the diagonal position (or more generally, the x and y locations) inside the transform block, and aSig specifies an index that depends on the local activity measure. The actual compilation of the probability model is one aspect of the actual implementation form. The probability model can be compiled, for example, as a 1-d array, in which case the combined index can be derived based on the values of cSig, sSig, dSig, and aSig.
[0207] Below, we will describe an exemplary method for deriving the indexes cSig, sSig, dSig, and aSig. However, note that different methods for deriving these indexes (or a subset of the indexes) are possible.
[0208] Color channel index cSig In a preferred embodiment, the color channel index cSig is set equal to 0 if and only if the current color channel represents the luminance channel (or more generally, the first color channel). Also, cSig is set equal to 1 if and only if the current color channel represents the chroma channel (or more generally, not the first color channel). cSig = (is the current channel luminance? 0 : 1)
[0209] Alternatively, cSig can be set equal to 0 for the luminance channel, equal to 1 for the Cb channel, and equal to 2 for the Cr channel.
[0210] State index sSig In a preferred embodiment, the index sSig is set equal to the following.
[0211]
Number
[0212] In other words, one set of probabilistic models is used for state variables equal to 0 and 1, a second set is used for state variables equal to 2, and a third set is used for state variables equal to 3.
[0213] Alternatively, the index sSig may be set equal to the state variable (sSig=state), in which case a separate set of probabilistic models will be used for each possible value of the state variable. Or, as another alternative, the index sSig may be set according to sSig=state>>1, in which case a separate set of context models will be used for each of the two quantizers Q0 and Q1 (note that quantizer Q0 is used when state is equal to 0 or 1, and quantizer Q1 is used when state is equal to 2 or 3).
[0214] Location Index dSig In a preferred embodiment, the index dSig is set as follows:
[0215] • If index cSig is equal to 0 (i.e., the current color channel represents the lumen channel), then dSig is set according to the following:
[0216]
number
[0217] • If index cSig is equal to 1 (i.e., the current color channel represents the chroma channel), then dSig is set according to the following:
[0218]
number
[0219] Here, diag represents the diagonal position given by diag = x + y, where x and y represent the x and y coordinates of the current scan position inside the transformation block.
[0220] Alternatively, any other clustering of diagonal positions is possible. Or, alternatively, the (x,y) locations within the transformation block may be divided into multiple classes, and the index dSig may be set to be equal to the corresponding class index.
[0221] Local Activity Index aSig Finally, in a preferred embodiment of the present invention, the index aSig is set according to the following: aSig = min(5, sumAbs1) However, sumAbs1 refers to the sum of the minimum absolute transformation coefficient levels in the local template, given by the data transmitted in the first pass (see above). Alternatively, a different maximum value or a different function may be used for sumAbs1.
[0222] Contextual modeling for the parity flag (par_flag) An adaptive probabilistic model for coding the current par_flag is selected from a set of probabilistic models. Similarly, assuming that the available probabilistic models are organized in a 4-dimensional array, as in the case of significance flags, probModelPar[cPar][sPar][dPar][aPar] However, cPar specifies an index that depends on the current color channel, sPar specifies an index that depends on the state variable, dPar specifies an index that depends on the diagonal position (or more generally, the x and y locations) inside the transformation block, and aPar specifies an index that depends on the local activity measure.
[0223] Color Channel Index cPar Similarly, as in the case of the significance flag, in a preferred embodiment, the color channel index cSig is set according to the following: cPar=(Is the current channel a luma? 0:1) Alternatively, the alternatives to cSig described above may be used.
[0224] State Index sPar In a preferred embodiment, the index sPar is set to equal to 0. That is, the chosen probabilistic model is independent of the state variable. Alternatively, one of the methods described above for sSig may be used.
[0225] Location Index dPar In a preferred embodiment, the index dPar is set as follows: • If index cPar is equal to 0 (i.e., the current color channel represents the lumen channel), then dPar is set according to the following:
[0226]
number
[0227] If index cPar is equal to 1 (i.e., the current color channel represents the chroma channel), then dPar is set as follows:
[0228]
number
[0229] Here, diag represents the diagonal position given by diag = x + y, where x and y represent the x and y coordinates of the current scan position inside the transformation block. The boolean variable firstNonZero specifies whether the current scan position represents the first non-zero level scan position in the coding order (i.e., the position identified by the x and y coordinates (or similar means) sent after the coding block flag). Thus, a different set of probabilistic models is used for the first non-zero level in the coding order (independent of the diagonal position). Alternatively, any other clustering of diagonal positions is possible. Or, alternatively, the (x,y) locations within the transformation block may be divided into multiple classes, and the index dPar may be set to be equal to the corresponding class index.
[0230] Local Activity Index aPar Finally, in a preferred embodiment of the present invention, the index aPar is set according to the following: aPar = min(4, sumAbs1 - numSig) However, sumAbs1 refers to the sum of the minimum absolute transformation coefficient levels in the local template, given by the data sent in the first pass (see above). Also, numSig refers to the number of non-zero levels in the local template (i.e., the number of sig_flags equal to 1). Alternatively, different maximum values or different functions may be used for sumAbs1 and numSig.
[0231] Context modeling for the flag gt1_flag An adaptive probabilistic model for coding the current gt1_flag is selected from the set of probabilistic models. Similarly, assuming that the available probabilistic models are organized in a 4-dimensional array, as in the case of significance flags, probModelGt1[cGt1][sGt1][dGt1][aGt1] However, cGt1 specifies an index that depends on the current color channel, sGt1 specifies an index that depends on the state variable, dGt1 specifies an index that depends on the diagonal position (or more generally, the x and y locations) inside the transform block, and aGt1 specifies an index that depends on the local activity measure.
[0232] In a preferred embodiment of the present invention, indices cGt1, sGt1, dGt1, and aGt1 are derived in the same manner as the indices cPar, sPar, dPar, and aPar described above. cGt1=cPar sGt1=sPar dGt1=dPar aGt1=aPar
[0233] It should be noted that using the same context index is different from using the same probabilistic model. The derivation of the context model index is the same for gt1_flag and par_flag, but the sets of probabilistic models are disjoint. That is, one set of probabilistic models is used for par_flag, and another set of probabilistic models is used for gt1_flag.
[0234] Note that the context selection for gt1_flag does not directly depend on the value of the preceding par_flag.
[0235] Alternatively, the indices cGt1, sGt1, dGt1, and aGt1 can be derived using any of the methods described above for significance flags.
[0236] Furthermore, the selected probabilistic model can, in addition, depend on the value of the preceding parity flag par_flag, so that different sets of probabilistic models are used for each of the two parity values. However, this introduces a direct dependency between par_flag and gt1_flag.
[0237] Context modeling for the flag gt2_flag An adaptive probabilistic model for coding the current gt2_flag is selected from a set of probabilistic models. Similarly, assuming that the available probabilistic models are organized in a 4-dimensional array, as in the case of significance flags, probModelGt2[cGt2][sGt2][dGt2][aGt2] However, cGt2 specifies an index that depends on the current color channel, sGt2 specifies an index that depends on the state variable, dGt2 specifies an index that depends on the diagonal position (or more generally, the x and y locations) inside the transform block, and aGt2 specifies an index that depends on the local activity measure.
[0238] In a preferred embodiment, indices cGt2, sGt2, dGt2, and aGt2 are derived in the same manner as indices cGt1, sGt1, dGt1, and aGt1 described above. cGt2=cGt1 sGt2=sGt1 dGt2 = dGt1 aGt2=aGt1
[0239] Similarly, it should be noted that, as in the case of gt1_flag, (even though the context index is the same for coding gt1_flag and gt2_flag), different sets of probabilistic models are generally used for gt1_flag and gt2_flag. However, as a special case, it is also possible to use the exact same probabilistic model for these two flags.
[0240] Alternatively, the indices cGt2, sGt2, dGt2, and aGt2 can be derived by any of the methods described above for the flags.
[0241] Furthermore, additional information from the gt2_flag in the local neighborhood may be used to derive the local activity index aGt2 (if gt2_flag is coded in the second pass). For example, the activity index may be set as follows: aGt2 = min(4, sumAbs2 - numSig) However, sumAbs2 refers to the sum of the minimum absolute transformation coefficient levels in the local template, given by the data transmitted in the first and second passes (see above).
[0242] Alternatively, different maximum values or different functions of sumAbs2, sumAbs1, and numSig may be used.
[0243] Next, referring to the descriptions of Figures 18 and 19, this means, in other words, that: As described, decoding 16 of significance flags for predetermined transformation coefficients may involve selecting a context for performing decoding 16, depending on the coefficient position of the predetermined transformation coefficients within the transformation block. This position is indexed by parameter k in Figures 18 and 19. Additional or alternative, as shown above with respect to Figure 16, significance flags for predetermined transformation coefficients 50 are decoded by determining local activity based on a set of flags decoded before significance flags for predetermined transformation coefficients for a set of adjacent transformation coefficients 51 in a local template 52 located around or at the position of the predetermined transformation coefficients 50, and selecting a context depending on the local activity. As demonstrated in Figures 18 and 19, for example, significance flags, parity flags, and one or more greater-than flags, or all greater-than flags, as in Figure 19, may be coded / decoded in a single pass, and the set of flags decoded for coefficients 51 in template 52 shall be such that these flags are decoded for a set of adjacent transformation coefficients 51 in template 52, and the activity may be calculated based on a sum having an addendum for each of the adjacent transformation coefficients 51, where the addendum represents the minimum assumed index, or minimum assumed reconstruction level, for each adjacent transformation coefficient 51, determined based on the flags previously decoded for each adjacent transformation coefficient. The minimum assumed value means the minimum threshold for the quantization index or reconstruction level that each adjacent coefficient assumes minimum based on the analysis of the previous flags derived for each adjacent coefficient 51. The minimum value may be defined in an absolute sense.In the case of Figure 19, for example, this minimum value can be calculated as sig_flag + gt1_flag + par_flag + 2*gt3_flag for each coefficient 51, since only the remainder may be missing for any coefficient. The previously coded / decoded flag set excludes some flags, such as par_flag and gt3_flag, and for coefficient 51, gt1_flag is zero, so then each flag has a default value of zero. Significance flags for the predetermined transformation coefficients can be coded / decoded using context, which are further selected depending on the state 46 that the state transitions assume for these predetermined transformation coefficients, either as an addition or alternative. For example, one set of contexts may be defined and selected for states 0 and 1, another for state 2, and a third set of contexts for state 3. Within the selected set of contexts, the selection of the context to be used last can then be performed using one of the aforementioned dependencies, such as depending on local activity. Instead of states, the currently selected reconfiguration set, e.g., setId, may be used.
[0244] In parity flags, context selectivity can be designed similarly. That is, a parity flag for a predetermined transformation coefficient can be coded / decoded using context, selected according to one or more of the following: 1) the coefficient position of the predetermined transformation coefficient; 2) local activity based on a set of flags coded / decoded before the parity flag of the predetermined transformation coefficient for a set of adjacent transformation coefficients 51 in a local template 52 around the predetermined transformation coefficient 50; 3) the number of transformation coefficients 51 in the local template 52 around the predetermined transformation coefficient whose reconstruction level is not zero; or 4) the difference between the local activity and the number of transformation coefficients.
[0245] For greater-than flags such as gt1_flag, gt2_flag, and gt3_flag, context selectivity can be designed similarly. That is, a greater-than flag can be coded / decoded using a context selected for a predetermined transformation coefficient, depending on one or more of the following: 1) the coefficient position of the predetermined transformation coefficient; 2) local activity, determined based on a set of flags coded / decoded before the first greater-than flag of the predetermined transformation coefficient for a set of adjacent transformation coefficients 51 in the local template 52 that are around or located at the predetermined transformation coefficient; 3) the number of transformation coefficients in the local template 52 whose reconstruction level is not zero; and / or 4) the difference between the local activity and the number of transformation coefficients.
[0246] For the remaining binarization, the following advantageous concepts may be used.
[0247] In a preferred embodiment, the syntax element remainder is coded in bypass mode of the arithmetic coding engine (see above). Compression efficiency depends on the binarization used. In HEVC, similar syntax elements are coded using a class of binarization codes called Golom-Rice codes. This class of codes is parameterized by so-called Rice parameters. In HEVC, Rice parameters are adjusted during coding so that the binarization used depends on the previous syntax element.
[0248] In a preferred embodiment, the same class (or an identical class) of Golomb-Rice code is used to binarize the syntax element `remainder`, as in the case of HEVC. In contrast to HEVC, the level information of `remainder` is divided by 2, so the derivation of the Rice parameters must be modified.
[0249] In a preferred configuration, the Rice parameter is derived using the absolute sum of adjacent levels covered by the local template, sumAbs (see above). In a particularly preferred embodiment, the Rice parameter RP is derived as follows:
[0250]
number
[0251] In other configurations, the threshold for switching the rice parameter may be changed. Alternatively, the rice parameter may be derived based on other activity measures in the local template. Furthermore, it may be specified that the rice parameter cannot be smaller within a subblock.
[0252] Alternatively, the Rice parameters can be modified in the same way as in the case of HEVC. That is, Rice parameter selection can be performed in the decryption 28 of the remainder.
[0253] For example, in the embodiment shown in Figure 18 described above, the parity syntax element is sent immediately after the significance information. In this configuration, the only direct bin-to-bin dependency exists between the significance and parity information. After coding / decoding the parity information, gt1_flag is coded, thereby completing the coding of the level information for the current scan position in the first pass. After completing the first scan pass 20 / 22', gt2_flag is sent in the second scan pass 22''. Finally, reminder is sent in scan pass 26. This design minimizes the direct bin-to-bin dependency to the significance and parity syntax elements. Moreover, more level information is evaluated for context modeling for the significance flag, which may enable higher compression efficiency. Context modeling for the parity flag is exactly the same as for the gt1 and gt2 flags, resulting in less logic and, therefore, less complexity.
[0254] In an alternative embodiment, parity information is transmitted first, before absolute level information, as shown in the pseudocode of Figure 20. Here, the parity flag is transmitted in pass 20'' before the significance flag is transmitted, and then in pass 22' before the first greater-than flag and the subsequent second greater-than flag in pass 22'' are transmitted. The significance flag is only required when the parity information is equal to 0, but when the parity flag is equal to 1, the significance flag is inferred to be equal to 1. The advantage of this configuration is that there is no direct bin-to-bin dependency. After the parity flag is transmitted in the first pass, the values of the state variables and, therefore, the quantizers used for the individual transformation coefficients are known.
[0255] The number of paths between a path with sig_flag and a path with a bypass-coded reminder can be chosen to be equal to zero, or to any value greater than zero, as in the case of Figure 19. Furthermore, multiple flags may be sent within a path.
[0256] Further modifications to the above explanation concern the following: The probabilistic model selected for the parity flag par_flag may depend on one or more of the following parameters:
[0257] • Color channels, • State variables, • Parity flag in the local template around the current scan position, • Scanning position (for example, by clustering diagonal positions).
[0258] Contextual modeling for syntax elements following parity may be conditional on parity information, such that different sets of contextual models are adopted depending on the parity. In addition, syntax elements may depend on any of the parameters previously described for the parity flag.
[0259] In this configuration, the number of bins using the context model increases, for example, to 6 (where the last context-coded syntax element is GT5). Then, since the conditional probabilities are approximately equal, parity information is transmitted in bypass mode. This configuration has the advantage that the compression efficiency of a design where complete information is transmitted for each scan position can be achieved.
[0260] Regarding entropy coding when using independent scalar quantization, the following is said:
[0261] The entropy coding described above is particularly advantageous for transformation coding using dependent quantization, but it can also be favorably applied to transformation coding using conventional independent quantization. The only aspect that needs to be modified is the derivation of the state variable. In practice, in the case of conventional independent quantization, the state variable can always be set to equal to 0. Note that quantizer Q0 represents a conventional uniform reconstruction quantizer.
[0262] A substitute for conventional scalar quantization can also be achieved by modifying the state transition table as follows: state_trans_table[4][2]={{0,0},{0,0},{0,0},{0,0}}
[0263] Since the state transition table can be represented as a single 16-bit integer (see description above), the same implementation can be used for dependent and independent scalar quantization. The quantization method used can consist of 16-bit values representing the state transition table. Therefore, the entropy coding method described is also suitable for codecs that support switching between dependent and independent quantization (e.g., at the sequence, picture, slice, tile, or block level).
[0264] Further embodiments relate to the following:
[0265] 1. An apparatus for decoding a block of transformation coefficients, configured to: a) in one or more first passes scanning the transformation coefficients, decode a significance flag for the transformation coefficient indicating whether the quantization index of the transformation coefficient is zero, a parity flag for the transformation coefficient indicating the parity of the transformation coefficient, and one or more greater-than flags for transformation coefficients whose quantization index is not zero, using context-adaptive binary arithmetic decoding; and b) in one or more second passes, decode the remaining binarization bins of the absolute values of the quantization indices of the transformation coefficients for which one or more greater-than flags are positive, and the signs of the quantization indices of the transformation coefficients whose quantization indices are not zero, using equiprobability binary arithmetic decoding.
[0266] 2. The apparatus of Embodiment 1, configured to, in one first pass, decode a significance flag for the currently scanned transformation coefficient using context-adaptive binary arithmetic decoding, and, if the significance flag indicates that the quantization index of the currently scanned transformation coefficient is not zero, decode a parity flag for the currently scanned transformation coefficient using context-adaptive binary arithmetic decoding.
[0267] 3. An apparatus of Embodiment 1 or 2, configured to decode a first greater-than flag for a currently scanned transformation coefficient using context-adaptive binary arithmetic decoding if, in one or more first passes, the quantization index of the currently scanned transformation coefficient is non-zero.
[0268] 4. The apparatus of Embodiment 3, configured to calculate the absolute value of the quantization index for predetermined transformation coefficients according to a sum, wherein the addendum is formed by twice the sum of the significance flag of the predetermined transformation coefficients, the parity flag of the predetermined transformation coefficients, the remainder of the predetermined transformation coefficients, and the first greater-than flag.
[0269] 5. The apparatus of Embodiment 3, configured to, in one or more second passes, decode a second greater-than flag for the currently scanned transformation coefficient using context-adaptive binary arithmetic decoding if the first greater-than-flag for the currently scanned transformation coefficient is positive.
[0270] 6. The apparatus of Embodiment 5, configured to calculate the absolute value of the quantization index for predetermined transformation coefficients according to a sum, wherein the addendum is formed by twice the sum of the significance flag of the predetermined transformation coefficients, the parity flag of the predetermined transformation coefficients, the first greater-than flag of the predetermined transformation coefficients, the remainder of the predetermined transformation coefficients, and the second greater-than flag.
[0271] 7. Any apparatus of Embodiments 1 to 6, configured to perform one or more second passes after each of one or more first passes.
[0272] 8. An apparatus of any of the preceding embodiments, wherein the conversion coefficients of a conversion block are divided into subblocks, the conversion coefficients are decoded for each subblock, and all paths on the scanning position of a subblock are decoded before the first path of the next subblock is decoded.
[0273] 9. An apparatus according to any of Embodiments 1 to 8, wherein the dequantization of the quantization index of each transformation coefficient whose quantization index is non-zero is configured to perform the dequantization by selecting a set of reconstruction levels from a plurality of reconstruction level sets in accordance with the parity of the quantization index of the transformation coefficient preceding each transformation coefficient in the scan order, and dequantizing each transformation coefficient to one of the levels in the set of reconstruction levels indexed by the quantization index of each transformation coefficient.
[0274] 10. The apparatus of Embodiment 9, which performs, using state transitions, the selection of a set of reconstruction levels from a plurality of reconstruction level sets for each transformation coefficient, wherein the performance is configured to uniquely select a set of reconstruction levels from a plurality of reconstruction level sets based on the state assumed by the state transition for each transformation coefficient, and to update the state of the state transition for subsequent transformation coefficients in the scan order according to the parity of the quantization index of each transformation coefficient.
[0275] 11. The apparatus of Embodiment 10, configured to perform one or more first passes and / or one or more second passes in accordance with the scanning order.
[0276] 12. An apparatus of embodiment 10 or 11, configured to perform state transitions between four different states.
[0277] 13. Any apparatus of Embodiments 9 to 12, configured to parameterize multiple reconstruction level sets by predetermined quantization step sizes, and to derive information about predetermined quantization step sizes from a data stream.
[0278] 14. An apparatus according to any of embodiments 9 to 13, wherein each of the multiple reconstruction level sets consists of a predetermined integer multiple of the quantization step size, which is constant for the multiple reconstruction level sets.
[0279] 15. Any apparatus of Embodiments 9 to 14, wherein the number of reconstruction level sets among a plurality of reconstruction level sets is two, and the plurality of reconstruction level sets comprises a first reconstruction level set having zero and an even multiple of a predetermined quantization step size, and a second reconstruction level set having zero and an odd multiple of a predetermined quantization step size.
[0280] 16. The apparatus of Embodiment 15, configured to select a first reconfiguration level set for state values 0 and 1, and a second reconfiguration level set for state values 2 and 3.
[0281] 17. An apparatus of any one of embodiments 1 to 16, which decodes significance flags for predetermined transformation coefficients using context-adaptive binary arithmetic decoding, wherein the decoding is configured to do so by selecting a context according to the coefficient positions of the predetermined transformation coefficients within a transformation block.
[0282] 18. An apparatus of any one of embodiments 1 to 17, which decodes significance flags for a predetermined transformation coefficient using context-adaptive binary arithmetic decoding, wherein the decoding is configured to determine local activity for a set of adjacent transformation coefficients in a local template around the predetermined transformation coefficient, based on a set of flags decoded before the significance flag of the predetermined transformation coefficient, and, depending on the local activity, select a context.
[0283] 19. Apparatus of Embodiment 18, configured to decode significance flags, parity flags, and one or more greater flags in one first pass such that the set of flags comprises significance flags, parity flags, and one or more greater flags decoded for a set of adjacent transformation coefficients, and to calculate local activity based on a sum over an addendum for each of the adjacent transformation coefficients such that the addendum indicates the minimum assumed index or minimum assumed reconstruction level for the adjacent transformation coefficients, determined based on significance flags, parity flags, and one or more greater flags decoded for the adjacent transformation coefficients.
[0284] 20. Any apparatus of Embodiments 1 to 19, configured to: a) perform a selection of a set of reconstruction levels from a plurality of reconstruction level sets for each transformation coefficient using state transitions, wherein the execution is by uniquely selecting a set of reconstruction levels from a plurality of reconstruction level sets based on the state assumed by the state transitions for each transformation coefficient, and updating the state of the state transitions for subsequent transformation coefficients in the scan order according to the parity of the quantization index of each transformation coefficient; b) perform one or more first passes along the scan order; and c) decode significance flags for predetermined transformation coefficients using context-adaptive binary arithmetic decoding, wherein the decoding is by selecting a context according to the state assumed by the state transitions for the predetermined transformation coefficients (50).
[0285] 21. The apparatus of Embodiment 20, configured to decode significance flags for predetermined transformation coefficients using context-adaptive entropy decoding by selecting a context set containing a context depending on the state, and selecting a context from the context set depending on local activity around a predetermined transformation coefficient or the coefficient position of a predetermined transformation coefficient.
[0286] 22. The apparatus of Embodiment 21, configured to select a first context set for states 0 and 1, a second context set for state 2, and a third context set for state 3.
[0287] 23. Any apparatus of Embodiments 1 to 22, configured to: a) dequantize the quantization index of each transformation coefficient whose quantization index is non-zero, wherein the dequantization is performed by selecting a set of reconstruction levels from a plurality of reconstruction level sets in accordance with the parity of the quantization index of the transformation coefficient preceding the respective transformation coefficient, in accordance with the scan order, and dequantizing each transformation coefficient onto one of the levels of the set of reconstruction levels indexed by the quantization index of the respective transformation coefficient; b) perform one or more first passes in accordance with the scan order; and c) decode significance flags for predetermined transformation coefficients using context-adaptive binary arithmetic decoding, wherein the decoding is performed by selecting a context in accordance with the set of reconstruction levels selected for the predetermined transformation coefficients.
[0288] 24. An apparatus of any of Embodiments 1 to 23, which decodes a parity flag for a predetermined transformation coefficient using context-adaptive binary arithmetic decoding, wherein the decoding is configured to do so by selecting a context depending on the coefficient position of the predetermined transformation coefficient within the transformation block.
[0289] 25. An apparatus of any one of Embodiments 1 to 24, which uses context-adaptive binary arithmetic decoding to decode a parity flag for a predetermined transformation coefficient, wherein the decoding is configured to do the following: determine local activity for a set of adjacent transformation coefficients in a local template around the predetermined transformation coefficient, based on a set of flags decoded before the parity flag of the predetermined transformation coefficient, and / or determine the number of transformation coefficients in the local template around the predetermined transformation coefficient whose reconstruction level is not zero, and select a context depending on the number of local activity and / or transformation coefficients.
[0290] 26. The apparatus of Embodiment 25, configured to select a context based on the difference between local activity and the number of transformation coefficients.
[0291] 27. An apparatus of Embodiment 25 or 26, configured to decode significance flags, parity flags, and one or more greater flags in one first pass such that the set of flags comprises significance flags, parity flags, and one or more greater flags decoded for a set of adjacent transformation coefficients, and to calculate activity based on a sum over an addendum for each of the adjacent transformation coefficients such that the addendum indicates the minimum assumed index or minimum assumed reconstruction level for the adjacent transformation coefficients, determined based on significance flags, parity flags, and one or more greater flags decoded for the adjacent transformation coefficients.
[0292] 28. An apparatus of any of Embodiments 1 to 27, which uses context-adaptive binary arithmetic decoding to decode a first of one or more greater-than flags for a predetermined transformation coefficient, wherein the decoding is configured to do so by selecting a context depending on the coefficient position of the predetermined transformation coefficient within the transformation block.
[0293] 29. An apparatus of any one of Embodiments 1 to 28, which uses context-adaptive binary arithmetic decoding to decode a first greater-than flag for a predetermined transformation coefficient, wherein the decoding is configured to do the following: determine local activity for a set of adjacent transformation coefficients in a local template around the predetermined transformation coefficient, based on a set of flags decoded before the first greater-than-flag of the predetermined transformation coefficient, and / or determine the number of transformation coefficients in the local template around the predetermined transformation coefficient whose reconstruction level is not zero; and select a context depending on the number of local activity and / or transformation coefficients.
[0294] 30. The apparatus of Embodiment 29, configured to select a context based on the difference between local activity and the number of transformation coefficients inside a transformation block.
[0295] 31. An apparatus of Embodiment 29 or 30, configured to decode significance flags, parity flags, and one or more greater flags in one first pass, such that the set of flags comprises significance flags, parity flags, and one or more greater flags decoded for a set of adjacent transformation coefficients, and to calculate activity based on a sum over an addendum for each of the adjacent transformation coefficients, such that the addendum indicates the minimum assumed index or minimum assumed reconstruction level for the adjacent transformation coefficients, determined based on significance flags, parity flags, and one or more greater flags decoded for the adjacent transformation coefficients.
[0296] 32. An apparatus of any of Embodiments 1 to 31, configured to decode the remainder for a predetermined transformation coefficient using a Golomb-Rice code and a Rice parameter that depends on the sum over an addendum for each of the set of adjacent transformation coefficients in a local template around the predetermined transformation coefficient, wherein the addendum depends on the quantization index or reconstruction level for each adjacent transformation coefficient.
[0297] 33. An apparatus for encoding a block of transformation coefficients, configured to: a) in one or more first passes scanning the transformation coefficients, encode a significance flag (e.g., sig_flag[k]) for the current transformation coefficient indicating whether the quantization index (e.g., level[k]) of the current transformation coefficient is zero, a parity flag (e.g., par_flag[k]) for the transformation coefficient indicating the parity of the transformation coefficient, and one or more greater-than flags (e.g., gt#_flag[k]) for transformation coefficients whose quantization index is not zero, using context-adaptive binary arithmetic encoding; and b) in one or more third passes, encode the remainder of the quantization indexes (e.g., remainder[k]) of the transformation coefficients whose one or more greater-than flags are positive, and the sign (e.g., sign[k]) of the quantization indexes of the transformation coefficients whose quantization index is not zero, using equiprobability binary arithmetic encoding.
[0298] 34. An apparatus of Embodiment 33, configured to, in one first pass, a) encode a significance flag for the currently scanned transformation coefficient using context-adaptive binary arithmetic coding, and b) encode a parity flag for the currently scanned transformation coefficient using context-adaptive binary arithmetic coding if the significance flag indicates that the quantization index of the currently scanned transformation coefficient is not zero.
[0299] 35. An apparatus of Embodiment 33 or 34, configured to encode a first greater-than flag for the currently scanned transformation coefficient using context-adaptive binary arithmetic coding if, in one or more second passes, the quantization index of the currently scanned transformation coefficient is non-zero.
[0300] 36. The apparatus of Embodiment 35, wherein, for predetermined transformation coefficients, a quantization index is obtainable according to a sum, and the addendum is formed by twice the sum of the significance flag of the predetermined transformation coefficients, the parity flag of the predetermined transformation coefficients, the remainder of the predetermined transformation coefficients, and a first greater-than flag.
[0301] 37. An apparatus of Embodiment 36, configured to encode a second greater-than flag for a currently scanned transformation coefficient using context-adaptive binary arithmetic coding if, in one or more second passes, the first greater-than-flag for the currently scanned transformation coefficient is positive.
[0302] 38. The apparatus of Embodiment 37, wherein, for predetermined transformation coefficients, a quantization index is obtainable according to a sum, and its addendum is formed by twice the sum of the significance flag of the predetermined transformation coefficient, the parity flag of the predetermined transformation coefficient, the first greater-than flag of the predetermined transformation coefficient, the remainder of the predetermined transformation coefficient, and the second greater-than flag.
[0303] 39. Any apparatus of embodiments 33 to 38, configured to perform one or more second passes after each of one or more first passes.
[0304] 40. An apparatus of any of the preceding embodiments, wherein the conversion coefficients of a conversion block are divided into subblocks, the conversion coefficients are encoded for each subblock, and all paths on the scanning position of a subblock are encoded before the first path of the next subblock is encoded.
[0305] 41. An apparatus of any of embodiments 33 to 40, wherein the quantization is performed by quantizing the quantization index of each transformation coefficient whose quantization index is non-zero, wherein the quantization is performed by selecting a set of reconstruction levels from a plurality of reconstruction level sets in accordance with the parity of the quantization index of the transformation coefficient preceding the respective transformation coefficient, in accordance with the scanning order, and by quantizing each transformation coefficient onto one of the levels in the set of reconstruction levels indexed by the quantization index of the respective transformation coefficient.
[0306] 42. The apparatus of Embodiment 41, which performs, using state transitions, the selection of a set of reconstruction levels from a plurality of reconstruction level sets for each transformation coefficient, wherein the performance is configured to uniquely select a set of reconstruction levels from a plurality of reconstruction level sets based on the state assumed by the state transition for each transformation coefficient, and to update the state of the state transition for subsequent transformation coefficients in the scan order according to the parity of the quantization index of each transformation coefficient.
[0307] 43. The apparatus of Embodiment 42, configured to perform one or more first passes and one or more second passes in accordance with a scanning sequence.
[0308] 44. The apparatus of embodiment 42 or 43, configured to perform state transitions between four different states.
[0309] 45. Any apparatus of Embodiments 40 to 43, configured to parameterize multiple reconstruction level sets by predetermined quantization step sizes, and to derive information about predetermined quantization step sizes from a data stream.
[0310] 46. An apparatus according to any of embodiments 40 to 45, wherein each of the multiple reconstruction level sets consists of a predetermined multiple of the quantization step size that is constant for the multiple reconstruction level sets.
[0311] 47. Any apparatus of Embodiments 40 to 46, wherein the number of reconstruction level sets among a plurality of reconstruction level sets is two, and the plurality of reconstruction level sets comprises a first reconstruction level set having zero and an even multiple of a predetermined quantization step size, and a second reconstruction level set having zero and an odd multiple of a predetermined quantization step size.
[0312] 48. The apparatus of Embodiment 47, configured to select a first reconfiguration level set for state values 0 and 1, and a second reconfiguration level set for state values 2 and 3.
[0313] 49. An apparatus of any of embodiments 33 to 48, which encodes significance flags for predetermined transformation coefficients using context-adaptive binary arithmetic coding, wherein the coding is configured to do so by selecting a context depending on the coefficient position of the predetermined transformation coefficients within a transformation block.
[0314] 50. An apparatus of any of embodiments 33 to 49, which uses context-adaptive binary arithmetic coding to code significance flags for a predetermined transformation coefficient, wherein the coding is configured to determine local activity based on a set of flags coded before the significance flag of the predetermined transformation coefficient for a set of adjacent transformation coefficients in a local template around the predetermined transformation coefficient, and to select a context in accordance with the local activity.
[0315] 51. An apparatus of Embodiment 50 configured to encode significance flags, parity flags, and one or more greater flags in one first pass, such that the set of flags comprises significance flags, parity flags, and one or more greater flags encoded for a set of adjacent transformation coefficients, and to calculate local activity based on a sum over an addendum for each of the adjacent transformation coefficients, such that the addendum indicates the minimum assumed index or minimum assumed reconstruction level for the adjacent transformation coefficients, determined based on significance flags, parity flags, and one or more greater flags encoded for the adjacent transformation coefficients.
[0316] 52. Any apparatus of Embodiments 33 to 51, configured to: a) perform a selection of a set of reconstruction levels from a plurality of reconstruction level sets for each transformation coefficient using state transitions, wherein the execution is performed by uniquely selecting a set of reconstruction levels from a plurality of reconstruction level sets based on the state assumed by the state transitions for each transformation coefficient, by updating the state of the state transitions for subsequent transformation coefficients in the scan order according to the parity of the quantization index of each transformation coefficient; b) perform one or more first passes along the scan order; and c) encode significance flags for predetermined transformation coefficients using context-adaptive binary arithmetic coding, wherein the coding is performed by selecting a context according to the state assumed by the state transitions for the predetermined transformation coefficients (50).
[0317] 53. The apparatus of Embodiment 52, configured to encode significance flags for predetermined transformation coefficients using context-adaptive entropy coding by selecting a context set containing a context depending on the state, and selecting a context from the context set depending on local activity around a predetermined transformation coefficient or the coefficient position of a predetermined transformation coefficient.
[0318] 54. Apparatus of Embodiment 53, configured to select a first context set for states 0 and 1, a second context set for state 2, and a third context set for state 3.
[0319] 55. Any apparatus of Embodiments 33 to 54, configured to: a) quantize the quantization index of each transformation coefficient whose quantization index is non-zero, wherein the quantization is performed by selecting a set of reconstruction levels from a plurality of reconstruction level sets in accordance with the parity of the quantization index of the transformation coefficients preceding each transformation coefficient, in accordance with the scan order, and quantizing each transformation coefficient onto one of the levels of the set of reconstruction levels indexed by the quantization index of each transformation coefficient; b) perform one or more first passes in accordance with the scan order; and c) encode significance flags for predetermined transformation coefficients using context-adaptive binary arithmetic coding, wherein the coding is performed by selecting a context in accordance with the set of reconstruction levels selected for the predetermined transformation coefficients (50).
[0320] 56. An apparatus of any of embodiments 33 to 55, which encodes a parity flag for a predetermined transformation coefficient using context-adaptive binary arithmetic coding, wherein the coding is configured to do so by selecting a context depending on the coefficient position of the predetermined transformation coefficient within the transformation block.
[0321] 57. An apparatus of any of embodiments 33 to 56, which uses context-adaptive binary arithmetic coding to code a parity flag for a predetermined transformation coefficient, wherein the coding is configured to do the following: determine local activity for a set of adjacent transformation coefficients in a local template around the predetermined transformation coefficient, based on a set of flags coded before the parity flag of the predetermined transformation coefficient, and / or the number of transformation coefficients in the local template around the predetermined transformation coefficient whose reconstruction level is not zero; and select a context depending on the number of local activity and / or transformation coefficients.
[0322] 58. The apparatus of Embodiment 57, configured to select a context based on the difference between local activity and the number of transformation coefficients.
[0323] 59. An apparatus of Embodiment 57 or 58, configured to encode significance flags, parity flags, and one or more greater flags in one first pass, such that the set of flags comprises significance flags, parity flags, and one or more greater flags encoded for a set of adjacent transformation coefficients, and to calculate activity based on a sum over an addendum for each of the adjacent transformation coefficients, such that the addendum indicates the minimum assumed index or minimum assumed reconstruction level for the adjacent transformation coefficients, determined based on significance flags, parity flags, and one or more greater flags encoded for the adjacent transformation coefficients.
[0324] 60. An apparatus of any of embodiments 33 to 59, which uses context-adaptive binary arithmetic coding to encode a first of one or more greater-than flags for a predetermined transformation coefficient, wherein the coding is configured to do so by selecting a context depending on the coefficient position of the predetermined transformation coefficient within the transformation block.
[0325] 61. An apparatus of any of embodiments 33 to 60, which uses context-adaptive binary arithmetic coding to code a first greater-than flag for a predetermined transformation coefficient, wherein the coding is configured to do the following: determine local activity for a set of adjacent transformation coefficients in a local template around the predetermined transformation coefficient, based on a set of flags coded before the first greater-than flag for the predetermined transformation coefficient, and / or determine the number of transformation coefficients in the local template around the predetermined transformation coefficient whose reconstruction level is not zero, and select a context depending on the number of local activity and / or transformation coefficients.
[0326] 62. The apparatus of embodiment 61, configured to select a context based on the difference between local activity and the number of transformation coefficients.
[0327] 63. An apparatus of Embodiment 61 or 62, configured to sequentially encode significance flags, parity flags, and one or more greater flags in one first pass, such that the set of flags comprises significance flags, parity flags, and one or more greater flags encoded for a set of adjacent transformation coefficients, and to calculate activity based on a sum over an addendum for each of the adjacent transformation coefficients, such that the addendum indicates the minimum assumed index or minimum assumed reconstruction level for the adjacent transformation coefficient, determined based on significance flags, parity flags, and one or more greater flags encoded for the adjacent transformation coefficients.
[0328] 64. An apparatus of any of embodiments 33 to 63, configured to encode the remainder for a predetermined transformation coefficient using a Golomb-Rice code and a Rice parameter that depends on the sum over an addendum for each of the set of adjacent transformation coefficients in a local template around the predetermined transformation coefficient, wherein the addendum depends on the quantization index or reconstruction level for each adjacent transformation coefficient.
[0329] 65. A method performed by an apparatus according to any of the above embodiments.
[0330] 66. A computer program for instructing a computer that executes a computer program to perform the method according to Embodiment 65.
[0331] 67. A data stream generated by an apparatus according to any one of embodiments 33 to 64.
[0332] While some embodiments have been described in the context of the apparatus, it is clear that these embodiments also represent descriptions of corresponding methods, in which case blocks or devices correspond to method steps or features of method steps. Similarly, embodiments described in the context of method steps also represent descriptions of corresponding blocks, items, or features of the corresponding apparatus. Some or all of the method steps may be performed by (or using) hardware devices, such as a microprocessor, a programmable computer, or an electronic circuit. In some embodiments, one or more of the most important method steps may be performed by such devices.
[0333] The encoded data stream of the present invention can be stored on a digital storage medium or transmitted over a transmission medium such as the Internet, a wireless transmission medium, or a wired transmission medium.
[0334] Depending on certain implementation requirements, embodiments of the present invention may be implemented in hardware or in software. The implementation may be carried out using a digital storage medium, such as a floppy disk, DVD, Blu-ray, CD, ROM, PROM, EPROM, EEPROM, or flash memory, on which electronically readable control signals are stored and which cooperate (or can cooperate) with a programmable computer system so that each method is performed. Thus, the digital storage medium may be computer-readable.
[0335] Some embodiments of the present invention include a data carrier having an electronically readable control signal, which can cooperate with a programmable computer system so that one of the methods described herein is performed.
[0336] Generally, embodiments of the present invention may be implemented as a computer program product having program code, the program code being operable to perform one of the methods when the computer program product is running on a computer. The program code may be stored, for example, on a machine-readable carrier.
[0337] Other embodiments include a computer program stored on a machine-readable carrier for performing one of the methods described herein.
[0338] In other words, one embodiment of the method of the present invention is a computer program having program code for performing one of the methods described herein when the computer program is running on a computer.
[0339] Accordingly, a further embodiment of the method of the present invention is a data carrier (or digital storage medium, or computer-readable medium) comprising a computer program recorded thereon for performing one of the methods described herein. The data carrier, digital storage medium, or recorded medium is typically tangible and / or non-transitional.
[0340] Accordingly, a further embodiment of the method of the present invention is a data stream or sequence of signals representing a computer program for performing one of the methods described herein. The data stream or sequence of signals may be configured to be transmitted, for example, over a data communication connection, for example, over the Internet.
[0341] Further embodiments include processing means, such as a computer or a programmable logic device, configured or adapted to perform one of the methods described herein.
[0342] Further embodiments include a computer on which a computer program for performing one of the methods described herein is installed.
[0343] Further embodiments of the present invention include an apparatus or system configured to transfer (e.g., electronically or optically) a computer program for performing one of the methods described herein to a receiver. The receiver may be, for example, a computer, a mobile device, a memory device, etc. The apparatus or system may include, for example, a file server for transferring the computer program to the receiver.
[0344] In some embodiments, a programmable logic device (e.g., a field-programmable gate array) may be used to perform some or all of the functions of the methods described herein. In some embodiments, a field-programmable gate array may cooperate with a microprocessor to perform one of the methods described herein. Generally, the methods are preferably performed by any hardware device.
[0345] The apparatus described herein may be implemented using hardware devices, a computer, or a combination of hardware devices and a computer.
[0346] The apparatus described herein, or any component of the apparatus described herein, may be implemented at least partially in hardware and / or software.
[0347] The methods described herein may be performed using hardware devices, or using a computer, or using a combination of hardware devices and a computer.
[0348] Any method or apparatus described herein may be implemented, at least partially, by hardware and / or software.
[0349] The embodiments described above are merely illustrative of the principles of the present invention. It will be understood that variations and modifications of the arrangements and details described herein will be obvious to those skilled in the art. Therefore, it is intended that the invention is limited only by the claims that follow, and not by the specific details presented in the description and explanation of the embodiments herein.
[0350] References [1] ITU-T and ISO|IEC, "Advanced video coding for audiovisual services", ITU-T Rec. H.264 and ISO|IEC 14406-10(AVC), 2003. [2] ITU-T and ISO|IEC, "High efficiency video coding", ITU-T Rec. H.265 and ISO|IEC 23008-10(HEVC), 2013. [3] Abrecht et al., “Description of SDR, HDR, and 360°video coding technology proposal by Fraunhofer HHI,” Joint Video Experts Team (JVET), doc. JVET-J0014, April 2018. [Explanation of symbols]
[0351] 10 conversion blocks, blocks 12 Conversion coefficients 14 subblocks Tasks 16 and 18, decryption. 20 First Path, Significance / Parity Path, Path, First Scan Path 20', 20'' pass 22 Second pass, greater than flag pass, pass, first pass 22' Pass, First Pass, First Scan Pass 22'' pass, second pass, second scan pass 24, 28 Decryption, Task 24' gt1_flagdecode, decode 24'' gt2_flagdecode, decode 26. Third pass, scanning pass 27 Third pass, pass 30 Decryption, Task, Path 40, 45 updated 42 Selections 44. Arrows, coding order, traversal order 46 Status 50 Pre-determined conversion coefficients 51 Adjacent conversion coefficients, coefficients, adjacent coefficients, conversion coefficients 52 Local templates, templates
Claims
1. A video decoder for decoding a picture from a data stream, Based on a first parity flag decoded from the data stream using context-adaptive entropy decoding, a first transformation coefficient level of a first transformation coefficient is determined, and the first parity flag indicates the parity of the first transformation coefficient level. Based on the parity of the first conversion coefficient level, the state variable is updated to obtain the updated state variable. The second transformation coefficient level is determined based on a second parity flag indicating the parity of the second transformation coefficient level of the second transformation coefficient. Based on the updated state variables, determine the set of reconstruction levels for the second transformation coefficient level from among a plurality of reconstruction level sets. A video decoder configured to assign the reconstruction levels of the reconstruction level set to the second conversion coefficient based on the second conversion coefficient level.
2. The video decoder according to claim 1, wherein the context for context-adaptive entropy decoding of the first parity flag is selected based on the position (x, y) of the first transformation coefficient in the transformation block.
3. The video decoder according to claim 2, wherein the context is selected based on sumAbs1 of the minimum absolute values of the transformation coefficient levels at one or more locations among (x+1, y), (x+2, y), (x+1, y+1), (x, y+1), and (x, y+2), the minimum absolute value is based on a context-adaptive entropy-decoded flag decoded at one or more locations.
4. The video decoder according to claim 3, wherein the context-adaptive entropy-decoded flags decoded at one or more of the aforementioned locations are decoded in a first pass that decodes the conversion coefficient levels within the subblocks of the conversion block.
5. The video decoder according to claim 3, wherein the context is based on the number of non-zero conversion coefficients numSig at one or more locations.
6. The video decoder according to claim 4, wherein the context is based on min(4, sumAbs1-numSig), where min(4, sumAbs1-numSig) is the minimum value between 4 and sumAbs1-numSig.
7. The video decoder according to claim 1, wherein the state variable is any one of 0, 1, 2, or 3.
8. The state variable is configured to be updated according to the parity of the first transformation coefficient level as follows: If the aforementioned state variable is 0: If the parity is 0, update the state variable to 0; if the parity is 1, update it to 2. When the aforementioned state variable is 1: If the parity is 0, update the state variable to 2; if the parity is 1, update it to 0. When the state variable is 2: If the parity is 0, update the state variable to 1; if the parity is 1, update it to 3. When the state variable is 3: If the parity is 0, update the state variable to 3; if the parity is 1, update it to 1. The video decoder according to claim 7.
9. The video decoder according to claim 7, wherein the plurality of reconstruction level sets include two reconstruction level sets, and the video decoder is configured to select a first reconstruction level set when the state variable is 0 or 1, and to select a second reconstruction level set when the state variable is 3 or 4.
10. The video decoder according to claim 9, wherein when the second conversion coefficient level is not zero, it is configured to decode a sign coefficient of 1 or -1 with respect to the second conversion coefficient, and the reconstruction level is assigned based on the sign coefficient.
11. A video decoding method for decoding a picture from a data stream, Determining a first transformation coefficient level of a first transformation coefficient based on a first parity flag decoded from the data stream using context-adaptive entropy decoding, wherein the first parity flag indicates the parity of the first transformation coefficient level. Based on the parity of the first conversion coefficient level, the state variable is updated to obtain the updated state variable, The second transformation coefficient level is determined based on a second parity flag indicating the parity of the second transformation coefficient level of the second transformation coefficient, Based on the updated state variables, determine the set of reconstruction levels for the second transformation coefficient level from among a plurality of reconstruction level sets, A video decoding method comprising assigning the reconstruction levels of the reconstruction level set to the second conversion coefficients based on the second conversion coefficient levels.
12. The video decoding method according to claim 11, wherein the context for context-adaptive entropy decoding of the first parity flag is selected based on the position (x, y) of the first transformation coefficient in the transformation block.
13. The video decoding method according to claim 12, wherein the context is selected based on sumAbs1 of the minimum absolute values of the transformation coefficient levels at one or more locations among (x+1, y), (x+2, y), (x+1, y+1), (x, y+1), and (x, y+2), the minimum absolute value is based on a context-adaptive entropy-decoded flag decoded at one or more locations.
14. The video decoding method according to claim 13, wherein the context-adaptive entropy-decoded flags decoded at one or more of the aforementioned locations are decoded in a first pass that decodes the conversion coefficient levels within the subblocks of the conversion block.
15. The video decoding method according to claim 13, wherein the context is based on the number of non-zero conversion coefficients numSig at one or more locations.
16. The video decoding method according to claim 15, wherein the context is based on min(4, sumAbs1-numSig), where min(4, sumAbs1-numSig) is the minimum value between 4 and sumAbs1-numSig.
17. The video decoding method according to claim 11, wherein the state variable is any one of 0, 1, 2, or 3.
18. The state variable is configured to be updated according to the parity of the first transformation coefficient level as follows: If the aforementioned state variable is 0: If the parity is 0, update the state variable to 0; if the parity is 1, update it to 2. When the aforementioned state variable is 1: If the parity is 0, update the state variable to 2; if the parity is 1, update it to 0. When the state variable is 2: If the parity is 0, update the state variable to 1; if the parity is 1, update it to 3. When the state variable is 3: If the parity is 0, update the state variable to 3; if the parity is 1, update it to 1. The video decoding method according to claim 17.
19. The video decoding method according to claim 17, wherein the plurality of reconstruction level sets include two reconstruction level sets, and the video decoding method includes selecting a first reconstruction level set when the state variable is 0 or 1, and selecting a second reconstruction level set when the state variable is 3 or 4.
20. The video decoding method according to claim 19, wherein when the second conversion coefficient level is not zero, a sign coefficient of 1 or -1 is decoded with respect to the second conversion coefficient, and the reconstruction level is assigned based on the sign coefficient.