Efficient coding of transform coefficients for use in or suitable for combination with dependent scalar quantization - Patents.com
By employing dependent scalar quantization and context-adaptive entropy coding, the method addresses the inefficiencies in transform coefficient coding, achieving reduced distortion and improved bitrate management.
Patent Information
- Application Number
- JP2023105222
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Priority Date
- 2018-09-24
- Filing Date
- 2023-06-27
- Publication Date
- 2025-04-14
- Estimated Expiration
- 2039-09-24
AI Technical Summary
Existing transform coefficient coding methods face challenges in achieving efficient coding while managing quantization distortion and bitrate, particularly when using dependent quantization and context-adaptive entropy coding.
The proposed solution involves using dependent scalar quantization, where the set of available reconstruction levels for a transform coefficient depends on the quantization index of preceding coefficients, combined with context-adaptive entropy coding to enhance coding efficiency.
This approach reduces the expected distortion between input and reconstructed transform coefficients for a given bitrate, achieving improved coding efficiency even when combined with dependent quantization.
Smart Images

Figure 0007661406000030 
Figure 0007661406000031 
Figure 0007661406000032
Abstract
Description
[Technical field]
[0001] This application relates to the coding of transform coefficient levels, such as for coding images or video. [Background technology]
[0002] In setting the quantization parameters, the encoder has to make compromises: coarser quantization reduces the bit rate but increases the quantization distortion, finer quantization reduces the distortion but increases the bit rate. It is preferable to have at hand a concept that increases the coding efficiency for a given domain of available quantization levels. One such possibility is the use of dependent quantization, where the quantization is constantly adapted depending on the previously quantized and coded data. However, the dependency in quantization also gives rise to problems such as increased coding complexity, accumulating reduced information to perform context modeling, as the dependency affects the interrelationships between the data items to be quantized and coded, and the availability of information about the context derivation for coding the individual syntax elements.
[0003] It is preferable to have a concept of achieving a more efficient encoding of the coefficients of a transform block by using dependent quantization and context-adaptive entropy coding, or of achieving the encoding of the coefficients of a transform block in a manner that allows for more efficient encoding even when the use of dependent quantization is combined with the use of context-adaptive entropy coding. Summary of the Invention [Problem to be solved by the invention]
[0004] The object of the invention is to provide such a concept for coding blocks of transform coefficients. [Means for solving the problem]
[0005] This object is achieved by the subject matter of the independent claims of the present application.
[0006] Advantageous aspects are the subject matter of the dependent claims. Preferred embodiments of the present application are described with reference to the following drawings, in which: [Brief description of the drawings]
[0007] [Figure 1] FIG. 1 shows a block diagram of a typical video encoder as an example of an image encoder that may be embodied to operate according to any of the embodiments described below or to incorporate functionality according to the embodiments described herein. [Diagram 2] FIG. 2 shows block diagrams of (a) a transform encoder and (b) a transform decoder illustrating the basic approach of block-based transform coding. [Diagram 3] FIG. 3 shows a histogram of the distribution representing a uniform reconstruction quantizer. [Figure 4] 4 shows (a) a schematic diagram of a transform block subdivided into sub-blocks, and (b) a schematic diagram of the sub-blocks to illustrate an example for scanning transform coefficient levels, typically used in H.265 | MPEG-H HEVC; in particular, (a) shows the division of a 16×16 transform block into 4×4 sub-blocks and the coding order of the sub-blocks, and (b) shows the coding order of transform coefficient levels within the 4×4 sub-blocks. Typically, the subdivision may be used in the embodiment of the present application for the path of coefficients when decoding their flags and residuals and state transitions when dequantizing them. [Diagram 5] FIG. 5 shows a schematic diagram of the multidimensional output space spanned by one axis per transform coefficient and the positions of allowable reconstruction vectors for the simple case of two transform coefficients: (a) an example of independent scalar quantization, (b) an example of dependent scalar quantization. [Figure 6]Figure 6 shows 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 to conventional transform coding (with an independent scalar quantizer) can be derived by comparison with Figure 2b. Similarly, an embodiment for encoding transform blocks using dependent scalar quantization can be obtained by modifying an encoder such as Figure 2a. [Figure 7] FIG. 7 is a schematic diagram illustrating an embodiment of dependent quantization of two sets of reconstruction levels completely determined by a single quantization step size Δ, where two available sets of reconstruction levels are highlighted as set 0 (top line) and set 1 (bottom line). Examples of quantization indices indicating the reconstruction levels in the set are given by the numbers below the circles. The hollow and filled circles indicate two different subsets in the set of reconstruction levels; the subsets 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; both sets are symmetric around zero. [Figure 8] FIG. 8 shows pseudocode illustrating an example of a reconstruction process of transform coefficients. k denotes an index identifying the reconstruction order of the current transform coefficient, the quantization index for the current transform coefficient is denoted by level[k], the quantization step size Δk to apply to the current transform coefficient is denoted 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 apply to the current transform coefficient. It is determined based on the previous transform coefficient in the reconstruction order; possible values of setId[k] are 0 and 1. The variable n specifies an integer factor of the quantization step size; it is given by the selected set of reconstruction levels (i.e., the value of setId[k]) and the transmitted quantization index level[k]. [Figure 9]FIG. 9 shows pseudocode illustrating another implementation of the pseudocode in FIG. 8. The main change is that the multiplication with the quantization step is expressed using an integer implementation that uses scale and shift parameters. Typically, the shift parameter (denoted by shift) is constant for the transform block, and only the scale parameter (given by scale[k]) may depend on the position of the transform coefficient. The variable add represents a rounding offset, which is typically set equal to add = (1 << (shift-1)). Δk is the nominal quantization step for the transform coefficient, and the parameters shift and scale[k] are selected to have Δk ≈ scale[k] · 2-shift. [Figure 10] 10 shows pseudocode illustrating an example of a transformation coefficient reconstruction process for a transformation block. The array level represents the transformation coefficient levels (quantization indices) sent for the transformation block, and the array trec represents the corresponding reconstructed transformation coefficients. The two-dimensional table state_trans_table specifies the state transition table, and the table setld specifies the quantization sets associated with the states. [Figure 11] FIG. 11 shows a schematic diagram illustrating state transitions in dependent scalar quantization as a trellis structure. The presence of horizontal positions represents different transform coefficients in the reconstruction order. The vertical axis represents different possible states in the dependent quantization and reconstruction process. The connections shown identify the available paths between states for different transform coefficients. [Figure 12a] 12a shows a schematic diagram of a transform block for an example of signaling the position of the first non-zero quantization index in the coding order, whose position is indicated by back filling. In addition to the position of the first non-zero transform coefficient, only the bin for the shaded coefficient is transmitted, while the white marked coefficients are assumed to be equal to 0. [Figure 12b]Fig. 12b shows a schematic diagram of the transformation block and illustrates the template used to select the probabilistic model. The black square identifies the current scan position, and the shaded squares represent the local neighborhood used to derive the context model. [Figure 13-1] FIG. 13-1 shows pseudocode according to a first embodiment for encoding a block of transform coefficients. [Figure 13-2] FIG. 13-2 shows pseudocode according to a first embodiment for encoding a transform coefficient block. [Figure 14] FIG. 14 is a schematic diagram illustrating a representation of quantization indexes of transform coefficients according to the embodiment of FIG. 13 by recursively bisecting the value domain of the quantization indexes. [Figure 15] FIG. 15 is a schematic diagram illustrating various passes in the decoding example of FIG. 13, showing how the transform coefficients are traversed and which flags or residuals are coded in the passes following the example of FIG. [Figure 16-1] FIG. 16-1 shows pseudocode to illustrate a second embodiment for encoding a transform coefficient block. [Figure 16-2] FIG. 16-2 shows pseudocode to illustrate a second embodiment for encoding a transform coefficient block. [Figure 17] FIG. 17 is a schematic diagram illustrating a representation of quantization indexes of coefficients according to the embodiment of FIG. [Figure 18-1] FIG. 18-1 shows pseudocode illustrating a third embodiment for encoding a transform coefficient block. [Figure 18-2] FIG. 18-2 shows pseudocode illustrating a third embodiment for encoding a transform coefficient block. [Figure 19-1] FIG. 19-1 shows pseudocode illustrating a fourth embodiment for encoding a transform coefficient block. [Figure 19-2] FIG. 19-2 shows pseudocode illustrating a fourth embodiment for encoding a transform coefficient block. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0008] According to the embodiments described below, transform coding is used to transform a set of samples. Dependent quantization is used to quantize the resulting transform coefficients, followed by entropy coding of the resulting quantization indexes, i.e. context-adaptive arithmetic coding. At the decoder side, a set of reconstructed samples is obtained by corresponding the decoding of the dependent reconstruction of the quantization indexes and transform coefficients, and an inverse transform produces samples. The samples can be part of an image or video and can describe specific image blocks. Of course, other possibilities exist as well. The description of the embodiments below is mainly directed to lossy coding of blocks of prediction error samples in image and video codecs, but the embodiments can also be applied to other areas of lossy coding. In particular, there is no restriction on the set of samples forming a rectangular block, nor on the set of samples representing prediction error samples (i.e. the difference between the original and the predicted signal).
[0009] All modern 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 image is divided into blocks, samples of the blocks are predicted using intra-picture or inter-prediction, and the resulting prediction error signal (the difference between the original samples and the samples of the predicted signal) is coded using transform coding.
[0010] FIG. 1 shows a simplified block diagram of a typical modern video encoder. Video images of a video sequence are coded in a specific order, called coding order. The coding order of images may differ from the capture and display order. For the actual coding, each video image is divided into blocks. A block contains samples of a rectangular area of a specific color component. An entity of blocks of all color components corresponding to the same rectangular area is often called a unit. In H.265|MPEG-H HEVC, depending on the purpose of the block division, it is distinguished between coding tree blocks (CTB), coding blocks (CB), prediction blocks (PB) and transform blocks (TB). The relevant units are called coding tree units (CTU), coding units (CU), prediction units (PU) and transform units (TU).
[0011] Typically, a video image is first divided into fixed-size units (i.e., fixed-size blocks aligned 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 divided 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 division are processed in a raster-scan order, and if any of the blocks are further divided, the corresponding four blocks (including the smaller blocks contained therein) are processed before the next block of a higher division level is processed.
[0012] If a CU is coded in an intra-coding mode, an intra-prediction mode for the luminance signal and another intra-prediction mode for the chrominance signal are transmitted if the video signal contains a chrominance component. In ITU-T H.265|MPEG-H HEVC, if the CU size is equal to the smallest CU size (as signaled in the sequence parameter set), the luminance block may be divided into four equal-sized blocks, in which case a separate luminance 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 coding CU, a prediction signal is derived using already reconstructed samples of the same chrominance component. The algorithm used to generate a prediction signal for the transform block is determined by the transmitted intra-prediction mode.
[0013] A CU coded in inter-picture coding mode may further be 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. The motion parameters of each set include the number of motion hypotheses (one or two in H.265|MPEG-H HEVC) and, for each motion hypothesis, the reference picture (indicated in the list of reference pictures via a reference picture index) and the associated motion vector. Furthermore, H.265|MPEG-H HEVC provides a so-called merge mode, where the motion parameters are not explicitly transmitted but are derived based on the motion parameters of spatially or temporally neighboring blocks. If a CU or PU is coded in merge mode, only an index of a list of motion parameter candidates (this list is derived using the motion data of spatially and temporally neighboring blocks) is transmitted. The index completely determines the set of motion parameters used. The 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, and the displacement for 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 one-quarter luma sample). For non-integer motion vectors, the prediction signal is generated by inserting a reconstructed reference picture (typically using a separable FIR filter). The final prediction signal for a PU with many hypothesis predictions is formed by a weighted sum of the prediction signals for each motion hypothesis. Typically, the same set of motion parameters is used for the luma and chroma blocks of a PU.Even though modern video coding standards use translational displacement vectors to identify the motion of the current region (block of samples) relative to a reference picture, it is also possible to use higher-order motion models (e.g. affine motion models), in which case additional motion parameters must be transmitted for the motion hypotheses.
[0014] For both intra-picture 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 divided into transform blocks (TBs). The division 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. In P and B slices, at the beginning of the CU syntax, a skip_flag is transmitted. 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 assumed to be equal to 1) and all transform coefficients are equal to 0 (i.e., the reconstructed signal is equal to the predicted signal). In that case, only merge_idx is sent in addition to skip_flag. If skip_flag is equal to 0, the prediction mode (inter or intra) is signaled, and the syntax features described above follow.
[0015] Since an already coded picture may be used for motion compensated prediction of blocks in a subsequent picture, the picture must be completely reconstructed in the encoder. The reconstructed prediction error signal of a block (obtained by reconstructing the transform coefficients given the quantization indexes and by inverse transform) is added to the corresponding prediction signal, and the result is written to a buffer for the current picture. After all the blocks of the picture are reconstructed, one or more in-loop filters can 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.
[0016] The embodiments described below present a concept for coding transform coefficient blocks, such as those related to prediction errors. The concept is applicable to both intra-picture and inter-picture coded blocks. It is also applicable to transform coding of non-rectangular sample portions. In contrast to conventional transform coding, transform coefficients are not quantized independently. Rather, they are quantized using dependent quantization. According to dependent quantization, the set of available reconstruction levels for a particular transform coefficient depends on the quantization indexes selected for other transform coefficients.
[0017] All major video coding standards (including the latest 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 the original signal and samples of the prediction signal for the block. The prediction signal is obtained by intra-picture prediction, in which case the samples of the prediction signal for the current block are derived based on already reconstructed samples of neighboring blocks in the same picture, or by inter-picture prediction, in which case the samples of the prediction signal are derived based on samples of already reconstructed pictures. The original prediction error signal samples 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.
[0018] 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 Fig. 2a), an N×M block of original samples is transformed using a linear analytical transform A. The result is an N×M block of transform coefficients. The transform coefficients tk represent the original prediction error samples in different signal spaces (or different coordinate systems). The N×M transform coefficients are quantized using N×M independent scalar quantizers. Each transform coefficient tk is mapped to a quantization index qk, also called a transform coefficient level. The resulting quantization index qk is entropy coded and written to the bitstream.
[0019] At the decoder side, shown in Figure 2b, transform coefficient levels qk are decoded from the received bitstream. Each transform coefficient level qk is mapped to a reconstructed transform coefficient t'k. An N × M block of reconstructed samples is obtained by transforming the block of reconstructed transform coefficients using a linear synthesis transform B.
[0020] Even if a video coding standard only specifies a synthesis transform B, it is common for the encoder to use the inverse of the synthesis transform B as the analysis transform A, i.e., A=B -1 Moreover, the transform used in practical video coding systems is the orthogonal transform (B -1 =B T ) or almost orthogonal transform. For an orthogonal transform, 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 independent scalar quantizers can be used to minimize the MSE distortion between the original and reconstructed sample blocks. Even though 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.
[0021] For a typical prediction error signal, the transform has the effect that the signal energy is concentrated in a small number of transform coefficients: the statistical dependence between the resulting transform coefficients is reduced compared to the original prediction error samples.
[0022] Most current video coding standards use the separable discrete cosine transform (Type II) or an integer approximation thereof. However, the transform can be easily replaced without changing other aspects of the transform coding system. Examples of improvements that have been proposed in the literature or in standards documents include the following: Intra-picture prediction blocks (possibly with intra-picture prediction mode and Use of the discrete sine transform (DST) for the quantization (depending on the block size and / or the block size). Note that H.265|MPEG-H HEVC already includes DST for intra-picture predicted 4x4 transform blocks. ● Switching transform: The encoder selects the transform to be actually used from a set of predefined transforms. The set of available transforms is known at both the encoder and the decoder and may 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 selected intra-prediction mode. In special cases, no syntax elements specifying the transform need to be transmitted, since the transform to be used is completely determined by coding parameters such as the intra-prediction mode. Non-separable transforms: The transforms used in the encoder and decoder represent non-separable transforms. Note that the concept of switching transforms may include one or more non-separable transforms. For complex reasons, the use of non-separable transforms may be restricted to certain block sizes. ● Multilevel transforms: Real transforms consist of two or more transform stages. The first transform stage can consist of a computationally low complexity separable transform, and in the second stage a subset of the resulting transform coefficients are further transformed using a non-separable transform. The two-stage approach has the advantage that a more complex non-separable transform is applied to a smaller number of samples compared to a non-separable transform on the entire transform block. The concept of multilevel transforms can be efficiently combined with that of switching transforms.
[0023] The transform coefficients are quantized using a scalar quantizer. As a result of the quantization, the set of permissible values of the transform coefficients is reduced. In other words, the transform coefficients are mapped to an addable 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 below, the permissible reconstruction levels are represented by quantization indices (also called transform coefficient levels) and transmitted as part of the bitstream. On the decoder side, the quantization indices (transform coefficient levels) are mapped to the reconstructed transform coefficients. The possible values of 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 indices).
[0024]
number
[0025] 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 of all quantization indexes for the other transform coefficients.
[0026]
number
[0027] Older video coding standards such as H.262|MPEG-2 Video also specify modified URQs in which the distance between reconstruction level zero and the first non-zero reconstruction level is increased compared to the nominal quantization step size (e.g., to two-thirds of the nominal quantization step size Δ).
[0028]
number
[0029] The slice QP is typically transmitted in the slice header. In general, it is possible to modify the quantization parameter QP on a block-by-block basis. For that purpose, a DQP (delta quantization parameter) can be transmitted. The used quantization parameter is determined by the transmitted DQP and the predicted QP value, which is derived using the QP of an already coded (typically neighboring) block.
[0030]
number
[0031] The main purpose of a quantization weight matrix is to provide the possibility to introduce quantization noise in a perceptually meaningful way. By using an appropriate weight matrix, it is possible to exploit the spatial contrast sensitivity of human vision and achieve a good 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 therefore fully specified by the quantization parameter QP.
[0032] A block of transform coefficient levels (quantization indices for the transform coefficients) is entropy coded (i.e., transmitted in a lossless manner as part of the bitstream). Since linear transforms can only reduce linear dependencies, entropy coding of transform coefficient levels is typically designed to exploit remaining nonlinear dependencies between transform coefficient levels within a block for efficient coding. Well-known examples are run-level coding in MPEG-2 video, run-level-last coding in H.263 and MPEG-4 video, context-adaptive variable length coding (CAVLC) in H.264|MPEG-4 AVC, and context-adaptive binary arithmetic coding (CABAC) in H.264|MPEG-4 AVC and H.265|MPEG-H HEVC.
[0033] CABAC, as specified in the latest video coding standards H.265|MPEG-H HEVC, follows a general concept that can be applied to a wide variety of transform block sizes. Transform blocks larger than 4x4 samples are divided into 4x4 sub-blocks. The division is illustrated in Fig. 4a and b as an example for a 16x16 transform block. The coding order of the 4x4 sub-blocks illustrated in Fig. 4a, as well as the coding order of the transform coefficient levels within the sub-blocks illustrated in Fig. 4b, is generally specified by the reverse diagonal scan illustrated in the figures. For certain intra-picture predicted blocks, a horizontal or vertical scan pattern is used (depending on the actual intra-prediction mode). The coding order always starts at a high frequency position.
[0034] In H.265|MPEG-H HEVC, transform coefficient levels are transmitted based on 4×4 sub-blocks. Lossless encoding of transform coefficient levels includes the following steps: 1. The syntax element coded_block_flag is sent to signal whether there are 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., block-wise reverse diagonal scan order shown in FIG. 4) are transmitted. The transmission of the 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_x_suffix. 3. Starting with the 4×4 sub-block that contains the first non-zero transform coefficient level in the coding order, the 4×4 sub-blocks are processed in coding order, and coding of the sub-blocks includes the following main steps: a. The syntax element coded_sub_block_flag is sent, which indicates whether the sub-block contains a non-zero transform coefficient level. For the first and last 4×4 sub-blocks (i.e., the sub-block containing the first non-zero transform coefficient level or DC level), this flag is not sent and is inferred to be equal to 1. b. If all transform coefficient levels in a sub-block with coded_sub_block_flag are equal to 1, then the syntax element significant_coeff_flag indicates whether the corresponding transform coefficient level is not equal to zero. This flag is only transmitted if its value cannot be estimated based on already transmitted data. In particular, this flag is not transmitted for the first significant scan position (identified 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. The flag coeff_abs_level_greater1_flag is sent if the first 8 transform coefficient levels with c.significant_coeff_flag are equal to 1 (if any), which indicates whether the absolute value of the transform coefficient level is greater than 1 or not. d. If the first transform coefficient with coeff_abs_level_greater1_flag is equal to 1 (if any), then the flag coeff_abs_level_greater2_flag is sent, which indicates whether the absolute value of the transform coefficient level is greater than 2 or not. If all levels with e.significant_coeff_flag are equal to 1 (exceptions are explained below), then the syntax element coeff_sign_flag is sent to specify the sign of the transform coefficient levels. f. For all transform coefficient levels whose absolute values are not already fully specified by the values of significant_coeff_flag, coeff_abs_level_greater1_flag and coeff_abs_level_greater2_flag (the absolute values are fully specified if any of the transmitted flags are equal to zero), the remainder of the absolute values is transmitted using the multilevel syntax element coeff_abs_level_remaining.
[0035] In H.265|MPEG-H HEVC, all syntax elements are coded using Context-Adaptive Binary Arithmetic Coding (CABAC). All non-binary syntax elements are first mapped to a sequence of binary decisions, also called bins. The resulting bin sequence is then coded using binary arithmetic coding. For that purpose, 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 binary probability mass function is updated based on the value of the bin actually coded. Conditional probabilities may be exploited by switching the context for a particular bin 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.
[0036] The context selected for coding of coded_sub_block_flag depends on the value of coded_sub_block_flag for neighboring sub-blocks already coded. The context for significant_coeff_flag is selected based on the scan position (x and y coordinates) within the sub-block, the size of the transform block and the value of coded_sub_block_flag in the neighboring sub-blocks. For flags coeff_abs_level_greater1_flag and coeff_abs_level_greater2_flag, the choice of context depends on whether the current sub-block contains a DC coefficient or not and whether a coeff_abs_level_be_flag equal to 1 has been sent for the neighboring sub-blocks. For coeff_abs_level_greater1_flag, it further depends on the number and value of coeff_abs_level_greater1_flag already coded for the sub-block.
[0037] The sign coeff_sign_flag and the absolute value residual coeff_abs_level_remaining are coded in the bypass mode of the binary arithmetic coder. To map coeff_abs_level_remaining to a sequence of bins (binary decisions), an adaptive binarization scheme is used. The binarization is controlled by a single parameter and is adapted based on the values already coded for the subblock.
[0038] H.265|MPEG-H HEVC also includes a so-called code data hiding mode, where (under certain conditions) the transmission of the code for the last non-zero level in 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 when determining the appropriate transform coefficient levels.
[0039] Video coding standards only specify the bitstream syntax and the reconstruction process. When considering transform coding for a given block of original prediction error samples and a given quantization step size, the encoder has many degrees of freedom. Given a quantization index qk for a transform block, the entropy coding must follow a uniquely defined algorithm (i.e., construct an arithmetic codeword) for writing data to the bitstream. However, the encoder algorithm for obtaining the quantization index qk given an original block of prediction error samples is outside the scope of video coding standards. Furthermore, the encoder has the freedom to select the quantization parameter QP on a block-by-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 of each transform coefficient is known. Furthermore, we assume that the encoder performs an analysis transform that is the inverse (or a very close approximation of the reverse) of the specified synthesis transform to obtain the original transform coefficient tk. Even under these conditions, the encoder has the freedom to select the quantization index qk for each original transform coefficient tk. Since the choice of transform coefficient levels determines both the distortion (or reconstruction / approximation quality) and the bitrate, the quantization algorithm used has a substantial impact on the rate-distortion performance of the generated bitstream.
[0040]
number
[0041]
number
[0042]
number
[0043]
number
[0044]
number
[0045] The modified concept for transform coding is that transform coefficients are not quantized and reconstructed independently. Instead, the allowable reconstruction levels of a transform coefficient depend on the quantization indexes selected for the preceding transform coefficients in the reconstruction order. The dependent scalar quantization concept is combined with modified entropy coding, where the selection of a probability model (or, alternatively, the selection of a codeword table) for a transform coefficient depends on the set of allowable reconstruction levels.
[0046]
number
[0047] Dependent scalar quantization of transform coefficients has the effect that for a given average number of reconstructed vectors per N-dimensional unit volume, the expected value of the distance between a given input vector of transform coefficients and the closest available reconstructed vector is reduced. As a result, the average distortion between the input vector of transform coefficients and the vector 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. And, in contrast to vector quantization, the implementation complexity of the reconstruction process (or decoding process) is comparable to conventional transform coding with independent scalar quantizers.
[0048]
number
[0049] Like conventional transform coding, transform coding according to the embodiments outlined herein further includes an analysis transform, a quantization algorithm, and entropy coding. The analysis transform typically uses the inverse (or a very close approximation of the inverse) of the synthesis transform, and the entropy coding usually uniquely specifies a given entropy decoding process. However, like conventional transform coding, there is a lot of freedom to choose the quantization indexes given the original transform coefficients.
[0050] Dependent quantization of transform coefficients refers to the notion that the set of available reconstruction levels for a transform coefficient depends on the selected quantization index of the preceding transform coefficient in reconstruction order (within the same transform block).
[0051] A plurality of sets of reconstruction levels are predefined, and one of the predefined sets is selected to reconstruct a current transform coefficient based on the quantization index of a preceding transform coefficient in the coding order.
[0052]
number
[0053] In one embodiment, the dependent scalar quantization for the transform coefficients uses exactly two different sets of reconstruction levels, and all reconstruction levels of the two sets for a transform coefficient tk represent integer multiples of the quantization step size Δk (determined at least in part by the block-based quantization parameter) for this transform coefficient. Note that the quantization step size Δk only represents a scaling factor for the allowable reconstruction values in both sets. Except for the possible individual quantization step sizes Δk (and individual scaling factors) for the different transform coefficients tk within the transform block, the same two sets of reconstruction levels are used for all transform coefficients.
[0054] A more preferred configuration for the two sets of reconstruction levels is shown in FIG. 7. The reconstruction levels included in the first quantization set (labeled as set 0 in the figure) represent even integer multiples of the quantization step size. The second quantization set (labeled as set 1 in the figure) includes all odd integer multiples of the quantization step size and also includes a reconstruction level equal to zero. Note that both reconstruction sets are symmetric around almost zero. Reconstruction levels equal to zero are included in both reconstruction sets, otherwise the reconstruction sets are disjoint. The combination of both reconstruction sets includes all integer multiples of the quantization step size.
[0055] The reconstruction level that the encoder selects among the allowable reconstruction levels must be indicated or transmitted in the bitstream. As in 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 number that uniquely identifies an available reconstruction level within a quantization set (i.e., within a set of reconstruction levels). The quantization index is sent to the decoder (using an entropy coding technique) as part of the bitstream. 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 quantization index transmitted for the current transform coefficient.
[0056] The reconstruction levels in FIG. 7 are labeled with an associated quantization index (the quantization index is given by the number under the circle representing the reconstruction level). A quantization index equal to 0 is assigned to the 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. In other words, the reconstruction levels greater than 0 are labeled in ascending order of their values with integer numbers greater than 0 (i.e., having 1, 2, 3, etc.). 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., second largest) reconstruction level less than 0, etc. In other words, the reconstruction levels less than 0 are labeled in descending order of their values with integer numbers less than 0 (i.e., −1, −2, −3, etc.). The use of reconstruction levels representing integer multiples of the quantization step size allows a computationally low complexity algorithm for the reconstruction of the transform coefficients at the decoder side. This is illustrated below based on a more preferred example in Fig. 7. The first quantization set includes all even integer multiples of the quantization step size, and the second quantization set includes all odd integer multiples of the quantization step size and a reconstruction level equal to 0 (included in both quantization sets). The reconstruction process of the transform coefficients may be implemented similarly to the algorithm specified in the pseudo code of Fig. 8.
[0057]
number
[0058]
number
[0059]
number
[0060] Another (merely cosmetic) change in FIG. 9 compared to FIG. 8 is that the switching between the two sets of reconstruction levels is performed using a ternary if-then-else operator ( a ? b : c ), which is known from programming languages such as the C programming language.
[0061] In addition to the selection of the set of reconstruction levels mentioned 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 "compression density" that can be achieved in the N-dimensional space of the transform coefficients (and subsequently also in the N-dimensional space of the reconstructed samples). Higher compression density ultimately translates into increased coding efficiency.
[0062] In a more preferred embodiment, the transition between the quantization sets (set 0 and set 1) is determined by a state variable. For the first transform coefficient in the reconstruction order, the state variable is set equal to a predefined value. Typically, the predefined value is equal to 0. The state variable for the next transform coefficient in the coding order is determined by an update process. The state of a particular transform coefficient depends only on the state of and the value of the preceding transform coefficient in the reconstruction order.
[0063] The state variable may have four possible values (0, 1, 2, 3). The state variable, in turn, specifies the quantization set to be used for the current transform coefficients: 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. The state variable, in turn, also specifies the possible transitions between quantization sets.
[0064] For example, the state of a particular transform coefficient may depend only on a binary function of the state of the preceding transform coefficients in the reconstruction order and the value of the preceding transform coefficient level, the binary function being referred to below as a path. In a particularly preferred embodiment, the following state transition table is used, where "path" refers to said binary function of the preceding transform coefficient level in the reconstruction order:
[0065] [Table 1]
[0066]
number
[0067] The state transition concept of dependent scalar quantization allows for a low-complexity implementation for the reconstruction of the transform coefficients at the decoder. A preferred example for the reconstruction process of the transform coefficients of a single transform block is shown in Figure 10, using C-style pseudocode.
[0068] In the pseudocode of FIG. 10, the index k identifies the reconstruction order of the transform coefficients. It should be noted that in the exemplary code, the index k is descending in the reconstruction order. The last transform coefficient has an index equal to k=0. The first index kstart identifies 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 may be set equal to the index of the first non-zero quantization index in the coding / reconstruction order (e.g., if the position of the first non-zero quantization index is transmitted in the applied entropy coding method). In the latter case, all preceding transform coefficients (with index k>kstart) are presumed to be equal to 0. The reconstruction process of each single transform coefficient is the same as in the example of FIG. 9. As in the example of 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. The one-dimensional table setId[] specifies the quantization sets associated with different values of the state variables, and the two-dimensional table state_trans_table[][] specifies the state transitions given the current state (first argument) and a path (second argument). As an example, a path may be given by the parity of the quantization index (bitwise and using the operator &), but other concepts are possible. As another example, a path may specify which transform coefficients are equal or not equal to zero. Example tables in C-style syntax are as follows (these tables are identical to Table 1 above):
[0069] setId[4] = { 0, 0, 1, 1} state_trans_table[4][2] = { {0,2}, {2,0}, {1,3}, {3,1}}
[0070] Instead of using the table state_trans_table[][] to determine the next state, arithmetic operations can be used that produce the same result. Similarly, the table setld[] can also be implemented using arithmetic operations. Alternatively, the combination of the lookup table and the sign function using the one-dimensional table setId[] can be implemented using arithmetic operations.
[0071] The main aspect of dependent scalar quantization 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. When considering the example of FIG. 7 and comparing the two quantization sets, it is clear that the distance between a reconstruction level equal to 0 and a neighboring reconstruction level is larger in set 0 than in set 1. Thus, when set 0 is used, the probability that a quantization index is equal to 0 is larger, and when set 1 is used, it is smaller. This effect may be exploited in entropy coding by switching the state-based probability model used for the quantization set or, more generally, the current quantization index.
[0072] Note that for proper switching of codeword tables or probability models, the paths of all previous quantization indexes (binary functions of the quantization indexes) must be known when entropy decoding the current quantization index (or the corresponding binary decision of the current quantization index).
[0073] The quantization indexes may be coded using binary arithmetic coding similar to H.264|MPEG-4 AVC or H.265|MPEG-H HEVC. To that end, the non-binary quantization indexes are first mapped to a set of binary decisions (usually called bins).
[0074] In the following, various examples are described of how, i.e. in what order and with what context, to binarize and arithmetically code the quantization indexes resulting from the dependent quantization. Here, the quantization indexes are transmitted as absolute values and signs for absolute values greater than 0. Although the signs are transmitted as a single bin, there are many possibilities for mapping the absolute values to a series of binary decisions that will reveal themselves in the examples described below. The following description first focuses on the coding order and binarization scheme and therefore presents various examples. Afterwards, different examples for context modeling are described. The latter may be combined with the former embodiments related to the coding order and binarization scheme, but the former embodiments are not limited to the latter examples.
[0075] Example 1 The following binary and non-binary syntax elements are transmitted: sig_flag: Specifies whether the absolute value of the transform coefficient level is greater than 0. If sig_flag is equal to 1, then gt1_flag: specifies whether the absolute value of the transform coefficient level is greater than 1 or not. If gt1_flag is equal to 1, then gt2_flag: specifies whether the absolute value of the transform coefficient level is greater than 1 or not. remainder: a non-binary syntax element that specifies the absolute level of the remainder if gt2_flag is equal to 1. This syntax element is transmitted in the bypass mode of the arithmetic coding engine, for example using Golomb-Rice coding. The current syntax element is not assumed to be equal to 0. At the decoder side, the absolute value of the transform coefficient level is reconstructed as: absLevel = sig_flag + gt1_flag + gt2_flag + remainder An additional gtX_flag may be sent, or the gt2_flag may be omitted, or both the gt1_flag and the gt2_flag may be omitted. The sig_flag and gtX_flag are coded using an adaptive context model.
[0076] Example 2 The following binary and non-binary syntax elements are transmitted: sig_flag: Specifies whether the absolute value of the transform coefficient level is greater than 0. If sig_flag is equal to 1, then gt1_flag: specifies whether the absolute value of the transform coefficient level is greater than 1 or not. If gt1_flag is equal to 1 par_flag: Specifies the parity of the remainder (ie, the absolute value -2) of the absolute value of the transform coefficient level. remainder: a non-binary syntax element that specifies the absolute level remainder (i.e., (absolute value-2-par_flag) / 2). This syntax element is transmitted in the bypass mode of the arithmetic coding engine, for example, using Golomb-Rice coding. The current syntax element is not assumed to be equal to 0. At the decoder side, the absolute value of the transform coefficient level is reconstructed as: absLevel = sig_flag + gt1_flag + par_flag + 2 * remainder An additional gtX_flag may be sent, or gt1_flag may be omitted. As an example, instead of the remainder above, a gt2_flag (specifying whether the absolute value is greater than 3) and (if gt2_flag is equal to 1) a modified remainder (i.e., (absolute value-3-par_flag) / 2) can be sent. The absolute value can then be constructed as follows: absLevel = sig_flag + gt1_flag + par_flag + 2 * ( gt2_flag + remainder ) The sig_flag, gtX_flag and par_flag are coded using an adaptive context model.
[0077] Example 3 The following binary and non-binary syntax elements are transmitted: sig_flag: Specifies whether the absolute value of the transform coefficient level is greater than 0. If sig_flag is equal to 1 par_flag: Specifies the parity of the remainder (ie, absolute value -1) of the absolute value of the transform coefficient level. gt1_flag: Specifies whether the remainder of the absolute value of the transform coefficient level (ie, (absolute value-1-par_flag) / 2) is greater than 0 or not. If gt1_flag is equal to 1, then gt2_flag: specifies whether the residual of the absolute value of the transform coefficient level (ie, (absolute value-1-par_flag) / 2) is greater than 1 or not. remainder: if gt2_flag is equal to 1, it is a non-binary syntax element that specifies the absolute level remainder (i.e., (absolute value-1-par_flag) / 2-2). This syntax element is transmitted in the bypass mode of the arithmetic coding engine, for example, using Golomb-Rice coding. The current syntax element is not assumed to be equal to 0. At the decoder side, the absolute value of the transform coefficient level is reconstructed as: absLevel = sig_flag + par_flag + 2 * (gt1_flag + gt2_flag + remainder). An additional gtX_flag may be sent or gt2_flag may be omitted. The sig_flag, gtx_flag and par_flag are coded using an adaptive context model.
[0078] Further binarization is possible.
[0079] With regard to context modeling, the following example is provided to illustrate the interrelationship between binarization, bin / coefficient ordering and context derivation. In a particular example, the syntax for transmitting a quantization index of a transform block includes a bin that specifies whether the quantization index is equal to zero or not (sig_flag introduced above) or whether it is not equal to zero. The probability model used to code this bin may be selected from a set of two or more probability models. The selection of the probability model used depends on the current state variable (state variable means the quantization set used). In this case, a different set of probability models may be used for all possible values of the state variable, or a different set of probability models may be used for each cluster (e.g., a first set of probability models for state 0 or 1, a second set of probability models for state 2 and a third set of probability models for state 3; or, alternatively, a first set of probability models for state 0 or 1, a second set of probability models for state 2 or 3).
[0080] The selected probability model for other binary syntax elements (eg, gt1_flag or par_flag) may also depend on the value of the current state variable.
[0081] When dependent quantization of transform coefficients is combined with entropy coding, it is advantageous that the selection of a probability model for one or more bins of the binary representation of a quantization index (also called a quantization level) depends on a state variable of the current quantization index, which is given by the quantization index (or a subset of bins representing the quantization index) for the preceding transform coefficient in the coding and reconstruction order.
[0082] In particular, the described choice of probability model is advantageously combined with one or more of the following entropy coding aspects: ● Send a flag for the transform block, which specifies whether any of the quantization indices for the transform block are not equal to zero or whether all the quantization indices for the transform block are equal to zero. ● Division of coefficients of a transform block in multiple sub-blocks (at least for transform blocks exceeding a predefined size given by the dimensions of the block or the number of samples contained). This is exemplarily shown for a transform block 10 in FIG. 12a, where the coefficients 12 of the block are subdivided into sub-blocks 14, here exemplarily coefficients of size 4×4. If a transform block is divided into multiple sub-blocks 14, then for one or more sub-blocks a flag is transmitted (unless it is inferred based on syntax elements already transmitted) specifying whether the sub-block contains a non-zero quantization index or not. The sub-blocks may be used to specify the coding order of the bins. For example, the coding bins may be divided into sub-blocks 14, and all bins of a sub-block are coded before any bins of the next sub-block 14 are transmitted. However, the bins of a particular sub-block 14 may be coded in multiple passes over the transform coefficients in this sub-block. For example, all bins specifying the absolute value of the quantization index for the sub-block may be coded before any coding bins are coded. The bins for the absolute values may also be divided into multiple passes, as described above. ● Transmission of the first non-zero position in the coding order. The position is shown in Fig. 12a and is shown in bold. It can be transmitted as an x and y coordinate specifying the position in a two-dimensional array of transform coefficients, it can be transmitted in the scan order as an index, or it can be transmitted by any other means. As shown in Fig. 12a, the transmitted position of the first non-zero quantization index (or transform coefficient) in the coding order specifies that all transform coefficients 12 preceding the identified coefficient in the coding order (marked in white in Fig. 12a) are presumed to be equal to zero. Further data is only transmitted for the specified position (marked in black / bold in Fig. 12a), i.e., the coefficient in the first position in the coding order, and the coefficient following this coefficient in the coding order (marked in diagonal lines in Fig. 12a). The example in Fig. 12a shows a 16x16 transform block 10 with 4x4 sub-blocks 14; the coding order used is a sub-block-wise diagonal scan as specified in H.265|MPEG-H HEVC. It should be noted that the coding of the quantization index at the specified position (the first non-zero coefficient in the coding order) may be slightly modified: for example, if the binarization of the absolute value of the quantization index includes a bin that specifies whether the quantization index is not equal to 0 or not, this bin does not transmit the quantization index at the specified position (it is already known that the coefficient is not equal to 0), instead, the bin is presumed to be equal to 1. ● The binarization of the absolute value of the quantization index includes an adaptively coded bin that specifies whether the quantization index is not equal to 0 or not. The probability model (called context) used to code this bin is selected from among a set of candidate probability models. The selected candidate probability model may be determined by a state variable of the current quantization index and further by the quantization indexes already transmitted for the transform block. In a preferred embodiment, the state variables determine a subset of the available probability models (also called a context set) and the values of the already coded quantization indexes determine the probability model to be used within this subset (context set). In a preferred embodiment, the probability model to be used in the context set is determined based on the values of already coded quantization indices in a local neighborhood 52 of the current transform coefficient 50, i.e. the values of the coefficients whose bins are currently being coded / decoded, and the context for the same need is determined. An example of such a local neighborhood 52 is shown in Fig. 12b, where the current transform coefficient 50 is marked in black and the local neighborhood 52 is marked with diagonal lines. In the following, some exemplary processes are listed that can be derived based on the values of quantization indices of neighboring coefficients 51 in the local neighborhood 52 and then used to select a probability model of a pre-determined context set. In addition, other data available to the decoder may be used (either explicitly or in combination with the processes listed above) to derive a probability model within a pre-determined context set. Such data may include: ○ The position of the current transform coefficient (x-coordinate, y-coordinate, diagonal number or any combination of these) ○ The size of the current block (vertical size, horizontal size, number of samples or any combination of them) ○ Aspect ratio of the current transformation block ● The binarization of the absolute value of the quantization index includes an adaptively coded bin that specifies whether the absolute value of the quantization index is greater than 1 or not. The probability model (called context) used to code this bin is selected from a set of candidate probability models. The selected probability model is determined by the already transmitted quantization index for the transform block. To select the probability model, any of the above methods can be used (for bins that specify whether the quantization index is not equal to 0 or not).
[0083] As already mentioned above, the coding order of the bins of the binarization of the quantization indexes of the coefficients 12 influences the efficiency of the coding of the block 10. For example, the probability model selected for at least one of the binary decisions (bins), typically sig_flag, depends on the value of the current state variable. And since the state variables are determined by a binary function path() of the preceding transform coefficient level, the coding order of the bins must be arranged in such a way that when coding sig_flag (or, more generally, a binary syntax element whose probability model depends on a state variable) for a current transform coefficient, the path for all preceding transform coefficients is known.
[0084] For example, all bins that specify the absolute value of a quantization index may be coded consecutively. That is, all bins (for absolute values) of all preceding quantization indexes in the coding / reconstruction order are coded before the first bin of the current quantization index. The code bins may or may not be coded in a separate second pass over the transform coefficients (which may actually depend on the quantization set used). The code bins of a subblock may be coded after the bins for the absolute value of the subblock, but before any bins for the next subblock.
[0085] In another example, only a subset of bins that specify the absolute value of the quantization index are coded consecutively in a first pass over the transform coefficients. However, these bins uniquely specify a state variable. The remaining bins are coded in one or more additional passes over the transform coefficients. Assuming that the passes are specified by the parity of the quantization index, the parity bins are included in the first pass over the transform coefficients. The remaining bins may be transmitted in one or more additional passes. In other embodiments of the invention, similar concepts are used. For example, the number of bins in a single term may change or even adapt based on symbols already transmitted. Different passes may be used based on subblocks, in which case the bins of a subblock are coded in multiple passes, but all bins of a subblock are transmitted before any bins of the next subblock are transmitted.
[0086] In the following, several examples are listed for encoding binary decisions in multiple passes. Example A: This example uses the binarization of Example 3 above, where the path is given by the parity. ● Path 1: sig_flag, par_flag, gt1_flag ● Path 2: gt2_flag ● Path 3: remainder ● Path 4: sig_flag, par_flag, gt1_flag Example B: This example uses the binarization of Example 3 above, where the path is given by the parity. ● Path 1: sig_flag, par_flag ● Path 2: gt1_flag ● Path 3: gt2_flag ●Pass 4: remainder Path 5: sign bits Example C: This example uses the binarization of Example 1 above, and the path identifies whether the absolute value is greater than 0 or not. Path 1: sig_flag ● Path 2: gt1_flag ● Path 3: gt2_flag ●Pass 4: remainder Path 5: sign bits Example D: This example uses the binarization of Example 2 above, where the path is given by the parity. ● Path 1: sig_flag, gt1_flag, par_flag ● Path 2: remainder Path 3: sign bits Example E: This example uses the binarization of Example 2 above with the addition of gt2_flag, where the path is given by the parity. ● Path 1: sig_flag, gt1_flag, par_flag, gt2_flag ● Path 2: remainder Path 3: sign bits As a slight modification of this example, the gt2_flag can also be sent on a separate path.
[0087] Other coding orders or combinations of binarized and coded orders are possible.
[0088] To enable the implementation of high-throughput decoders, it is preferable to keep the number of context coding bins (also called positive coding bins) as low as possible (without degrading performance). This can be achieved (similar to HEVC) by limiting the maximum number of specific bins. The remaining information is coded using a bypass mode of the arithmetic coding engine. The method of reducing the maximum number of context coding bins described below may be combined with one or more of the following aspects already presented above: ● Multiple sets of reconstruction levels for quantization of transform coefficients. In particular, two sets: a first set including all even integer multiples of the quantization step size, and a second set including all odd integer multiples of the quantization step size and zero. (at least a portion of the transform coefficients in the transform block) ● The selected set of reconstruction levels depends on the state variables: The state variables are set equal to 0 for the first coefficient in the reconstruction order. For all other coefficients the following applies: The value of the state variables of the current transform coefficient is determined by a binary function (path) of the values of the state variables for the preceding transform coefficient levels and the values of the preceding transform coefficient levels. ● The transform coefficient levels are binarized and the bins are entropy coded using binary arithmetic coding. The binarization includes a sig_flag, which specifies whether the transform coefficient level is not equal to zero. This flag is coded using an adaptive probability model, where the selected probability model depends on the values of the state variables for the current transform coefficient (and potentially other parameters).
[0089] In the following, several embodiments are described for reducing the number of context coding bins for dependent scalar quantization. In these embodiments, the worst-case decoding complexity is bounded on a sub-block basis. Typically, as in HEVC, larger transform blocks are split into 4x4 sub-blocks and the following applies: ● The syntax for a transform block includes a syntax element (e.g., coded_block_flag) that specifies whether there are non-zero transform coefficient levels in the transform block. If coded_block_flag is equal to 0, all transform coefficient levels are equal to 0 and no further data is transmitted for the transform block; otherwise (coded_block_flag is equal to 1), the following applies; ● The x and y coordinates of the first significant transform coefficient in the scan order are transmitted (this is sometimes called the last significant coefficient because the actual scan order specifies scanning from high to low frequency components); ● The scanning of transform coefficients is processed on a sub-block basis (typically 4 x 4 sub-blocks); all transform coefficient levels of a sub-block are coded before any transform coefficient levels of any other sub-block are coded, and the sub-blocks are processed in a predefined scan order, starting with the sub-block containing the first significant coefficient in the scan order and ending with the sub-block containing the DC coefficient. ● The syntax includes coded_subblock_flag, which indicates whether the subblock contains non-zero transform coefficient levels; for the first and last subblock in scan order (i.e., the subblock containing the first significant coefficient in scan order, and the subblock containing a DC coefficient), this flag is not transmitted but is inferred to be equal to 1; if coded_subblock_flag is transmitted, it is typically transmitted at the beginning of the subblock. For each subblock with coded_subblock_flag equal to 1, the transform coefficient levels are transmitted in multiple scan paths across the scan positions of the subblock.
[0090] The following embodiment applies to the coding of transform coefficient levels for sub-blocks with coded_subblock_flag equal to 1. However, the embodiment is not limited to this case. It is also possible to apply the embodiment to complete the transform block (without a sub-block structure). In this context, it is also possible to use a sub-block structure (as described above), but to apply a worst-case complexity constraint (as described below) to complete the transform block (instead of applying the constraint to the sub-blocks individually).
[0091] EMBODIMENT 1 In a first embodiment, the transform coefficient levels are coded in multiple scan paths, which have the following properties: • The state machine for dependent quantization is driven by the parity of the transform coefficient levels, i.e., each binary function path (level) returns the parity of its argument; ● The probability model for sig_flag in the first pass is selected based on the corresponding values of the state variables (and optionally other parameters available to the decoder, see above). First Pass: In the first pass over the scan positions, the following context-coding bins are transmitted: ●sig_flag indicates whether the transform coefficient is not equal to 0; if sig_flag can be assumed to be equal to 1 (for example, which is the case for the first significant scan position in the transform block (one that is explicitly signaled by the x and y coordinates)), then sig_flag is not transmitted. If sig_flag is equal to 1 (encoded or estimated value), the following is additionally sent for the current scan position: ○par_flag specifies the absolute value of the parity minus 1. gt1_flag specifies whether the residual (given by absolute level-1-par_flag) / 2 is greater than 0. If a predefined maximum number of context coding bins is reached, the first pass is terminated. Let MAX_REG_BINS be the maximum number of bins that can be sent in the first pass, and regBins represent the number of positive coding bins still available. Then the following applies: ○ regBins is initially set equal to MAX_REG_BINS; After encoding any bin (sig_flag, gt1_flag, par_flag), regBins is decremented by 1. ○If after sending the bins (sig_flag, and if sig_flag is equal to 1, gt1_flag, par_flag) for a scan position, the number of bins regBins still available is less than 3 (i.e., sig_flag, par_flag and gt1_flag cannot be sent for the next scan position), then the first scan path is terminated. Second Pass: In the second pass over the scan positions, the following context-encoded bins are transmitted: ● If gt1_flag for a scan position is equal to 1, then gt2_flag is sent specifying whether the residual (given by absolute level-3-par_flag) / 2) is greater than 0 or not. The second pass is terminated if a predefined maximum number of context-encoded gt2_flag has been transmitted. The second pass is also terminated if a scan position is reached where no data was transmitted in the first pass (i.e., for such scan position no data is transmitted in the second pass). Third Pass: In the third pass over scan positions, absolute level residuals (i.e., data not already specified by transmitted sig_flag, par_flag, gt1_flag, and gt2_flag) are transmitted for all scan positions where sig_flag was coded in pass 1. The residuals for non-binary syntax elements are binarized using a structured code (such as Golomb-Rice code) and the bins are coded in bypass mode of the arithmetic coding engine. The residuals are transmitted for the following scan positions: For all scan positions, gt2_flag equal to 1 is sent in the second pass: For these scan positions, the remainder of the non-binary syntax elements transmitted specify the following: (absolute value-5-par_flag) / 2 For all scan positions, gt1_flag equal to 1 was sent on the first pass, but gt2_flag was not sent on the second pass: For these scan positions, the remainder of the non-binary syntax elements transmitted specify the following: (absolute value-3-par_flag) / 2 Fourth pass: In the fourth pass, the absolute levels for all scan positions for which no data was transmitted in the first pass are encoded. The absolute levels are first binarized using a structured code, and the code used can depend on local activity measurements as well as the current state variable values. The bins are transmitted using the bypass mode of the arithmetic coding engine. Fifth Pass: Finally, in the fifth pass, the signs of all transform coefficient levels not equal to 0 are transmitted. The signs are transmitted in a bypass mode of the arithmetic coding engine.
[0092] An advantage of the described embodiment is that the number of context coding bins is effectively reduced compared to a version that does not constrain the number of bins in the first and second passes. The complexity is reduced because the encoding and decoding of the context coding bins requires a more complex implementation than the bins coded in bypass mode.
[0093] The above description is illustrated with reference to the pseudocode shown in Fig. 13. Fig. 13 shows a method for decoding a block of transform coefficients according to the embodiment described above, but a corresponding encoding embodiment can be easily derived therefrom by replacing all "decode" with "encode".
[0094] The pseudocode shown in Figure 13 illustrates the encoding / decoding process at the transform coefficient level within a sub-block 14. It is illustrated from the decoder's point of view. Decoding from the data stream is performed in a sequence of passes 601 to 605 that scan the transform coefficient positions 12 of the block 10 according to the scan order. Since binarization is used, i.e. flags / bins are used to define the quantization indexes of the coefficients, the distribution of flags and residual encoding / decoding in the encoding / decoding passes is changed in the embodiments described below, and therefore the description of Figure 13 is focused on providing an overview or general description that also applies to the embodiments described below.
[0095] The basic scan order possibilities for the paths are described above with respect to Figures 12a and 12b and are shown by way of example at 62 in Figure 12b, but it should be noted that paths 601 to 605 do not necessarily scan all transform coefficient positions 12 of transform block 10, but they all use scan order 62; flags for some of the flag types may be transmitted on the same path, as described with respect to Figure 13, but other possibilities exist.
[0096] The predefined values MAX_REG_BINS and MAX_GT2_BINS shown in FIG. 13 specify the maximum number of positive coding bins in pass 1 601 and pass 2 602, respectively. The Boolean variable firstSubblock specifies whether the current subblock is the first subblock in coding order (within the transform block) coded / decoded for block 10, such as the subblock containing bold / black coefficient 12 in FIG. 12a. firstSigScanIdx specifies the scan index corresponding to the position of the first significant transform coefficient in transform block 10, i.e., the position of the coefficient explicitly signaled at the start of the transform block syntax. Reference numeral 64 will be used hereafter to denote that position. minSubblockScanIdx and maxSubblockScanIdx represent the minimum and maximum values of the scan index for the current, i.e., currently decoded / coded subblock. Note that the first scan index, startScanIdx, for which data is sent for the current subblock 14 depends on whether the subblock contains the first significant coefficient in scan order or not. In this case, the first scan path starts at the scan index corresponding to the first significant transform coefficient 64; otherwise, the scan order 62 is derived such that the first scan path starts at the smallest scan index of the subblock, such as the bottom-left coefficient position in subblock 14, or in other words, the position furthest from the DC position 66. Again, it should be noted that while FIG. 13 is an embodiment used for subblock-wise coding, the concepts relate to coding coefficients en-block, or some of the aspects described below may relate to subblocks, while others may be easily modified to relate to the entire block 10.
[0097] In the sequence of passes 601 to 604, a context-adaptive binary arithmetic coding / decoding is used to code / decode flags or bins, respectively selected from a set of one or more flag types, including, for example, sig_flag, par_flag, gt1_flag and gt2_flag in the presently described embodiment 1, and a variable length code is used to code / decode the residual values. That is, the bins of the codewords of the variable length code are coded / decoded in a bypass mode of the binary arithmetic coding / decoding engine using a uniform non-adaptive probability model, resulting in a compression ratio of 1 for each bin. Thus, each flag and each residual value is decoded for the position of the currently scanned transform coefficient, as indicated by 50 in Fig. 12b. In the pseudocode, this current position is indicated by a parameter or index k.
[0098]
number
[0099] When the residual value is coded / decoded for a particular current scan transform coefficient position 50, the residual value uniquely indicates the absolute value of the quantization index for the currently scanned transform coefficient position, either from the value domain if at least one flag is decoded for the currently scanned transform coefficient position, or from the initial value domain if no flag is decoded for the currently scanned transform coefficient position. Note that the transform coefficient positions for which the residual value has not been coded / decoded and for which one or more flags are coded / decoded already limit the value domain to include only one absolute value. If no transform coefficient is indicated at all, like the sign, the same may be coded separately in bypass mode, as is assumed in this embodiment, but does not necessarily require a modified embodiment. In FIG. 13, it is shown that any non-zero quantization index is coded / decoded separately in its own path 605, but this may be modified to arrive at further embodiments.
[0100] Dependent quantization is used to successively dequantize the quantization indexes of the transform coefficient positions of the coded set of transform coefficient positions. This process results in reconstructed transform coefficients for this set of transform coefficient positions. For example, state transitions as outlined above can be used. It may be realized by making a selection 72 for a current transform coefficient position, indicated for example using index k as shown in Fig. 10, using a state transition table or trellis diagram according to the scan order 62, whose quantization index is uniquely coded / decoded according to the above-mentioned concept, from a set of multiple reconstruction levels 73, i.e. set 0 and set 1 in Fig. 7, uniquely based on the state that the state transition assumes for the current transform coefficient position, indicated by "state" in Fig. 7, by inverse quantizing 74 the quantization index level[k] to a reconstruction level trec[k], where the quantization index points to a set of reconstruction levels, i.e. the reconstructed transform coefficient is set equal to said reconstruction level, and by updating 76 the state of the state transition that assumes for the one currently scanned during the dependent quantization to generate an updated state 78 for the current transform coefficient position, i.e. the position of the transform coefficient following the current transform coefficient in the scan order. The updating 76 is performed depending on the quantization index of the current transform coefficient position, level[k] as shown by 80 in Fig. 10, where table 82 is used for this end. Similarly, quantization using the selected level set is performed at the encoder side.
[0101] As illustrated above, the state transition may transition between four different states corresponding to the four elements of the vector described in FIG. 10. Furthermore, the update may be performed by determining between a first and a second successor state 841 and 842 depending on a binary function 86, such as a parity function, applied to the quantization index 80 of the current transform coefficient position, the first and second successor states depending on the state of the current transform coefficient position, as indicated at 88. The encoder and the decoder are parameterized with a set of levels reconstructed by a predetermined quantization step size, i.e. Δ in FIG. 7 and 2shift in FIG. 10, and information about the predetermined quantization step size is transmitted, for example, in the data stream. Furthermore, as shown in FIG. 7, each reconstructed level set may be composed of an integer multiple of a predetermined quantization step size that is constant or valid for all sets of reconstructed levels for the current transform coefficient position. It should be noted that different step sizes may be used for different coefficients within one block 10 due to the scaling matrix described above. The number of sets of reconstruction levels among the multiple reconstruction level sets may be two, and the multiple reconstruction level sets may include a first reconstruction level set, i.e., set 0, that includes zero and an even multiple of a predetermined quantization step size, and a second reconstruction level set that includes an odd multiple of the predetermined quantization step size.
[0102] So far, the description of Fig. 13 also applies to the embodiments described below. However, embodiment 1 uses the following mechanism to limit the number of flags coded using context adaptivity. In particular, in a particular pass of a sequence of passes, namely pass 601 shown in Fig. 13, flags of sig_flag type are only coded / decoded up to a pre-determined position that meets the pre-determined abort criterion in the first pass according to the scan order for the first time - "up to" should be understood in this specification as a position preceding and including, while the reference to a position "after [position 112]" should be understood to represent a position after position 112 excluding position 112 -. In Fig. 13, not only is the number of sig_flag limited in this way, but also the number of par_flag, gt1_flag in pass 601 and gt2_flag in pass 602. It should be noted that the limitation affects the binarization: as soon as the abort criterion is met, the respective flag type is no longer used to define the coefficient position following the pre-determined transform coefficient position immediately before in the scan order. That is, the flags of the predetermined flag type, i.e., those subject to a restriction on the number to be coded / decoded, are coded / decoded only for the positions of the transform coefficients preceding and including the position of the predetermined transform coefficient in the scan order. Thus, in Fig. 13, as soon as the criterion for the pass 601, i.e., related to MAX_REG_BINS, is met, for each of the coded set of positions of the transform coefficients following the position of the predetermined transform coefficient in the scan order, in a further pass of the sequence of passes, i.e., pass 603 in the case of Fig. 13, one of the residual values is coded, the latter directly, i.e., by any of the flags of the flag type used to code / decode the quantization index of the respective coefficient, without any restriction preceding the initial value domain.
[0103] In order to explain the just presented concept for limiting the number of context-adaptively coded / decoded flags, reference is made to Fig. 13 as well as Fig. 14 and Fig. 15. Fig. 14 shows an initial value domain for the absolute value of a quantization index of a transform coefficient at 90. This initial value domain may include all integer values between zero and any maximum value. The initial value domain may be an interval that opens towards larger numbers. The number of integer values in the initial value domain 90 does not necessarily have to be a power of two. Furthermore, Fig. 14 shows various flag types related to representing individual quantization indexes, i.e., to indicating their absolute value. There is a sig_flag type that indicates whether the absolute value of a particular quantization index is zero or not. That is, sig_flag 92 bifurcates the initial value domain 90 into two subparts, i.e., one contains only zero and the other contains all other possible values. That is, as shown in the lower part of Fig. 14, if the latter is zero, sig_flag already uniquely indicates the absolute value of the quantization index. The non-zero values of the initial value domain 90 form a value domain 94 which is further divided into two halves by a flag type par_flag, i.e., one for odd values and the other for even values. Only if the latter is non-zero, par_flag 96 needs to be present for a particular quantization index. par_flag 96 does not create uniqueness for one of the halves of the same division of the value domain 94. It indicates the next half of the resulting (recursively defined) value domain, and thus the next flag, i.e., gt1_flag 98, divides this resulting value domain into two halves after par_flag, further indicating odd non-zero values 100 if the quantization index value is odd, and even non-zero values 102 if the quantization index value is even. In particular, the division into two halves by gt1_flag 98 is performed such that one part simply contains the minimum odd value 100 of the value domain or the minimum non-zero even value 102 of the value domain, respectively. The other part contains all other values 100 / 102 of the respective domain.The remaining latter of the value domain is further bisected by the flag gt2_flag 104 in the same way, i.e. the minimum value represents one part and the other values represent the other part. As shown in the lower part of Fig. 14, this means that if the latter is zero, then simply sig_flag 92 is coded for the quantization index of the particular transform coefficient, if the latter is partitioned into a value interval 106 containing absolute values 1 and 2, sig_flag, par_flag and gt1_flag 92, 96 and 98 are coded to represent the absolute value of the quantization index of the particular transform coefficient, if the latter is partitioned into the value interval 108 immediately following containing values 3 and 4, then all flags 92, 96, 98 and 104 are coded to represent the absolute value of the quantization index of the particular transform coefficient, and additionally for the absolute value of the quantization index of the particular transform coefficient whose absolute value is in the remaining interval 110 of the initial value domain 90. The flag type flags 92, 96 and 98 are coded in a first pass 601. Flags 104 are coded in a second pass 602. These flags are coded using context-adaptive arithmetic coding. However, the number of flags coded in a pass may be limited, and may be limited by FIG. 13. In the example of FIG. 13, the number of flags of flag type in pass 601 is limited to max_rec_bins. Flags of flag type 92, 96 and 98 are coded for position 12 of the currently accessed transform coefficient in the first pass according to order 62 only if the total number of flags coded in pass 601 can be coded in pass 601 without exceeding the maximum allowed number of flags coded / decoded in pass 601. FIG. 15 shows that the position of the last transform coefficient in pass 601 that does not exceed the maximum allowed number of flags is 112. Similarly, a flag 104 of a flag type is coded for position 12 of the currently accessed transform coefficient in the second pass according to order 62 only if it can be coded in pass 602 without the total number of flags 104 coded in pass 602 exceeding the maximum allowed number of flags coded / decoded in pass 602.FIG. 15 shows that the position of the last transform coefficient in path 602 that does not exceed the maximum number of allowed flags is 116.
[0104] Although FIG. 15 illustrates the coding of the transform coefficients or their quantization indexes with the respective sub-block 14, as already indicated above, the embodiment of FIG. 13 may be modified in so far as all the processes of FIG. 13 are applied to the block 10 as a whole. Furthermore, FIG. 15 illustrates the case where the coded set of transform coefficients includes, for example, all coefficients for the case of the sub-block following the sub-block in the scanning order including the position 64 of the first non-zero transform coefficient. Accordingly, all transform coefficient positions indicated with diagonal lines in FIG. 15 relate to the quantization index of the transform coefficients represented as including flag types 92, 96 and 98. Thus, in a first pass 601, flags 92, 96 and 98 of these flag types are coded for the transform coefficients 12 up to position 112. For some of the transform coefficients 12 up to position 112, only sig_flag 92 needs to be coded, whereas all the other three flag types are included and coded / decoded in pass 601. FIG. 15 shows that the data stream accordingly includes a corresponding portion 114 where flags 92, 96 and 98 of these flag types are coded in pass 601. After position 112, nothing is coded / decoded in pass 601. In a second pass 602, positions 12 of transform coefficients are traversed again according to the scan order 62, and such gt2_flag is coded for transform coefficients whose gt1_flag 98 indicates that the absolute value of the corresponding quantization index is within the remaining value domain portion including intervals 108 and 118, as long as there is a maximum number of gt2_flag that can be coded during pass 602, i.e., as long as the number of such flags does not exceed max_gt2_bins. FIG. 15 shows all positions 12 of transform coefficients up to position 116 cross-hatched according to the scan order 62, distinguishing these positions from positions 12 of subsequent transform coefficients up to position 112, which are only hatched. All positions 12 of transform coefficients following position 112 are shown unhatched in FIG. 15. The gt2_flag 104 encoded during pass 602 is encoded into portion 118 of the data stream immediately following portion 114 .No further data is coded during pass 602 after position 116. In the next two passes 603, 604, which may be interpreted as forming half of one pass, the residuals are coded in the portion 120 of the data stream immediately following portion 118. In particular, in a first sub-portion of portion 120, during pass 603, the residuals for positions 12 of transform coefficients up to position 112 are coded. These residuals thus indicate the absolute value of the quantization index of the position 12 of a particular transform coefficient of the remaining value domain that includes the positions 12 of the cross-hatched transform coefficients, i.e. the interval 110 for the positions 12 of transform coefficients up to position 116, and the intervals 108 and 110 for the positions 12 of the simply hatched transform coefficients, i.e. the positions following position 116 up to position 112. After the residual sub-portion 122 of the positions 12 of the transform coefficients up to position 112, there is one further sub-portion 124 of the residual in which, during the pass 604, every position 12 of the transform coefficients following position 112, i.e. every position 12 of the transform coefficients that are not hatched, is coded into the data stream. The latter residuals directly indicate the quantization indexes, i.e. directly the absolute values out of the initial value domain 90. Thus, the number of context adaptive coding flags 92, 96, 98 and 104 is reduced, increasing the number of bins coded using the bypass mode, i.e. fixed equal probability mode, i.e. the bins of the binarization of the residual.
[0105] 13, the abort criteria discussed above is whether the number of flags decoded in the first pass exceeds a predetermined threshold. In addition to sig_flag, flags of types 96 and 98 are counted.
[0106] The variable length code for encoding / decoding the residual value for the currently scanned transform coefficient position may be selected from a set of predefined variable length codes, such as Golomb-Rice codes. The selected code may be different depending on whether the currently scanned transform coefficient position is located up to the predetermined transform coefficient position 112, i.e., at a hatched position in FIG. 15 or following the predetermined transform coefficient position 112 in the scan order 62, or in the case of FIG. 13, the selection may be dependent on whether the position is between positions 112 and 116. For example, the encoding / decoding of the residual may include a different VLC code in path 603 than in path 604, or even a different code for encoding / decoding the residual of the merely hatched coefficients of FIG. 15 at 128 in FIG. 13 compared to the VLC code used in encoding / decoding the residual of the cross-hatched coefficients shown at 130 in FIG. 15. The selection may include parameterizing a parameterizable VLC code, such as selecting an exponential-Golomb code order or a Rice parameter as described below. Alternatively, the parameter indicative of the selected variable length code may be kept constant in path 603 and gradually changed with the quantization index of the position of the preceding transform coefficient that meets a predetermined criterion. Or the binarization parameter may be selected in dependence on the quantization index of the position of the transform coefficient in the neighborhood of the position of the currently scanned transform coefficient when encoding the residual. This dependence is used, for example, for all hatched positions in Fig. 15, only in the case of the position of the current transform coefficient for which the residual is encoded that is the preceding or predetermined transform coefficient position 112 in the scan order 62. More details on this are outlined below.
[0107] The codeword selected from the selected / parameterized code also depends on the coefficient position where the residual is coded / decoded: the absolute value of the quantization index minus the maximum value representable by flags 92, 96, 98 and 104 of the first and second passes 601,2, i.e. 4 plus 1, i.e. 5, is represented, or, for the coefficient to which the quantization index belongs, the VLC to be coded is somewhere up to position 116, by the binarization of the residual of the quantization index of any coefficient, i.e. 5, by the flags 92, 96, 98 and 104 of the first pass 601, The absolute value of the quantization index minus the maximum value represented by 98, i.e. 2 plus 1, i.e. 3, is represented, or, for coefficients to which the quantization index belongs, the VLC encoded by the binarization of the residual of the quantization index of any coefficient is somewhere after position 116 to position 112, and the absolute value of the quantization index is represented directly, or, for coefficients to which the quantization index belongs, the VLC encoded by the binarization of the residual of the quantization index of any coefficient is somewhere after position 112.
[0108] Some variants of the embodiment of Fig. 13 may be applied. For example, gt2_flag may not be coded / decoded in a separate pass 602 but included in the first pass 601. The number of coded gt2_flag may then be included in the count of context coding bins in the first pass 601, and the first pass is terminated if the number of available context coding bins is less than 4. That is, in this case, a single threshold for the number of context coding bins is used. Alternatively, gt2_flag is not transmitted at all, in which case the residual is coded if gt1_flag is equal to 1. In another variation of this embodiment, one or more additional gtx_flag are included. Similar to gt2_flag, these flags are coded only if the preceding gty_flag (y=x-1) is equal to 1, and indicate whether the absolute value of the quantization index is greater than the smallest possible value specified by the preceding gtx_flag. The reconstruction of the absolute value is then given by: absLevel = sig_flag + par_flag + 2 * ( gt1_flag + gt2_flag + gt3_flag + … + remainder ). These flags may be coded in the same pass as gt2_flag (this includes the case where gt2_flag is included in the first pass), or in one or more additional passes, in which case a further threshold may be applied to limit the number of gtx_flag.
[0109] The second embodiment described below differs from the first embodiment in one aspect: the order of par_flag and gt1_flag are swapped (thus changing the meaning of these flags). If sig_flag is equal to 1, the first gt1_flag is transmitted, which specifies whether the absolute value of the transform coefficient level is greater than 1 or not. And if gt1_flag is equal to 1, par_flag specifies the residual parity (i.e. absolute level -2). As in the first embodiment, the following applies: • The state machine for dependent quantization is driven by the parity of the transform coefficient levels, i.e., each binary function path (level) returns the parity of its argument; ● The probability model for sig_flag in the first pass is selected based on the corresponding values of the state variables (and optionally other parameters available to the decoder, see above). First Pass: In the first pass over the scan positions, the following context-coding bins are transmitted: ●sig_flag indicates whether the transform coefficient is not equal to 0; if sig_flag can be assumed to be equal to 1 (for example, which is the case for the first significant scan position in the transform block (one that is explicitly signaled by the x and y coordinates)), then sig_flag is not transmitted. If sig_flag is equal to 1 (encoded or estimated value), the following is additionally sent for the current scan position: ○ gt1_flag specifies whether the absolute value is greater than 1; ○ If gt1_flag is equal to 1, then par_flag specifies absolute level parity -2; If a predefined maximum number of context coding bins is reached, the first pass is terminated. Let MAX_REG_BINS be the maximum number of bins that can be sent in the first pass, and regBins represent the number of positive coding bins still available. Then the following applies: ○ regBins is initially set equal to MAX_REG_BINS; After encoding any bin (sig_flag, gt1_flag, par_flag), regBins is decremented by 1; ○If, after sending the bins (sig_flag and, if applicable, gt1_flag and par_flag) for a scan position, the number of bins still available, regBins, is less than 3 (i.e., sig_flag, par_flag and gt1_flag cannot be sent for the next scan position), then the first scan path is terminated. Second Pass: In the second pass over the scan positions, the following context-encoded bins are transmitted: ● If gt1_flag at a scan position is equal to 1, then gt2_flag is sent specifying whether the residual (given by absolute level-2-par_flag) / 2) is greater than 0 or not. The second pass is terminated if a predefined maximum number of context-encoded gt2_flag has been transmitted. The second pass is also terminated if a scan position is reached where no data was transmitted in the first pass (i.e., for such scan position no data is transmitted in the second pass). Third Pass: In the third pass over scan positions, absolute level residuals (i.e., data not already specified by transmitted sig_flag, par_flag, gt1_flag, and gt2_flag) are transmitted for all scan positions where sig_flag was coded in pass 1. The residuals for non-binary syntax elements are binarized using a structured code (such as Golomb-Rice code) and the bins are coded in bypass mode of the arithmetic coding engine. The residuals are transmitted for the following scan positions: For all scan positions, gt2_flag equal to 1 is sent in the second pass: For these scan positions, the remainder of the non-binary syntax elements transmitted specify the following: (absolute value-4-par_flag) / 2 For all scan positions, gt1_flag equal to 1 was sent on the first pass, but gt2_flag was not sent on the second pass: For these scan positions, the remainder of the non-binary syntax elements transmitted specify the following: (absolute value-2-par_flag) / 2 Fourth Pass: In the fourth pass, absolute levels for all scan positions for which no data was transmitted in the first pass are encoded. The absolute levels are first binarized using a structured code, and the code used can depend on local activity measurements as well as the current state variable values. The bins are transmitted using the bypass mode of the arithmetic coding engine. Fifth Pass: Finally, in the fifth pass, the signs of all transform coefficient levels not equal to 0 are transmitted. The signs are transmitted in a bypass mode of the arithmetic coding engine. The pseudocode of Fig. 16 further illustrates the encoding / decoding process of the transform coefficient level within a sub-block. The same comments as in the first embodiment apply. Fig. 17 illustrates a modified version of Fig. 14 adapted to Fig. 16. Fig. 15 is also modified for Fig. 16, except for the details that the residual starts from the value domain related to the coefficient between positions 112 and 116, i.e. the maximum value is represented using flags 92, 96 and 98, which is 2 in Fig. 13 and 1 in Fig. 16. As can be seen in the other cases of Fig. 13, the encoding / decoding of the flag par_flag in the first pass 601 is performed exclusively for the transform coefficient positions and subsequent transform coefficient positions for which the flag gt1_flag indicates that the quantization index of the corresponding scanned transform coefficient has a magnitude greater than 1. In the case of Fig. 13, this encoding / decoding is necessarily performed in the non-zero case indicated by the corresponding sig_flag.
[0110] In a variation of this embodiment, gt2_flag is not coded in a separate pass, but is included in the first pass. The number of coded gt2_flag is then included in the count of context coding bins in the first pass, and the first pass is terminated if the number of available context coding bins is less than 4. That is, in this case, a single threshold for the number of context coding bins is used.
[0111] Alternatively, gt2_flag is not sent at all, in which case the residual is encoded when gt1_flag is equal to 1.
[0112] In another variation of this embodiment, one or more additional gtx_flag are included. Similar to gt2_flag, these flags are coded only if the preceding gty_flag (y=x-1) is equal to 1. Indicates whether the absolute value of the quantization index is greater than the smallest possible value specified by the preceding gtx_flag. The reconstruction of the absolute value is then given by: absLevel = sig_flag + gt1_flag + par_flag + 2 * ( gt2_flag + gt3_flag + … + remainder ) These flags may be coded in the same pass as gt2_flag (this includes the case where gt2_flag is included in the first pass), or in one or more additional passes, in which case a further threshold may be applied to limit the number of gtx_flag.
[0113] The third embodiment differs from the first embodiment in one aspect: sig_flag in the first pass is coded for all scan positions, and only the presence of par_flag and gt1_flag is determined by the number of context coding bins already transmitted. As in the first embodiment, the following applies: • The state machine for dependent quantization is driven by the parity of the transform coefficient levels, i.e., each binary function path (level) returns the parity of its argument; ● The probability model for sig_flag in the first pass is selected based on the corresponding values of the state variables (and optionally other parameters available to the decoder, see above). First Pass: In the first pass over the scan positions, the following context-coding bins are transmitted: ●sig_flag indicates whether the transform coefficient is not equal to 0; if sig_flag can be assumed to be equal to 1 (for example, which is the case for the first significant scan position in the transform block (one that is explicitly signaled by the x and y coordinates)), then sig_flag is not transmitted. If sig_flag is equal to 1 (encoded or estimated value), the following is additionally sent for the current scan position: ○par_flag specifies the absolute level parity minus 1; gt1_flag specifies whether the residual (given by (absolute level-1-par_flag) / 2) is greater than 0. If a predefined maximum number of context coding bins (still including coded sig_flag) is reached, the transmission of par_flag and gt1_flag is skipped. Let MAX_REG_BINS be the maximum number of bins that can be transmitted in the first pass, and regBins represent the number of positive coding bins still available. Then the following applies: ○ regBins is initially set equal to MAX_REG_BINS minus the sig_flag sent in the first pass (this number is given by the first scan index for the first pass, the last scan index of the subblock, and information on whether the subblock contains the first significant coefficient in the scan order); ○ After encoding any gt1_flag or par_flag, regBins is decremented by 1; ○If after sending the bins (sig_flag, and if sig_flag is equal to 1, gt1_flag, par_flag) for a scan position, the number of bins still available regBins is less than 2 (i.e., par_flag and gt1_flag cannot be sent for the next scan position), then only sig_flag is sent for all subsequent scan indexes in the first scan path. Second Pass: In the second pass over the scan positions, the following context-encoded bins are transmitted: ● If gt1_flag at a scan position is equal to 1, then gt2_flag is sent and specifies whether the residual (given by absolute level-3-par_flag) / 2) is greater than 0. The second pass is terminated if a predefined maximum number of context-encoded gt2_flag has been transmitted. The second pass is also terminated if a scan position is reached where only sig_flag equal to 1 was transmitted in the first pass (i.e., for such scan positions, no data is transmitted in the second pass). Third Pass: In the third pass over scan positions, absolute level residuals (i.e. data not already specified by transmitted sig_flag, par_flag, gt1_flag and gt2_flag) are transmitted for all scan positions where sig_flag, gt1_flag and par_flag were coded in pass 1. The residuals for non-binary syntax elements are binarized using a structured code (such as Golomb-Rice code) and the bins are coded in bypass mode of the arithmetic coding engine. The residuals are transmitted for the following scan positions: For all scan positions, gt2_flag equal to 1 is sent in the second pass: For these scan positions, the remainder of the non-binary syntax elements transmitted specify the following: (absolute value-5-par_flag) / 2 For all scan positions, gt1_flag equal to 1 was sent on the first pass, but gt2_flag was not sent on the second pass: For these scan positions, the remainder of the non-binary syntax elements transmitted specify the following: (absolute value-3-par_flag) / 2 4th pass: In the 4th pass, the absolute level minus 1 is coded for all scan positions, and only sig_flag equal to 1 in the first pass is coded (but gt1_flag is not transmitted). The residual (absolute level minus 1) is first binarized using a structured code, and the code used can depend on local activity measurements as well as the current state variable values. The bins are transmitted using the bypass mode of the arithmetic coding engine. Fifth Pass: Finally, in the fifth pass, the signs of all transform coefficient levels not equal to 0 are transmitted. The signs are transmitted in a bypass mode of the arithmetic coding engine. The pseudocode of Fig. 18 further illustrates the coding process of the transform coefficient levels within a sub-block. The same comments as in the first embodiment apply. Fig. 14 and Fig. 15 are also modified for Fig. 18, except for the fact that position 112 indicates positions where flags 96 and 98 are no longer coded according to scan order 62, while sig_flag is available throughout the block, and the residuals for positions 112 downstream of the transform positions, i.e. those not hatched, do not represent the quantization index of the corresponding coefficient, but rather are coded for coefficients after position 112 whose sig_flag indicates non-zero and only the absolute level of the quantization index minus one.
[0114] Note that after the first sig_flag equal to 1 is coded, no state variables are known and no gt1_flag / par_flag follows, so for subsequent sig_flag the probability model used must be derived independently from the state variables (which still depend on the state variables for the preceding sig_flag).
[0115] The following variations of embodiment 3 are possible. 1. The state machine is driven by sig_flag (i.e., the information whether the transform coefficient level is equal to zero or not). A binary function path specifies whether the level is not equal to zero or not. In this case, no parity flag needs to be transmitted and only the following data is transmitted appended to sig_flag: ● First pass: gt1_flag (sig_flag transmission equal to 1; specifies whether absolute level is greater than 0; ● Second pass: gt2_flag (sending gt1_flag equal to 1; specifies whether the absolute level is greater than 2 or not. This has the advantage that the state variables are known for all sig_flag, and therefore the probability model used to code sig_flag can be selected based on the state variables. Furthermore, gt1_flag can be removed from the first pass and coded in a separate pass as follows: First pass: Sending sig_flag ● Second pass: Send gt1_flag (up to the maximum number of gt1_flag) ● Third pass: Send gt2_flag (up to the maximum number of gt2_flag) Fourth pass: (a) the remainder of the scan indexes where gt2_flag equal to 1 was sent, and (b) where gt1_flag equal to 1 was sent but no gt2_flag was sent. Fifth pass: absolute level minus 1 for scan positions where sig_flag is equal to 1 but gt1_flag was not sent Sixth pass: Signs for all transform coefficient levels not equal to 0
[0116] 2. The state machine switches from a parity driven state machine to a critical driven state machine, which means: ● For all scan indices where regBins (specified in the pseudocode above) is greater than or equal to 2, the state variables are updated with parity (i.e., the binary function path specifies the parity of the transform coefficient levels); After regBins becomes less than 2, the state variables are updated using the significant information (i.e., the binary function path(level) specifies whether the level is not equal to 0 or not). This has the advantage that the state variables are known for every sig_flag, and therefore the probability model used to encode sig_flag may be selected based on the state variables. In contrast to variant 1 (where the state machine is always driven by sig_flag), a higher compression density in the N-dimensional space and a higher encoding efficiency are achieved.
[0117] That is, the state transitions 76 described as merely parity driven may now be modified to the extent that the update of the state transition depends on whether the position of the current transform coefficient given by k in Fig. 10 precedes in the scan order 62 the predetermined transform coefficient position 112, i.e. the one hatched in Fig. 15, or exceeds the latter range, i.e. the non-hatched position shown in Fig. 15, with respect to the scan 601. If the position of the current transform coefficient does not exceed the predetermined transform coefficient position 112 according to the scan order 62, i.e. occurs before or is equal to the transform coefficient position 112, the subsequent update depends on the second flag type flag 96 of the current transform coefficient position, i.e. the parity as described above, but if the position of the current transform coefficient follows the predetermined transform coefficient position in the scan order, i.e. exceeds it according to the scan order 62, the update depends on the first flag of the transform coefficient position, i.e. the zero value of the current coefficient. This may then be utilized when context-adaptive entropy decoding flags of the first predetermined flag type, i.e. according to this embodiment, the sig_flag related to the representation of the quantization index of each coefficient exceeds coefficient position 112 other than the parity flag and the gt1 flag whose encoding stops at 112: it is thus possible for the decoder and encoder to determine the context of such sig_flag for the currently scanned transform coefficient, depending on the state the state transition assumes for the currently scanned transform coefficient position, for all transform coefficient positions preceding, including and exceeding the predetermined transform coefficient position 112.
[0118] Alternatively, state updates may be performed in any manner such as simply being parity driven, with the context for sig_flag up to position 112 being performed independently after position 112, based on the state of the dependent quantization.
[0119] As in the first embodiment, the following modifications are possible. ● The first pass contains gt2_flag; ● gt2_flag is not coded at all; ●An additional gtx_flag is encoded.
[0120] That is, in the third embodiment, there is a flag 92 of a first predetermined flag type, i.e., sig_flag, and a flag 96 of a second predetermined flag type, i.e., par_flag, which, as in the other embodiments, are coded / decoded such that the flag limiting the value domain of the absolute value of the quantization index for the position of the first transform coefficient is coded / decoded before the flag limiting the value domain of the absolute value of the quantization index for the position of the second transform coefficient that follows the position of the first transform coefficient in the scan order 62. That is, any sig_flag[k] and par_flag[k] are coded / decoded before sig_flag[k+1] and par_flag[k+1]. However, other than the case of Fig. 13, the coding / decoding of the flag of the predetermined second flag type, i.e. par_flag, is performed up to the predetermined transform coefficient position 112 indicated by "startldxByass-1" in Fig. 18, and the abort criterion is met in the first pass 601 according to the scan order 62 only when - for example, the number of coded flags in the first pass 601 exceeds a certain threshold - the coding / decoding of the flag of the predetermined first flag type, i.e. sig_flag, is performed in the scan order 62 beyond the predetermined transform coefficient position 112, i.e., for example, for all transform coefficients or for the first non-zero quantization index for position 64, but not all, without checking any abort criterion.
[0121] The fourth embodiment differs from the third embodiment in one aspect: the order of par_flag and gt1_flag are swapped (and the meaning of these flags is changed accordingly). If sig_flag is equal to 1, the first gt1_flag is sent, specifying whether the absolute value of the transform coefficient level is greater than 1 or not. And if gt1_flag is equal to 1, par_flag specifies the residual parity (i.e., absolute level -2). As in the first embodiment, the following applies: • The state machine for dependent quantization is driven by the parity of the transform coefficient levels, i.e., each binary function path (level) returns the parity of its argument; ● The probability model for sig_flag in the first pass is selected based on the values of the state variables (and optionally other parameters available to the decoder, see above). First Pass: In the first pass over the scan positions, the following context-coding bins are transmitted: ●sig_flag indicates whether the transform coefficient is not equal to 0; if sig_flag can be assumed to be equal to 1 (for example, which is the case for the first significant scan position in the transform block (one that is explicitly signaled by the x and y coordinates)), then sig_flag is not transmitted. If sig_flag is equal to 1 (encoded or estimated value), then the following is sent additionally for the current scan position: gt1_flag specifies whether the absolute level is greater than 1. If gt1_flag is equal to 1, then par_flag specifies the absolute level of parity minus 2. If a predefined maximum number of context coding bins (still including coded sig_flag) is reached, the transmission of par_flag and gt1_flag is skipped. Let MAX_REG_BINS be the maximum number of bins that can be transmitted in the first pass, and regBins represent the number of positive coding bins still available. Then the following applies: ○ regBins is initially set equal to MAX_REG_BINS minus the sig_flag sent in the first pass (this number is given by the first scan index for the first pass, the last scan index of the subblock, and information on whether the subblock contains the first significant coefficient in the scan order); ○ After encoding any gt1_flag or par_flag, regBins is decremented by 1; ○If after sending the bins (sig_flag, and if sig_flag is equal to 1, gt1_flag, par_flag) for a scan position, the number of bins still available regBins is less than 2 (i.e., par_flag and gt1_flag cannot be sent for the next scan position), then only sig_flag is sent for all subsequent scan indexes in the first scan path. Second Pass: In the second pass over the scan positions, the following context-encoded bins are transmitted: ● If gt1_flag at a scan position is equal to 1, then gt2_flag is sent and specifies whether the residual (given by absolute level-2-par_flag) / 2) is greater than 0. The second pass is terminated if a predefined maximum number of context-encoded gt2_flag has been transmitted. The second pass is also terminated if a scan position is reached where only skip_flag equal to 1 was transmitted in the first pass (i.e., for such scan position, no data is transmitted in the second pass). Third Pass: In the third pass over scan positions, absolute level residuals (i.e. data not already specified by transmitted sig_flag, par_flag, gt1_flag and gt2_flag) are transmitted for all scan positions where sig_flag, gt1_flag and par_flag were coded in pass 1. The residuals for non-binary syntax elements are binarized using a structured code (such as Golomb-Rice code) and the bins are coded in bypass mode of the arithmetic coding engine. The residuals are transmitted for the following scan positions: For all scan positions, gt2_flag equal to 1 is sent in the second pass: For these scan positions, the remainder of the non-binary syntax elements transmitted specify the following: (absolute value-4-par_flag) / 2 For all scan positions, gt1_flag equal to 1 was sent on the first pass, but gt2_flag was not sent on the second pass: For these scan positions, the remainder of the non-binary syntax elements transmitted specify the following: (absolute value-2-par_flag) / 2 4th pass: In the 4th pass, the absolute level minus 1 is coded for all scan positions, and only sig_flag equal to 1 in the first pass is coded (but gt1_flag is not transmitted). The residual (absolute level minus 1) is first binarized using a structured code, and the code used can depend on local activity measurements as well as the current state variable values. The bins are transmitted using the bypass mode of the arithmetic coding engine. Fifth Pass: Finally, in the fifth pass, the signs of all transform coefficient levels not equal to 0 are transmitted. The signs are transmitted in a bypass mode of the arithmetic coding engine. The pseudocode in Figure 19 further illustrates the coding process of transform coefficient levels within a sub-block. Similar comments as in the first and third embodiments apply. Figures 17 and 15 are also modified for Figure 19, however, in Figure 15 the residual is changed to the start of the value domain for the residual for the coefficients between positions 112 and 116, i.e. the maximum value representable using flags 92, 96 and 98, 2 in the case of Figure 13 and 1 in the case of Figure 19.
[0122] The fourth embodiment can be modified in the same manner as the third embodiment, including the following aspects (similar to the second embodiment). ● The first pass contains gt2_flag; ● gt2_flag is not coded at all; ●An additional gtx_flag is encoded.
[0123]
number
number
number
[0124] Probability model selection for par_flag, gt1_flag, and gt2_flag The adaptive probability model for encoding the current par_flag is selected from a set of probability models. Similarly for the significance flag, we assume that the available probability models are organized in a 4-dimensional array. probModelPar[ cPar ][ sPar ][ dPar ][ aPar ], Here, 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 x and y positions in the transform block, and aPar specifies indices that depend on the local activity measures. A similar concept is also used for gt1_flag and par_flag. probModelGt1[ cGt1 ][ sGt1 ][ dGt1 ][ aGt1], probModelGt2[ cGt2 ][ sGt2 ][ dGt2 ][ aGt2 ] In a preferred embodiment, the same index is used for the three flags par_flag, gt1_flag and gt2_flag. This has the advantage that the index (or the combined index) has to be calculated only once per scan index. cGt2 = cGt1 = cPar sGt2 = sGt1 = sPar dGt2 = dGt1 = dPar aGt2 = aGt1 = aPar Even though the indices are the same, still different sets of probability models are used for the three flags par_flag, gt1_flag and gt2_flag. In another embodiment, the same set of probability models is used for both gt1_flag and gt2_flag (in this case, for each sample position, gt1_flag and gt2_flag are always coded with the same probability model). It is also possible to use different methods of deriving the indexes of the individual flags. In the following, for example, the indexes cPar, sPar, dPar and aPar are described. The same method is applied to the corresponding indexes for gt1_flag and gt2_flag. Color channel index cPar In a preferred embodiment, the color channel index cSig, as well as the significance flag, are set as follows: cPar = (current channel is luma ? 0 : 1 ) Alternatively, the alternatives described above for cSig can be used.
number
number
[0125]
number
[0126]
number
[0127] That is, the variable length code for encoding / decoding the residual value for the currently scanned transform coefficient position may be selected from a set of predefined variable length codes, such as a set of Golomb-Rice codes that differ from each other by the RP. The selection may depend on whether the currently scanned transform coefficient position at which the residual is encoded / decoded is located up to the predetermined transform coefficient position 112 or downstream of it in the scan order 62. That is, different RPs are selected in the former and latter cases. According to the above-mentioned methods 1 and 2, the RP parameter indicating the selected variable length code may generally be kept constant during the passes 603, 4, but as in the method 1, it may be gradually changed to the quantization index of the preceding decoded / coded transform coefficient that meets a predetermined criterion, such as exceeding a certain limit, or to the quantization index at a transform position in the vicinity of the currently scanned transform coefficient position that meets some criterion, such as exceeding a certain limit. For example, this dependency or incremental change may be used only if the current transform coefficient position at which the residual is encoded is located up to the predetermined transform coefficient position 112, i.e., for all hatched positions in FIG. 15. In addition to the quantization indexes of the neighboring coefficients, the dependent quantization states may be used to select the binarization code parameters.
[0128] The following aspect can be combined with the above-mentioned embodiments, but may alternatively be implemented therein in order to increase coding efficiency: This aspect concerns the explicit signaling of blocks / sub-blocks that do not contain any of the transform coefficient levels with absolute value greater than 1. In order to reduce the number of bins for coding the transform coefficient levels, a dedicated flag is introduced per transform block or sub-block to signal if any of the absolute levels within the block or sub-block are greater than 1: If a subblock with coded_subblock_flag is equal to 1 (coded or estimated), a second flag is sent for the subblock. This flag (gt1_subblock_flag) specifies whether the subblock contains any transform coefficient levels with absolute levels greater than 1. If gt1_subblock_flag is equal to 0, then only the significance information (sig_flag) and the sign bits of the transform coefficient levels not equal to 0 are transmitted. If gt1_subblock_flag is equal to 1, the encoding of the transform coefficient levels proceeds as described in embodiments 1 to 4, possibly including further states, where when the last scan index in a subblock is reached and all previous absolute levels in the subblock are equal to 1, then it is possible to deduce that the last absolute level is greater than 1 - thus the corresponding gt1_flag may be estimated to be equal to 1. Also for embodiments 1 and 3, the parity flag par_flag may be estimated to be equal to 0 in this case. A flag specifying that all levels have absolute values equal to 1 can also be sent for the entire transform block, or alternatively on a sub-block basis. It is also possible to send this flag only for selected sub-blocks (e.g., the sub-block containing the first significant coefficient).
[0129] That is, the transform coefficient block 10 is now coded / decoded in the following manner: for each of at least one set of sub-blocks 14 into which the transform coefficient block 10 is divided, a sub-block significance flag, i.e. gt1_subblock_flag, is transmitted indicating whether each sub-block 14 contains a transform coefficient 12 whose absolute value of a quantization index is greater than a predetermined non-zero threshold, etc. The transform coefficients of the transform coefficient block in each sub-block 14 in which the sub-block significance flag indicates that there is at least one transform coefficient whose absolute value of a quantization index is greater than a predetermined non-zero threshold, are coded / decoded as described above by recursively bisecting the value domain of each transform coefficient into two parts and sequentially coding / decoding for each transform coefficient in the respective sub-block a sequence of one or more flags 92, 96, 98, 194 or other flags indicating in which of the two parts the quantization index of each transform coefficient is present, with the accompanying stopping of decoding the sequence as soon as the value domain contains only one value or values that are equal in the absolute sense, if the value domain is interpreted to define a signed value. If the value domain still contains one or more values that are distinct in the absolute sense, the residual values that indicate the absolute values of the quantization indexes of each transform coefficient in the value domain are coded / decoded. Within each subblock for which the subblock critical flag indicates that there are no transform coefficients whose absolute value of a quantization index is greater than a predetermined non-zero threshold value, Subsequent decoding of the sequence of one or more flags for each of the transform coefficients in each sub-block is stopped as soon as the value domain contains only one value that does not exceed a non-zero threshold, simply one value or simply values that are equal in an absolute sense. The first stopping criterion arises from the fact that the remaining value domain or remaining value interval simply contains one such value, as determined by the previously coded / decoded flags for each coefficient, that satisfies the requirement indicated by the sub-block critical flag by the index of all coefficients in each sub-block not exceeding a predetermined non-zero threshold, and thus this one value of this value domain is the quantization index.
[0130] Thus, inter alia, the following embodiments have been described above:
[0131] A1. An apparatus for decoding a block of transform coefficients, the apparatus using context-adaptive binary arithmetic decoding in a sequence of passes that scans positions of transform coefficients of the block according to a scan order (note that the passes need not scan positions of all transform coefficients of a transform block, but all use the scan order, and further that flags for some of the flag types may be transmitted in the same pass) to 1) decode flags (e.g., embodiment 1: sig_flag, par_flag, gt1_flag, gt2_flag), each of which is one of a set of one or more flag types, and variable length codes (e.g., using compression ratio 1; transmitted in bypass mode; as described above, VLC codeword bins may be encoded using an arithmetic code engine, but instead of using this context adaptation, this is performed using a (0.5;0.5) probability bypass mode - alternatively, these VLC codeword bins may be encoded using a binarization and non-adaptive binary arithmetic decoding or a bypass mode with a uniform probability model at the start of the bypass mode. LC bins), 2) decoding residual values (residuals) from the data stream such that a respective flag and a respective residual value are decoded for the currently scanned transform coefficient position (e.g., embodiment 1: index k), and for each transform coefficient position of the coded set of transform coefficient positions (e.g., extending between a predefined first transform coefficient position and a predefined last transform coefficient position, where the predefined first and last transform coefficient positions identify a subset of the transform coefficient positions in a transform block; alternatively, extending between a predefined coefficient such as, for example, the last non-zero coefficient and a DC coefficient), at least one of the one or more flags and one residual value (e.g., one residual and no flags, one or more flags and one residual, or one or more flags and no residual) is successively decoded to obtain an initial value domain (e.g., x-bit representation → Ω=0 to 2) in which the absolute value of the quantization index for the currently scanned transform coefficient position lies. x-1; e.g., x=16) in a continuous (i.e., continuous sense) manner to include only the absolute values of the quantization indexes for the currently scanned transform coefficient positions in the value domain (i.e., the "one or more flags and one residual value" to be decoded for a particular transform coefficient position uniquely defines the latter from the initial value domain), where each flag defines a value domain of the absolute values of the quantization indexes for the currently scanned transform coefficient positions, where the value domain of the absolute values of the quantization indexes for the currently scanned transform coefficient positions is divided in half (e.g., sig_flag: value domain Ω includes A={0} and
number
number
[0132] A2. The apparatus of any of embodiments B5 or A1 configured to perform the state transitions between four distinct states.
[0133] A3. An embodiment configured to perform the updating by deciding between a first successor state and a second successor state in dependence on a binary function applied to the quantization index of the current transform coefficient position when updating the state of the state transition, the first successor state and the second successor state being dependent on the state of the current transform coefficient position. An apparatus as described in any of B5 or A1-A2.
[0134] A4. Embodiment B5 or B6, in which the binary function produces the parity or zero. An apparatus according to any one of A1-A3.
[0135] A5. The apparatus of any of embodiments B5 or A1-A4, configured to parameterize the plurality of quantization level sets by a predetermined quantization step size and to derive information regarding the predetermined quantization step size from the data stream.
[0136] A6. The apparatus of any of embodiments B5 or A1-A5, wherein each of the plurality of quantization level sets is comprised of a multiple of a predetermined quantization step size that is constant for the plurality of quantization level sets.
[0137] A7. The apparatus of any of embodiments B5 or A1-A6, wherein the number of quantization level sets among the plurality of quantization level sets is two, and the plurality of quantization level sets includes a first quantization level set that includes zero and an even multiple of a predetermined quantization step size, and a second quantization level set that includes zero and an odd multiple of the predetermined quantization step size.
[0138] A8. The decoder, in a first pass of the sequence of passes, 1) decodes from the data stream a flag of a predetermined first flag type (e.g., sig_flag) and a flag of a predetermined second flag type (e.g., par_flag) such that a flag limiting the value domain of an absolute value of a quantization index for a position of a first transform coefficient is decoded before a flag limiting the value domain of an absolute value of a quantization index for a position of a second transform coefficient that follows the position of the first transform coefficient in scan order (i.e., any sig_flag[k] and par_flag[k] before any sig_flag[k+1] and par_flag[k+1]), where the decoding of the flag of the predetermined second flag type is performed only when a predetermined transform coefficient position in the first pass meets a predetermined abort criterion in the scan order for the first time (e.g., the number of flags coded in the first pass exceeds a certain threshold) (e.g., embodiment 3: startIdxBypass-1), and the decoding of the flag of the predetermined first flag type is performed beyond the position of the predetermined transform coefficient in the scan order (for all of the coded sets or for the first non-zero quantization index for which no abort criterion has been measured), and the flag of the predetermined first flag type indicates whether the quantization index of the currently scanned transform coefficient is zero (e.g., sig_flag).
[0139] A9. The apparatus of embodiment A8, in which the flag of the second predetermined flag type indicates the parity of the quantization index for the currently scanned transform coefficient.
[0140] A10. An apparatus as described in any of preceding embodiments A8-A9, configured to decode the flag of the second predetermined flag type in the first pass exclusively for transform coefficient positions where the flag of the first predetermined flag type indicates that the quantization index of the currently scanned transform coefficient is non-zero and subsequent transform coefficient positions.
[0141] A11. The apparatus of embodiment A8, wherein the predetermined abort criterion is related to a number of flags decoded in the first pass exceeding a predetermined threshold.
[0142] A12. An apparatus as described in any of the preceding embodiments A8-A11, configured to also decode, in the first pass, a flag of a third predetermined flag type indicating whether the quantization index for the currently scanned transform coefficient position is assumed to be the minimum value in the value domain in terms of absolute value.
[0143] A13. The apparatus of embodiment A12, configured to decode the flag of the third predetermined flag type exclusively for transform coefficient positions and subsequent transform coefficient positions where the flag of the first predetermined flag type indicates that the quantization index for the currently scanned transform coefficient is non-zero in the first pass.
[0144] A14. The apparatus of embodiment A13 (e.g., embodiment 3), configured to decode the flag of the third predetermined flag type after the flag of the second predetermined flag type for transform coefficient positions and subsequent transform coefficient positions where the flag of the first predetermined flag type indicates that the quantization index for the currently scanned transform coefficient position is non-zero in the first pass.
[0145] A15. The apparatus of embodiment A13 (e.g., embodiment 4), configured to decode the flag of the second predetermined flag type exclusively for transform coefficient positions where the flag of the first predetermined flag type indicates that the quantization index for the currently scanned transform coefficient position is non-zero and for subsequent transform coefficient positions where the flag of the third predetermined flag type indicates a magnitude greater than 1, in the first pass.
[0146] A16. An apparatus as described in any of the preceding embodiments A8-A15, configured to also decode, in a second pass following the first pass, a flag of a fourth predetermined flag type indicating whether the quantization index for the position of the currently scanned transform coefficient is assumed to be the minimum value in the value domain, in terms of absolute value, as limited by the flag decoded in the first pass.
[0147] A17. The apparatus of embodiment A16, configured to decode the residual value in one or more additional passes following the second pass.
[0148] A18. The apparatus of any one of embodiments A8-A17, wherein the apparatus is configured to decode the residual value in one or more passes following the first pass.
[0149] A19. The apparatus of any one of embodiments A8-A18 configured to decode signs of non-zero transform coefficients in a final pass.
[0150] A20. The decoder 1) in the state transition, - if the position of the current transform coefficient precedes or is equal to the position of the predetermined transform coefficient in the scan order, for the respective transform coefficient position - depending on the flag of the second flag type (e.g., embodiment 3: par_flag) of the position of the current transform coefficient, - if the position of the current transform coefficient follows the position of the predetermined transform coefficient in the scan order, for the respective transform coefficient position - depending on the flag of the first flag type (e.g., embodiment 3: pass (level) produces zero) of the position of the current transform coefficient. 1) performing the update of the state of the state transition (e.g., embodiment 3, second variant "2. The state machine switches from a parity driven state machine to a significance driven state machine."); and 2) in the context adaptive entropy decoding, configured to determine a context for decoding the predetermined first flag type flag for the currently scanned transform coefficient for all transform coefficient positions preceding, including and following the predetermined transform coefficient position depending on the state that the state transition assumes for the currently scanned transform coefficient position.
[0151] A21. The device is configured to determine, in the context adaptive entropy decoding, a context for decoding a flag of the predetermined first flag type for the currently scanned transform coefficient position depending on the state that the state transition assumes for the currently scanned transform coefficient position for the transform coefficient positions preceding and including the predetermined transform coefficient position, and independently of the state that the state transition assumes for the currently scanned transform coefficient position for the transform coefficient positions following the predetermined transform coefficient position (e.g., embodiment 3), as described in any of the preceding embodiments A8-A19.
[0152] A22. The decoder is configured to: 1) in the context adaptive entropy decoding, determine a context for decoding a flag (92) of the predetermined first flag type for the currently scanned transform coefficient position for all transform coefficient positions preceding, including and following the predetermined transform coefficient position (112) depending on the state that the state transition assumes for the currently scanned transform coefficient position; and 2) in the state transition, perform the update of the state of the state transition assumed for the current transform coefficient position for transform coefficient positions following the respective transform coefficient position in the scan order depending on the flag of the first flag type for the current transform coefficient position (e.g., embodiment 3: path (level) results in zero) (e.g., embodiment 3: first variant), as described in any of the preceding embodiments A8-A19.
[0153] B1. An apparatus for decoding a block of transform coefficients, comprising: in a sequence of passes scanning positions of the transform coefficients according to a scan order (note that the passes need not scan all transform coefficient positions of a transform block, but may all use the scan order, and furthermore, flags for some of the flag types may be transmitted in the same pass), the apparatus decodes from the data stream 1) flags (e.g., embodiment 1: sig_flag, par_flag, gt1_flag, gt2_flag) each being one of a set of one or more flag types, using context-adaptive binary arithmetic decoding; and 2) residual values (residual) using a variable length code (e.g., using compression rate 1; transmitted in bypass mode; therefore, see also the comments for A1), The respective flag and the respective residual value are decoded respectively for the currently scanned transform coefficient position (e.g., embodiment 1: index k), and for each transform coefficient position of the coded set of transform coefficient positions (e.g., extending between a predefined first transform coefficient position and a predefined last transform coefficient position, where the predefined first and last transform coefficient positions identify a subset of the transform coefficient positions in a transform block; alternatively, extending between a predefined coefficient, e.g., the last non-zero coefficient and a DC coefficient), at least one of the one or more flags and one residual value (e.g., one residual and no flag, one or more flags and one residual, or one or more flags and no residual) is successively decoded to determine an initial value domain (e.g., x-bit representation → Ω=0 to 2 ) in which the absolute value of the quantization index for the currently scanned transform coefficient position lies. x-1; e.g., x=16) continuously (i.e., in a continuous sense) restricting the value domain of the absolute values of the quantization indexes for the currently scanned transform coefficient position to include only the absolute values of the quantization indexes for the currently scanned transform coefficient position (i.e., the “one or more flags and one residual value” to be decoded for a particular transform coefficient position uniquely defines the latter from the initial value domain), where each flag defines a value domain of the absolute values of the quantization indexes for the currently scanned transform coefficient position, where the value domain of the absolute values of the quantization indexes for the currently scanned transform coefficient position is divided into two (e.g., sig_flag: value domain Ω is A={0} and
number
number
[0154] B2. The apparatus of embodiment B1, wherein the variable length code is configured to parameterize the variable length code to decode the residual value for the currently scanned transform coefficient position differently depending on whether the currently scanned transform coefficient position precedes, is, or follows the predetermined transform coefficient position in a scan order.
[0155] B3. The apparatus of embodiment B1 or B2, configured to parameterize the variable length code by gradually changing it to the quantization index of a preceding transform coefficient position that meets a predetermined criterion and / or in dependence on the quantization index of a transform coefficient position in the vicinity of the currently scanned transform coefficient position, in order to decode the residual value for the currently scanned transform coefficient position if the currently scanned transform coefficient position precedes or is equal to the predetermined transform coefficient position (in the scan order).
[0156] B4. The apparatus of embodiment B1 or B2 or B3, configured to parameterize the variable length code depending on the quantization index of a transform coefficient position near the currently scanned transform coefficient position and depending on the state that the state transition assumes for the currently scanned transform coefficient position, in order to decode the residual value for the currently scanned transform coefficient position if the currently scanned transform coefficient position follows the predetermined transform coefficient position in the scan order.
[0157] B5. The apparatus of any of embodiments B1 to B4, wherein the decoder is configured to successively dequantize (i.e., use dependent quantization) the quantization indexes of the transform coefficient positions of the coded set of transform coefficient positions using the state transitions (e.g., see a trellis diagram) by: a) selecting a set of one reconstructed level from a plurality of reconstructed level sets uniquely based on a state that a state transition assumes for the current transform coefficient position, and dequantizing the quantization index to the reconstructed level to which the quantization index points in the set of reconstructed levels; and b) updating, depending on the quantization index for the current transform coefficient position, the state of the state transition assumed for the current transform coefficient position (note that this term currently indicates the intended purpose or effect of the update) for the transform coefficient position following the current transform coefficient position in the scan order.
[0158] 3. The apparatus of any of embodiments A1-A22 or B1-B5, configured to perform the decoding such that, for each of the set of one or more flag types, in one of the sequences of passes, the flag of the respective flag type is decoded.
[0159] 4. The apparatus of any of the preceding embodiments (eg, embodiments 1 to 4), wherein the variable length code is a Golomb-Rice code.
[0160] 5. An apparatus as described in any of the preceding embodiments, wherein the apparatus is configured to parameterize the variable length code by gradually changing it to the quantization index of a previous transform coefficient position that satisfies a predetermined criterion and / or by depending on the quantization index of a transform coefficient position in the vicinity of the currently scanned transform coefficient position in order to decode the residual value for the currently scanned transform coefficient position (e.g., methods 1 and 2 in embodiments 1 to 4, 4.5.4).
[0161] 6. An apparatus as described in any of the preceding embodiments (e.g., embodiments 1 to 4), configured to determine the encoded set of positions of transform coefficients extending in accordance with the scan order between the position of a first non-zero quantization index in the scan order and a predefined transform coefficient position, and to identify the position of the first non-zero quantization index based on the data stream.
[0162] 7. An apparatus as in any of the preceding embodiments, configured to, for each non-zero quantization index, decode a sign bit from the data stream using an equal probability bypass mode.
[0163] 10. An apparatus as described in any of the preceding embodiments, configured to decode the flag of the first flag type for a predetermined position of a transform coefficient using context adaptive entropy decoding by selecting a context depending on the coefficient position of the predetermined transform coefficient.
[0164] 11. An apparatus as described in any of the preceding embodiments, configured to decode the flag of the first predetermined flag type for a predetermined transform coefficient position using context adaptive entropy decoding by: a) determining a local activity based on a set of flags decoded before the flag of the predetermined flag type for the predetermined transform coefficient position for a set of neighboring transform coefficient positions within a local template around the predetermined transform coefficient position, and b) selecting a context depending on the local activity.
[0165] 12. The apparatus of embodiment 11, wherein the set of flags includes the flags of the predetermined first flag type, the flags of the predetermined second flag type, and the flags of the predetermined third flag type (at least; but may be more, such as 4) decoded for the set of neighboring transform coefficient positions, and the apparatus is configured to calculate the activity based on a sum of addends for each of the neighboring transform coefficient positions, the addends indicating a minimum assumed absolute value for the quantization index or a minimum assumed absolute quantization level for the neighboring transform coefficient positions determined based on (at least) the flags of the predetermined first flag type, the flags of the predetermined second flag type, and the flags of the predetermined third flag type decoded for the neighboring transform coefficient positions.
[0166] 13. The decoder performs the steps of: a) selecting, for each transform coefficient position, one reconstructed level set from a plurality of reconstructed level sets uniquely based on a state that a state transition assumes for the respective transform coefficient position, and dequantizing the quantization index to the reconstructed level to which the quantization index points in the set of reconstructed levels; and b) inverse quantizing the quantization index for the current transform coefficient position, for a transform coefficient position following the current transform coefficient in the scan order (note that this term currently indicates the intended purpose or effect of the update), for the current transform coefficient position (note that this is the one currently scanned during dependent quantization; the one "currently scanned"). is used to represent what is currently being decoded during a pass. 2) configured to successively dequantize (i.e., use dependent quantization) using state transitions according to the scan order (e.g., see a trellis diagram) by updating the states of the state transitions assumed for a predetermined transform coefficient position; and 3) configured to decode using context adaptive entropy decoding by selecting a context depending on the states the state transitions assume for the predetermined transform coefficient position and / or the set of reconstruction levels selected for the predetermined transform coefficient position (e.g., embodiments 1 to 4).
[0167] 20. An apparatus as described in any of the preceding embodiments, configured to decode the flag of the second flag type for a predetermined position of a transform coefficient using context adaptive entropy decoding by selecting a context depending on the coefficient position of the predetermined transform coefficient.
[0168] 21. An apparatus according to any of the preceding embodiments, configured to decode the flag of the second predetermined flag type for the predetermined transform coefficient position using context adaptive entropy decoding by: 1) determining, for a set of neighboring transform coefficient positions in a local template around the predetermined transform coefficient position, a local activity and / or a number of transform coefficients whose quantization indexes are non-zero in the local template around the predetermined transform coefficient position based on a set of flags decoded before the flag of the second predetermined flag type for the predetermined transform coefficient position; and 2) selecting a context depending on the local activity and / or the number of non-zero quantization indexes.
[0169] 22. The apparatus of embodiment 21, configured to select the context depending on a difference between the local activity and the number of non-zero quantization indexes.
[0170] 23. The apparatus of embodiment 20 or 21, wherein the set of flags includes the flags of the predetermined first flag type, the flags of the predetermined second flag type, and the flags of the predetermined third flag type decoded for the set of neighboring transform coefficient positions (e.g., encoded in a first scan path, similarly for embodiment 12), and the apparatus is configured to calculate the activity based on a sum of addends for each of the neighboring transform coefficient positions, the addends indicating a minimum expected absolute value of the quantization index or a minimum expected absolute quantization index for the neighboring transform coefficient positions determined based on the flags of the predetermined first flag type, the flags of the predetermined second flag type, and the flags of the predetermined third flag type decoded for the neighboring transform coefficient positions (note that more flags than the above flags can be used if more flags are transmitted in the first pass).
[0171] 33. An apparatus as described in any of the preceding embodiments, configured to decode the flag of the third flag type for a predetermined position of a transform coefficient using context adaptive entropy decoding by selecting a context depending on the coefficient position of the predetermined transform coefficient.
[0172] 31. An apparatus according to any of the preceding embodiments, configured to decode the flag of the third predetermined flag type for a predetermined transform coefficient position using context adaptive entropy decoding by: 1) determining a local activity and / or a number of transform coefficients in the local template around the predetermined transform coefficient position, the quantization index of which is not zero, based on a set of flags decoded before the flag of the second predetermined flag type of the predetermined transform coefficient for a set of neighboring transform coefficient positions in a local template around the predetermined transform coefficient position; and 2) selecting a context depending on the local activity and / or the number of non-zero quantization indexes.
[0173] 32. The apparatus of embodiment 31, configured to select the context depending on a difference between the local activity and the number of non-zero quantization indexes.
[0174] 33. The apparatus of embodiment 30 or 31, wherein the set of flags includes flags of the predetermined first flag type, the flags of the predetermined second flag type, and the flags of the predetermined third flag type decoded for the set of neighboring transform coefficient positions (see notes of embodiments 12 and 23), and the apparatus is configured to calculate the activity based on a sum of addends for each of the neighboring transform coefficient positions, the addends indicating a minimum assumed absolute value for the quantization index for the neighboring transform coefficient positions or a minimum assumed absolute quantization index determined based on the flags of the predetermined first flag type, the flags of the predetermined second flag type, and the flags of the predetermined third flag type decoded for the neighboring transform coefficient positions (see notes of embodiments 12 and 23).
[0175] C1. A decoder for decoding a transform coefficient block, comprising: 1) decoding a sub-block significance flag for each of at least one set of sub-blocks into which the transform coefficient block is divided, indicating whether the respective sub-block includes a transform coefficient whose absolute value of a quantization index is greater than a predetermined non-zero threshold; and 2) within each sub-block in which the sub-block significance flag indicates the presence of at least one transform coefficient whose absolute value of the quantization index is greater than the predetermined non-zero threshold, a) for each of the transform coefficients in the respective sub-block, recursively bisecting a value domain of the respective transform coefficient into two parts and successively decoding a sequence of one or more flags indicating in which of the two parts the quantization index of the respective transform coefficient is located; and, and if the value domain still contains one or more values which are different in the absolute sense, continuously decoding residual values indicative of the absolute values of the quantization indexes of the respective transform coefficients in the value domain, and within each sub-block where the sub-block significant flag indicates that there are no transform coefficients whose absolute values of the quantization indexes are greater than the predetermined non-zero threshold, b) continuously decoding the sequence of one or more flags for each of the transform coefficients in the respective sub-block and stopping decoding the sequence as soon as the value domain contains only one value not exceeding the non-zero threshold, just one value or just values which are equal in the absolute sense.
[0176] C2. The apparatus of embodiment C1, in which a first flag of the sequence flags is a significance flag that indicates whether the transform coefficient to be decoded is zero.
[0177] C3. The apparatus of embodiment C2, wherein the predetermined non-zero threshold is 1 and the apparatus is configured to sequentially decode the first flag for each of the transform coefficients in each sub-block in which the sub-block significant flag indicates that there are no transform coefficients whose absolute value of the quantization index is greater than 1.
[0178] C4. An apparatus as described in any of the preceding embodiments C1-C3, configured to: 1) decode, for each of at least one other set of sub-blocks into which the transform coefficient block is divided, a further sub-block significance flag indicating whether the respective sub-block contains a transform coefficient not equal to zero; 2) determine the set of sub-blocks that constitute the sub-block for which the sub-block significance flag is decoded and for which the further sub-block significance flag indicates that the sub-block contains at least one transform coefficient not equal to zero; and 3) estimate that within each sub-block for which the further sub-block significance flag indicates that there are no non-zero transform coefficients, the transform coefficients of the transform coefficient block are all zero.
[0179] In the above description, the concept of quantization and entropy coding of transform coefficient levels (quantization indexes) for block-based hybrid video coding is presented. The techniques outlined above may be applied to lossy coding of blocks of residual samples. The residual samples may represent the difference between the original block of samples and samples of a prediction signal (the prediction signal may be obtained by intra-picture prediction or inter-picture prediction, or a combination of inter-picture and intra-picture prediction, or any other means; in special cases, the prediction signal may be set equal to zero).
[0180] The residual block of samples may be transformed using a signal transform. Typically, a linear and separable transform is used (linear means that the transform is linear but may incorporate additional rounding of the transform coefficients). Often, an integer approximation of the DCT-II or other transforms of the DCT / DST family is used. Different transforms can be used in the horizontal or vertical direction. The transform is not limited to a linear and separable transform. Any other transform (linear and non-separable, or non-linear) may be used. As a result of the signal transform, a block of transform coefficients is obtained that represents the original block of residual samples in a different signal space. In special cases, the transform can be equal to a discriminant transform (i.e., the block of transform coefficients can be equal to the block of residual samples). The block of transform coefficients is coded using a lossy coding. At the decoder side, the reconstructed block of transform coefficients is inverse transformed to obtain a reconstructed block of residual samples. Finally, the reconstructed block of image samples is obtained by adding a prediction signal.
[0181] The following aspects, which are particularly suitable for lossy coding of blocks of transform coefficients, are used in the above described embodiments: Dependent scalar quantization of transform coefficients: At the encoder side, blocks of transform coefficients are mapped to blocks of transform coefficient levels (i.e., quantization indexes), which represent the reduced-fidelity transform coefficients. At the decoder side, the quantization indexes are mapped to the reconstructed transform coefficients (which differ from the original transform coefficients due to quantization). In contrast to conventional scalar quantization, transform coefficients are not quantized independently. Instead, the allowable set of reconstruction levels for a particular transform coefficient depends on the quantization indexes selected for the other transform coefficients. ●Entropy coding of transform coefficient levels (quantization indexes): The transform coefficient levels representing the reconstructed transform coefficients (with respect to the dependent scalar quantization) are entropy coded using binary arithmetic coding, in which the properties of dependent quantization are exploited to improve the efficiency of the entropy coding.
[0182] Different embodiments and aspects have been described above. The description relates to various aspects such as flag / residue representation, distribution of flags and residuals to paths, context derivation, constraints on context-adaptively coded flags, etc. These aspects, features, functions and details described in different parts can be optionally introduced individually or together in the embodiments described herein. Also, the embodiments described in this specification can be used separately or can be supplemented by any of the features, functions and details in the other chapters. Also, it should be noted that the individual aspects described herein may be used individually or in combination, and thus details may be added to each of the individual aspects without adding details to any other one of the aspects. In particular, the embodiments are also set forth in the claims. The claimed embodiments may optionally be supplemented by any of the features, functions and details as described herein, both individually and in combination. This disclosure explicitly or implicitly describes features usable in video encoders (apparatuses for providing an encoded representation of an input video signal) and video decoders (apparatuses for providing a decoded representation of a video signal based on the encoded representation of the video signal). Thus, any of the features described herein can be used in the context of a video encoder as well as in the context of a video decoder. Moreover, features and functions disclosed herein in relation to a method may also be used in an apparatus (configured to perform such functions). Moreover, features and functions disclosed herein in relation to an apparatus may also be used in the corresponding method. In other words, the methods disclosed herein may be supplemented by any of the features and functions described in relation to the apparatus. Additionally, any of the features and functionality described herein can be implemented in hardware or software, or using a combination of hardware and software, as described in the "Implementation Options" section.
[0183] Although some aspects have been described in the context of an apparatus, it will be apparent that these aspects also represent a description of a corresponding method, where a block or device corresponds to a method step or a function of a method step. Similarly, aspects described in the context of a method step also represent a description of a corresponding block, item or function 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.
[0184] Depending on specific implementation requirements, embodiments of the present invention can be implemented in hardware or in software. Implementation can be performed using a digital storage medium, such as a floppy disk, DVD, Blu-ray disk, CD, ROM, PROM, EPROM, EEPROM or flash memory, having electronically readable control signals stored thereon and cooperating (or capable of cooperating) with a programmable computer system such that the respective methods are performed. Hence, the digital storage medium can be computer readable.
[0185] Some embodiments of the present invention comprise a data carrier having electronically readable control signals capable of cooperating with a programmable computer system to cause one of the methods described herein to be performed.
[0186] In general, embodiments of the present invention may be implemented as a computer program product with 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.
[0187] Other embodiments comprise the computer program for performing one of the methods described herein, stored on a machine readable carrier.
[0188] 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.
[0189] A further embodiment of the inventive method is therefore a data carrier (or digital storage medium or computer readable medium) comprising a computer program recorded thereon for performing one of the methods described herein. The data carrier, digital storage medium or recording medium is typically tangible and / or non-volatile.
[0190] 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 over a data communication connection, for example the Internet.
[0191] 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.
[0192] A further embodiment comprises a computer having installed thereon the computer program for performing one of the methods described herein.
[0193] 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 be, for example, a computer, a mobile device, a memory device, etc. The apparatus or system may comprise, for example, a file server for transferring the computer program to the receiver. 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.
[0194] 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.
[0195] The apparatus described herein or any components of the apparatus described herein may be implemented at least in part in hardware and / or software.
[0196] 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.
[0197] Any of the components of the methods or apparatus described herein may be at least partially implemented by hardware and / or software.
[0198] The embodiments described herein are merely illustrative of the principles of the present invention. It is understood that modifications and variations of the arrangements and details described herein will be apparent to those skilled in the art. It is therefore intended that the present invention be limited only by the scope of the impending claims and not by the specific details expressed by the description and manner of illustration of the embodiments herein.
Claims
1. 1. A method for decoding an image from a data stream, comprising the steps of: identifying a number of context coding bins available for decoding a transform block representing a portion of the image; a decoding pass of at least one location, each location corresponding to a transform coefficient within a sub-block of the transform block, the decoding pass beginning at a start location and proceeding along a scan order to sequentially traverse the at least one location, decoding at least one context coding flag at a current position within said sub-block; updating the number of available context coding bins in response to decoding each of the at least one context coding flag; after decoding all context coding flags associated with the current position, comparing the updated number of available context coding bins with a predefined value before proceeding to a next position that immediately follows the current position in the scanning order; terminating the decoding pass based on the comparison; and decoding an absolute level residual value associated with a particular transform coefficient at each position of the particular transform coefficient at selected positions along the scanning order starting from the starting position to the current position; at each position along the scanning order starting from the next position to an end position within the sub-block, decoding an absolute level associated with the transform coefficient at each position; Including, The step of decoding at least one context coding flag comprises: - decoding, for the transform coefficient of the current position, a first context coding flag of a first flag type indicating whether the transform coefficient of the current position is equal to zero; if the first context coding flag of the first flag type indicates that the transform coefficient of the current position is not equal to zero, after the number of available context coding bins is updated, decoding, for the transform coefficient of the current position, a second context coding flag of a second flag type indicating whether the transform coefficient of the current position is greater than a preset value; if a first context coding flag of the first flag type indicates that the transform coefficient at the current position is equal to zero and after the number of available context coding bins has been updated, determining based on the comparison whether to decode another context coding flag of the first flag type for the transform coefficient at the next position or to terminate the decoding pass; Including, method.
2. each of the at least one context coding flag at least partially identifies a transform coefficient level of an associated transform coefficient of the sub-block; The method of claim 1.
3. updating the number of available context coding bins comprises: decreasing the number of available context coding bins for each decoded context coding flag of the at least one context coding flag. The method of claim 1.
4. determining to terminate the decoding pass based on the comparison indicating that the updated number of available context coding flags is less than the predefined value; The method of claim 1.
5. determining to continue the decoding path based on the comparison indicating that the updated available context coding bins are greater than the predefined value; decoding at least one additional context coding flag associated with the transform coefficient at the next position along the scanning order; Further comprising: The method of claim 1.
6. determining a state for each of the transform coefficients of the sub-block, the state for a previous transform coefficient and for a current transform coefficient depending on the previous transform coefficient; determining whether to transition between quantization sets based on the state; Further comprising: The method of claim 1.
7. 1. An electronic device for decoding an image from a data stream, comprising: A processor is included. The processor, identifying a number of context coding bins available for decoding a transform block representing a portion of the image; During a decoding pass of at least one location, each location corresponding to a transform coefficient within a sub-block of the transform block, the decoding pass beginning at a start location and proceeding along a scan order that sequentially traverses the at least one location, decoding at least one context coding flag at a current position within the sub-block; updating the number of available context coding bins in response to decoding each of the at least one context coding flag; comparing the updated number of available context coding bins with a predefined value after decoding all context coding flags associated with the current position and before proceeding to a next position that immediately follows the current position in the scan order; terminating the decoding pass based on the comparison; and and decoding an absolute level residual value associated with a particular transform coefficient at each position of the particular transform coefficient at selected positions along the scan order starting from the starting position to the current position; decoding, at each position along the scanning order starting from the next position to an end position within the sub-block, an absolute level associated with the transform coefficient at each position; configured to run To decode at least one context coding flag, the processor: decoding, for the transform coefficient of the current position, a first context coding flag of a first flag type indicating whether the transform coefficient of the current position is equal to zero; if a first context coding flag of the first flag type indicates that the transform coefficient of the current position is not equal to 0, after the number of available context coding bins is updated, for the transform coefficient of the current position, decoding a second context coding flag of a second flag type indicating whether the transform coefficient of the current position is greater than a preset value; if a first context coding flag of the first flag type indicates that the transform coefficient at the current position is equal to zero and after the number of available context coding bins has been updated, determining based on the comparison whether to decode another context coding flag of the first flag type for the transform coefficient at the next position or to terminate the decoding pass; configured to execute electronic equipment.
8. each of the at least one context coding flag at least partially identifies a transform coefficient level of an associated transform coefficient of the sub-block; 8. The electronic device of claim 7.
9. To update the number of available context coding bins, the processor and configured to reduce the number of available context coding bins for each decoded context coding flag of the at least one context coding flag.
8. The electronic device of claim 7.
10. the processor is configured to determine to terminate the decoding pass based on the comparison indicating that the updated number of available context coding flags is less than the predefined value.
8. The electronic device of claim 7.
11. The processor further comprises: determining to continue the decoding pass based on the comparison indicating that the updated available context coding bins are greater than the predefined value; decoding at least one additional context coding flag associated with the transform coefficient at the next position along the scanning order; configured to execute 8. The electronic device of claim 7.
12. The processor further comprises: determining a state for each of the transform coefficients of the sub-block, the state for a previous transform coefficient and for a current transform coefficient depending on the previous transform coefficient; determining whether to transition between quantization sets based on the state; configured to execute 8. The electronic device of claim 7.
13. at least one processor of the electronic device, identifying a number of context coding bins available for decoding a transform block representing a portion of an image; processing during a decoding pass of at least one location, each location corresponding to a transform coefficient within a sub-block of the transform block, the decoding pass beginning at a start location and proceeding along a scan order to sequentially traverse the at least one location; decoding at least one context coding flag at a current position within the sub-block; updating the number of available context coding bins in response to decoding each of the at least one context coding flag; comparing the updated number of available context coding bins with a predefined value after decoding all context coding flags associated with the current position and before proceeding to a next position that immediately follows the current position in the scan order; terminating the decoding pass based on the comparison; and and decoding an absolute level residual value associated with a particular transform coefficient at each position of the particular transform coefficient at selected positions along the scanning order starting from the starting position to the current position; at each position along the scanning order starting from the next position to an end position within the sub-block, decoding an absolute level associated with the transform coefficient at each position; [0023] The instructions for causing the at least one processor to perform a process of decoding at least one context encoding flag include instructions for causing the at least one processor to: - decoding, for the transform coefficient of the current position, a first context coding flag of a first flag type indicating whether the transform coefficient of the current position is equal to zero; if a first context coding flag of the first flag type indicates that the transform coefficient of the current position is not equal to zero, after the number of available context coding bins is updated, decoding, for the transform coefficient of the current position, a second context coding flag of a second flag type indicating whether the transform coefficient of the current position is greater than a preset value; if a first context coding flag of the first flag type indicates that the transform coefficient at the current position is equal to zero and after the number of available context coding bins has been updated, deciding based on the comparison whether to decode another context coding flag of the first flag type for the transform coefficient at the next position or to terminate the decoding pass; containing instructions to execute A non-transitory computer-readable recording medium.
14. each of the at least one context coding flag at least partially identifies a transform coefficient level of an associated transform coefficient of the sub-block; The recording medium according to claim 13.
15. The instructions for causing the at least one processor to perform a process of updating the number of available context coding bins include instructions for causing the at least one processor to: instructions for performing a process of reducing the number of available context coding bins for each decoded context coding flag of the at least one context coding flag; The recording medium according to claim 13.
16. The at least one processor, determining to terminate the decoding pass based on the comparison indicating that the updated number of available context coding flags is less than the predefined value; The recording medium according to claim 13.
17. The at least one processor, determining to continue the decoding path based on the comparison indicating that the updated available context coding bins are greater than the predefined value; decoding at least one additional context coding flag associated with the transform coefficient at the next position along the scanning order; [0033] The recording medium according to claim 13.
18. The at least one processor, determining a state for each of the transform coefficients of the sub-block, the state for a previous transform coefficient and for a current transform coefficient depending on the previous transform coefficient; determining whether to transition between quantization sets based on the state; [0033] The recording medium according to claim 13.
19. 1. A method for encoding an image, comprising the steps of: setting a number of available context coding bins based on a size of a transform block representing a portion of the image; a coding pass of at least one location, each location corresponding to a transform coefficient within a sub-block of the transform block, the coding pass beginning at a start location and proceeding along a scan order to sequentially traverse the at least one location, encoding at least one context encoding flag for a current position within said sub-block; updating the number of available context coding bins in response to coding each of the at least one context coding flag; after encoding all context encoding flags associated with the current position, comparing the updated number of available context encoding bins with a predefined value before proceeding to a next position that immediately follows the current position in the scan order; terminating the encoding pass based on the comparison; and encoding an absolute level residual value associated with a particular transform coefficient at each position of the particular transform coefficient at selected positions along the scanning order starting from the starting position to the current position; at each position along the scanning order starting from the next position to an end position within the sub-block, encoding an absolute level associated with the transform coefficient at each position; Including, The step of encoding at least one context encoding flag comprises: encoding, for the transform coefficient of the current position, a first context coding flag of a first flag type indicating whether the transform coefficient of the current position is equal to zero; if a first context coding flag of the first flag type indicates that the transform coefficient of the current position is not equal to zero, after the number of available context coding bins is updated, coding, for the transform coefficient of the current position, a second context coding flag of a second flag type indicating whether the transform coefficient of the current position is greater than a preset value; if a first context coding flag of the first flag type indicates that the transform coefficient at the current position is equal to zero and after the number of available context coding bins has been updated, deciding based on the comparison whether to code another context coding flag of the first flag type for the transform coefficient at the next position or to terminate the coding pass; Including, method.
20. 1. An electronic device for encoding an image, comprising: A processor is included. The processor, setting a number of available context coding bins based on a size of a transform block representing a portion of the image; During a coding pass of at least one location, each location corresponding to a transform coefficient within a sub-block of the transform block, the coding pass beginning at a start location and proceeding along a scan order that sequentially traverses the at least one location, encoding at least one context encoding flag for a current position within said sub-block; updating the number of available context coding bins in response to coding each of the at least one context coding flag; comparing the updated number of available context coding bins with a predefined value after encoding all context coding flags associated with the current position and before proceeding to a next position that immediately follows the current position in the scan order; terminating the encoding pass based on the comparison; and and encoding an absolute level residual value associated with a particular transform coefficient at each position of the particular transform coefficient at selected positions along the scanning order starting from the starting position to the current position; at each position along the scanning order starting from the next position to an end position within the sub-block, encoding an absolute level associated with the transform coefficient at each position; configured to run To encode at least one context encoding flag, the processor further comprises: encoding, for the transform coefficient of the current position, a first context coding flag of a first flag type indicating whether the transform coefficient of the current position is equal to zero; if a first context coding flag of the first flag type indicates that the transform coefficient of the current position is not equal to zero, after the number of available context coding bins is updated, coding, for the transform coefficient of the current position, a second context coding flag of a second flag type indicating whether the transform coefficient of the current position is greater than a preset value; if a first context coding flag of the first flag type indicates that the transform coefficient at the current position is equal to zero and after the number of available context coding bins has been updated, deciding based on the comparison whether to code another context coding flag of the first flag type for the transform coefficient at the next position or to terminate the coding pass; configured to execute electronic equipment.
21. at least one processor of the electronic device, setting a number of available context coding bins based on a size of a transform block that represents a portion of an image; processing during a coding pass of at least one location, each location corresponding to a transform coefficient within a sub-block of the transform block, the coding pass beginning at a start location and proceeding along a scan order to sequentially traverse the at least one location; encoding at least one context encoding flag for a current position within said sub-block; updating the number of available context coding bins in response to coding each of the at least one context coding flag; comparing the updated number of available context coding bins with a predefined value after coding all context coding flags associated with the current position and before proceeding to a next position that immediately follows the current position in the scan order; terminating the encoding pass based on the comparison; and and encoding an absolute level residual value associated with a particular transform coefficient at each position of the particular transform coefficient at selected positions along the scanning order starting from the starting position to the current position; at each position along the scanning order starting from the next position to an end position within the sub-block, encoding an absolute level associated with the transform coefficient at each position; [0023] The instructions for causing the at least one processor to perform a process for encoding at least one context encoding flag include instructions for causing the at least one processor to: - coding, for the transform coefficient of the current position, a first context coding flag of a first flag type indicating whether the transform coefficient of the current position is equal to zero; if a first context coding flag of the first flag type indicates that the transform coefficient of the current position is not equal to zero, after the number of available context coding bins is updated, coding, for the transform coefficient of the current position, a second context coding flag of a second flag type indicating whether the transform coefficient of the current position is greater than a preset value; if a first context coding flag of the first flag type indicates that the transform coefficient at the current position is equal to zero and after the number of available context coding bins has been updated, deciding based on the comparison whether to code another context coding flag of the first flag type for the transform coefficient at the next position or to end the coding pass; containing instructions to execute A non-transitory computer-readable recording medium.
Citation Information
Patent Citations
Throughput improvements for CABAC coefficient level coding
JP2015507424A
Throughput improvement for cabac coefficient level coding
US20130182757A1