Entropy coding of transform coefficients suitable for dependent scalar quantization.
Dependent scalar quantization and context-adaptive entropy coding address the trade-off between bitrate and distortion in video coding standards, enhancing coding efficiency by adapting reconstruction levels based on previous quantization and improving hardware implementation.
Patent Information
- Application Number
- JP2022130075
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Priority Date
- 2018-07-02
- Filing Date
- 2022-08-17
- Publication Date
- 2025-01-23
- Estimated Expiration
- 2039-07-01
AI Technical Summary
Existing video coding standards face challenges in achieving optimal coding efficiency due to the trade-off between bitrate and quantization distortion, particularly in the quantization of transform coefficients, where coarser quantization reduces bitrate but increases distortion, and finer quantization increases bitrate.
The implementation of dependent scalar quantization, where the set of allowable reconstruction levels for a transform coefficient depends on the previously quantized and coded data, combined with context-adaptive entropy coding, to enhance coding efficiency.
This approach improves coding efficiency by tightly packing reconstruction vectors in the signal space, reducing average distortion for a given number of bits, and allows for efficient hardware implementation with reduced computational complexity.
Smart Images

Figure 0007620597000023 
Figure 0007620597000024 
Figure 0007620597000025
Abstract
Description
[Technical field]
[0001] This application relates to entropy coding at the transform coefficient level, such as for coding pictures or video. [Background technology]
[0002] In setting the quantization parameters, the encoder has to make compromises: by rendering the quantization coarser, the bit rate is reduced but the quantization distortion increases, by rendering the quantization finer, the distortion is reduced but the bit rate is increased. It would be advantageous to have at hand a concept that increases the coding efficiency for a given range of available quantization levels. One such possibility is the use of dependent quantization, where the quantization is steadily adapted depending on the previously quantized and coded data, but the dependency in the quantization also affects the interrelationship between the data items to be quantized and coded, and thus the availability of information for context-adaptive entropy coding. It would be advantageous to have a concept that is suitable for dependent quantization and allows for the coding of coefficients of a transform block in a way that can be effectively implemented by entropy coding, in terms of coding efficiency. Summary of the Invention [Problem to be solved by the invention]
[0003] The object of the present invention is to provide such a concept for coding blocks of transform coefficients. [Means for solving the problem]
[0004] This object is achieved by the subject matter of the independent claims of the present application.
[0005] Advantageous aspects are the subject matter of the dependent claims. Preferred embodiments of the present application are described below with reference to the figures. [Brief description of the drawings]
[0006] [Figure 1] FIG. 2 is a block diagram of an exemplary video encoder, as an example for a picture encoder that may be implemented to operate according to any of the embodiments described below. [Figure 2a] 1 is a block diagram of a transform encoder for illustrating the basic techniques of block-based transform coding; [Figure 2b] FIG. 1 is a block diagram of a transform decoder to illustrate the basic techniques of block-based transform coding. [Diagram 3] 1 is a histogram of the distribution showing a uniform reconstruction quantizer. [Figure 4a] FIG. 1 is a schematic diagram of a transform block subdivided into sub-blocks to illustrate an example for scanning transform coefficient levels, exemplarily as used in H.265|MPEG-H HEVC, specifically showing the partitioning of a 16×16 transform block into 4×4 sub-blocks and the coding order of the sub-blocks. The subdivision may be exemplarily used in embodiments of the present application for passing coefficients in their flag and residual decoding, as well as for state transitions in the inverse quantization of the same. [Figure 4b] FIG. 1 is a schematic diagram of a sub-block to illustrate an example for scanning of transform coefficient levels, exemplarily as used in H.265|MPEG-H HEVC, specifically showing the coding order of transform coefficient levels inside a 4×4 sub-block. Subdivision may be exemplarily used in embodiments of the present application for passing coefficients in their flag and residual decoding, as well as for state transitions in inverse quantization of the same. [Figure 5a]FIG. 1 is a schematic diagram of a multidimensional output space spanned by one axis per transform coefficient, and the locations of allowable reconstruction vectors, for the simple case of two transform coefficients with independent scalar quantization. [Figure 5b] FIG. 1 is a schematic diagram of a multidimensional output space spanned by one axis per transform coefficient, and the locations of allowable reconstruction vectors, for the simple case of two transform coefficients, which is an example for dependent scalar quantization. [Figure 6] Figure 2 is a block diagram of a transform decoder using dependent scalar quantization, thereby forming an embodiment of a media decoder according to the present application. Modifications compared to conventional transform coding (with independent scalar quantizers) can be derived by comparison with Figure 2b. In a corresponding manner, an embodiment for encoding transform blocks using dependent scalar quantization can be obtained by similarly modifying the encoder of Figure 2a. [Figure 7] FIG. 1 is a schematic diagram showing two sets of reconstruction levels completely determined by a single quantization step size Δ for one embodiment of dependent quantization. The two available sets of reconstruction levels are highlighted Set 0 (top line) and Set 1 (bottom line). Examples for quantization indexes indicating reconstruction levels within a set are given by the numbers under the circles. The hollow and filled circles indicate two different subsets within the set of reconstruction levels, which may be used to determine the set of reconstruction levels for the next transform coefficient in the reconstruction order. Both sets contain reconstruction levels equal to zero but are otherwise mutually prime, and both sets are symmetric around zero. [Figure 8]FIG. 13 is a pseudocode illustrating an example for a reconstruction process for transform coefficients. k represents an index specifying the reconstruction order of the current transform coefficient, the quantization index for the current transform coefficient is indicated by level[k], the quantization step size Δk applied to the current transform coefficient is indicated by quant_step_size[k], and trec[k] represents the value of the reconstructed transform coefficient t′k. The variable setId[k] specifies the set of reconstruction levels to be applied to the current transform coefficient. Based on the preceding transform coefficient in the reconstruction order, it is determined that the possible values of setId[k] are 0 and 1. The variable n specifies an integer factor of the quantization step size and is given by the chosen set of reconstruction levels (i.e., the value of setId[k]) and the transmitted quantization index level[k]. [Figure 9] FIG. 10 is a pseudocode illustrating an alternative implementation of the pseudocode in FIG. 8. The main change is that the multiplication with the quantization step is represented using an integer implementation that uses a scale parameter and a shift parameter. Typically, the shift parameter (represented by shift) is constant for a transform block, and only the scale parameter (given by scale[k]) may depend on the location of the transform coefficient. The variable add represents a rounding offset and is typically set equal to add=(1<<(shift-1)). The parameters shift and scale[k] are chosen such that we have Δk≈scale[k]·2-shift, with Δk being the nominal quantization step for the transform coefficient. [Figure 10] FIG. 8 is a schematic diagram of an example for splitting a set of reconstruction levels into two subsets. The two illustrated quantization sets are the example quantization sets of FIG. 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]FIG. 13 shows pseudocode illustrating an example for a reconstruction process of transform coefficients for a transform block. The array level represents the transmitted transform coefficient levels (quantization indexes) for the transform block, and the array trec represents the corresponding reconstructed transform coefficients. The 2d table state_trans_table specifies the state transition table, and the table setId specifies the quantization sets associated with the states. [Figure 12] 1 is a schematic diagram illustrating state transitions in dependent scalar quantization as a trellis structure. The horizontal axis represents different transform coefficients in 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 the different transform coefficients. [Figure 13] FIG. 2 is a diagram illustrating an example of a basic trellis cell. [Figure 14] 1 is a schematic diagram of a transform block for an example of signaling the position of the first non-zero quantization index in coding order, whose position is indicated by filling in the background. In addition to the position of the first non-zero transform coefficient, only the bins for the shaded coefficients are transmitted, and coefficients marked white are inferred to be equal to 0. [Figure 15] FIG. 13 shows pseudocode illustrating a comparative example for transform coefficient level coding for a block of coefficients such as a sub-block, which can be easily transferred onto the decoding of a transform block that is not divided into sub-blocks, and onto the decoding of the coefficients (i.e., by replacing "coding" by "decoding"). Here, one pass is used to code all flags for the coefficients and the remainder, except for the sign flag. [Figure 16] 1 is a schematic diagram of a transform block and illustrates the template used to select a probabilistic model: the black square designates the current scan position, and the shaded squares represent the local neighborhood used to derive the context model. [Figure 17]FIG. 1 is a schematic diagram of an example trellis structure that may be utilized to determine a sequence (or block) of quantization indexes that minimizes a cost measure (such as a Lagrangian cost measure D+λ·R). The trellis is shown for 8 transform coefficients (or quantization indexes). The first state (leftmost) represents the initial state, which is set equal to 0. [Figure 18] FIG. 15 shows pseudocode illustrating one embodiment for coding of transform coefficient levels for blocks of coefficients such as sub-blocks, which can be easily transferred onto the decoding of transform blocks that are not divided into sub-blocks, and onto the decoding of coefficients (i.e., by replacing "coding" by "decoding"). Here, one pass is used to code all flags for the coefficients and the rest, except for the sign flag. Here, the common pass of FIG. 15 is split into three passes. [Figure 19] FIG. 15 shows pseudocode illustrating one embodiment for coding of transform coefficient levels for blocks of coefficients such as sub-blocks, which can be easily transferred onto the decoding of transform blocks that are not divided into sub-blocks, and onto the decoding of coefficients (i.e., by replacing "coding" by "decoding"). Here, one pass is used to code all flags and the remainder for the coefficients, except for the sign flag. Here, the common pass of FIG. 15 is split into two passes, one for the remainder and the other for flags other than the sign flag. [Figure 20]FIG. 15 shows pseudocode illustrating one embodiment for coding of transform coefficient levels for blocks of coefficients such as sub-blocks, which can be easily transferred onto the decoding of transform blocks that are not divided into sub-blocks, and onto the decoding of coefficients (i.e., by replacing "coding" by "decoding"). Here, one pass is used to code all flags for the coefficients and the rest, except for the sign flag. Here, the common pass of FIG. 15 is split into several passes, with the parity flag coded before the absolute level or before any other flag, respectively. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0007] According to the embodiments described below, entropy coding of transform coefficient levels is performed in a manner suitable for efficient implementation with dependent quantization and context-adaptive entropy coding, such as context-adaptive binary arithmetic coding. These embodiments are particularly advantageous for entropy coding of transform coefficient levels in the context of transform coding with 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 entropy coding of transform coefficient levels in the context of transform coding with conventional independent scalar quantization. Moreover, the embodiments described below are applicable for codecs that support switching (e.g., at sequence, picture, slice, tile, or block level) between transform coding with dependent quantization and transform coding with conventional independent quantization.
[0008] In the embodiment described below, transform coding is used to transform a set of samples. Quantization, which may be embodied as dependent scalar quantization or alternatively as independent scalar quantization, is used to quantize the resulting transform coefficients, and entropy coding of the obtained quantization indexes is performed. At the decoder side, a set of reconstructed samples is obtained by entropy decoding of the quantization indexes, dependent reconstruction (or alternatively, independent reconstruction) of the transform coefficients, and inverse transformation. The difference between dependent scalar quantization and traditional independent scalar quantization is that in dependent scalar quantization, the set of allowable reconstruction levels for a transform coefficient depends on the transmitted transform coefficient levels preceding the current transform coefficient in the reconstruction order. This aspect is exploited in the entropy coding by using different sets of probability models for different sets of allowable reconstruction levels. To enable an efficient hardware implementation, binary decisions (called bins) related to the transform coefficient levels of a block or sub-block are coded in multiple passes. The binarization of the transform coefficient levels and the distribution of the binary decisions (also called bins) over the multiple passes are chosen in such a way that the data coded in the first pass uniquely determines the set of acceptable reconstruction levels for the next scan position. This has the advantage that the probability models for some of the bins in the first pass can be selected depending on the set of acceptable reconstruction levels (for the corresponding transform coefficients).
[0009] Although the following description of the embodiments is mainly directed to lossy coding of blocks of prediction error samples in image and video codecs, these embodiments may also be applied to lossy coding in other fields. In particular, there is no restriction to the set of samples forming a rectangular block, and there is no restriction to the set of samples representing 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 basic approach of hybrid video coding: a video picture is partitioned into blocks, samples of the blocks are predicted using intra-picture prediction or inter-prediction, and the resulting samples of the prediction error signal (the difference between the original samples and the samples of the prediction signal) are coded using transform coding.
[0011] FIG. 1 shows a simplified block diagram of a typical modern video encoder. Video pictures of a video sequence are coded in a certain order, called coding order. The coding order of pictures may differ from the capture and display order. In practical coding, each video picture is partitioned into blocks. A block comprises samples of a rectangular area of a particular color component. An entity of blocks of all color components corresponding to the same rectangular area is often called a unit. Depending on the purpose of block partitioning, in H.265|MPEG-H HEVC, a distinction is made between coding tree blocks (CTB), coding blocks (CB), prediction blocks (PB) and transform blocks (TB). The associated units are called coding tree units (CTU), coding units (CU), prediction units (PU) and transform units (TU).
[0012] Typically, a video picture is first partitioned into fixed-size units (i.e., aligned 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 may be further partitioned into multiple coding units (CUs). A coding unit is an entity for which a coding mode (e.g., intra- or inter-picture coding) is selected. In H.265|MPEG-H HEVC, the decomposition of a CTU into one or more CUs is specified by a quad-tree (QT) syntax and transmitted as part of the bitstream. The CUs of a CTU are processed in a so-called z-scan order. That is, the four blocks resulting from the partition are processed in a raster scan order, and if any of those blocks are further partitioned, the corresponding four blocks (including the included smaller block) are processed before the next block of a higher partition level is processed.
[0013] If a CU is coded in an intra-coding mode, an intra-prediction mode for the luma signal and another intra-prediction mode for the chroma signal are transmitted if the video signal includes chroma components. 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 luma block may also be divided into four equal-sized blocks, in which case a separate luma intra-prediction mode is transmitted for each of these blocks. The actual intra-prediction and coding is performed based on the transform block. For each transform block of an intra-picture coded CU, a prediction signal is derived using already reconstructed samples of the same color component. The algorithm used to generate a prediction signal for the transform block is determined by the transmitted intra-prediction mode.
[0014] A CU coded in inter-picture coding mode may be further divided into multiple prediction units (PUs). A prediction unit is an entity of luma and, in 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 may be coded as a single prediction unit or may be 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 into a list of reference pictures) and an associated motion vector. In addition, H.265|MPEG-H HEVC provides 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 neighboring blocks. When a CU or PU is coded in merge mode, only an index to a list of motion parameter candidates (derived using motion data of spatially and temporally neighboring blocks) is transmitted. The index completely determines the set of motion parameters used. A prediction signal for an inter-coded PU is formed by motion compensated prediction. For each motion hypothesis (specified by a reference picture and a motion vector), a prediction signal is formed by a displaced block in the specified reference picture, except that the displacement with respect to the current PU is specified by the motion vector. The displacement is typically specified with sub-sample accuracy (in H.265|MPEG-H HEVC, the motion vector has an accuracy of 1 / 4 luma sample). With non-integer motion vectors, the prediction signal is generated by interpolating the reconstructed reference picture (typically using a separable FIR filter).The final prediction signal of a PU using multi-hypothesis prediction is formed by a weighted sum of prediction signals for individual motion hypotheses. Typically, the same set of motion parameters is used for the luma and chroma blocks of a PU. Although state-of-the-art video coding standards use a translational displacement vector to specify the motion of the current area (a block of samples) relative to the reference picture, it is also possible to adopt a higher-order motion model (e.g., an affine motion model). In that case, additional motion parameters must be transmitted for the motion hypotheses.
[0015] In both intra-picture coded CUs and inter-picture coded CUs, the prediction error signal (also called the residual signal) is typically transmitted via transform coding. In H.265|MPEG-H HEVC, the blocks of luma residual samples of a CU, as well as the blocks of chroma residual samples (if present), are partitioned into transform blocks (TBs). The partitioning of a CU into transform blocks is indicated by a quadtree syntax, also called the 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 indexes) are entropy coded. Within P 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 transform coefficients are equal to zero (i.e., the reconstructed signal is equal to the predicted signal). In that case, in addition to skip_flag, only merge_idx is transmitted. If skip_flag is equal to 0, the prediction mode (inter or intra) is signaled, followed by the syntax features described above.
[0016] Since an already coded picture may be used for motion-compensated prediction of a block in a subsequent picture, the picture must be fully reconstructed in the encoder. The reconstructed prediction error signal for a block (obtained by reconstructing the transform coefficients given the quantization indexes and the inverse transform) is added to the corresponding prediction signal, and the result is written to a buffer for the current picture. After all blocks of the picture are 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 transform coding, such as transform coding of prediction error signals. The concept is applicable for both intra-picture and inter-picture coded blocks. The concept is also applicable to transform coding of non-rectangular sample regions. In contrast to conventional transform coding, transform coefficients are not independently quantized according to the embodiments described below. At least, the transform coefficients are suitable to be quantized using dependent quantization. According to dependent quantization, the set of available reconstruction levels for a particular transform coefficient depends on the chosen quantization indexes for other transform coefficients. A modification for entropy coding of the quantization indexes is described below, which enhances coding efficiency and maintains the ability to be combined with dependent scalar quantization.
[0018] All major video coding standards (including the state-of-the-art standard H.265|MPEG-H HEVC) utilize the concept of transform coding for coding blocks of prediction error samples. The prediction error samples of a block represent the difference between samples of an original signal and samples of a prediction signal for the block. The prediction signal is obtained either by intra-picture prediction (in which the samples of the prediction signal for the current block are derived based on already reconstructed samples of neighboring blocks inside the same picture) or by inter-picture prediction (in which the samples of the prediction signal are derived based on samples of already reconstructed pictures). The samples of the original prediction error signal are obtained by subtracting the values of the samples of the prediction signal from the values of the samples of the original signal for the current block.
[0019] Transform coding of a block of samples consists of a linear transformation, scalar quantization, and entropy coding of the quantization indexes. At the encoder side (see Figure 2a), an N × M block of original samples is transformed using a linear analysis transform A. The result is an N × M block of transform coefficients. k represent the original prediction error samples in a different signal space (or a different coordinate system). The N×M transform coefficients are quantized using N×M independent scalar quantizers. Each transform coefficient t k is the quantization index q, also called the transform coefficient level. k The obtained quantization index q k is entropy coded and written into the bitstream.
[0020] At the decoder side, shown in FIG. 2b, the transform coefficient level q k is decoded from the received bitstream. For each transform coefficient level q k is the reconstructed transform coefficient t' kAn N×M block of reconstructed samples is obtained by transforming the block of reconstructed transform coefficients using a linear synthesis transform B.
[0021] Although the video coding standard specifies only a 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 Moreover, the transforms used in practical video coding systems are orthogonal transforms (B -1 =B T ), or nearly orthogonal transform, in which the mean squared error (MSE) distortion in the signal space is equal to the MSE distortion in the transform domain. The orthogonality has the important advantage that the MSE distortion between the original and reconstructed sample blocks can be minimized using independent scalar quantizers. Even if the actual quantization process used in the encoder takes into account the dependencies between transform coefficient levels (introduced by the entropy coding description above), the use of an orthogonal transform significantly simplifies the quantization algorithm.
[0022] For a typical prediction error signal, the transform has the effect that the signal energy is concentrated in a small number of transform coefficients: compared to the original prediction error samples, the statistical dependence between the resulting transform coefficients is reduced.
[0023] State-of-the-art video coding standards use the separable discrete cosine transform (Type II), or an integer approximation thereof. 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 standardization documents include:
[0024] Use of Discrete Sign Transform (DST) for intra-picture predicted blocks (possibly depending on intra-prediction mode and / or block size). Note that H.265|MPEG-H HEVC already includes DST for intra-picture predicted 4x4 transform blocks. · Switched transform: The encoder selects the transform that is actually used among a set of predefined transforms. Since the set of available transforms is known by both the encoder and the decoder, it can be efficiently signaled using an index into 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 chosen intra-prediction mode. In special cases, the transform used is completely determined by coding parameters such as the intra-prediction mode, eliminating the need for a syntax element to be transmitted to specify the transform. Non-separable transform: The transform used in the encoder and decoder represents a non-separable transform. Note that the concept of switching transform may include one or more non-separable transforms. For complexity reasons, the use of non-separable transforms may be limited to some block sizes. Multilevel transform: A real transform consists of two or more transform stages. The first transform stage may consist of a computationally low complexity separable transform, and in the second stage a subset of the resulting transform coefficients is further transformed using a non-separable transform. Compared to a non-separable transform for the entire transform block, the two-stage approach has the advantage that a more complex non-separable transform is applied to a smaller number of samples. The concept of multilevel transform can be efficiently combined with the concept of switching transform.
[0025] The transform coefficients are quantized using a scalar quantizer. As a result of the quantization, the set of permissible values for the transform coefficients is reduced. In other words, the transform coefficients are mapped to a countable set (in practice, a finite set) of so-called reconstruction levels. The set of reconstruction levels represents a proper subset of the set of possible transform coefficient values. To simplify the entropy coding that follows, the permissible reconstruction levels are represented by quantization indexes (also called transform coefficient levels), which are transmitted as part of the bitstream. On the decoder side, the quantization indexes (transform coefficient levels) are mapped to the reconstructed transform coefficients. The possible values for the reconstructed transform coefficients correspond to the set of reconstruction levels. On the encoder side, the result of the scalar quantization is a block of transform coefficient levels (quantization indexes).
[0026] State-of-the-art video coding standards use Uniform Reconstruction Quantizers (URQs). Their basic design is shown in Fig. 3. URQs have the property that the 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 quantization index q to the reconstructed transform coefficients 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 transform coefficient, the associated reconstructed transform coefficient t′ can be determined independently from all quantization indexes for the other transform coefficients.
[0028] Since video decoders typically utilize standard precision (e.g., 32-bit) integer arithmetic, the actual formula used in the standard may differ slightly from simple multiplication. When ignoring clipping to the supported dynamic range for the transform coefficients, the reconstructed transform coefficients in H.265|MPEG-H HEVC are obtained by: t'=(scale·q+(1<<(shift-1)))>>shift where the operators “<<” and “>>” represent left and right bit shifts, respectively. When we ignore integer arithmetic, the quantization step size Δ corresponds to the following term: Δ=scale 2 -shift
[0029] Older video coding standards, such as H.262|MPEG-2 Video, also specify modified URQs for which the distance between reconstruction level zero and the first non-zero reconstruction level is increased relative to the nominal quantization step size (e.g., to 3 / 2 of the nominal quantization step size Δ).
[0030] The quantization step size (or scale and shift parameters) for a transform coefficient is determined by two coefficients.
[0031] Quantization parameter QP: The quantization step size may be changed, typically on a block basis. To that end, 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 into a predefined list of quantization step sizes. The 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 in the slice header. In general, it is possible to change the quantization parameter QP on a block-by-block basis. To that end, a DQP (delta quantization parameter) can be transmitted. The quantization parameter used is determined by the transmitted DQP and a predicted QP value, which is derived using the QP of an already coded (typically neighboring) block.
[0034] Quantization weighting matrix: Video coding standards often provide the possibility to use different quantization step sizes for individual transform coefficients. This is achieved by specifying a so-called quantization weight matrix w, which can be selected by the encoder, typically at sequence or picture level, and transmitted as part of the bitstream. The quantization weight matrix w has the same size as the corresponding block of transform coefficients t ik Quantization step size Δ ik is given by Δ ik =w ik Δ block However, Δ block denotes the quantization step size for the block under consideration (denoted by the block quantization parameter QP), i and k represent the coordinates specifying the current transform coefficient within the transform block, and w ik represents the corresponding entry in the quantization weight matrix w.
[0035] The main intention of the quantization weight matrix is to provide the possibility to introduce quantization noise in a perceptually meaningful way. By using an appropriate weight matrix, the spatial contrast sensitivity of human vision can be exploited to achieve a better trade-off between bit rate 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 transform coefficients in a block. The quantization step size is then fully specified by the quantization parameter QP.
[0036] A block of transform coefficient levels (quantization indexes for transform coefficients) is entropy coded (i.e., transmitted in a lossless manner as part of the bitstream). Since a linear transform can only reduce linear dependencies, the entropy coding for transform coefficient levels is typically designed in such a way that the remaining nonlinear dependencies between transform coefficient levels within a block can be exploited for efficient coding. Well-known examples are 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] CABAC, specified in the state-of-the-art video coding standard H.265|MPEG-H HEVC, follows a general concept that can be applied for a wide variety of transform block sizes. Transform blocks larger than 4×4 samples are partitioned into 4×4 sub-blocks. This partitioning is illustrated for the example of a 16×16 transform block in Fig. 4a and Fig. 4b. The coding order of the 4×4 sub-blocks illustrated in Fig. 4a, as well as the coding order of the transform coefficient levels inside the sub-blocks illustrated in Fig. 4b, are generally specified by the reverse diagonal scan illustrated in those figures. For some intra-picture prediction blocks, a horizontal or vertical scan pattern is used (depending on the actual intra-prediction mode). The coding order always starts from a high-frequency location.
[0038] In H.265|MPEG-H HEVC, transform coefficient levels are transmitted based on 4×4 sub-blocks. Lossless coding of transform coefficient levels includes the following steps:
[0039] 1. A syntax element coded_block_flag is sent, signaling whether or not there are any non-zero transform coefficient levels in the transform block. If coded_block_flag is equal to 0, no further data is coded for the transform block. 2. The x and y coordinates of the first non-zero transform coefficient level in coding order (e.g., the block-wise anti-diagonal scan order shown in FIG. 4) are transmitted. The transmission of these coordinates is split into a prefix and a suffix part. 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 4×4 sub-block containing the first non-zero transform coefficient level in coding order, the 4×4 sub-blocks are processed in coding order, where coding of a sub-block includes the following main steps: The syntax element coded_sub_block_flag is transmitted, indicating whether the sub-block contains any non-zero transform coefficient levels. For the first and last 4×4 sub-blocks (i.e., the sub-blocks containing the first non-zero transform coefficient level or the DC level), this flag is not transmitted but is inferred to be equal to 1. b. For all transform coefficient levels within a sub-block with coded_sub_block_flag equal to 1, the syntax element significant_coeff_flag indicates whether the corresponding transform coefficient level is not equal to zero. This flag is transmitted only if its value cannot be inferred based on already transmitted data. Specifically, this flag is not transmitted for the first significant scan position (specified by the transmitted x and y coordinates) and is not transmitted for a DC coefficient if the DC coefficient is located in a different sub-block than the first non-zero coefficient (in coding order) and all other significant_coeff_flag for the last sub-block are equal to zero. c. A flag coeff_abs_level_greater1_flag is signaled for the first 8 transform coefficient levels that have significant_coeff_flag equal to 1 (if any). This flag indicates whether the absolute value of the transform coefficient level is greater than 1 or not. d. For the first transform coefficient level (if any) that has coeff_abs_level_greater1_flag equal to 1, a flag coeff_abs_level_greater2_flag is signaled. This flag indicates whether the absolute value of the transform coefficient level is greater than 2 or not. e. For all levels that have significant_coeff_flag equal to 1 (exceptions are described below), the syntax element coeff_sign_flag is sent, which specifies the sign of the transform coefficient level. f. For all transform coefficient levels for which the absolute value is not already fully specified by the values of significant_coeff_flag, coeff_abs_level_greater1_flag, and coeff_abs_level_greater2_flag (the absolute value is fully specified if any of the transmitted flags are equal to zero), the remainder of the absolute value 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 that end, each bin is associated with a probability model (binary probability mass function), also called context. For most bins, the context represents an adaptive probability model, which means that the associated binomial probability mass function is updated based on the actually coded bin value. Conditional probabilities can be exploited by switching the context for some bins based on already transmitted data. CABAC also includes a so-called bypass mode, where a fixed probability mass function (0.5,0.5) is used.
[0041] The context chosen for coding of coded_sub_block_flag depends on the value of coded_sub_block_flag for adjacent sub-blocks already coded. The context for significant_coeff_flag is selected based on the internal scan position (x and y coordinates) of the sub-block, the size of the transform block, and the value of coded_sub_block_flag in the adjacent sub-blocks. For flags coeff_abs_level_greater1_flag and coeff_abs_level_greater2_flag, the context selection depends on whether the current sub-block contains a DC coefficient or not, and whether any coeff_abs_level_greater1_flag equal to 1 has been transmitted for an adjacent sub-block. For coeff_abs_level_greater1_flag, the context selection further depends on the number and value of already coded coeff_abs_level_greater1_flag for the sub-block.
[0042] The sign, coeff_sign_flag, and the remainder of the 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). The binarization is controlled by a single parameter, which is adapted based on the already coded values for the sub-block.
[0043] H.265|MPEG-H HEVC also includes a so-called code data hiding mode, in which (under some conditions) the transmission of the code for the last non-zero level inside a subblock is omitted. Instead, the code for this level is embedded in the parity of the sum of the absolute values for the levels of the corresponding subblock. Note that the encoder must take this aspect into account in determining the appropriate transform coefficient level.
[0044] Video coding standards specify only the bitstream syntax and the reconstruction process. If we consider transform coding for a given block of original prediction error samples and a given quantization step size, the encoder has a great deal of freedom. The quantization index q for the transform block k Given q, entropy coding must follow a uniquely defined algorithm for writing the data into the bitstream (i.e., constructing arithmetic codewords). However, given an original block of prediction error samples, the quantization index q k The encoder algorithm for obtaining QP is outside the scope of the video coding standard. Moreover, 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 transform coefficient is known. We assume that the encoder can obtain the quantization parameter QP for the original transform coefficient t k We further assume that the encoder performs an analytical transform that is the inverse (or a very close approximation of the inverse) of the specified synthetic transform to obtain k quantizer index q for k Since the choice of transform coefficient levels determines both the distortion (or reconstruction / approximation quality) and the bitrate, the quantization algorithm used has a significant impact on the rate-distortion performance of the resulting bitstream.
[0045] The simplest method is to quantize the original transform coefficients t k to the nearest reconstruction level. In a typically used URQ, the corresponding quantization index q k may be determined according to:
[0046]
number
[0047] where sgn() is the sign function and the operator [·] returns the largest integer less than or equal to its argument. This quantization method reduces the MSE distortion.
[0048]
number
[0049] is minimized, but the resulting transform coefficient levels q k
[0046] We completely ignore the bit rate required to transmit . Typically, better results are obtained if the rounding is biased towards zero.
[0050]
number
[0051] however,
[0052]
number
[0053] The best results in the rate-distortion sense are obtained when the quantization process minimizes the Lagrangian function D+λ·R, where D represents the distortion of the transform block (e.g., the MSE distortion), R specifies the number of bits required to transmit the transform coefficient levels of the block, and λ is the Lagrangian multiplier. The relationship between QP and the 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 Lagrangian multiplier ,λ, and the block quantization parameter, QP, is often used:
[0056]
number
[0057] where c1 and c2 represent constant coefficients for the slice or picture.
[0058] Quantization algorithms that aim to minimize the Lagrangian function of distortion and rate D+λ·R are also called rate-distortion optimized quantization (RDOQ). If we use MSE or weighted MSE to measure distortion, then the quantization index q for a transform block k should be determined in such a way that the following cost measure is minimized:
[0059]
number
[0060] Here, the transform coefficient index k specifies the coding order (or scanning order) of the transform coefficient levels. k |q k-1 ,q k-2 ,...) is the quantization index q k This condition represents the number of bits (or an estimate thereof) required to transmit a particular transform coefficient level q k The number of bits for k-1 , q k-2 It is shown that the coefficient α in the above formula depends on the values chosen for k can be used to weight the contributions of the individual transform coefficients, for example to model the contrast sensitivity of human vision. In the following, we generally refer to all weighting coefficients α kWe assume that is equal to 1 (but the algorithm can easily be modified in such a way that different weighting factors can be taken into account).
[0061] In transform coefficient coding in H.265|MPEG-H HEVC, most binary decisions are coded using an adaptive probability model, so the exact calculation of the rate terms is quite complicated. However, if we ignore some aspects of the probability model selection and ignore that the probability model is adapted inside the transform block, it is possible to design an RDOQ algorithm with 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 scan position k, the transform coefficient level q k is not inferred to be equal to zero, the Lagrangian cost D k (q k )+λ·R k (q k ) is selected by minimizing D k (q k ) is the (weighted) squared error D k (q k )=α k (t k -Δ k ·q k ) 2 R k (q k ) is q k represents an estimate of the number of bits required to transmit 2. The flag coded_sub_block_flag for the 4x4 sub-block is determined by comparing the Lagrangian costs for the following two cases: (a) the transform coefficient level selected in step 1 is used; and (b) the syntax element coded_sub_block_flag is set equal to zero, and therefore all transform coefficient levels of the 4x4 sub-block are set equal to zero. 3. The location of the first non-zero transform coefficient level is determined by comparing the Lagrangian costs obtained by choosing one of the non-zero transform coefficient levels (after step 2) as the first non-zero transform coefficient level in the coding order (the preceding transform coefficient level is set equal to zero). 4. The coded_block_flag is determined by comparing the Lagrangian cost for the sequence of transform coefficient levels obtained after step 3 with the Lagrangian cost for the case where all transform coefficient levels inside the transform block are set equal to zero.
[0063] In [3], a modified concept for transform coding is proposed, which is described in more detail below. The main change compared to conventional transform coding is that transform coefficients are not independently quantized and reconstructed. Instead, the allowable reconstruction levels for a transform coefficient depend on the selected quantization index for the preceding transform coefficient in the reconstruction order. The concept of dependent scalar quantization is combined with modified entropy coding, in which the probability model selection (or alternatively, the codeword table selection) for a transform coefficient depends on the set of allowable reconstruction levels.
[0064] The advantage of dependent quantization of transform coefficients is that the permissible reconstruction vectors are packed more densely in the N-dimensional signal space (where N denotes the number of samples or transform coefficients in the transform block). The reconstruction vectors for a transform block refer to the ordered reconstructed transform coefficients (or alternatively, the ordered reconstructed samples) of the transform block. This effect is illustrated in Fig. 5a and Fig. 5b for the simplest case of two transform coefficients. Fig. 5a illustrates the permissible reconstruction vectors (representing points in a 2d plane) for independent scalar quantization. As can be seen, the set of permissible values for the second transform coefficient t'1 does not depend on the chosen value for the first reconstructed transform coefficient t'0. Fig. 5b illustrates an example for dependent scalar quantization. It should be noted that in contrast to independent scalar quantization, the selectable reconstruction values for the second transform coefficient t'1 depend on the chosen reconstruction level for the first transform coefficient t'0. In the example of Fig. 5b, there are two different sets of available reconstruction levels for the second transform coefficient t'1 (indicated by different colors). If the quantization index for the first transform coefficient t'0 is even (..., -2, 0, 2, ...), any reconstruction level of the first set (blue dots) can be selected for the second transform coefficient t'1. Also, if the quantization index for the first transform coefficient t'0 is odd (..., -3, -1, 1, 3, ...), any reconstruction level of the second set (red dots) can be selected for the second transform coefficient t'1. In this example, the reconstruction levels for the first and second sets are shifted by 1 / 2 of the quantization step size (any reconstruction level of the second set is located between two reconstruction levels of the first set).
[0065] Dependent scalar quantization of transform coefficients has the effect that for a given average number of reconstruction vectors per N-dimensional unit quantity, the expected value of the distance between a given input vector of transform coefficients and the closest available reconstruction vector is reduced. As a result, the average distortion between the input vector of transform coefficients and the vector of reconstructed transform coefficients can be reduced for a given average number of bits. In vector quantization, this effect is called space-filling gain. Using dependent scalar quantization for transform blocks, most of the potential space-filling gain for high-dimensional vector quantization can be exploited. Also, in contrast to vector quantization, the implementation complexity of the reconstruction process (or decoding process) is comparable to that of conventional transform coding with independent scalar quantizers.
[0066] A block diagram of a transform decoder with dependent scalar quantization is shown in Fig. 6. The main change concerns the incorporation of dependent quantization into the arrows pointing from top to bottom. As indicated by these vertical arrows, the reconstructed transform coefficients t' with reconstruction order index k>0 are k is the associated quantization index q k , q for the preceding transform coefficients in the reconstruction order, rather than depending only on k-1 Note that for dependent quantization, the reconstruction order of the transform coefficients must be uniquely defined. k If knowledge of the set of reconstruction levels associated with is also exploited in the entropy coding, the performance of the overall transform codec may be improved. That is, it is advantageous to switch contexts (probability models) or codeword tables based on the set of reconstruction levels applied to the transform coefficients.
[0067] As in conventional transform coding, transform coding according to the embodiments outlined herein involves, in addition to an analysis transform, a quantization algorithm and entropy coding. As the analysis transform, the inverse (or a close approximation of the inverse) of the synthesis transform is typically used, and the entropy coding is usually uniquely specified given the entropy decoding process. However, as in conventional transform coding, there is a lot of freedom to choose the quantization indexes given the original transform coefficients.
[0068] Dependent quantization of transform coefficients refers to the notion that the set of available reconstruction levels for a transform coefficient depends on the chosen quantization indexes for the preceding transform coefficients in reconstruction order (within the same transform block). The set of allowable reconstruction levels for a current transform coefficient is selected (based on the quantization indexes for the preceding transform coefficients in coding order) among two predefined sets of reconstruction levels.
[0069] As in the case of conventional independent scalar quantization, a block-based quantization parameter (QP) determines the quantization step size Δ (or the corresponding scale and shift parameters, as explained above), and all reconstruction levels (in 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 as an extension of the Uniform Reconstruction Quantizer (URQ). Its basic advantage is that the reconstructed transform coefficients can be calculated by an algorithm with extremely low computational complexity.
[0070] Specific conversion factor t k Quantization step size Δ k(k denotes the reconstruction order) may not be determined solely by the block quantization parameter QP, and may be used for a particular transform coefficient t k Quantization step size Δ k can also be determined by the quantization weight matrix and the block quantization parameter. Typically, the transform coefficients t k Quantization step size Δ k is the transform coefficient t (specified by the quantization weight matrix) k Weighting factor for w k and the block quantization step size Δ block It is given by the product of Δ k =w k Δ block
[0071] The reconstructed transform coefficients t' k It should be noted that the actual calculation of (or the actual calculation of the reconstruction level) may deviate slightly from the ideal multiplication due to aspects of integer or other implementations. k is a specific conversion factor t k Let be the quantization step size for k (For example, the quantization index q k Let us specify a nominal integer factor for the quantization step size (given by k is given by: t' k =n k Δ k
[0072] Due to the restriction to integer implementations, the reconstructed transform coefficients t' k (or the corresponding reconstruction level) is actually t' k =(n k scale+(1<<(shift-1)))>>shift, where scale 2 -shift ≒Δ k or a similar procedure. When we speak of integer multiples of the quantization step size in the following description, the corresponding text also applies to integer approximations similar to those specified above.
[0073] The dependent scalar quantization for transform coefficients proposed in [3] uses two different sets of reconstruction levels for the transform coefficients t k All reconstruction levels of the two sets for , are determined by the quantization step size Δ k The quantization step size Δ k Note that t represents only the scaling coefficients for acceptable reconstruction values in both sets. k Possible individual quantization step sizes Δ k Except for (and therefore the individual scaling coefficients), the same two sets of reconstruction levels are used for all transform coefficients.
[0074] In Fig. 7, a preferred configuration for two sets of reconstruction levels t is shown. The reconstruction levels contained in the first quantization set (labeled set 0 in the figure) represent even integer multiples of the quantization step size. The second quantization set (labeled set 1 in the figure) contains all odd integer multiples of the quantization step size and additionally a reconstruction level equal to zero. Note that both reconstruction sets are symmetric around zero. A reconstruction level equal to zero is contained in both reconstruction sets, and these reconstruction sets are otherwise mutually disjoint. The union of both reconstruction sets contains all integer multiples of the quantization step size.
[0075] The reconstruction level that the encoder selects among the allowable reconstruction levels is transmitted inside the bitstream. As in the case of conventional independent scalar quantization, this can be achieved using so-called quantization indexes, also called transform coefficient levels. A quantization index (or transform coefficient level) is an integer that uniquely identifies an available reconstruction level inside a quantization set (i.e., inside a set of reconstruction levels). The quantization index is sent to the decoder as part of the bitstream (using any entropy coding technique). At the decoder side, a reconstructed transform 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 transform coefficient.
[0076] The assignment of quantization indexes to reconstruction levels within a set of reconstruction levels (or quantization set) may follow the following rules, as seen in FIG. 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), etc. Or, in other words, the 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 −1 is assigned to the largest reconstruction level less than 0, a quantization index −2 is assigned to the next (i.e., the second largest) reconstruction level less than 0, etc. Or, in other words, the 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 transform coefficients may be implemented similar to the algorithm specified in the pseudocode of FIG.
[0077] In the pseudocode in Figure 8, level[k] is the transformation coefficient tk where setId[k] (equal to 0 or 1) specifies the identifier of the current set of reconstruction levels (determined based on the preceding quantization index 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]. The transform coefficients are multiplied by the quantization step size Δ k If the transform coefficients are coded using a first set of reconstruction levels that contain an even integer multiple of , (setId[k]=0), the variable n is twice the transmitted quantization index. If the transform coefficients are coded using a second set of reconstruction levels (setId[k]=1), we have three cases: (a) if level[k] is equal to 0, then n is also equal to 0; (b) if level[k] is greater than 0, then n is equal to 2 times the quantization index level[k]-1; and (c) if level[k] is less than 0, then n is equal to 2 times the quantization index level[k]+1. This may be specified using a 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] minus the sign function of the quantization index, sign(level[k]).
[0080] Once the variable n (which specifies the integer factor of the quantization step size) has been determined, the reconstructed transform coefficients t' k is the quantization step size Δ k It is obtained by multiplying n by
[0081] As mentioned above, the quantization step size Δ k Instead of exact multiplication with kcan be obtained by integer approximation. This is shown in the pseudocode in FIG. 9. Here, the variable shift represents a bit shift to the right. 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 a block). The variable scale[k] is the iterative scale of the transform coefficient t k , which may depend in addition to the block quantization parameters, for example, on 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 arithmetic specified in the pseudocode of FIG. 9 (last line) scales the quantization step size Δ, given, excluding rounding, by: k Note that this is equivalent to multiplying with Δ k =scale[k] 2 -shift
[0082] Another (purely cosmetic) change in FIG. 9 compared to FIG. 8 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 therefore 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 transform coefficient is determined based on the partitioning of the quantizer sets, as shown in Fig. 10. Each of the two quantizer sets is partitioned into two subsets. The first quantizer set (labeled set 0) is partitioned into two subsets (labeled A and B), and the second quantizer set (labeled set 1) is also partitioned into two subsets (labeled C and D). In Fig. 7 and Fig. 10, the partitioning of the quantizer sets into subsets is indicated by hollow and filled circles. The following partitioning 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 of quantization set 1.
[0086] The subset used is not explicitly indicated inside the bitstream. Instead, the subset used may be derived based on the quantization set used (e.g., set 0 or set 1) and the quantization indexes actually transmitted. The subsets may be derived by a bitwise "and" operation of the transmitted quantization indexes level and 1. Subset A consists of all quantization indexes of set 0 for which (level&1) is equal to 0, subset B consists of all quantization indexes of set 0 for which (level&1) is equal to 1, subset C consists of all quantization indexes of set 1 for which (level&1) is equal to 0, and subset D consists of all quantization indexes of set 1 for which (level&1) is equal to 1.
[0087] The transitions between the 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 transform coefficient. Quantization set 0 is used if and only if the state variable is equal to 0 or 1, and quantization set 1 is used if and only if the state variable is equal to 2 or 3. On the other hand, the state variable also specifies the possible transitions between the 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 transform coefficient. Table 1 further specifies the state transitions based on the path associated with the chosen quantization index (given a quantization set, the path specifies the subset A, B, C, or D to be used). In the reconstruction of the transform coefficients 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 may be determined by: path=(level[k]&1) where the operator & represents 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 reconstruction order) and the previous quantization index, such as its parity in this example. The initial state for a transform block is set equal to 0.
[0091] The concept of state transitions for dependent scalar quantization allows for a low-complexity implementation for the reconstruction of transform coefficients at the decoder. A preferred example for the reconstruction process of transform coefficients of a single transform block is shown in Figure 11 using C-style pseudocode.
[0092] In the pseudocode of FIG. 11, the index k specifies the reconstruction order of the transform coefficients. Note that in the exemplary code, the index k decreases in the reconstruction order. The last transform 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 transform coefficient. The variable kstart may be set equal to the number of transform coefficients in the transform block minus 1, or (for example, if the location of the first non-zero quantization index is transmitted in the applied entropy coding method) equal to the index of the first non-zero quantization index in the coding / reconstruction order. In the latter case, all preceding transform coefficients (with index k>kstart) are inferred to be equal to 0. The reconstruction process for each single transform coefficient is the same as in the example of FIG. 9. For the example in FIG. 9, the quantization index is represented by level[k] and the associated reconstructed transform is represented by trec[k]. The state variable is represented by state. Note that in the example of Figure 11, state is set equal to 0 at the beginning of the transform block. The 1d table setId[] specifies the quantization sets associated with different values of the state variables, and the 2d table state_trans_table[][] specifies the state transitions given the current state (first argument) and path (second argument), where path is given by the parity of the quantization index (using the bitwise and operator &).
[0093] Instead of the table setId[], simple arithmetic operations can be used, for example bit shifts to the right. setId[state]=state>>1
[0094] Similarly, the table state_trans_table[][] can also be implemented using simple arithmetic operations, for example: 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 a state transition table that always chooses state 0, and therefore the conventional uniform reconstruction quantizer Q0.
[0096] State transitions in dependent quantization can also be represented using a trellis structure, as shown in FIG. 12. The trellis shown in this figure corresponds to the state transitions specified in Table 1. For each state, there are two paths that connect the state for the current transform coefficient with the two possible states for the next transform coefficient in the reconstruction order. These paths are labeled Path 0 and Path 1, and the number corresponds to the path variable introduced above (in the 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 FIG. 12, the subset is specified in parentheses. Given an initial state (State 0), a path through the trellis is uniquely specified by the transmitted quantization index.
[0097] In the example in FIG. 12, the states (0, 1, 2, and 3) have the following properties:
[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 levels of set 1, and the current quantization index level[k] specifies the reconstruction levels of set 0. State 2: The previous quantization index level[k-1] specifies the reconstruction levels of set 0, and the current quantization index level[k] specifies the reconstruction levels of 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] A trellis consists of a concatenation of so-called elementary trellis cells, which are shown in FIG.
[0100] One aspect of dependent scalar quantization as outlined above is that there are different sets of permissible reconstruction levels (also called quantization sets) for transform coefficients. The quantization set for a current transform coefficient is determined based on the values of the quantization indexes for the preceding transform coefficients. If 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 0 is higher when set 0 is used and smaller when set 1 is used. For efficient coding, this aspect is exploited in entropy coding by switching probability models based on the quantization set (or state) used for the current quantization index.
[0101] It should be noted that for a suitable switching of probability models, the paths of all previous quantization indexes (association with the subset 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). To that end, in the codec proposed in [3], the transform coefficients are coded in the reconstruction order. The quantization indexes are coded using binary arithmetic coding similar to H.264|MPEG-4 AVC, or H.265|MPEG-H HEVC. The non-binary quantization indexes are first mapped onto a set of binary decisions (commonly called bins). The quantization indexes are transmitted as absolute values and, for absolute values greater than 0, as signs.
[0102] As in HEVC, the transform coefficient levels of a transform block are coded based on sub-blocks. First, a flag, coded_block_flag, is transmitted, specifying whether the transform block contains any non-zero transform coefficient levels or not. If coded_block_flag is equal to 0 (i.e., the block does not contain any non-zero levels), no further information for the transform block is transmitted. Otherwise (coded_block_flag is equal to 1), the following applies:
[0103] ·x and y coordinates of the first non-zero level in the coding order. As shown in Fig. 14, the location of the first non-zero level transmitted specifies that all transform coefficients preceding the identified coefficient in the coding order (marked white in Fig. 14) are inferred to be equal to zero. Further data is transmitted only for the coefficient at the specified location (marked black in Fig. 14) and for the coefficients following this coefficient in the coding order (marked shaded in Fig. 14). The example in Fig. 14 shows a 16x16 transform block with 4x4 sub-blocks, but the coding order used is the diagonal scan per sub-block specified in H.265|MPEG-H HEVC. For the sub-block preceding the sub-block containing the first non-zero level (indicated by the transmitted x and y coordinates), a flag, coded_subblock_flag, is transmitted that specifies whether the sub-block contains any non-zero transform coefficient levels. As an exception, coded_subblock_flag is not transmitted for sub-blocks containing DC coefficients; for these sub-blocks, coded_subblock_flag is inferred to be equal to 1.
[0104] Finally, for all sub-blocks with coded_subblock_flag equal to 1 and for the sub-blocks containing the first non-zero level in the coding order, the values of the transform coefficient levels are coded as shown by the pseudo code in FIG. 15, where firstScanIdSbb represents the first scan index within the sub-block. For the sub-block 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 the other transmitted sub-blocks, firstScanIdSbb specifies the first scan index within the sub-block. The scan index lastScanIdSbb specifies the last scan index within the sub-block. Note that all coefficients within a sub-block are coded before any coefficients of the next sub-block in the coding order are coded.
[0105] The levels of the sub-blocks are coded in two passes: for all coefficients with absolute value not equal to zero, in the first pass the absolute value is transmitted and in the second pass the sign is transmitted. The absolute value is coded as follows:
[0106] A flag sig_flag is transmitted that specifies whether the absolute level is greater than zero. This flag is not transmitted if it can be inferred to be equal to 1, i.e. when any of the following conditions apply: The current scan index k is equal to the scan index of the first non-zero level (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 or not. If sig_flag and gt1_flag are equal to 1 (ie the absolute level is greater than 1), then another flag gt2_flag is sent which specifies whether the absolute level is greater than 2 or not. If sig_flag, gt1_flag and gt2_flag are equal to 1 (ie the absolute level is greater than 2), then another flag gt3_flag is sent, which specifies whether the absolute level is greater than 3 or not. If sig_flag, gt1_flag, gt2_flag and gt3_flag are equal to 1 (ie the absolute level is greater than 3), then another flag gt4_flag is sent which specifies whether the absolute level is greater than 4 or not. · If sig_flag, gt1_flag, gt2_flag, gt3_flag and gt4_flag are equal to 1 (i.e. the absolute level is greater than 4), then the syntax element gt3_flag is sent, specifying the absolute value -5.
[0107] After the absolute values for all levels of a subblock have been transmitted, a sign bit, sign_flag, is transmitted for all coefficients with absolute levels not equal to zero.
[0108] The flags sig_flag, gt1_flag, gt2_flag, gt3_flag, and gt4_flag are coded using adaptive probability models (also called contexts). For these flags, one of multiple adaptive probability models is selected as follows:
[0109] Let state be the current value of the state variables for the transform coefficients (the state variables are 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). Let sumAbsTemplate be the sum of the absolute values already coded in the local neighborhood shown in FIG. 16, where the corresponding neighborhood is shown by shading those coefficients that belong to the neighborhood of the coefficient whose bin is currently being coded, which is drawn in black. Let numSigTemplate be the number of absolute levels greater than 0 in the same local neighborhood.
[0110] In sig_flag, the probability model selected depends on: The diagonal of the current scan position (given by the sum of the x and y coordinates), The quantizer used for the current transform coefficient (Q0 or Q1, as given by state>>1), The sum of the absolute levels already coded in the local neighborhood given by sumAbsTemplate.
[0111] In gt1_flag, the probability model selected depends on: The diagonal of the current scan position (given by the sum of the x and y coordinates), The quantizer used for the current transform coefficient (Q0 or Q1, as given by state>>1), sumAbsTemplate - the value of numSigTemplate (i.e. the sum of the absolute values in the local neighborhood - the number of absolute levels greater than 0 in the local neighborhood).
[0112] The same probability model is used for gt2_flag, gt3_flag, and gt4_flag. The same probability model is selected depending on: The diagonal of the current scan position (given by the sum of the x and y coordinates), sumAbsTemplate - the value of numSigTemplate (i.e. the sum of the absolute values in the local neighborhood - the number of absolute levels greater than 0 in the local neighborhood).
[0113] First the non-binary syntax elements binarized (i.e. mapped to a sequence of bins) and the bins are coded in the bypass mode of the arithmetic coding engine (using a non-adaptive probability model with pmf{0.5,0.5}). For binarization, Rice-Golomb codes are used, which are parameterized by the so-called Rice parameters. The Rice parameters are selected depending on the value of (sumAbsTemplate-numSigTemplate). Finally, the sign flag is coded using the bypass mode of the arithmetic coding engine.
[0114] To obtain a bitstream that provides a very good tradeoff between distortion (reconstruction quality) and bitrate, the quantization index is determined by the Lagrangian cost metric
[0115]
number
[0116] should be chosen in such a way that minimizes t'. In the case of independent scalar quantization, such a quantization algorithm (called rate-distortion optimal quantization, or RDOQ) has been described above. However, compared to independent scalar quantization, we have an additional difficulty. k , and therefore their distortion D k =(t k -t' k ) 2 is the associated quantization index q k It depends not only on the value of the quantization index that precedes it in the coding order, but also on the value of the quantization index that precedes it in the coding order.
[0117] However, as we explained above, the dependencies between transform coefficients can be represented using a trellis structure. For further explanation, we use the preferred embodiment given in FIG. 10 as an example. The trellis structure for an example block of eight transform coefficients is shown in FIG. 17. The paths through the trellis (from left to right) represent the possible state transitions for the quantization indexes. Note that each connection between two nodes represents the quantization indexes of a particular subset (A, B, C, D). If we define the quantization index q k Select from each of the subsets (A, B, C, D) and calculate the corresponding rate-distortion cost J k =D k (q k |q k-1 ,q k-2 ,...)+λ R k (q k |q k-1 ,q k-2 ,...) to the associated connection 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 path through the trellis (from left to right in Fig. 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 encoding algorithm for selecting suitable quantization indexes for a transform block may consist of the following main steps:
[0119] 1. Set the rate distortion cost for the initial state equal to 0. 2. For all transform coefficients in coding order, do the following: For each subset A, B, C, D, determine the quantization index that minimizes the distortion for the given original transform coefficients. b. For all trellis nodes (0, 1, 2, 3) for the current transform coefficient, do the following: i. Calculate the rate-distortion cost for the two paths connecting the state for the preceding transform coefficient with the current state. The cost is the cost for the preceding state, and D k +λ R k where D k and R k represents the distortion and rate for choosing the quantization indexes of the subset (A, B, C, D) associated with the connection under consideration. ii. Assign the minimum of the calculated costs to the current node and prune connections to states of previous transform coefficients that do not represent a minimum cost path.
[0120] NOTE: After this step, every node for the current transform coefficient has a single connection to any node for the preceding transform coefficient.
[0121] 3. Compare the costs of the four final nodes (for the last coefficient in the coding order) and choose the node with the smallest cost. Note that this node is associated with a unique path through the trellis (all other connections were pruned in the previous step). 4. Follow the chosen path (specified by the last node) in reverse order and collect the quantization indices associated with the connections between the trellis nodes.
[0122] Next, the embodiments of the present application will be described. The embodiments of the present application will be presented independently, but reference may be made to the figures described above. In particular, the following description focuses on the differences from the above example, and therefore these differences may be used to modify the above description to produce further embodiments, and vice versa, and each task described above, such as those related to context selection, quantization, inverse quantization, transformation, retransformation, entropy coding / decoding, may be used individually or in combination to modify or further specify the embodiments described later to produce still further embodiments.
[0123] Transform coding using dependent scalar quantization as described above [3] generally improves coding efficiency compared to transform coding using traditional independent scalar quantization. However, the entropy coding of dependent quantization indexes (transform coefficient levels) described in Figure 15 above has 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 the bypass mode (bins of 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 the arithmetic coding engine can also be implemented particularly efficiently when a rather large number of bypass bins are coded consecutively. Frequent switching between normal mode and bypass mode is disadvantageous for hardware implementations.
[0125] The probability model for most bins depends directly on the value of the bin that immediately precedes it. For example, the probability model used for sig_flag depends on the parity of the previous absolute level (which is not known 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 prevent efficient pipelining of the arithmetic decoding process. It would be preferable to reduce the number of direct dependencies so that the arithmetic decoding of the bins can be pipelined to some extent.
[0126] An approach to reduce the complexity of state-of-the-art residual coding designs is coding in several scan passes. In each scan pass, partial information of the level is transmitted, and the complete level information is available only after the last scan pass. However, this design is not compatible with dependent quantization techniques. It should be noted that bin reordering is not straightforward for dependent quantization for the following reasons.
[0127] In particular, 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 transform coefficient, the compression efficiency will be significantly reduced. However, the quantizer used depends on the parity of all transform coefficient levels, and the parity of all transform coefficient levels is known only if all bins of all previous transform coefficients are coded before the first bin (sig_flag) for the current transform coefficient.
[0128] Context modeling for a bin also relies on knowledge of the absolute levels already transmitted in the local neighborhood. Typically, better knowledge of neighboring transform coefficient levels leads to increased coding efficiency.
[0129] Briefly, the embodiments further described below overcome the noted problems by one or more of the following design aspects.
[0130] · The bins associated with the transform coefficient levels of a sub-block (or block) are coded in multiple passes over all scan positions. The first pass - or the first passes - over the scan positions includes coding of sig_flag and, if sig_flag is equal to 1, a parity flag par_flag (specifying the parity of the transform coefficient level). The first pass may or may not include additional data. Note that by coding a dedicated parity flag, the quantizer used for the transform coefficients is known and this knowledge can be used for efficient context modeling of sig_flag. All bypass bins of the syntax element remainder for a sub-block (or block) are coded in a separate pass, i.e. all bypass bins of a sub-block (or block) are coded consecutively.
[0131] In the following, a design approach is described that, firstly, is compatible with quantization methods that require parity information, and, secondly, inherits less complexity than coding the complete absolute level information. The central idea is to transmit the parity information for each absolute level as a dedicated syntax element. Different locations are possible, e.g., before the significance flag, after the significance flag, after any "is level greater than" information, etc. The semantics of the syntax elements following the parity information alternate depending on the selected location for the transmission of the parity syntax element. When the parity information is available, the remaining absolute level information is divided by two, which may result in different conditional probabilities for the syntax elements.
[0132] Further details regarding the bin coding order and associated context modeling are provided below.
[0133] In one embodiment, similar to HEVC, the transform coefficient levels of a transform block are coded based on sub-blocks. First, a flag coded_block_flag is transmitted, which specifies whether the transform block contains any non-zero transform coefficient levels. If coded_block_flag is equal to 0 (i.e., the block does not contain any non-zero levels), no further information for the transform block is transmitted. Otherwise (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 transmitted. As shown in Figure 14, the location of the first non-zero level transmitted specifies that all transform coefficients preceding the identified coefficient in the coding order (marked white in Figure 14) are inferred to be equal to zero. For each sub-block following the sub-block containing the first non-zero level in coding order (indicated by the transmitted x and y coordinates), a flag, coded_subblock_flag, is transmitted specifying whether the sub-block contains any non-zero transform coefficient levels. As an exception, coded_subblock_flag is not transmitted for sub-blocks containing DC coefficients; for these sub-blocks, coded_subblock_flag is inferred to be equal to 1.
[0135] Finally, for all sub-blocks with coded_subblock_flag equal to 1, and for the sub-block containing the first non-zero level in coding order, the value of the transform coefficient level is coded as described below.
[0136] A preferred embodiment for coding the transform coefficient levels of a sub-block is shown by the pseudo code in Figure 18, where firstScanIdSbb represents the first scan index within the sub-block. For the sub-block 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 the other transmitted sub-blocks, firstScanIdSbb specifies the first scan index within the sub-block. Scan index lastScanIdSbb specifies the last scan index within the sub-block.
[0137] Let level[k] and absLevel[k] = abs(level[k]) denote the transform coefficient level at scan position k and the absolute value of the transform coefficient level. The coding of the transform coefficient levels proceeds in four passes over the scan positions inside a sub-block.
[0138] In the first pass, the binary syntax elements sig_flag, par_flag, and gt1_flag are transmitted.
[0139] The binary syntax element sig_flag[k] specifies whether the absolute value of the transform 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., when any of the following conditions apply: The current scan index k is equal to the scan index of the first non-zero level (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 transmitted.
[0142] par_flag[k] specifies the parity of the transform coefficient level. In a preferred embodiment of the present invention, par_flag[k] is set equal to a parity of absolute value -1 (representing the reverse parity of the transform 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) where 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 transmitted. The binary syntax element gt2_flag[k] is coded only for those scan positions k for which gt1_flag[k] equal to 1 was transmitted 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 or not. gt2_flag[k]=(((absLevel[k]-1)>>1)>1?1:0)
[0145] In the third pass, the syntax element remainder is transmitted. The syntax element remainder[k] is coded only for those scan positions k for which gt2_flag[k] equal to 1 was transmitted 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 transmitted. The syntax element sign_flag[k] is coded only for those scan positions k for which a sig_flag[k] equal to 1 was transmitted or inferred in the first pass. sign_flag[k] specifies whether the transform coefficient level is negative or not. sign_flag[k]=(level[k]<0?1:0)
[0147] At 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 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 with coded_subblock_flag equal to 1, its value is inferred to be equal to 1.
[0148] Given the coding and inferred values, the absolute value of the transform 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] Also, given a sign_flag[k] for an absolute level not equal to 0, the transform coefficient level is given by: level[k]=(sign_flag[k]?-absLevel[k]:absLevel[k])
[0150] The particular embodiments described above may be modified, for example, in one or more of the following aspects.
[0151] · The coding of transform coefficient levels may not be based on sub-blocks. That is, instead of splitting the coding of transform coefficient levels into sub-blocks, all transform coefficient levels of a transform block may be coded at once. In this case, the passes described above represent passes over all scan positions inside a complete transform block. This approach may still be combined with the coding of coded_block_flag and an indication of the scan position of the first non-zero level in the coding order (e.g., by transmitting the x and y positions or by some other means). This approach may also be combined with an indication (similar to coded_block_flag) that specifies that all transform coefficient levels inside large regions are equal to 0. These regions may represent sub-blocks, consecutive scan positions, or any other well-defined subset of transform coefficient locations. The corresponding indication may be coded before the actual transform coefficient levels or may be coded interleaved with the bins of the first pass. The coding order of flags par_flag and gt1_flag may be changed. Note that these flags are not dependent on each other, 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 may be changed: instead of signaling absolute level-1 parity, absolute level parity may be transmitted (which is the same as absolute level-2 parity).
[0153] The meaning of gt1_flag can be changed. Instead of signaling whether (absLevel-1)>>1 is greater than 0 or not (see above), we can also signal whether (absLevel-1-par_flag) is greater than 0 or not. Or, if the meaning of par_flag is changed as shown above, gt1_flag can indicate whether (absLevel-1) is greater than 0 or not. In both cases, the reconstruction formula is changed to: absLevel[k]=sig_flag[k]+par_flag[k]+gt1_flag[k]+ 2*(gt2_flag[k]+remainder[k]) In addition, the meaning of gt2_flag and remainder will be changed 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 that case the flags are distributed differently over the passes and the reconstruction of the quantization indexes involves absQIdx = sig_flag + gt1_flag + par_flag + 2 * (gt3_flag + remainder), and the partial reconstruction possible 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 in such a way that only sig_flag and par_flag are transmitted in this path. The gt1_flag may be moved to the second path or may be transmitted in a separate path between the first and second paths described. Alternatively, an additional flag (eg, gt2_flag) may be coded as part of the first pass.
[0156] The second pass (with gt2_flag) may be omitted, in which case a pass with the syntax element remainder will be 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 transmitted at all. In the latter case, the meaning of the syntax element remainder is changed to: remainder[k]=((absLevel[k]-1)>>1)-1 In addition, the reconstruction formula has been changed to the following: absLevel[k] = sig_flag[k]+par_flag[k]+2*(gt1_flag[k]+remainder[k]) Or, 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 pass may include an additional flag, for example an additional gt3_flag with the following meaning: gt3_flag[k]=(((absLevel[k]-1)>>1)>2?1:0) may be transmitted. Or, as described above, the gt1_flag may be moved from the first path to the second path. This may also be combined with the gt3_flag.
[0158] It is also possible that the maximum number of gtx_flags to be transmitted for the current scan position is adaptively determined based on already coded data (e.g., based on a sum of absolute values in a local neighborhood, which may be derived based on already coded data).
[0159] One or more additional passes with normal coding bins may be coded between the second pass (with gt2_flag) and the third pass (syntax element remainder). For example, gt3_flag may be transmitted in the additional passes.
[0160] · The bypass coded bins of the syntax element remainder and the bypass coded sign_flag may be interleaved coded in a single pass.
[0161] Two or more of the above listed points may also be combined.
[0162] Having briefly summarized the above embodiments, further embodiments are described again below, and in doing so we will use the reference numbers pointing to the figures described above.
[0163] In particular, the above embodiments have described concepts for decoding a block (10) of transform coefficients 12, where the transform block 10 may or may not be subdivided into sub-blocks 14.
[0164] This decoding is performed in passes. In one or more first passes scanning the transform coefficients, the decoding of a significance flag for the current transform coefficient, indicating whether the quantization index of the transform coefficient is zero or not, and the decoding of a parity flag for the transform coefficient, indicating the parity of the transform coefficient, are performed. The pseudocode in the figure shows the decoding procedure in the same way by changing "coding" to "decoding", so that the tasks just mentioned are performed in 16 and 18, respectively. The tasks are included in one first pass 20 in FIG. 18, but according to alternatives, they may 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 transform coefficients, one or more greater-than flags are decoded 24 for transform coefficients with non-zero quantization indexes. In FIG. 18, there are two such passes 22′ and 22″. The greater-than flag pass or passes 22 need not be separate from the first pass or passes 20. In FIG. 18, gt1_flag decode 24′ is performed in pass 22′, which is simultaneously the first pass 20, and gt2_flag decode 24″ is performed in a separate pass 22″. FIG. 19 shows that the first pass or passes 20 and the second pass or passes 22 may coincide. Here, in FIG. 19, the decodes 16, 18 and 24 are performed in the same pass. In FIG. 19, there is one such pass exemplarily indicated by the braces indicating the significance / parity pass 20 and that pass serving as the greater-than 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 illustratively decoded, but this is merely an example.
[0166] In one or more third passes 26, 27, i.e. in the case of Figs. 18 and 19, two mutually separate passes that are separate to passes 20, 22, a decoding 28 of the remainder of the quantization indexes of the transform coefficients whose one or more greater-than flags are positive, such as indicated by being one of those coefficients whose greatness is confirmed / acknowledged, and a decoding 30 of the signs of the quantization indexes of the transform coefficients whose quantization index is not zero are performed. Tasks 28 and 30 are performed using equiprobability entropy decoding, which may be equiprobability binary arithmetic decoding. In particular, decoding 28 may involve using equiprobability binary arithmetic decoding of the binarization bins and the remainder of the binarization bins of the absolute values of the quantization indexes of the transform coefficients whose one or more greater-than flags are positive. The advantage of separating the paths in any of the above ways has been motivated above and will become apparent from the following description of possibilities in performing, for example, inverse quantization and / or context derivation, the details of which should not be considered as limiting the scope of the subsequent claims. The advantage is that it provides a basis for describing transform blocks that can be usefully coded using dependent quantization and context-adaptive entropy coding, such as context-adaptive binary arithmetic coding.
[0167] As shown in Fig. 18 and Fig. 19, in one first pass 20, for the currently scanned transform coefficient, a decoding 16 of a significance flag for the currently scanned transform coefficient may be performed using context adaptive entropy decoding, and then, if the significance flag, when checked at 32, indicates that the quantization index of the currently scanned transform coefficient is not zero, a decoding 18 of a parity flag for the currently scanned transform coefficient is performed using context adaptive entropy decoding for the currently scanned transform coefficient. 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 Fig. 18, and in the case of Fig. 19, one of the passes 22 at the same time, a decoding 24', 24'' of a greater-than flag for the currently scanned transform coefficient is performed using context adaptive entropy decoding for the currently scanned transform coefficient if the quantization index of the currently scanned transform coefficient is not zero, the situation of which is checked at 32. It should be noted that this first greater-than flag may have different definitions and may be gt1_flag or gt3_flag, as explained above. The decoding 18 in the case of Fig. 19, and even the decoding 24'' in the case of Figs. 18 and 19, is performed only if the greater-than flag gt1_flag for the currently scanned transform coefficient, the status of which is checked at 34, was positive. That is, for the currently scanned coefficient, the coding / decoding order of the flags is: significance flag, greater-than flag gt1_flag, parity flag, and greater-than flag gt2_flag in the case of Fig. 18, and greater-than flag gt3_flag in the case of Fig. 19.
[0168] As mentioned above, the calculation of the quantization index for a predetermined transform coefficient from the mentioned flags may, in the case of Figures 18 and 19, involve sums whose addends are formed by the following: one addend is formed by the significance flag of the predetermined transform coefficient, one addend is formed by the parity flag of the predetermined transform coefficient, and one addend is formed by twice the sum of the remainder of the predetermined transform coefficient and one greater than flag, namely gt2_flag in the case of Figure 18 and gt3_flag in the case of Figure 19.
[0169] In one of the one or more second passes 22, i.e. 22″ in FIG. 18 and 22 simultaneously being pass 20 in the case of FIG. 19, if for a currently scanned transform coefficient the previous greater-than flag of the currently scanned transform coefficient is positive, a decoding 24″ of a further greater-than flag for the currently scanned transform coefficient, i.e. gt2_flag in the case of FIG. 18 and gt3_flag in the case of FIG. 19, is performed using context-adaptive entropy decoding. In the case of FIG. 18, for a predetermined transform coefficient, the absolute value of the quantization index is calculated according to a sum, the addend of which is formed by one addend which is the significance flag of the predetermined transform coefficient, one addend which is the parity flag of the predetermined transform coefficient and one addend which is twice the sum of the remainder of the predetermined transform coefficient, the first greater-than flag and the second greater-than flag.However, if a different definition of the greater-than flag is used, such as, for example but not exclusively, according to FIG. 19 , then a significance flag is decoded 16 for the currently scanned transform coefficient using context adaptive entropy decoding, and then, if the significance flag, when checked at 32, indicates that the quantization index of the currently scanned transform coefficient is not zero, a greater-than flag gt1_flag is decoded 24′ for the currently scanned transform coefficient using context adaptive entropy decoding, and then, if the greater-than flag, when checked at 34, is positive, a greater-than flag is decoded 25′ for the currently scanned transform coefficient using context adaptive entropy decoding, and then, if the significance flag, when checked at 32, indicates that the quantization index of the currently scanned transform coefficient is not zero, a greater-than flag gt1_flag is decoded 26′ for the currently scanned transform coefficient using context adaptive entropy decoding, and then, if the greater-than flag, when checked at 34, is positive, a greater-than flag is decoded 27′ for the currently scanned transform coefficient using context adaptive entropy decoding, and then, if the greater-than flag, when checked at 34, is positive, a greater-than flag is decoded 28′ for the currently scanned transform coefficient using context adaptive entropy decoding, and then, if the greater-than flag, when checked at 34, is positive, a greater-than flag is decoded 29′ for the currently scanned transform coefficient using context adaptive entropy decoding, and then, if the greater-than flag, when checked at 34, is positive, a greater-than flag is decoded 30′ for the currently scanned transform coefficient using context adaptive entropy decoding, and then, if the greater-than flag, when checked at 34, is positive, a greater-than flag is decoded 31′ for the currently scanned transform coefficient using context adaptive entropy decoding, and then, if the greater-than flag, when checked at 34, is positive, a greater-than flag is decoded 32′ for the currently scanned transform coefficient using context Then, a parity flag decoding 18 and, for the currently scanned transform coefficient, a further greater than flag gt3_flag decoding 24'' for the currently scanned transform coefficient are performed using context-adaptive entropy decoding, where the absolute value of the quantization index for a predetermined transform coefficient, such as the current one, is calculated according to a sum, the addends of which are formed by one addend being the significance flag of the predetermined transform coefficient, one addend being the parity flag of the predetermined transform coefficient, one addend being the greater than flag gt1_flag of the predetermined transform coefficient, and one addend being twice the sum of the remainder of the predetermined transform coefficient and the further greater than flag gt3_flag. The decoding 24' and 24'' of the first and second greater than flags can be performed in separate second passes 22' and 22'', as shown in FIG. 18, or in one, as shown in FIG. 19.
[0170] As an alternative to FIG. 12, in one of one or more first passes, for the currently scanned transform coefficient, it is possible to decode 16 a significance flag for the currently scanned transform coefficient using context adaptive entropy decoding, and then, after one first pass, in one or more second passes, to decode 24', 24'' a sequence of two or more greater-than flags for the transform coefficient using context adaptive entropy decoding, and then, after one or more second passes, in a further one of the one or more first passes, to decode parity flags for transform coefficients with non-zero quantization indices using equal-probability entropy decoding.
[0171] As already mentioned above, the coding / decoding may be performed in sub-blocks, such that the transform coefficients are decoded sub-block by sub-block, where all passes over the scanning positions of a sub-block are decoded before the first pass of the next sub-block is decoded.
[0172] Each coefficient, whose binarization, i.e. all significance, parity and greater-than flags as well as the remainder and sign have been decoded, can be reconstructed by dequantizing the quantization index of each transform coefficient whose quantization index is not zero by selecting for each transform coefficient a set of reconstruction levels from among a number of sets of reconstruction levels, i.e. in the above example, the two "set 0" and "set 1" in Figs. 7 and 10. This is done by using the current state state by "setId[state]". Then, state is derived according to the parity of the quantization index of the transform coefficient preceding the respective transform coefficient along the scanning order, i.e. by updating the state used for the previously dequantized coefficient by the latter's parity, for example at 40 in Fig. 11. After the selection, dequantization of each transform coefficient is performed on one level of the selected set of reconstruction levels indexed by setId. This level is indexed by the quantization index of the respective transform coefficient. As explained, the selection of the set of reconstructed levels from among the reconstructed level sets for each transform coefficient is performed using state transitions based on the state that the state transitions assume for each transform coefficient, i.e., by uniquely selecting the correct set of reconstructed levels from among the multiple reconstructed level sets at 42 in FIG. 11 and updating the state of the state transitions for the following transform coefficients in the scan order at 40 depending on the parity of the quantization indexes of the respective transform coefficients. Thus, the scan order is here the same one used for passes 20, 22, 27, and 30. An example was given above. One is illustrated in FIG. 4 by arrow 44. Again, as with the decoding of coefficients by subblock, the subblock subdivision is optional, i.e., each pass does not perform all passes for one subblock before proceeding to the next, but may alternatively traverse a subblock in succession before the next pass is started. There may be four different states for the state transitions.The transitions may be implemented using a table such as shown in Table 1, into which a lookup is performed to yield the state for the subsequent coefficient, at 45, or using a trellis diagram such as shown in FIG. 12, where the state appears at 46, for example.
[0173] As explained above, the multiple reconstruction level sets may be parameterized by a predetermined quantization step size Δ, as shown in FIG. 7 and FIG. 10. Information about the predetermined quantization step size may be carried in the data stream. Each of the reconstruction level sets may consist of multiples of this predetermined quantization step size that are constant or equal among the multiple reconstruction level sets, as shown in FIG. 7 and FIG. 10, using a common horizontal axis t. The number of reconstruction level sets may be two, as shown in FIG. 7 and FIG. 10, and the first reconstruction level set may comprise zero and an even multiple of the predetermined quantization step size, such as set 0 in FIG. 7 and FIG. 10, and the second reconstruction level set may comprise zero and an odd multiple of the predetermined quantization step size, such as set 1 in FIG. 7 and FIG. 10. As shown in Table 1, the first reconstruction level set may be selected for state values 0 and 1, and the second reconstruction level set may be selected for state values 2 and 3.
[0174] It should be noted that if the above dependent quantization scheme is used, after decoding 18 of the parity of a coefficient, a state variable state defining the quantization set of the next coefficient may be defined or determined, and this state may be used to code the significance and parity flags of the next coefficient.
[0175] Next, we turn our attention to the context selection for performing the decoding 16, 18, and 24, and describe an advantageous context modeling concept.
[0176] In a preferred embodiment, an adaptive probability model used for a normal coding bin is selected among a set of multiple adaptive probability models. A probability model is also called a context, and the selection of a probability model is also called context modeling. In a preferred embodiment, the selected probability model depends on one or more of the following characteristics:
[0177] Color planes. Typically, luma and chroma transform coefficients have different statistical properties, and therefore coding efficiency can be increased if different sets of probability models are used for luma and chroma. It is also possible that a separate set of probability models is used for each color plane (e.g., Y, Cb, Cr).
[0178] The diagonal position, diag=x+y, given by the sum of the x and y coordinates inside the transform block. On average, the absolute value of the transform coefficients increases with decreasing diagonal position diag. For that reason, compression efficiency can be increased if the diagonal positions are typically partitioned into two or more classes and a separate set of probability models is used for each class.
[0179] · A state variable applied to the current transform coefficient. As mentioned above, the two quantizers Q0 and Q1 have different sets of allowable 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 transform coefficient level is not equal to 0). Therefore, compression efficiency can be increased if different sets of probability models are used for the two quantizers. As an extension of this concept, different sets of probability models can be used for different values of the state variable (which can take four possible values, i.e., 0, 1, 2, 3). Or, different sets of probability models can be used for different values of a defined function of the state variable. It should be noted that using different sets of probability models for two different quantizers represents a special case of the latter approach.
[0180] Dependence on state variables may not be suitable for all bins, since it would increase the total number of probability models and therefore slow down the probability adaptation. Therefore, different sets of probability models for different values of functions of state variables may be used only for a subset of the regular coding bins, e.g., only for sig_flag, or only for sig_flag and par_flag (or any other subset).
[0181] · Activity measures within a local neighborhood around the current scan position. Typically, the likelihood that the absolute value of the current transform coefficient exceeds some threshold increases with the activity within the local neighborhood, where activity refers, for example, to the sum of the absolute transform coefficient levels in the neighborhood. This aspect can be exploited to increase compression efficiency by using different probability measures for different local activity measures. Note, however, that since we code the absolute values in multiple passes, only those data that are available in a pass may be used.
[0182] In the following, we will describe in more detail an exemplary setup for context modeling (selection of a probabilistic model). This example refers to the coding order of the bins specified in Fig. 18. However, this concept is not limited to this particular example and can be easily transferred to the coding order modifications described above, such as the one referred to in Fig. 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 a different template, for example a template that includes more or fewer adjacent scan positions. Typically, it is preferred if the template used includes only the scan positions that precede the current scan position in the coding order 44.
[0184] Let T(k) denote the set of scan positions in the local template 52. Then let sumAbs be the sum of absolute values in the local template given by:
[0185]
number
[0186] Further, let numSig be the number of absolute levels in the local template that are greater than zero.
[0187]
number
[0188] Values of absLevel[i] and sig_flag[i] that reference locations outside the current transform block are inferred to be equal to 0.
[0189] The measure numSig may already be derived based on the value of sig_flag. However, the sum of absolute levels 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 information can be used for context modeling.
[0190] According to a preferred embodiment shown in the pseudocode of Figure 18, the bins sig_flag, par_flag, and gt1_flag are transmitted in the first path 20 / 22'. Based on these data for a certain transform coefficient level, we can conclude that:
[0191] If sig_flag is equal to 0, the transform coefficient level is equal to 0: level=0, If sig_flag is equal to 1, par_flag is equal to 0, and gt1_flag is equal to 0, the transform coefficient level is equal to 1: level=1, If sig_flag is equal to 1, par_flag is equal to 1, and gt1_flag is equal to 0, the transform coefficient level is equal to 2: level=2, If sig_flag is equal to 1, par_flag is equal to 0, and gt1_flag is equal to 1, the transform coefficient level is 3 or greater: level>=3, · If sig_flag is equal to 1, par_flag is equal to 1, and gt1_flag is equal to 1, the transform coefficient level is 4 or greater: level>=4.
[0192] Therefore, we can at least derive a minimum value for the absolute transform coefficient levels according to: minAbs1[k]=sig_flag[k]+par_flag[k]+2*gt1_flag[k]
[0193] In the second pass, we further know the value of gt2_flag and can therefore derive the minimum value: minAbs2[k]=sig_flag[k]+par_flag[k]+2*(gt1_flag[k]+gt2_flag[k])
[0194] The corresponding sums of the minimum absolute values are denoted by sumAbs1 and sumAbs2 and are given by:
[0195]
number
[0196] and
[0197]
number
[0198] The values of minAbs1[i] and minAbs2[i] that refer to locations outside the current transform block are inferred to be equal to 0.
[0199] In this context, it should be noted that the exact formula for calculating minAbs1[k] and minAbs2[k] (and, consequently, the final values for sumAbs1[k] and sumAbs2[k]) depends on which bins are included in the first pass, as well as the semantics (i.e., meaning) of these bins. For example, if gt2_flag[k] is included in the first pass, or if the meaning of gt1_flag[k] is changed (both alternatives are discussed above), the formula for calculating minAbs1[k] must be changed accordingly. For example, this minimum is minAbs1=sig_flag+gt1_flag+par_flag+2*(gt3_flag+remainder) during the first pass 20 / 22 in the case of FIG. 19. In either case, minAbs1[k] represents the minimum absolute level 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, may be used as local activity measures for context modeling. Detailed examples are described below.
[0201] In an alternative embodiment, the values sumAbs, minAbs1, and minAbs2 are not determined based on the transmitted transform coefficient levels, but rather based on associated multiplication coefficients (absolute values) for the quantization step sizes. These data may be derived based on the transform coefficient levels and the associated state variables. Given the absolute levels absLevel[k] and the associated state variables state[k], the multiplication coefficients for the quantization step sizes qIdx[k] may be determined according to: qIdx[k]=2*absLevel[k]-(state[k]>>1)
[0202] Similar values to replace minAbs1 and minAbs2 can be derived according to the following: minQIdx1[k]=2*minAbs1[k]-(state[k]>>1) minQIdx2[k]=2*minAbs2[k]-(state[k]>>1)
[0203] Given these values, replacement values sumQAbs, sumQAbs1, and sumQAbs2 to replace sumAbs, sumAbs1, and sumAbs2 may be derived according to the following:
[0204]
number
[0205] In the following description we use the values sumAbs, sumAbs1, and sumAbs2. However, note that these values can be replaced by the values sumQAbs, sumQAbs1, and sumQAbs2. When using the values sumQAbs, sumQAbs1, and sumQAbs2, it may be preferable to use a different function of these values in the context derivation.
[0206] Context modeling for significance flag sig_flag An adaptive probability model for coding the current sig_flag is selected among a set of probability models. For simplicity, we assume that the available probability models are organized in a four-dimensional array: probModelSig[cSig][sSig][dSig][aSig] where cSig specifies an index that depends on the current color channel, sSig specifies an index that depends on the state variables, dSig specifies an index that depends on the diagonal position (or more generally, the x and y location) inside the transform block, and aSig specifies an index that depends on the local activity measure. The actual organization of the probability model is an aspect of the actual implementation. The probability model may, for example, be organized as a 1-d array, in which case a combined index may be derived based on the values of cSig, sSig, dSig, and aSig.
[0207] In the following, we describe an exemplary method for deriving the indexes cSig, sSig, dSig, and aSig, however, it should be noted that different ways of deriving these indexes (or parts 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 a luma channel (or, more generally, the first color channel), and cSig is set equal to 1 if and only if the current color channel represents a chroma channel (or, more generally, is not the first color channel). cSig=(Is current channel luma? 0:1)
[0209] Alternatively, cSig may be set equal to 0 for the luma channel, 1 for the Cb channel, and 2 for the Cr channel.
[0210] State index sSig In a preferred embodiment, the index sSig is set equal to:
[0211]
number
[0212] That is, 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 probability 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 when state is equal to 0 or 1, quantizer Q0 is used, and when state is equal to 2 or 3, quantizer Q1 is used).
[0214] Location index dSig In a preferred embodiment, the index dSig is set as follows:
[0215] If the index cSig is equal to 0 (i.e. the current color channel represents the luma channel), then dSig is set according to:
[0216]
number
[0217] If the index cSig is equal to 1 (i.e. the current color channel represents a chroma channel), dSig is set according to:
[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 within the transform block.
[0220] Alternatively, any other clustering of diagonal positions is possible, or alternatively, the (x,y) locations within the transform block may be partitioned into multiple classes and the index dSig may be set equal to the corresponding class index.
[0221] Local Activity Index aSig Finally, in a preferred embodiment of the invention, the index aSig is set according to: aSig=min(5,sumAbs1) where sumAbs1 refers to the sum of the smallest absolute transform 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 of sumAbs1 may be used.
[0222] Context modeling for parity flag par_flag An adaptive probability model for coding the current par_flag is chosen among the set of probability models. Similarly, as in the case of the significance flag, we assume that the available probability models are organized in a four-dimensional array: probModelPar[cPar][sPar][dPar][aPar] where cPar specifies indices that depend on the current color channel, sPar specifies indices that depend on the state variables, dPar specifies indices that depend on the diagonal position (or more generally, the x and y location) within the transform block, and aPar specifies indices that depend on the local activity measure.
[0223] Color channel index cPar Similarly, as with the significance flag, in a preferred embodiment, the color channel index cSig is set according to: cPar = (Is current channel luma? 0:1) Alternatively, the alternatives discussed above for cSig may be used.
[0224] State index sPar In a preferred embodiment, the index sPar is set equal to 0, i.e. the chosen probabilistic model does not depend on the state variables. Alternatively, any 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 the index cPar is equal to 0 (i.e. the current color channel represents the luma channel), dPar is set according to:
[0226]
number
[0227] If the index cPar is equal to 1 (i.e. the current color channel represents the chroma channel), dPar is set according to:
[0228]
number
[0229] where 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 transform block. The Boolean variable firstNonZero specifies whether the current scan position represents the scan position of the first non-zero level in the coding order (i.e., the position identified by the x and y coordinates (or similar means) sent after the coded block flag). Thus, a different set of probability 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 transform block may be partitioned into multiple classes, and the index dPar may be set 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: aPar = min(4,sumAbs1-numSig) where sumAbs1 refers to the sum of the smallest absolute transform coefficient levels in the local template given by the data transmitted in the first pass (see above), and numSig refers to the number of non-zero levels (i.e., the number of sig_flag equal to 1) in the local template (see above). Alternatively, different maximum values or different functions of sumAbs1 and numSig may be used.
[0231] Context modeling for flag gt1_flag An adaptive probability model for coding the current gt1_flag is selected from the set of probability models. Similarly, as in the case of the significance flag, we assume that the available probability models are organized in a four-dimensional array: probModelGt1[cGt1][sGt1][dGt1][aGt1] where cGt1 specifies an index that depends on the current color channel, sGt1 specifies an index that depends on the state variables, dGt1 specifies an index that depends on the diagonal position (or more generally, the x and y location) within the transform block, and aGt1 specifies an index that depends on the local activity measure.
[0232] In a preferred embodiment of the present invention, the indexes cGt1, sGt1, dGt1, and aGt1 are derived in a similar manner as the indexes cPar, sPar, dPar, aPar described above. cGt1=cPar sGt1=sPar dGt1=dPar aGt1=aPar
[0233] Note that using the same context index is different from using the same probability model: the derivation of the context model index is the same for gt1_flag and par_flag, but the sets of probability models are disjoint, i.e., one set of probability models is used for par_flag and another set of probability models is used for gt1_flag.
[0234] Note that the context selection for gt1_flag does not depend on the value of the par_flag that immediately precedes it.
[0235] Alternatively, the indexes cGt1, sGt1, dGt1, and aGt1 may be derived by any of the methods described above with respect to the significance flags.
[0236] Furthermore, the selected probability model can additionally depend on the value of the directly preceding parity flag par_flag, so that a different set of probability models is used for each of the two parity values. However, this would introduce a direct dependency between par_flag and gt1_flag.
[0237] Context modeling for flag gt2_flag An adaptive probability model for coding the current gt2_flag is selected from the set of probability models. Similarly, as in the case of the significance flag, we assume that the available probability models are organized in a four-dimensional array: probModelGt2[cGt2][sGt2][dGt2][aGt2] where cGt2 specifies an index that depends on the current color channel, sGt2 specifies an index that depends on the state variables, dGt2 specifies an index that depends on the diagonal position (or more generally, the x and y location) within the transform block, and aGt2 specifies an index that depends on a local activity measure.
[0238] In a preferred embodiment, the indexes cGt2, sGt2, dGt2, and aGt2 are derived in a similar manner to the indexes cGt1, sGt1, dGt1, aGt1 described above. cGt2=cGt1 sGt2=sGt1 dGt2=dGt1 aGt2=aGt1
[0239] Similarly, as in the case of gt1_flag, note that in general, different sets of probability models are used for gt1_flag and gt2_flag (even though the context index is the same for coding gt1_flag and gt2_flag). However, as a special case, it is also possible to use exactly the same probability model for these two flags.
[0240] Alternatively, the indexes cGt2, sGt2, dGt2, and aGt2 may be derived by any of the methods described with respect to the flags above.
[0241] Furthermore, additional information of 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 according to: aGt2=min(4,sumAbs2-numSig) where sumAbs2 refers to the sum of the smallest absolute transform 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] Now, referring to the description of Figures 18 and 19, this means, in other words, that: As explained, the decoding 16 of the significance flag for the predetermined transform coefficient may involve selecting a context for performing the decoding 16 depending on the coefficient position of the predetermined transform coefficient inside the transform block. This position is indexed by the parameter k in Figures 18 and 19. Additionally or alternatively, the significance flag for the predetermined transform coefficient 50 as shown above with respect to Figure 16 is decoded by determining a local activity based on a set of flags decoded before the significance flag of the predetermined transform coefficient for a set of neighboring transform coefficients 51 in a local template 52 located around or at the position of the predetermined transform coefficient 50, and selecting a context depending on the local activity. As done in Figures 18 and 19, for example, one of the significance flag, the parity flag, and one or more greater-than flags, or as in the case of Figure 19, all the greater-than flags may be coded / decoded in one pass, such that the set of flags decoded for a coefficient 51 in the template 52 comprises these flags as decoded for the set of neighboring transform coefficients 51 in the template 52, and the activity may be calculated based on a sum with an addend for each of the neighboring transform coefficients 51, the addend indicating a minimum assumed index or a minimum assumed reconstruction level for each neighboring transform coefficient 51 determined based on the above flags previously decoded for each neighboring transform coefficient. The minimum assumed value means a minimum threshold value for a quantization index or reconstruction level that each neighboring coefficient assumes the minimum based on an analysis of the previous flags derived for each neighboring coefficient 51. The minimum value may be defined in an absolute sense.In the case of FIG. 19, for example, this minimum value may 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. Since gt1_flag is zero for coefficient 51, whose previously coded / decoded flag set excludes some flags, such as par_flag and gt3_flag, then the respective flags have a default value of zero. The significance flag for a pre-determined transform coefficient may additionally or alternatively be coded / decoded using a context, which is selected depending on the state 46 that the state transition assumes for this pre-determined transform coefficient. For example, one context set may be defined and selected for states 0 and 1, another for state 2, and a third for state 3. Within the selected context set, the selection of the last used context may then be performed using any of the dependencies mentioned above, such as depending on local activity. Instead of a state, the currently chosen reconstruction set, e.g., setId, may be used.
[0244] For the parity flag, context selectivity may be designed similarly. That is, the parity flag for a predetermined transform coefficient may be coded / decoded using a context selected according to one or more of: 1) the coefficient position of the predetermined transform coefficient; 2) a local activity based on a set of flags coded / decoded before the parity flag of the predetermined transform coefficient for a set of adjacent transform coefficients 51 in a local template 52 around the predetermined transform coefficient 50; 3) a number of transform coefficients 51 in a local template 52 around the predetermined transform coefficient whose reconstruction level is not zero; or 4) a difference between the local activity and the number of transform coefficients.
[0245] For the greater-than flag, such as any of gt1_flag, gt2_flag, and gt3_flag, context selectivity may be designed similarly. That is, the greater-than flag may be coded / decoded using a context selected for a predetermined transform coefficient according to one or more of: 1) a coefficient position of the predetermined transform coefficient; 2) a local activity determined based on a set of flags coded / decoded before a first greater-than flag of the predetermined transform coefficient for a set of neighboring transform coefficients 51 in the local template 52 around or located at the predetermined transform coefficient; 3) a number of transform coefficients in the local template 52 whose reconstruction level is not zero; and / or 4) a difference between the local activity and the number of transform coefficients.
[0246] For the remaining binarization the following advantageous concept can be used.
[0247] In a preferred embodiment, the syntax element remainder is coded in the bypass mode of the arithmetic coding engine (see above). The compression efficiency depends on the binarization used. In HEVC, similar syntax elements are coded using a class of binarization codes called Golomb-Rice codes. This class of codes is parameterized by the so-called Rice parameters. In HEVC, the 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 entirely similar class) of Golomb-Rice codes is used to binarize the syntax element remainder as in HEVC. In contrast to HEVC, the level information of remainder is divided by 2, so the derivation of the Rice parameters has to be changed.
[0249] In a preferred arrangement, the Rice parameter is derived using the absolute sum of the adjacent levels covered by the local template, sumAbs (see above). In a particularly preferred embodiment, the Rice parameter RP is derived according to:
[0250]
number
[0251] In other configurations, the threshold for switching the Rice parameter may be changed, or the Rice parameter may be derived based on other activity measures of the local template. Moreover, it may be additionally specified that the Rice parameter is not allowed to become smaller within a sub-block.
[0252] Alternatively, the Rice parameters may be changed in a similar manner as in HEVC, i.e., the Rice parameter selection may be performed at remainder decoding 28.
[0253] For example, in the embodiment of FIG. 18 described above, the parity syntax element is transmitted immediately after the significance information. In this configuration, there is only a direct bin-to-bin dependency between the significance and the parity information. After coding / decoding the parity information, the 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′, the gt2_flag is transmitted in the second scan pass 22″. Finally, the remainder is transmitted in the scan path 26. This design minimizes the direct bin-to-bin dependency on 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. The context modeling for the parity flag is exactly the same as for the gt1 and gt2 flags, which results in less logic and therefore less complexity.
[0254] In an alternative embodiment, the parity information is transmitted first before the absolute level information, as shown in the pseudocode of FIG. 20. Here, the parity flag is transmitted on path 20′ before transmitting the significance flag on path 20″, then the first greater-than flag on path 22′ followed by the second greater-than flag on path 22″. The significance flag is only needed 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 on the first path, the values of the state variables, and therefore the quantizers to be used for the individual transform coefficients, are known.
[0255] The number of paths between the path with sig_flag and the path with bypass coding remainder may be chosen to be equal to zero, such as in Figure 19, or to any value greater than zero. Additionally, multiple flags may be transmitted within a path.
[0256] Further modifications of the above description relate to the following: The probability model selected for the parity flag par_flag may depend on one or more of the following parameters:
[0257] Color channels, State variables, Parity flags in the local template around the current scan position, · Scanning position (e.g., by clustering diagonal positions).
[0258] The context modeling for the syntax elements following the parity may be conditional on the parity information, such that a different set of context models is employed depending on the parity. In addition, the 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 is increased, for example, to 6 (then the last context coding syntax element is GT5). Then, since the conditional probabilities are approximately equiprobable, parity information is transmitted in bypass mode. This configuration has the benefit that the compression efficiency of a design in which complete information is transmitted for each scan position can be achieved.
[0260] Regarding entropy coding when independent scalar quantization is used, the following is said.
[0261] Although the entropy coding described above is particularly advantageous for transform coding with dependent quantization, it can also be advantageously applied to transform coding with conventional independent quantization. The only aspect that needs to be changed is the derivation of the state variables. In fact, in the case of conventional independent quantization, the state variables can always be set equal to 0. It should be noted that the quantizer Q0 represents a conventional uniform reconstruction quantizer.
[0262] An alternative to conventional scalar quantization can also be achieved by modifying the state transition table to the following: 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 above), the same implementation can be used for dependent and independent scalar quantization. The quantization method used can be configured by the 16-bit value representing the state transition table. Therefore, the described method for entropy coding 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 transform coefficients, the apparatus being configured to: a) in one or more first passes scanning the transform coefficients, use context-adaptive binary arithmetic decoding to decode a significance flag for the transform coefficient indicating whether a quantization index of the transform coefficient is zero, a parity flag for the transform coefficient indicating parity of the transform coefficient, and one or more greater-than flags for transform coefficients whose quantization index is non-zero; and b) in one or more second passes, use equiprobable binary arithmetic decoding to decode remaining binarized bins of absolute values of quantization indexes of transform coefficients whose one or more greater-than flags are positive and signs of the quantization indexes of transform coefficients whose quantization index is non-zero.
[0266] 2. The apparatus of embodiment 1, configured to, in one first pass, decode a significance flag for the currently scanned transform coefficient using context-adaptive binary arithmetic decoding, and, if the significance flag indicates that the quantization index of the currently scanned transform coefficient is not zero, decode a parity flag for the currently scanned transform coefficient using context-adaptive binary arithmetic decoding, for the currently scanned transform coefficient.
[0267] 3. The apparatus of embodiment 1 or 2, configured to, in one or more first passes, for a currently scanned transform coefficient, decode a first greater-than flag for the currently scanned transform coefficient using context-adaptive binary arithmetic decoding if the quantization index of the currently scanned transform coefficient is not zero.
[0268] 4. The apparatus of embodiment 3, configured to calculate, for a predetermined transform coefficient, an absolute value of a quantization index according to a sum, the summand being formed by twice the sum of a significance flag of the predetermined transform coefficient, a parity flag of the predetermined transform coefficient, a remainder of the predetermined transform coefficient, and a first greater than flag.
[0269] 5. The apparatus of embodiment 3, configured to, in one or more second passes, decode, for a currently scanned transform coefficient, a second greater-than flag for the currently scanned transform coefficient using context-adaptive binary arithmetic decoding if the first greater-than flag for the currently scanned transform coefficient is positive.
[0270] 6. The apparatus of embodiment 5, configured to calculate, for a predetermined transform coefficient, an absolute value of a quantization index according to a sum, the summand being formed by twice the sum of a significance flag of the predetermined transform coefficient, a parity flag of the predetermined transform coefficient, a first greater than flag of the predetermined transform coefficient, a remainder of the predetermined transform coefficient, and a second greater than flag.
[0271] 7. The apparatus of any of embodiments 1 to 6, configured to perform each of the one or more second passes after each of the one or more first passes.
[0272] 8. The apparatus of any of the preceding embodiments, wherein the transform coefficients of a transform block are partitioned into sub-blocks, the transform coefficients are decoded sub-block by sub-block, and all passes over a scanning position of a sub-block are decoded before the first pass of the next sub-block is decoded.
[0273] 9. The apparatus of any of embodiments 1 to 8, configured to inverse quantize a quantization index of each transform coefficient having a non-zero quantization index, the inverse quantization being performed by selecting, for each transform coefficient, a set of reconstruction levels from among a plurality of reconstruction level sets according to the parity of the quantization index of a transform coefficient preceding the respective transform coefficient along the scanning order, and inverse quantizing each transform coefficient onto one level of the set of reconstruction levels indexed by the quantization index of the respective transform coefficient.
[0274] 10. The apparatus of embodiment 9, configured to perform the selection of a set of reconstruction levels from among a plurality of reconstruction level sets for each transform coefficient using state transitions, the selection being performed by uniquely selecting a set of reconstruction levels from among the plurality of reconstruction level sets based on a state that the state transition assumes for each transform coefficient, by updating a state of the state transition for a subsequent transform coefficient in the scanning order according to the parity of a quantization index of the respective transform coefficient.
[0275] 11. The apparatus of embodiment 10, configured to perform one or more first passes and / or one or more second passes through the scan order.
[0276] 12. The apparatus of embodiment 10 or 11, configured to perform state transitions between four different states.
[0277] 13. The apparatus of any of embodiments 9 to 12, configured to parameterize a plurality of reconstruction level sets by a predetermined quantization step size, and to derive information about the predetermined quantization step size from the data stream.
[0278] 14. The apparatus of any of embodiments 9 to 13, wherein each of the plurality of reconstructed level sets comprises an integer multiple of a predetermined quantization step size that is constant for the plurality of reconstructed level sets.
[0279] 15. The apparatus of any of embodiments 9 to 14, wherein the number of reconstructed level sets among the plurality of reconstructed level sets is two, and the plurality of reconstructed level sets comprises a first reconstructed level set comprising zero and an even multiple of a predetermined quantization step size, and a second reconstructed level set comprising zero and an odd multiple of a predetermined quantization step size.
[0280] 16. The apparatus of embodiment 15, configured to select a first reconstructed level set for state values 0 and 1, and to select a second reconstructed level set for state values 2 and 3.
[0281] 17. The apparatus of any of embodiments 1 to 16, configured to decode a significance flag for a predetermined transform coefficient using context-adaptive binary arithmetic decoding, the decoding being by selecting a context according to a coefficient position of the predetermined transform coefficient within a transform block.
[0282] 18. The apparatus of any of embodiments 1 to 17, configured to decode a significance flag for a predetermined transform coefficient using context-adaptive binary arithmetic decoding, the decoding being by determining a local activity based on a set of flags decoded prior to the significance flag of the predetermined transform coefficient for a set of adjacent transform coefficients in a local template around the predetermined transform coefficient, and selecting a context in response to the local activity.
[0283] 19. The apparatus of embodiment 18, configured to: decode a significance flag, a parity flag, and one or more greater-than flags in one first pass, such that a set of flags comprises a significance flag, a parity flag, and one or more greater-than flags decoded for a set of adjacent transform coefficients; and calculate a local activity based on a sum over an addend for each of the adjacent transform coefficients, such that the addend indicates a minimum assumed index for the adjacent transform coefficient or a minimum assumed reconstruction level determined based on the significance flag, parity flag, and one or more greater-than flags decoded for the adjacent transform coefficients.
[0284] 20. The apparatus of any of embodiments 1 to 19, configured to: a) perform a selection of a set of reconstruction levels from among a plurality of reconstruction level sets for each transform coefficient using state transitions, where the selection uniquely selects a set of reconstruction levels from among the plurality of reconstruction level sets based on a state that the state transition assumes for the respective transform coefficient, and updates a state of the state transition for a subsequent transform coefficient in a scanning order according to a parity of a quantization index of the respective transform coefficient; b) perform one or more first passes along the scanning order; and c) decode a significance flag for a predetermined transform coefficient using context-adaptive binary arithmetic decoding, where the decoding selects a context according to a state that the state transition assumes for the predetermined transform coefficient (50).
[0285] 21. The apparatus of embodiment 20, configured to select a context set comprising a context according to a state, and decode a significance flag for a predetermined transform coefficient using context-adaptive entropy decoding by selecting a context from the context set according to local activity around the predetermined transform coefficient or a coefficient position of the predetermined transform 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. The apparatus of any of embodiments 1 to 22, configured to: a) inverse quantize a quantization index of each transform coefficient having a non-zero quantization index, where the inverse quantization is by selecting, for each transform coefficient, a set of reconstruction levels from among a plurality of reconstruction level sets according to a parity of a quantization index of a transform coefficient preceding the respective transform coefficient along a scanning order, and inverse quantizing each transform coefficient onto one level of the set of reconstruction levels indexed by the quantization index of the respective transform coefficient; b) perform one or more first passes along the scanning order; and c) decode a significance flag for a predetermined transform coefficient using context-adaptive binary arithmetic decoding, where the decoding is by selecting a context according to the set of reconstruction levels selected for the predetermined transform coefficient.
[0288] 24. The apparatus of any one of embodiments 1 to 23, configured to decode a parity flag for a predetermined transform coefficient using context-adaptive binary arithmetic decoding, the decoding being by selecting a context according to a coefficient position of the predetermined transform coefficient within a transform block.
[0289] 25. The apparatus of any of embodiments 1 to 24, configured to decode a parity flag for a predetermined transform coefficient using context-adaptive binary arithmetic decoding, the decoding being based on a set of flags decoded prior to the parity flag of the predetermined transform coefficient for a set of adjacent transform coefficients in a local template surrounding the predetermined transform coefficient, determining a local activity and / or a number of transform coefficients in a local template surrounding the predetermined transform coefficient whose reconstruction level is non-zero, and selecting a context depending on the local activity and / or the number of transform coefficients.
[0290] 26. The apparatus of embodiment 25, configured to select a context depending on a difference between a local activity and a number of transform coefficients.
[0291] 27. The apparatus of embodiment 25 or 26, configured to: decode a significance flag, a parity flag, and one or more greater-than flags in one first pass, such that a set of flags comprises a significance flag, a parity flag, and one or more greater-than flags decoded for a set of adjacent transform coefficients; and calculate an activity based on a sum over an addend for each of the adjacent transform coefficients, such that the addend indicates a minimum assumed index for the adjacent transform coefficient or a minimum assumed reconstruction level determined based on the significance flag, parity flag, and one or more greater-than flags decoded for the adjacent transform coefficients.
[0292] 28. The apparatus of any of embodiments 1 to 27, configured to decode a first of one or more greater-than flags for a predetermined transform coefficient using context-adaptive binary arithmetic decoding, the decoding being by selecting a context depending on a coefficient position of the predetermined transform coefficient within a transform block.
[0293] 29. The apparatus of any of embodiments 1 to 28, configured to decode a first greater-than flag for a predetermined transform coefficient using context-adaptive binary arithmetic decoding, the decoding being by determining a local activity based on a set of flags decoded prior to the first greater-than flag of the predetermined transform coefficient for a set of adjacent transform coefficients in a local template surrounding the predetermined transform coefficient and / or a number of transform coefficients in a local template surrounding the predetermined transform coefficient whose reconstruction level is non-zero, and selecting a context depending on the local activity and / or the number of transform coefficients.
[0294] 30. The apparatus of embodiment 29, configured to select a context depending on a difference between a local activity and a number of transform coefficients within a transform block.
[0295] 31. The apparatus of embodiment 29 or 30, configured to: decode a significance flag, a parity flag, and one or more greater-than flags in one first pass, such that a set of flags comprises a significance flag, a parity flag, and one or more greater-than flags decoded for a set of adjacent transform coefficients; and calculate an activity based on a sum over an addend for each of the adjacent transform coefficients, such that the addend indicates a minimum assumed index for the adjacent transform coefficient or a minimum assumed reconstruction level determined based on the significance flag, parity flag, and one or more greater-than flags decoded for the adjacent transform coefficients.
[0296] 32. The apparatus of any of embodiments 1 to 31, configured to decode a remainder for a predetermined transform coefficient using a Golomb-Rice code and using a Rice parameter that depends on a sum over an addend for each from among a set of neighboring transform coefficients in a local template around the predetermined transform coefficient, where the addend depends on a quantization index or reconstruction level for each neighboring transform coefficient.
[0297] 33. An apparatus for encoding a block of transform coefficients configured to: a) in one or more first passes scanning the transform coefficients, use context-adaptive binary arithmetic encoding to encode a significance flag (e.g., sig_flag[k]) for a current transform coefficient indicating whether a quantization index (e.g., level[k]) of the current transform coefficient is zero, a parity flag (e.g., par_flag[k]) for the transform coefficient indicating parity of the transform coefficient, and one or more greater-than flags (e.g., gt#_flag[k]) for transform coefficients whose quantization index is non-zero; and b) in one or more third passes, use equiprobability binary arithmetic encoding to encode remainders of quantization indexes (e.g., remainder[k]) of transform coefficients whose one or more greater-than flags are positive and signs of quantization indexes (e.g., sign[k]) of transform coefficients whose quantization index is non-zero.
[0298] 34. The apparatus of embodiment 33, configured to, in one first pass, for a currently scanned transform coefficient, a) encode a significance flag for the currently scanned transform coefficient using context-adaptive binary arithmetic coding, and b) if the significance flag indicates that the quantization index of the currently scanned transform coefficient is not zero, encode a parity flag for the currently scanned transform coefficient using context-adaptive binary arithmetic coding.
[0299] 35. The apparatus of embodiment 33 or 34, configured to, in one or more second passes, for a currently scanned transform coefficient, encode a first greater-than flag for the currently scanned transform coefficient using context-adaptive binary arithmetic coding if the quantization index of the currently scanned transform coefficient is not zero.
[0300] 36. The apparatus of embodiment 35, configured such that for a predetermined transform coefficient, a quantization index is obtainable according to a sum, the summand being formed by twice the sum of a significance flag of the predetermined transform coefficient, a parity flag of the predetermined transform coefficient, a remainder of the predetermined transform coefficient, and a first greater than flag.
[0301] 37. The apparatus of embodiment 36, configured to, in one or more second passes, for a currently scanned transform coefficient, encode a second greater-than flag for the currently scanned transform coefficient using context-adaptive binary arithmetic coding if the first greater-than flag for the currently scanned transform coefficient is positive.
[0302] 38. The apparatus of embodiment 37, wherein for a predetermined transform coefficient, a quantization index is obtainable according to a sum, the addend of which is formed by twice the sum of a significance flag of the predetermined transform coefficient, a parity flag of the predetermined transform coefficient, a first greater than flag of the predetermined transform coefficient, a remainder of the predetermined transform coefficient, and a second greater than flag.
[0303] 39. The apparatus of any of embodiments 33 to 38, configured to perform each of the one or more second passes after each of the one or more first passes.
[0304] 40. The apparatus of any of the preceding embodiments, wherein transform coefficients of a transform block are partitioned into sub-blocks, the transform coefficients are coded on a sub-block basis, and every pass over a scanning position of a sub-block is coded before the first pass of the next sub-block is coded.
[0305] 41. The apparatus of any of embodiments 33 to 40, configured to quantize a quantization index of each transform coefficient having a non-zero quantization index, the quantization being by selecting, for each transform coefficient, a set of reconstruction levels from among a plurality of reconstruction level sets according to the parity of the quantization index of a transform coefficient preceding the respective transform coefficient along the scanning order, and quantizing each transform coefficient onto one level of the set of reconstruction levels indexed by the quantization index of the respective transform coefficient.
[0306] 42. The apparatus of embodiment 41, configured to perform the selection of a set of reconstruction levels from among a plurality of reconstruction level sets for each transform coefficient using state transitions, the selection being performed by uniquely selecting a set of reconstruction levels from among the plurality of reconstruction level sets based on a state that the state transition assumes for each transform coefficient, by updating a state of the state transition for a subsequent transform coefficient in the scanning order according to the parity of the quantization index of the respective transform coefficient.
[0307] 43. The apparatus of embodiment 42, configured to perform one or more first passes and one or more second passes along the scan order.
[0308] 44. The apparatus of embodiment 42 or 43, configured to perform state transitions between four different states.
[0309] 45. The apparatus of any of embodiments 40 to 43, configured to parameterize a plurality of reconstruction level sets by a predetermined quantization step size, and to derive information about the predetermined quantization step size from the data stream.
[0310] 46. The apparatus of any of embodiments 40 to 45, wherein each of the multiple reconstructed level sets comprises a multiple of a predetermined quantization step size that is constant for the multiple reconstructed level sets.
[0311] 47. The apparatus of any of embodiments 40 to 46, wherein the number of reconstructed level sets among the plurality of reconstructed level sets is two, and the plurality of reconstructed level sets comprises a first reconstructed level set comprising zero and an even multiple of a predetermined quantization step size, and a second reconstructed level set comprising zero and an odd multiple of a predetermined quantization step size.
[0312] 48. The apparatus of embodiment 47, configured to select a first reconstructed level set for state values 0 and 1, and to select a second reconstructed level set for state values 2 and 3.
[0313] 49. The apparatus of any of embodiments 33 to 48, configured to encode a significance flag for a predetermined transform coefficient using context-adaptive binary arithmetic coding, the encoding being by selecting a context depending on a coefficient position of the predetermined transform coefficient within a transform block.
[0314] 50. The apparatus of any of embodiments 33 to 49, configured to encode a significance flag for a predetermined transform coefficient using context-adaptive binary arithmetic coding, the encoding being by determining a local activity based on a set of flags encoded prior to the significance flag of the predetermined transform coefficient for a set of adjacent transform coefficients in a local template surrounding the predetermined transform coefficient, and selecting a context in response to the local activity.
[0315] 51. The apparatus of embodiment 50, configured to: encode a significance flag, a parity flag, and one or more greater-than flags in one first pass, such that a set of flags comprises a significance flag, a parity flag, and one or more greater-than flags encoded for a set of adjacent transform coefficients; and calculate a local activity based on a sum over addends for each of the adjacent transform coefficients, such that the addends indicate a minimum assumed index for the adjacent transform coefficient or a minimum assumed reconstruction level determined based on the significance flag, parity flag, and one or more greater-than flags encoded for the adjacent transform coefficients.
[0316] 52. The apparatus of any of embodiments 33 to 51, configured to: a) perform a selection of a set of reconstruction levels from among a plurality of reconstruction level sets for each transform coefficient using state transitions, where the selection uniquely selects a set of reconstruction levels from among the plurality of reconstruction level sets based on a state that the state transition assumes for the respective transform coefficient, by updating a state of the state transition for a subsequent transform coefficient in the scanning order according to the parity of a quantization index of the respective transform coefficient; b) perform one or more first passes along the scanning order; and c) encode a significance flag for a predetermined transform coefficient using context-adaptive binary arithmetic coding, where the encoding selects a context according to a state that the state transition assumes for the predetermined transform coefficient (50).
[0317] 53. The apparatus of embodiment 52, configured to: select a context set comprising a context in response to a state; and encode a significance flag for a predetermined transform coefficient using context-adaptive entropy coding by selecting a context from the context set in response to local activity around the predetermined transform coefficient or a coefficient position of the predetermined transform coefficient.
[0318] 54. The 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. The apparatus of any of embodiments 33 to 54, configured to: a) quantize a quantization index of each transform coefficient having a non-zero quantization index, where the quantization is by selecting, for each transform coefficient, a set of reconstruction levels from among a plurality of reconstruction level sets in accordance with the parity of the quantization index of a transform coefficient preceding the respective transform coefficient along the scanning order, and quantizing each transform coefficient onto one level of the set of reconstruction levels indexed by the quantization index of the respective transform coefficient; b) perform one or more first passes along the scanning order; and c) encode a significance flag for the predetermined transform coefficient using context-adaptive binary arithmetic coding, where the encoding is by selecting a context in accordance with the set of reconstruction levels selected for the predetermined transform coefficient (50).
[0320] 56. The apparatus of any of embodiments 33 to 55, configured to encode a parity flag for a predetermined transform coefficient using context-adaptive binary arithmetic coding, the encoding being by selecting a context depending on a coefficient position of the predetermined transform coefficient within a transform block.
[0321] 57. The apparatus of any of embodiments 33 to 56, configured to encode a parity flag for a predetermined transform coefficient using context-adaptive binary arithmetic coding, the encoding being based on a set of flags coded prior to the parity flag of the predetermined transform coefficient for a set of adjacent transform coefficients in a local template surrounding the predetermined transform coefficient, determining a local activity and / or a number of transform coefficients in a local template surrounding the predetermined transform coefficient whose reconstruction level is non-zero, and selecting a context depending on the local activity and / or the number of transform coefficients.
[0322] 58. The apparatus of embodiment 57, configured to select a context depending on a difference between a local activity and a number of transform coefficients.
[0323] 59. The apparatus of embodiment 57 or 58, configured to: encode a significance flag, a parity flag, and one or more greater-than flags in one first pass, such that a set of flags comprises a significance flag, a parity flag, and one or more greater-than flags encoded for a set of adjacent transform coefficients; and calculate an activity based on a sum over addends for each of the adjacent transform coefficients, such that the addends indicate a minimum assumed index for the adjacent transform coefficients or a minimum assumed reconstruction level determined based on the significance flag, parity flag, and one or more greater-than flags encoded for the adjacent transform coefficients.
[0324] 60. The apparatus of any of embodiments 33 to 59, configured to encode a first of one or more greater-than flags for a predetermined transform coefficient using context-adaptive binary arithmetic coding, the encoding being by selecting a context depending on a coefficient position of the predetermined transform coefficient within a transform block.
[0325] 61. The apparatus of any of embodiments 33 to 60, configured to: encode a first greater-than flag for a predetermined transform coefficient using context-adaptive binary arithmetic coding, the encoding being by determining a local activity based on a set of flags coded before the first greater-than flag of the predetermined transform coefficient for a set of adjacent transform coefficients in a local template around the predetermined transform coefficient and / or a number of transform coefficients in a local template around the predetermined transform coefficient whose reconstruction level is not zero, and selecting a context depending on the local activity and / or the number of transform coefficients.
[0326] 62. The apparatus of embodiment 61, configured to select a context depending on a difference between a local activity and a number of transform coefficients.
[0327] 63. The apparatus of embodiment 61 or 62, configured to sequentially code a significance flag, a parity flag, and one or more greater-than flags in one first pass, such that a set of flags comprises a significance flag, a parity flag, and one or more greater-than flags coded for a set of adjacent transform coefficients, and to calculate an activity based on a sum over addends for each of the adjacent transform coefficients, such that the addends indicate a minimum assumed index for the adjacent transform coefficients or a minimum assumed reconstruction level determined based on the significance flag, parity flag, and one or more greater-than flags coded for the adjacent transform coefficients.
[0328] 64. The apparatus of any of embodiments 33 to 63, configured to encode a remainder for a predetermined transform coefficient using a Golomb-Rice code and using a Rice parameter that depends on a sum over an addend for each from among a set of neighboring transform coefficients in a local template around the predetermined transform coefficient, where the addend depends on a quantization index or reconstruction level for each neighboring transform 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 executing the 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] Although some aspects have been described in the context of an apparatus, it will be clear that these aspects also represent a description of a corresponding method, where a block or device corresponds to a method step, or a feature of a method step. Similarly, aspects described in the context of a method step also represent a description of a corresponding block, or item, or feature of a corresponding apparatus. Some or all of the method steps may be performed by (or using) a hardware apparatus, such as, for example, 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 an apparatus.
[0333] The encoded data stream of the present invention may be stored on a digital storage medium or transmitted over a transmission medium, such as a wireless or wired transmission medium, such as the Internet.
[0334] Depending on certain implementation requirements, embodiments of the present invention may be implemented in hardware or in software. The implementation may be performed 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 cooperates (or is capable of cooperating) with a programmable computer system such that the respective method is performed. Thus, the digital storage medium may be computer readable.
[0335] Some embodiments according to the invention comprise a data carrier having electronically readable control signals capable of cooperating with a programmable computer system such 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 operable to perform one of the methods when the computer program product runs on a computer. The program code may, for example, be stored on a machine readable carrier.
[0337] Other embodiments comprise the computer program for performing one of the methods described herein, stored on a machine readable carrier.
[0338] In other words, an embodiment of the inventive method is, therefore, a computer program having a program code for performing one of the methods described herein, when the computer program runs on a computer.
[0339] A further embodiment of the inventive method is therefore a data carrier (or digital storage medium, or computer readable medium) comprising recorded thereon a computer program for performing one of the methods described herein. The data carrier, digital storage medium, or recorded medium is typically tangible and / or non-transitory.
[0340] A further embodiment of the inventive method is therefore a data stream or a sequence of signals representing the computer program for performing one of the methods described herein. The data stream or sequence of signals may for example be arranged to be transferred via a data communication connection, for example via the Internet.
[0341] A further embodiment comprises a processing means, for example a computer, or a programmable logic device, configured to or adapted to perform one of the methods described herein.
[0342] A further embodiment comprises a computer having installed thereon the computer program for performing one of the methods described herein.
[0343] Further embodiments according to the invention comprise an apparatus or a 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 for example be a computer, a mobile device, a memory device, etc. The apparatus or system may for example comprise 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. In general, the methods are preferably performed by any hardware apparatus.
[0345] The apparatus described herein may be implemented using a hardware apparatus, or using a computer, or using a combination of a hardware apparatus and a computer.
[0346] The apparatus described herein, or any components of the apparatus described herein, may be implemented at least partially in hardware and / or in software.
[0347] The methods described herein may be performed using a hardware apparatus, or using a computer, or using a combination of a hardware apparatus and a computer.
[0348] Any of the methods described herein, or components of the apparatus described herein, may be performed at least in part by hardware and / or by software.
[0349] The above-described embodiments are merely illustrative of the principles of the present invention. It will be understood that modifications and variations of the arrangements and details described herein will be apparent to others skilled in the art. It is therefore intended to be limited only by the scope of the claims that follow, and not by the specific details presented as descriptions and illustrations 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 Factors 14 Subblocks 16, 18 tasks, decryption 20 1st pass, significance / parity pass, pass, 1st scan pass 20', 20'' pass 22 second pass, greater than flag pass, pass, first pass 22' pass, first pass, first scanning pass 22'' pass, 2nd pass, 2nd scan pass 24, 28 Decryption,Task 24' gt1_flag decryption, decryption 24'' gt2_flag decryption, decryption 26 Third pass, scanning pass 27 Third Pass, Pass 30 Decryption, Task, Path 40, 45 updated 42 Selection 44 Arrows, coding order, traversal order 46 Status 50 Pre-determined conversion factor 51 Adjacent conversion coefficients, coefficients, adjacent coefficients, conversion coefficients 52 Local Templates, Templates
Claims
1. 1. An image decoder for decoding an image comprising blocks (10) of transform coefficients (12), said image decoder comprising at least one processor, The at least one processor In at least one first pass (20) of scanning the transform coefficients, decoding, for each transform coefficient, significance flags for the respective transform coefficients, each of which indicates whether a quantization index of the respective transform coefficient is zero or not, using context adaptive entropy decoding; decoding, for each transform coefficient, a parity flag for the transform coefficient, each flag indicating a parity of the respective transform coefficient; Determining a respective greater-than flag for each transform coefficient, where each greater-than flag indicates whether an absolute value of a quantization index of the transform coefficient is greater than a value corresponding to the respective greater-than flag, and determining the respective greater-than flag for each transform coefficient includes: using context adaptive entropy decoding, decoding a first greater-than flag for each transform coefficient having a non-zero quantization index and setting a first greater-than flag for each transform coefficient having a zero quantization index to zero; decoding, using context adaptive entropy decoding, a respective second greater-than flag for each transform coefficient for which the first greater-than flag is equal to one, and setting, to zero, each second greater-than flag for each transform coefficient for which the first greater-than flag is zero; In at least one further pass (26, 27), using equal probability entropy decoding, decoding respective remainders of the absolute values of the quantization indexes of each transform coefficient for which the first greater than flag and the second greater than flag are equal to one, and setting the respective remainders of each transform coefficient for which the first greater than flag and the second greater than flag are not equal to one to zero; decoding a sign of a respective quantization index of each transform coefficient, the quantization index of each transform coefficient being non-zero, using equal probability entropy decoding; 2. An image decoder configured to:
2. The at least one processor: In one first pass (20), for the transform coefficient currently being scanned: decoding the significance flag for the currently scanned transform coefficient using context adaptive entropy decoding; and if the significance flag indicates that the quantization index of the currently scanned transform coefficient is not zero, decoding the parity flag for the currently scanned transform coefficient using context adaptive entropy decoding for the currently scanned transform coefficient.
2. An image decoder as claimed in claim 1, configured to:
3. The at least one processor: Calculating, for a current transform coefficient, an absolute value of a quantization index of the current transform coefficient according to a sum, the summand being: a significance flag for the current transform coefficient; a parity flag for the current transform coefficient; a first greater-than flag for the current transform coefficient; a remainder of the current transform coefficient and two times the sum of a second greater-than flag of the current transform coefficient; formed by 2. An image decoder as claimed in claim 1, configured to:
4. 2. The image decoder of claim 1, wherein the at least one first pass is one first pass.
5. 2. An image decoder as claimed in claim 1, wherein the transform coefficients of the block are partitioned into sub-blocks (14) and the transform coefficients of the block are decoded sub-block by sub-block, such that each transform coefficient of a sub-block (14) is decoded before the transform coefficients of the next sub-block.
6. 2. The image decoder of claim 1, wherein a binary arithmetic decoding is used as the entropy decoding and the residue is decoded by decoding the binarization bins of the absolute values of the quantization indexes.
7. The at least one processor: dequantizing the quantization index of each transform coefficient for which the quantization index is non-zero, the dequantization comprising: selecting (42) for each transform coefficient a reconstructed level set from among a plurality of reconstructed level sets in response to a parity of a quantization index of a transform coefficient preceding the respective transform coefficient along a scanning order (44); dequantizing each of the transform coefficients onto one level of the reconstructed level set, the level being indexed by the quantization index of the each of the transform coefficients; by 2. An image decoder as claimed in claim 1, configured to:
8. The at least one processor: performing the selection of the reconstructed level set from among the plurality of reconstructed level sets (52) for each transform coefficient using state transitions, the performing comprising: uniquely selecting (42) the reconstructed level set from among the plurality of reconstructed level sets based on the state that the state transition assumes for the respective transform coefficient; updating (45) the state of the state transition for a subsequent transform coefficient in the scanning order in response to the parity of the quantization index of the respective transform coefficient. by 8. An image decoder as claimed in claim 7, arranged to:
9. The at least one processor: According to the scanning order, the at least one first path; and The at least one further path 9. An image decoder as claimed in claim 8, configured to perform:
10. The at least one processor:
9. An image decoder as claimed in claim 8, arranged to perform said state transitions between four different states.
11. The at least one processor: parameterizing the plurality of reconstruction level sets by a quantization step size and deriving information about the quantization step size from a data stream.
8. An image decoder as claimed in claim 7, arranged to:
12. 9. The image decoder of claim 8, wherein each of said plurality of reconstructed level sets is comprised of a multiple of a predetermined quantization step size that is constant for said plurality of reconstructed level sets.
13. The number of reconstructed level sets among the plurality of reconstructed level sets is two, and the plurality of reconstructed level sets are a first reconstruction level set comprising zero and even multiples of a quantization step size; a second reconstruction level set comprising zero and odd multiples of the quantization step size; An image decoder as claimed in claim 10, comprising:
14. The at least one processor:
14. An image decoder according to claim 13, configured to select the first reconstructed level set for state values 0 and 1, and to select the second reconstructed level set for state values 2 and 3.
15. The at least one processor: Decoding a significance flag for a current transform coefficient using context adaptive entropy decoding, the decoding comprising: The coefficient position of the current transform coefficient within the block. By choosing the context accordingly, 2. An image decoder as claimed in claim 1, configured to:
16. The at least one processor: decoding a significance flag for a current transform coefficient (50) using context-adaptive entropy decoding, said decoding comprising: determining a local activity for a set of neighboring transform coefficients (51) in a local template (52) around the current transform coefficient based on a set of significance flags decoded prior to the significance flag of the current transform coefficient; Selecting a context in response to the local activity by 2. An image decoder as claimed in claim 1, configured to:
17. decoding sequentially, in one first pass, a significance flag, a parity flag, and a first greater-than flag, such that the set of flags comprises a significance flag, a parity flag, and a first greater-than flag decoded for the set of adjacent transform coefficients; and calculating an activity based on a respective sum over addends for each of the adjacent transform coefficients of the set of adjacent transform coefficients, the addends being based on the significance flag, the parity flag, and the first greater-than flag of the adjacent transform coefficient.
17. An image decoder according to claim 16, configured to:
18. The at least one processor: performing, for each transform coefficient, the selection of the reconstructed level set from among a plurality of reconstructed level sets using state transitions, the performing comprising: uniquely selecting the reconstructed level set from among the plurality of reconstructed level sets based on the state that the state transition assumes for the respective transform coefficient; updating a state of the state transition for a subsequent transform coefficient in a scanning order in response to the parity of the quantization index of the respective transform coefficient. By, performing the at least one first pass through the scan order; and Decoding a significance flag for a current transform coefficient using context adaptive entropy decoding, the decoding comprising: The state that the state transition assumes for the current transform coefficient (13'). By choosing the context accordingly, 8. An image decoder as claimed in claim 7, arranged to:
19. The at least one processor: selecting a context set comprising the context in response to the state of a state transition assuming the current transform coefficient, and decoding the significance flag for the current transform coefficient using context-adaptive entropy decoding by selecting the context from among the context set in response to a local activity around the current transform coefficient or a coefficient position of the current transform coefficient.
20. An image decoder according to claim 18, configured to:
20. The at least one processor:
20. An image decoder as claimed in claim 19, 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.
21. The at least one processor: decoding a parity flag for a current transform coefficient using context adaptive entropy decoding, the decoding comprising: The coefficient position of the current transform coefficient By choosing the context accordingly, 2. An image decoder as claimed in claim 1, configured to:
22. The at least one processor: decoding a parity flag for a current transform coefficient using context adaptive entropy decoding, the decoding comprising: determining a number of transform coefficients in a local template around the current transform coefficient whose local activity and / or reconstruction level is non-zero based on a set of flags decoded before the parity flag of the current transform coefficient for a set of neighboring transform coefficients in the local template around the current transform coefficient; and selecting a context depending on said local activity and / or the number of said transform coefficients; by 2. An image decoder as claimed in claim 1, configured to:
23. The at least one processor:
23. An image decoder as claimed in claim 22, arranged to select the context depending on a difference between the local activity and the number of transform coefficients.
24. decoding sequentially, in one first pass, a significance flag, a parity flag, and a first greater-than flag, such that the set of flags comprises a significance flag, a parity flag, and a first greater-than flag decoded for the set of adjacent transform coefficients; and calculating an activity based on a respective sum over addends for each of the adjacent transform coefficients of the set of adjacent transform coefficients, the addends being based on the significance flag, the parity flag, and the first greater-than flag of the adjacent transform coefficient.
23. An image decoder according to claim 22, configured to:
25. The at least one processor: Decoding a first greater-than flag for a current transform coefficient using context adaptive entropy decoding, the decoding comprising: The coefficient position of the current transform coefficient By choosing the context accordingly, 2. An image decoder as claimed in claim 1, configured to:
26. The at least one processor: Decoding a first greater-than flag for a current transform coefficient using context adaptive entropy decoding, the decoding comprising: determining a number of transform coefficients in the local template around the current transform coefficient that have a non-zero local activity and / or reconstruction level based on a set of flags decoded before the first greater-than flag of the current transform coefficient for a set of neighboring transform coefficients in the local template around the current transform coefficient; and selecting a context depending on said local activity and / or the number of said transform coefficients; by 2. An image decoder as claimed in claim 1, configured to:
27. The at least one processor:
27. An image decoder as claimed in claim 26, arranged to select the context depending on a difference between the local activity and the number of transform coefficients.
28. The at least one processor: decoding sequentially, in one first pass, a significance flag, a parity flag, and a first greater-than flag, such that the set of flags comprises a significance flag, a parity flag, and a first greater-than flag decoded for the set of adjacent transform coefficients; and calculating a local activity based on respective sums over addends for each of the adjacent transform coefficients of the set of adjacent transform coefficients, the addends being based on the significance flag, the parity flag, and the first greater-than flag of the adjacent transform coefficient.
27. An image decoder according to claim 26, configured to:
29. The at least one processor: decoding a residual for a current transform coefficient using a Golomb-Rice code and using a Rice parameter that depends on a sum over a respective addend for each from among a set of neighboring transform coefficients in a local template around the current transform coefficient, the addends depending on a quantization index or reconstruction level for each neighboring transform coefficient; 2. An image decoder as claimed in claim 1, configured to:
30. 1. An image encoder for encoding an image comprising blocks of transform coefficients, the image encoder comprising: The at least one processor In at least one first pass of scanning the transform coefficients, encoding, for each transform coefficient, significance flags for the transform coefficient, each of the significance flags indicating whether a quantization index of the respective transform coefficient is zero or not, using context adaptive entropy coding; encoding, for each transform coefficient, a parity flag for the transform coefficient, each flag indicating a parity of the respective transform coefficient; determining a respective greater-than flag for each transform coefficient, each greater-than flag indicating whether an absolute value of a quantization index for that transform coefficient is greater than a value corresponding to the respective greater-than flag; encoding a first greater-than flag for each transform coefficient having a non-zero quantization index using context-adaptive entropy coding and setting a first greater-than flag for each transform coefficient having a zero quantization index to zero; encoding, using context adaptive entropy coding, a respective second greater-than flag of each transform coefficient whose first greater-than flag is equal to one, and setting to zero the respective second greater-than flag of each transform coefficient whose first greater-than flag is zero; In at least one further pass coding, using equal probability entropy coding, respective remainders of the absolute values of the quantization indexes of each transform coefficient for which the first greater than flag and the second greater than flag are equal to one, and setting the respective remainders of each transform coefficient for which the first greater than flag and the second greater than flag are not equal to one to zero; encoding a sign of a respective quantization index of each transform coefficient, the quantization index of each transform coefficient being non-zero, using equal probability entropy coding; 13. An image encoder configured to:
Citation Information
Patent Citations
JPP7127160B