Efficient coding of transform coefficients using or suitable for combination with dependent scalar quantization

By combining dependent quantization and context-adaptive entropy coding, the problem of balancing bit rate and distortion in coding techniques is solved, thereby improving coding efficiency and information storage utilization.

CN118678074AActive Publication Date: 2024-09-20FRAUNHOFER GESELLSCHAFT ZUR FORDERUNG DER ANGEWANDTEN FORSCHUNG EV
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202410962989.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2018-09-24
Filing Date
2019-09-24
Publication Date
2024-09-20
Estimated Expiration
2039-09-24

AI Technical Summary

Technical Problem

Existing coding techniques struggle to balance bit rate and distortion when setting quantization parameters, leading to increased coding complexity and reduced information storage space, thus affecting coding efficiency.

Method used

A combination of dependent quantization and context-adaptive entropy coding is used to encode the coefficients of the transform block, achieving more efficient encoding through this combination.

Benefits of technology

It improves coding efficiency, reduces coding complexity, optimizes the utilization of information storage space, and enhances coding quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118678074A
    Figure CN118678074A
Patent Text Reader

Abstract

A concept of more efficient coding of coefficients of a transform block by using dependent quantization and context adaptive entropy coding, or even if a combination of dependent quantization and context adaptive entropy coding is used to allow for more efficient coding, is proposed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application is a divisional application of Application No.: 201980077366.X Invention Name: Efficient Coding of Transform Coefficients Using or Applicable in Combination with Reliance on Scalar Quantization. This application relates to coding at the transform coefficient level, such as for encoding images or videos. Background Art

[0002] When setting the quantization parameters, the encoder must make a compromise. Rendering the quantization coarser reduces the bitrate but increases the quantization distortion, while rendering the quantization finer reduces the distortion but increases the bitrate. Having a concept at hand, it would be advantageous to increase the coding efficiency for a given domain of available quantization levels. One such possibility is to use dependent quantization, where the quantization is robustly adapted to previously quantized and encoded data. However, dependencies in quantization also raise some issues, such as increased coding complexity and reduced storage space for information to perform context modeling, because dependencies affect the relationship between the data items to be quantized and encoded, and thus affect the availability of information for context derivation for encoding individual syntactic elements. Summary of the invention

[0003] It would be advantageous to achieve a more efficient encoding of the coefficients of a transform block by using dependent quantization and context adaptive entropy coding, or to provide a concept where the encoding of the coefficients of a transform block is achieved in a way that allows for a more efficient encoding using a combination of dependent quantization and context adaptive entropy coding.

[0004] It is an object of the invention to provide a concept for encoding a block of transform coefficients.

[0005] This object is solved by the subjects of the independent claims of the present application.

[0006] Advantageous aspects are the subject matter of the dependent claims. BRIEF DESCRIPTION OF THE DRAWINGS

[0007] The preferred embodiments of the present application are described below with reference to the accompanying drawings, in which:

[0008] Figure 1 A block diagram of an exemplary video encoder is shown as an example for an image encoder that may be implemented to operate according to any of the embodiments described below or to incorporate functionality according to embodiments set forth herein.

[0009] FIG2 shows a block diagram of a transform encoder; and (b) a transform decoder to illustrate the basic method of block-based transform coding;

[0010] Figure 3 A histogram of the distribution is shown, illustrating a uniform reconstruction quantizer.

[0011] FIG4 shows (a) a transform block subdivided into subblocks and (b) a schematic diagram of a subblock to illustrate an example for scanning transform coefficient levels, exemplarily one used in H.265|MPEG-H HEVC; in particular, (a) shows the division of a 16×16 transform block into 4×4 subblocks and the coding order of the subblocks; (b) shows the coding order of transform coefficient levels within a 4×4 subblock. The subdivision can be exemplarily used in embodiments of the present application for the pass of coefficients to decode their flags and residues, and for state transitions when dequantizing their flags and residues.

[0012] 5 shows a schematic diagram of a multi-dimensional output space with one axis for each transform coefficient, and the positions of allowed reconstruction vectors for the simple case of two transform coefficients: (a) independent scalar quantization; (b) an example of dependent scalar quantization.

[0013] Figure 6 A block diagram of a transform decoder using scalar quantization is shown, thereby forming an embodiment of a media decoder according to the present application. Figure 2b , a modification relative to conventional transform coding (with independent scalar quantizers) can be obtained. In a corresponding manner, Figure 2a An encoder is used to obtain an embodiment for encoding a transform block using dependent scalar quantization.

[0014] Figure 7 is a schematic diagram showing two sets of reconstruction levels for an embodiment that relies on quantization, which are completely determined by a single quantization step size Δ. Two sets of available reconstruction levels are highlighted, denoted as set 0 (top line) and set 1 (bottom line). The numbers below the circles give examples of quantization indices representing reconstruction levels within a set. The open and filled circles represent two different subsets within the set of reconstruction levels; these subsets can be used to determine the set of reconstruction levels for the next transform coefficient in the reconstruction order. Both sets include reconstruction levels equal to zero, but are otherwise disjoint, with both sets being symmetric around zero.

[0015] Figure 8 Pseudocode is shown, which shows an example of a reconstruction process for transform coefficients. k represents an index that specifies the reconstruction order of the current transform coefficient, the quantization index for the current transform coefficient is represented by level[k], and the quantization step size Δ applied to the current transform coefficient is k It is represented by quant_step_size[k], while trec[k] represents the reconstructed transform coefficient t′ kThe variable setId[k] specifies the set of reconstruction levels applicable to the current transform coefficient. It is determined based on the previous transform coefficients in reconstruction order; the possible values ​​of setId[k] are 0 and 1. The variable n specifies an integer factor for 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].

[0016] Fig. 9 Show pseudo code, this pseudo code shows Figure 8 An alternative implementation of the pseudocode in . The main change is that the multiplication with the quantization step size is represented by an integer implementation using scale and shift parameters. Typically, the shift parameter (denoted by shift) is constant for the transform block, and only the scaling parameter (given by scale[k]) may depend on the position of the transform coefficients. The addition of the variable represents a rounding offset, which is typically set equal to add=(1<<(shift-1)). In Δ k is the nominal quantization step size of the transform coefficients, so that we have Δ k ≈scale[k]·2 -shift The parameters shift and scale[k] are selected in this way.

[0017] Fig.10 Pseudocode is shown which shows an example of a reconstruction process for transform coefficients of a transform block. Array level represents the transform coefficient level (quantization index) for transmission of the transform block, and array trec represents the corresponding reconstructed transform coefficients. The 2d table state_trans_table specifies the state transition table, and the table setId specifies the quantization set associated with the state.

[0018] Fig.11 A schematic diagram illustrating the state transition in dependent scalar quantization as a grid structure is shown. The horizontal axis represents different transform coefficients in reconstruction order. The vertical axis represents the different states that may occur during the dependent quantization and reconstruction process. The connections shown specify the available paths between states for different transform coefficients.

[0019] Fig.12a A schematic diagram showing a transform block for signaling the position of a first non-zero quantization index in coding order, the position of the first non-zero quantization index being shown by backfilling. In addition to the position of the first non-zero transform coefficient, only the binary bits of the shaded coefficients are transmitted, the white marked coefficients are inferred to be equal to 0.

[0020] Figure 12b A schematic diagram of the transform block is shown, and a template for selecting a probability model is shown. The black square represents the current scan position, and the shaded square represents the local neighborhood used to derive the context model.

[0021] FIG13 shows a pseudo code according to a first embodiment for encoding a block of transform coefficients;

[0022] Fig.14 A schematic diagram is shown, which shows the representation of the quantization index of the transform coefficient according to the embodiment of FIG. 13 by recursively dividing the value range of the quantization index into two equal parts;

[0023] Fig.15 A schematic diagram showing various passes of decoding in the example of FIG. 13 , the way coefficients are transformed in the passes according to the example of FIG. 13 , and which flags or hints are encoded in which pass;

[0024] FIG16 is a pseudo code for illustrating a second embodiment of encoding a block of transform coefficients;

[0025] Fig.17 is a schematic diagram showing representation of quantization indices of coefficients according to the embodiment of FIG. 16 ;

[0026] FIG18 is a pseudo code showing a third embodiment of encoding a block of transform coefficients; and

[0027] Fig. 19 shows a pseudo code illustrating a fourth embodiment for encoding a block of transform coefficients.

[0028] In the embodiments described below, transform coding is used to transform a set of samples. The obtained transform coefficients are quantized using dependent quantization, and the obtained quantization indexes are entropy encoded, i.e., context adaptive arithmetic coding. On the decoder side, a set of reconstructed samples is obtained by correspondingly decoding the quantization indexes and dependent reconstruction of the transform coefficients, so that the inverse transform obtains the samples. The sample can be part of an image or a video and can describe a certain image block. Naturally, there are other possibilities. The description of the following embodiments is mainly aimed at the lossy coding of blocks of prediction error samples in image and video codecs, but these 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, and there is no restriction on the set of samples representing the prediction error samples (i.e., the difference between the original signal and the predicted signal).

[0029] All the latest 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. The video image is divided into blocks, the samples of the blocks are predicted using intra-image prediction or inter-prediction, and the samples of the resulting prediction error signal (the difference between the original samples and the samples of the predicted signal) are encoded using transform coding.

[0030] Figure 1A simplified block diagram of a typical modern video encoder is shown. The video images of a video sequence are encoded in a certain order, which is called the coding order. The coding order of the images may differ from the capture and display order. For the actual encoding, each video image is divided into blocks. A block includes samples of a rectangular area of ​​a certain color component. The entity of blocks corresponding to all color components of the same rectangular area is usually called a unit. Depending on the purpose of the block division, in H.265|MPEG-H HEVC, a distinction is made between coding tree blocks (CTB), coding blocks (CB), prediction blocks (PB) and transform blocks (TB). The associated units are called coding tree units (CTU), coding units (CU), prediction units (PU) and transform units (TU).

[0031] Typically, a video image is initially 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 can be further divided into multiple Coding Units (CUs). A Coding Unit is an entity for which a coding mode (e.g., intra-image or inter-image coding) is selected. In H.265|MPEG-H HEVC, a CTU is decomposed into one or more CUs, which are specified by a quadtree (QT) syntax and transmitted as part of the bitstream. The CUs of a CTU are processed in the so-called z-scan order. That is, the four blocks resulting from the partitioning will be processed in raster scan order; and if any block is further partitioned, the corresponding four blocks (including the included smaller blocks) are processed before processing the next block at a higher partitioning level.

[0032] If the CU is encoded in intra-coding mode, an intra-prediction mode is used for the luminance signal, and if the video signal includes a chrominance component, another intra-prediction mode for the chrominance signal is transmitted. In ITUTH.265|MPEGHHEVC, if the CU size is equal to the minimum CU size (as indicated in the sequence parameter set), the luminance block can also be divided into four blocks of equal size, in which case a separate luminance intra-prediction mode is transmitted for each of these blocks. The actual intra-prediction and encoding are done on a transform block basis. For each transform block of a CU encoded within an image, a prediction signal is derived using samples of the same color component that have been reconstructed. The algorithm used to generate the prediction signal for the transform block is determined by the transmitted intra-prediction mode.

[0033] A CU coded in inter-image coding mode can be further split into multiple prediction units (PUs). A prediction unit is an entity of luminance or, for color video, two associated chrominance blocks (covering the same image area), for which a set of prediction parameters is used. A CU can be coded as a single prediction unit, or it can be split into two non-square (supporting symmetric and asymmetric splitting) or four square prediction units. For each PU, a single set of motion parameters is transmitted. Each set of motion parameters includes the number of motion hypotheses (one or two in H.265|MPEG H HEVC), for each motion hypothesis, a reference picture (indicated in the reference picture list by a reference picture indicator) and an associated motion vector. In addition, H.265|MPEG-H HEVC provides a so-called merge mode, in which 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 the indicator of the list of motion parameter candidates is transmitted (this list is derived using the motion data of spatially and temporally neighboring blocks). The indicator fully determines the set of motion parameters used. The prediction signal for the inter-coded PU is formed by motion compensated prediction. For each motion hypothesis (specified by a reference image and a motion vector), the prediction signal is formed by a block of displacements in the specified reference image, where the displacement relative to the current PU is specified by the motion vector. The displacements are usually specified with subsample precision (in H.265|MPEG HHEVC, the precision of the motion vectors is one quarter of a luma sample). For non-integer motion vectors, the prediction signal is generated by interpolating the reconstructed reference image (usually using a separable FIR filter). The final prediction signal for a PU with multi-hypothesis prediction is formed by the weighted sum of the prediction signals of the individual motion hypotheses. Typically, the same set of motion parameters is used for the luma and chroma blocks of the PU. Even though the latest video coding standards use translational displacement vectors to specify the motion of the current region (block of samples) relative to the reference image, higher-order motion models (e.g., affine motion models) can also be used. In this case, additional motion parameters have to be transmitted for the motion hypothesis.

[0034] For both intra-image and inter-image coded CUs, the prediction error signal (also called residual signal) is usually transmitted via transform coding. In H.265|MPEG-H HEVC, blocks of luma residual samples and blocks of chroma residual samples (if present) of a CU are divided into transform blocks (TBs). The partitioning of a CU into transform blocks is indicated by a quadtree syntax, which is also called residual quadtree (RQT). The resulting transform blocks are encoded using transform coding: a 2d transform is applied to blocks of residual samples, the resulting transform coefficients are quantized using independent scalar quantization, and the resulting transform coefficient levels (quantization indices) are entropy encoded. In P and B slices, at the beginning of the CU syntax, skip_flag is transmitted. If this flag is equal to 1, it means that the corresponding CU is composed of a single set of prediction units encoded in merge mode (i.e., merge_flag is inferred to be equal to 1) and all transform coefficients are equal to zero (i.e., the reconstructed signal is equal to the prediction signal). In this case, in addition to skip_flag, only merge_idx is transmitted. If skip_flag is equal to 0, the prediction mode (inter or intra) is signaled, followed by the above syntax features.

[0035] Since the already encoded image can be used for motion compensation prediction of blocks in subsequent images, the image must be completely reconstructed in the encoder. The reconstructed prediction error signal for the block (obtained by reconstructing the transform coefficients of a given quantization index and performing an inverse transform) is added to the corresponding prediction signal, and the result is written to the buffer of the current image. After all blocks of the image are reconstructed, one or more loop filters (e.g., a deblocking filter and a sample adaptive offset filter) may be applied. The final reconstructed image is then stored in the decoded image buffer.

[0036] The embodiments described below propose a concept for encoding blocks of transform coefficients such as those related to prediction errors. The concept is applicable to blocks encoded within and between images. It is also applicable to transform coding of non-rectangular sample areas. In contrast to conventional transform coding, transform coefficients are not independently quantized. Instead, 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 index selected for other transform coefficients.

[0037] All major video coding standards (including the latest standard H.265 | MPEG-H HEVC) use the concept of transform coding for coding blocks of prediction error samples. The prediction error samples of a block represent the difference between the samples of the original signal and the samples of the prediction signal of the block. The prediction signal is obtained by intra-image prediction (in this case, the samples of the prediction signal of the current block are derived based on the reconstructed samples of adjacent blocks in the same image) or by inter-image prediction (in this case, the samples of the prediction signal are derived based on the samples of the reconstructed image). The original samples of the prediction error signal are obtained by subtracting the sample values ​​of the prediction signal from the sample values ​​of the original signal of the current block.

[0038] The transform coding of a sample block includes linear transformation, scalar quantization and entropy coding of the quantization index. Figure 2a ), a block of N×M original samples is transformed using a linear analysis transform A. The result is a block of N×M transform coefficients. The transform coefficients t k Represents the original prediction error samples in different signal spaces (or different coordinate systems). N×M transform coefficients are quantized using N×M independent scalar quantizers. Each transform coefficient t k is mapped to the quantization index q k , also called the transform coefficient level. k Perform entropy encoding and write to the bitstream.

[0039] exist Figure 2b At the decoder side shown in FIG, the transform coefficient level q is decoded from the received bit stream k Each transform coefficient level q k Mapped to the reconstructed transform coefficients t' k By transforming the reconstructed transform coefficient block using a linear synthesis transform B, N×M blocks of reconstructed samples are obtained.

[0040] Even if the video coding standard specifies only the synthesis transform B, it is common practice to use the inverse of the synthesis transform B as the analysis transform A in the encoder, i.e. A = B -1 Moreover, the transform used in the actual video coding system is an orthogonal transform (B -1 =B T ) or nearly orthogonal transforms. For an orthogonal transform, the mean square error (MSE) distortion in the signal space is equal to the MSE distortion in the transform domain. Orthogonality has the important advantage that the MSE distortion between the original and reconstructed blocks of samples can be minimized using independent scalar quantizers. Even though the actual quantization process used in the encoder takes into account the dependencies between the transform coefficient levels (introduced by the entropy coding description above), the use of an orthogonal transform significantly simplifies the quantization algorithm.

[0041] For a typical prediction error signal, the transform has the effect of concentrating the signal energy in a few transform coefficients. The statistical dependencies between the resulting transform coefficients are reduced compared to the original prediction error samples.

[0042] In the latest video coding standards, a separable discrete cosine transform (type II) or its integer approximation is used. However, this transform can be easily replaced without modifying other aspects of the transform coding system. Examples of improvements proposed in the literature or standardization documents include:

[0043] • Use of discrete sine transform (DST) for intra-image prediction blocks (possibly dependent on intra-prediction mode and / or block size).

[0044] Note that H.265|MPEG-H HEVC already includes DST for 4×4 transform blocks for intra-image prediction.

[0045] Switched transforms: The encoder selects the transform that is actually used from a set of predefined transforms. The set of available transforms is known to both the encoder and the decoder, so it can be efficiently signaled using a pointer into the list of available transforms. The set of available transforms and their order in the list may depend on other coding parameters of the block, such as the selected intra-prediction mode. In special cases, the transform used is completely determined by encoding parameters such as the intra-prediction mode, so there is no need to transmit syntax elements specifying the transform.

[0046] • Non-separable transform: The transform used in the encoder and decoder represents a non-separable transform. Note that the concept of a transformed transform may include one or more non-separable transforms. Due to complexity reasons, the use of non-separable transforms may be limited to certain specific block sizes.

[0047] · Multi-level transform: The actual transform is composed of two or more transform stages. The first transform stage can be composed of separable transforms of low computational complexity. And in the second stage, a subset of the resulting transform coefficients is further transformed using a non-separable transform. The advantage of the two-stage approach is that a more complex non-separable transform is applied to a smaller number of samples compared to a non-separable transform of the entire transform block. The concept of multi-level transforms can be effectively combined with the concept of transformed transforms.

[0048] The transform coefficients are quantized using a scalar quantizer. As a result of quantization, the set of allowed values ​​of the transform coefficients is reduced. In other words, the transform coefficients are mapped to a countable set (actually 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. In order to simplify the subsequent entropy coding, the allowable reconstruction levels are represented by quantization indices (also called transform coefficient levels), which are 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 scalar quantization is a block of transform coefficient levels (quantization indices).

[0049] In the latest video coding standards, the Uniform Reconstruction Quantizer (URQ) is used. Its basic design is as follows Figure 3 URQ has the property that the reconstruction levels s are equidistantly distributed. The distance Δ between two adjacent reconstruction levels is called the quantization step size. One of the reconstruction levels is equal to 0. Therefore, the complete set of available reconstruction levels is uniquely specified by the quantization step size Δ. The mapping of the quantization index q to the reconstructed transform coefficient t' of the decoder is in principle given by the following simple formula

[0050] t′=q·Δ.

[0051] 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 indices of other transform coefficients.

[0052] Since video decoders typically utilize integer arithmetic with standard precision (e.g. 32 bits), the actual formula used in the standard may differ slightly from simple multiplication. Ignoring the clipping of the dynamic range supported by the transform coefficients, H.265|MPEG-H HEVC is obtained by

[0053] t′=(scale·q+(1<<(shift-1)))>>shift,

[0054] The operators “<<” and ”>>” represent left shift and right shift respectively. When we ignore integer arithmetic, the quantization step size Δ corresponds to

[0055] Δ=scale·2 -shift .

[0056] Older video coding standards such as H.262|MPEG-2 Video also specify a modified URQ where the distance between reconstruction level zero and the first non-zero reconstruction level is increased relative to the nominal quantization step size (eg, two-thirds of the nominal quantization step size Δ).

[0057] The quantization step size (or scaling and shifting parameters) of the transform coefficients is determined by two factors:

[0058] Quantization parameter QP: The quantization step size can usually be modified on a block basis. To this end, the video coding standard provides a set of predefined quantization step sizes. An indicator from a predefined list of quantization step sizes is used to indicate the quantization step size used (or, equivalently, the parameters "scaling" and "shifting" introduced above). The indicator is called the quantization parameter (QP). In H.265|MPEG-H HEVC, the relationship between QP and quantization step size is approximately

[0059]

[0060] The slice QP is usually transmitted in the slice header. In general, the quantization parameter QP can be modified on a block basis. For this purpose, a DQP (delta quantization parameter) can be transmitted. The quantization parameter used is determined by the transmitted DQP and the predicted QP value, which is derived using the QP of the coded (usually neighboring) blocks.

[0061] Quantization weighting matrix: Video coding standards usually provide the possibility to use different quantization step sizes for individual transform coefficients. This is achieved by specifying a so-called quantization weighting matrix W, which can usually be selected by the encoder on sequence or picture level and transmitted as part of the bitstream. The quantization weighting matrix W has the same size as the corresponding transform coefficient block. The transform coefficient t ik The quantization step size Δ ik Given by the following formula

[0062] Δ ik =w ik Δ block ,

[0063] where Δ block represents the quantization step size of the block under consideration (represented by the block quantization parameter QP), i and k represent the coordinates of the current transform coefficient within the specified transform block, and w ik represents the corresponding entry in the quantization weight matrix W.

[0064] The main purpose of the quantization weighting matrix is ​​to provide a possibility to introduce quantization noise in a perceptually meaningful way. By using an appropriate weighting matrix, a better trade-off between bit rate and subjective reconstruction quality can be achieved by exploiting the spatial contrast sensitivity of human vision. However, many encoders use so-called flat quantization matrices (which can be efficiently transmitted using high-level syntax elements). In this case, the same quantization step size Δ is used for all transform coefficients in a block. The quantization step size is then fully specified by the quantization parameter QP.

[0065] Blocks of transform coefficient levels (quantization indices for the transform coefficients) are entropy coded (i.e., transmitted as part of the bitstream in a lossless manner). Since a linear transform can only reduce linear dependencies, entropy coding of the transform coefficient levels is usually designed in a way so that the remaining non-linear dependencies between the transform coefficient levels in the block can be exploited for efficient coding. Well-known examples are run-level coding in MPEG-2 Video, run-level end coding in H.263 and MPEG-4 Visual, 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.

[0066] CABAC, specified in the latest video coding standard H.265|MPEG-H HEVC, follows a general concept that can be applied to a variety of transform block sizes. Transform blocks larger than 4x4 samples are divided into 4x4 sub-blocks. Figure 4a and Figure 4b The partitioning is illustrated by taking a 16×16 transform block as an example. Figure 4a The coding order of the 4×4 sub-blocks shown in and Figure 4b The coding order of the transform coefficient levels within the sub-block shown in is usually specified by the reverse diagonal scanning shown in the figure. For some specific intra-image prediction blocks, video or vertical scanning mode is used (depending on the actual intra-prediction mode). The coding order always starts from the high frequency position.

[0067] In H.265|MPEG-H HEVC, transform coefficient levels are transmitted based on 4x4 sub-blocks. Lossless encoding of transform coefficient levels includes the following steps:

[0068] 1. The syntax element coded_block_flag is transmitted, which signals whether there are any non-zero transform coefficient levels in the transform block. If coded_block_flag is equal to 0, no other data will be encoded for this transform block.

[0069] 2. Transmit the x and y coordinates of the first non-zero transform coefficient level in coding order (e.g., the block-by-block reverse diagonal scan order shown in FIG. 4). The transmission of the coordinates is divided into prefix and suffix parts. The standard uses the syntax elements last_sig_coeff_x_prefix, last_sig_coeff_y_prefix, last_sig_coeff_x_suffix, and last_sig_coeff_x_suffix.

[0070] 3. Starting from the 4x4 sub-block containing the first non-zero transform coefficient level in the coding order, the 4x4 sub-block is processed in the coding order, where the coding of the sub-block comprises the following main steps:

[0071] a. Transmit the syntax element coded_sub_block_flag, which indicates whether the sub-block contains any non-zero transform coefficient levels. For the first and last 4x4 sub-blocks (i.e., the sub-blocks containing the first non-zero transform coefficient level or DC level), this flag is not transmitted but can be inferred to be equal to 1.

[0072] b. For all transform coefficient levels within a sub-block where coded_sub_block_flag is equal to 1, the syntax element significant_coeff_flag indicates whether the corresponding transform coefficient level is not equal to zero. This flag is transmitted only if its value cannot be inferred from the transmitted data. In particular, 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_flags of the last sub-block are equal to zero, then no flag is transmitted for the first significant scan position (specified by the transmitted x and y coordinates) and no flag is transmitted for the DC coefficient.

[0073] c. For the first eight transform coefficient levels where significant_coeff_flag is equal to 1 (if any), the flag coeff_abs_level_greater1_flag is transmitted. It indicates whether the absolute value of the transform coefficient level is greater than 1.

[0074] d. For the first transform coefficient level with coeff_abs_level_greater1_flag equal to 1 (if any), the flag coeff_abs_level_greater2_flag shall be transmitted. It indicates whether the absolute value of the transform coefficient level is greater than 2.

[0075] e. For all levels with significant_coeff_flag equal to 1 (one exception is described below), the syntax element coeff_sign_flag shall be transmitted, which specifies the sign of the transform coefficient level.

[0076] f. For all transform coefficient levels whose absolute values ​​have not been fully specified by the values ​​of significant_coeff_flag, coeff_abs_level_greater1_flag and coeff_abs_level_greater2_flag (or fully specified if any of the transmitted flags is equal to zero), the remainder of the absolute values ​​is transmitted using the multi-level syntax element coeff_abs_level_remaining.

[0077] In H.265|MPEG-HHEVC, all syntactic elements are encoded using context-based adaptive bit-based arithmetic coding (CABAC). All non-bit syntactic elements are first mapped to a series of bit decisions, which are also called bits. The resulting bit sequence is encoded using bit-based arithmetic coding. For this purpose, each bit is associated with a probability model (the probability mass function of the bit), which is also called a context. For most bits, the context represents an adaptive probability model, which means that the probability mass function of the associated bit will be updated according to the value of the actual encoded bit. Conditional probabilities can be exploited by switching the context of certain specific bits based on the transmitted data. CABAC also includes a so-called bypass mode, in which a fixed probability mass function (0.5, 0.5) is used.

[0078] The context selected for the encoding of coded_sub_block_flag depends on the value of coded_sub_block_flag for the neighboring subblocks that have already been coded. The context for significant_coeff_flag is selected based on the scan position (x and y coordinates) inside the subblock, the size of the transform block and the value of coded_sub_block_flag in the neighboring subblocks. For the flags coeff_abs_level_greater1_flag and coeff_abs_level_greater2_flag, the context selection depends on whether the current subblock includes a DC coefficient and whether any coeff_abs_level_greater1_flag equal to 1 has been transmitted for the neighboring subblocks. For coeff_abs_level_greater1_flag, it also depends on the number and value of coeff_abs_level_greater1_flags that have already been coded for the subblock.

[0079] The sign coeff_sign_flag and the remainder of the absolute value coeff_abs_level_remaining are encoded in bypass mode of the arithmetic encoder of the bins. In order to map coeff_abs_level_remaining to a sequence of bins (bin decisions), an adaptive binarization scheme is used. The binarization is controlled by a single parameter, which is adapted based on the coded value of the sub-block.

[0080] H.265|MPEG-HHEVC also includes a so-called sign data hiding mode, where the transmission of the sign of the last non-zero level within a sub-block is omitted (under certain specific conditions). Instead, the sign of this level is embedded in the parity bits of the sum of the absolute values ​​of the levels of the corresponding sub-block. Note that the encoder has to take this aspect into account when determining the appropriate transform coefficient levels.

[0081] Video coding standards only specify the bitstream syntax and the reconstruction process. If we consider transform coding for a given original block of prediction error samples and a given quantization step size, the encoder has a lot of freedom. Given the quantization index q for the transform block k , entropy coding must follow a uniquely defined algorithm for writing data into the bitstream (i.e., constructing arithmetic codewords). However, given the original prediction error sample block, the quantization index q k The encoder algorithm for t is outside the scope of the video coding standard. In addition, the encoder has the freedom to choose the quantization parameter QP on a block basis. For the following description, we assume that the quantization parameter QP and the quantization weight matrix are given. Therefore, the quantization step size for each transform coefficient is known. We further assume that the analysis transform performed by the encoder is the inverse (or a number that is very close to the inverse) of the specified synthesis transform to obtain the original transform coefficients t k Even under these conditions, the encoder is free to choose each original transform coefficient t k The quantization index q k Since the choice of transform coefficient levels determines both the distortion (or reconstruction / approximation quality) and the bit rate, the quantization algorithm used has a substantial impact on the rate-distortion performance of the resulting bitstream.

[0082] The simplest quantization method converts the original transform coefficients t k Round to the nearest reconstruction level. For the commonly used URQ, the corresponding quantization index q can be determined according to the following formula k :

[0083]

[0084] where sgn() is the sign function and the operator Returns the largest integer less than or equal to its argument. This quantization method guarantees MSE distortion

[0085]

[0086] is minimized, but it completely ignores the resulting transformed coefficient level q k The desired bit rate. Generally, better results are obtained if rounding towards zero is biased:

[0087]

[0088] The best results for rate-distortion sensing are obtained if the quantization process minimizes the Lagrangian function D + λ·R, where D represents the distortion of the transform block (e.g., MSE distortion), R specifies the number of binary bits required for the transform coefficient levels of the transport block, and λ is the Lagrangian multiplier.

[0089] For the relationship between QP and quantization step size used For codecs such as H.264|MPEG-4AVC or H.265|MPEG-H HEVC, the following relationship between the Lagrangian multiplier λ and the block quantization parameter QP is often used.

[0090]

[0091] where c1 and c2 represent constant factors for the slice or image.

[0092] The quantization algorithm that aims to minimize the Lagrangian function D + λ · R of distortion and rate is also called rate-distortion optimized quantization (RDOQ). If we use MSE or weighted MSE to measure distortion, the quantization index q of the transformed block should be determined in some way k , so that the following cost metric is minimized:

[0093] D+λ·R=∑ k α k ·(t k -Δ k ·q k ) 2 +λ·R(q k |q k-1 ,q k-2 ,…).

[0094] At this time, the transform coefficient index k specifies the coding order (or scanning order) of the transform coefficient levels. k |q k-1 ,q k-2 ,…) represents the transmission quantization index q kThe number of bits required (or its estimate). This condition states (due to the use of combined probabilities or conditional probabilities) that a particular transform coefficient level q k The number of bits of q usually depends on the previous transform coefficient level q in the coding order k-1 ,q k-2 The factor α in the above formula is k can be used to weight the contributions of individual transform coefficients, e.g. to simulate the contrast sensitivity of human vision. In the following, we generally assume that all weighting factors α k is equal to 1 (but the algorithm can be modified directly by taking into account different weighting factors).

[0095] For transform coefficient coding in H.265|MPEG-HHEVC, the exact computation of the rate term is very complex, because most of the bit decisions are encoded using an adaptive probability model. However, if we ignore certain aspects of the probability model selection and ignore the adaptation of the probability model inside the transform block, it is possible to design an RDOQ algorithm with reasonable complexity. The RDOQ algorithm implemented in the reference software for H.265|MPEG-HHEVC consists of the following basic processing steps:

[0096] 1. For each scanned position k, under the assumption that the level is not inferred to be zero, calculate the Lagrangian cost D by k (q k )+λ·R k (q k ) to minimize the transform coefficient level q k . D k (q k ) represents the (weighted) squared error D k (q k )=α k ·(t k -Δ k ·q k ) 2 , R k (q k ) represents the transmission q k An estimate of the number of binary bits required.

[0097] 2. Determine the flag coded_sub_block_flag of the 4×4 sub-block by comparing the Lagrangian cost of the following two cases: (a) using the transform coefficient level selected in step 1; (b) setting the syntax element coded_sub_block_flag to zero, thereby setting all transform coefficient levels of the 4×4 sub-block to zero.

[0098] 3. Determine the position of the first non-zero transform coefficient level by comparing the Lagrangian cost, which is obtained by selecting one of the non-zero transform coefficient levels (after step 1) as the first non-zero transform coefficient level in the coding order (the previous transform coefficient levels are set to zero).

[0099] 4. coded_block_flag is determined by comparing the Lagrangian costs of the sequence of transform coefficient levels obtained after step 1 and setting all transform coefficient levels within the transform block to zero.

[0100] It is a modified concept of transform coding that transform coefficients are not independently quantized and reconstructed. Instead, the allowed reconstruction level of a transform coefficient depends on the quantization index selected for the previous transform coefficient in the reconstruction order. The concept of dependent scalar quantization is combined with modified entropy coding, where the probability model selection (or, alternatively, codeword table selection) for the transform coefficient depends on the set of allowed reconstruction levels.

[0101] The advantage of dependent quantization of transform coefficients is that the allowable reconstruction vectors are densely packed in the N-dimensional signal space (where N represents the number of samples or the number of transform coefficients in the transform block). The reconstruction vector for a transform block refers to the ordered reconstructed transform coefficients (or, alternatively, the ordered reconstructed samples) of the transform block. For the simplest case of two transform coefficients, Figure 5a and Figure 5b This effect is illustrated in . Figure 5a The allowable reconstruction vectors (representing points in a two-dimensional plane) for independent scalar quantization are shown. It can be seen that the set of allowed values ​​of the second transform coefficient t'1 does not depend on the selected value of the first reconstructed transform coefficient t'0. Figure 5b An example for dependent scalar quantization is shown. Note that in contrast to independent scalar quantization, the selectable reconstruction value of the second transform coefficient t′1 depends on the selected reconstruction level of the first transform coefficient t′0. Figure 5b In the example of , there are two different sets of available reconstruction levels (shown by different colors) for the second transform coefficient t′1. If the quantization index of the first transform coefficient t′0 is even (..., -2, 0, 2, ...), any reconstruction level of the first set (blue dots) can be selected for the second transform coefficient t′1. And if the quantization index of the first transform coefficient t′0 is odd (..., -3, -1, 1, 3, ...), any reconstruction level of the second set (red dots) can be selected for the second transform coefficient t′1. In the example, the reconstruction levels of the first set and the second set are offset by half the quantization step size (any reconstruction level of the second set is located between two reconstruction levels of the first set).

[0102] Dependent scalar quantization of transform coefficients has the following effect: for a given average number of reconstruction vectors per N-dimensional unit volume, the expected value of the distance between a given input vector of transform coefficients and the closest available reconstruction vector is reduced. As a result, for a given average number of binary bits, the average distortion between the input vector of transform coefficients and the transform coefficients reconstructed by the vector can be reduced. In vector quantization, this effect is called spatial filling gain. Using dependent scalar quantization for transform blocks can utilize a major part of the potential spatial filling gain of high-dimensional vector quantization. And, in contrast to vector quantization, the implementation complexity of the reconstruction process (or decoding process) is comparable to conventional transform coding with an independent scalar quantizer.

[0103] Figure 6 The block diagram of a transform decoder with dependent scalar quantization is shown in FIG. 1 . The main changes are related to the dependent quantization, resulting in the arrows pointing from top to bottom. As shown by these vertical arrows, the reconstructed transform coefficients t′ with reconstruction order index k>0 k Not only depends on the relevant quantization index q k , but also depends on the quantization indices q0,q1,…,q used for the previous transform coefficients in the reconstruction order k-1 Note that in dependent quantization, the reconstruction order of the transform coefficients must be uniquely defined. If the quantization index q is also used in entropy coding k Knowledge of the associated set of reconstruction levels can then improve the performance of the overall transform codec. This means that it is advantageous to switch the context (probability model) or codeword table based on the set of reconstruction levels applied to the transform coefficients.

[0104] As in conventional transform coding, transform coding according to the embodiments outlined herein includes a quantization algorithm and entropy coding in addition to the analysis transform. As the analysis transform, the inverse of the synthetic transform (or a number approximating the inverse) is usually used, and the entropy coding is usually uniquely specified given the entropy decoding process. However, similar to conventional transform coding, there is a lot of freedom in choosing the quantization index given the original transform coefficients.

[0105] Dependent quantization of transform coefficients refers to the concept where the set of available reconstruction levels for a transform coefficient depends on the quantization index selected for the previous transform coefficient in the reconstruction order (within the same transform block).

[0106] A plurality of sets of reconstruction levels are predefined, and based on the quantization index for a previous transform coefficient in the coding order, one of the predefined sets is selected to reconstruct the current transform coefficient.

[0107] A set of permissible reconstruction levels for the current transform coefficient is selected from a set (two or more sets) of predetermined reconstruction levels (based on the quantization index for the previous transform coefficient in the coding order). The values ​​of the reconstruction levels in the set of reconstruction levels are parameterized by a block-based quantization parameter. The block-based quantization parameter (QP) determines the quantization step size Δ, and all reconstruction levels (in the set of all reconstruction levels) represent integer multiples of the quantization step size Δ. For a particular transform coefficient t k The quantization step size Δ k (where k represents the reconstruction order) can be determined not only by the block quantization parameter QP, but also by the quantization weight matrix and the block quantization parameter to determine the specific transform coefficient t k The quantization step size Δ k . Usually, for the transformation coefficient t k The quantization step size Δ k By using the transformation coefficient t k The weighting factor w (specified by the quantized weight matrix) k and the block quantization step size Δ block (specified by the block quantization parameter),

[0108] Δ k =w k Δ block .

[0109] In an embodiment, dependent scalar quantization for transform coefficients uses two different sets of reconstruction levels, and the transform coefficients t k All reconstruction levels of the two sets represent the quantization step size Δ of this transform coefficient k (i.e., determined at least in part by a block-based quantization parameter). Note that the quantization step size Δ k represents only the scaling factors of the allowed reconstructed values ​​in the two sets. In addition to the scaling factors for different transform coefficients t within the transform block k The possible single quantization step size Δ k (and, therefore, a single scaling factor), the same set of two reconstruction levels is used for all transform coefficients.

[0110] exist Figure 7 , a preferred configuration of two sets of reconstruction levels is shown. The reconstruction levels contained 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) contains all odd integer multiples of the quantization step size, and also contains reconstruction levels equal to zero. Please note that both reconstruction sets are symmetric to zero. The reconstruction levels equal to zero are contained in both reconstruction sets, otherwise the reconstruction sets are disjoint. The union of the two reconstruction sets contains all integer multiples of the quantization step size.

[0111] The reconstruction level selected by the encoder among the allowed reconstruction levels is indicated or transmitted inside the bitstream. As in conventional independent scalar quantization, this can be achieved using so-called quantization indices, also called transform coefficient levels. A quantization index (or transform coefficient level) is an integer that uniquely identifies an available reconstruction level within a quantization set (i.e., within a set of reconstruction levels). The quantization index is transmitted as part of the bitstream to the decoder (using any entropy coding technique). On the decoder side, the reconstructed transform coefficient can be uniquely calculated based on the current set of reconstruction levels (determined by the previous quantization index in the encoding / reconstruction order) and the transmitted quantization index for the current transform coefficient.

[0112] Figure 7 The reconstruction levels in are assigned with an associated quantization index (the quantization index is given by the number below the circle representing the reconstruction level). A quantization index equal to 0 is assigned to a reconstruction level equal to 0. A quantization index equal to 1 is assigned to the smallest reconstruction level greater than 0, a quantization index equal to 2 is assigned to the next reconstruction level greater than 0 (i.e., the second smallest reconstruction level greater than 0), and so on. Or, 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., 1, 2, 3, etc.). Similarly, a quantization index of -1 is assigned to the largest reconstruction level less than 0, a quantization index of -2 is assigned to the next (i.e., second largest) reconstruction level less than 0, and so on. Or, 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.).

[0113] The use of reconstruction levels representing integer multiples of the quantization step size allows a computationally low complexity algorithm to be used for reconstructing the transform coefficients at the decoder side. Figure 7 The first quantization set includes all even integer multiples of the quantization step size, while 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). Figure 8 The algorithm specified in the pseudo code implements the reconstruction process of the transform coefficients.

[0114] exist Figure 8 In the pseudocode, level[k] represents the transformation coefficient t kThe quantization index transmitted is setId[k], and setId[k] (equal to 0 or 1) specifies the identifier of the set of the current reconstruction level (determined based on the previous quantization index in the reconstruction order, as will be described in more detail below). The variable n represents an integer multiple of the quantization step size given by the quantization index level[k] and the set identifier setId[k]. If the transform coefficients are encoded using the set of the first reconstruction level (setId[k] == 0), this reconstruction level contains the quantization step size Δ k If the transform coefficients are encoded using the set of the second reconstruction level (setId[k] == 1), then there are three cases: (a) if level[k] is equal to 0, n is also equal to 0; (b) if level[k] is greater than 0, n is equal to twice the quantization index level[k] minus 1; (c) if level[k] is less than 0, n is equal to twice the quantization index level[k] plus 1. This can be specified using the sign function

[0115]

[0116] Then, if the second quantization set is used, the variable n is equal to the quantization index level[k] minus twice the sign function of the quantization index sign(level[k]). Once the variable n (an integer factor specifying the quantization step size) is determined, the quantization step size Δ is calculated by multiplying n by the quantization step size Δ. k To obtain the reconstructed transform coefficient t′ k .

[0117] As mentioned above, instead of the quantization step size Δ k The exact multiplication of can be used to obtain the reconstructed transform coefficient t′ through integer approximation k This is Figure 8 This is illustrated in the pseudocode of . Here, the variable shift represents a right shift. Its value usually depends only on the quantization parameter of the block (but the shift parameter can also be changed for different transform coefficients within a block). The variable scale[k] represents the number of bits used for the transform coefficient t k The variable "add" specifies a rounding offset, which is usually set equal to add = (1 << (shift-1)). It should be noted that in Figure 8 The integer arithmetic specified in the pseudocode (last line) is equivalent to the quantization step size Δ except for rounding. k The multiplication of is represented by

[0118] Δ k = scale[k]·2 -shift .

[0119] Relative to Figure 8 , Fig. 9 Another (purely cosmetic) change in is the switching between sets of two refactoring levels implemented using a ternary if-then-else operator (a?b:c), which is known from programming languages ​​such as the C programming language.

[0120] In addition to the selection of the set of reconstruction levels discussed above, another task in transform coding that relies on scalar quantization is the algorithm used to switch between defined quantization sets (sets of reconstruction levels). The algorithm used determines the "compression density" that can be achieved in the N-dimensional space of transform coefficients (and, therefore, also in the N-dimensional space of reconstructed samples). Higher compression density ultimately leads to improved coding efficiency.

[0121] In a preferred embodiment, the transition between 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 predetermined value. Typically, the predefined value is equal to 0. The state variables of the following transform coefficients in the coding order are determined by an update process. The state of a particular transform coefficient depends only on the state of the previous transform coefficient in the reconstruction order and the value of the previous transform coefficient.

[0122] The state variable can have four possible values ​​(0, 1, 2, 3). On the one hand, the state variable specifies the quantization set used for the current transform coefficient. Quantization set 0 is used if and only if the state variable is equal to 0 or 1; quantization set 1 is used if and only if the state variable is equal to 2 or 3. On the other hand, the state variable specifies the possible transitions between quantization sets.

[0123] For example, the state for a particular transform coefficient may depend only on a binary function of the state of the previous transform coefficient in the reconstruction order and the value of the previous transform coefficient level. A binary function is referred to below as a path. In a particularly preferred embodiment, the following state transition table is used, where a "path" refers to the binary function of the previous transform coefficient level in the reconstruction order.

[0124] Table 1: Preferred example of a state transition table for a configuration with 4 states.

[0125]

[0126] The path can be given by the parity bit of the quantization index. Taking level[k] as the transform coefficient level, it can be determined according to the following formula

[0127] path=(level[k]&1),

[0128] The & operator represents the bitwise AND in two's complement integer operations.

[0129] The path can also represent other binary functions of level[k]. For example, it can specify whether the transform coefficient level is equal to or not equal to 0:

[0130]

[0131] The concept of state transitions for scalar quantization-dependent transformations allows for a low-complexity implementation of reconstruction of transform coefficients in the decoder. Fig.10 A preferred example of the reconstruction process of the transform coefficients of a single transform block using a C-type pseudo code is shown in FIG.

[0132] exist Fig.10 In the pseudocode of , the index k specifies the reconstruction order of the transform coefficients. It should be noted that in the example code, the index k decreases in the reconstruction order. The last transform coefficient has an index equal to k=0. The first index kstart specifies the reconstruction index of the first reconstructed transform coefficient (or more precisely, the reciprocal reconstruction index). The variable kstart can be set equal to the number of transform coefficients in the transform block minus 1, or it can be set equal to the index of the first non-zero quantization index in the encoding / reconstruction order (for example, if the position of the first non-zero quantization index is transmitted in the applied entropy coding method). In the latter case, all previous transform coefficients (with indices k>kstart) are inferred to be equal to 0. The reconstruction process for each single transform coefficient is the same as Fig. 9 The example is the same as Fig. 9 In the example of , the quantization index is represented by level[k] and the associated reconstructed transform is represented by trec[k]. State variables are represented by states. The 1D table setId[] specifies the quantization sets associated with different values ​​of the state variables, while the 2D table state_trans_table[][] specifies the state transition given the current state (first parameter) and the path (second parameter). For example, the path can be given by the parity bits of the quantization index (using the bitwise and operator &), but other concepts are also possible. As another example, the path can specify whether the transform coefficient is equal to or not equal to zero. Examples of tables in C-style syntax are as follows (these tables are the same as Table 1 shown above).

[0133] setId[4]={0,0,1,1}

[0134] state_trans_table[4][2]={{0,2},{2,0},{1,3},{3,1}}

[0135] The table state_trans_table[][] is not used to determine the next state, instead an arithmetic operation that produces the same result can be used. Similarly, the table setId[] can also be implemented using arithmetic operations. Alternatively, a combination of table lookup and symbolic functions using the 1d table setId[] can be implemented using arithmetic operations.

[0136] The main aspect of scalar quantization is that there is a set of different permissible reconstruction levels (also called quantization set) for the transform coefficients. The quantization set for the current transform coefficient is determined based on the value of the quantization index of the previous transform coefficient. If we consider Figure 7 and comparing the two quantization sets, it is clear that the distance between the reconstructed levels equal to 0 in set 0 and the adjacent reconstructed levels is larger than in set 1. Therefore, the probability that the quantization index is equal to 0 is larger if set 0 is used and smaller if set 1 is used. This effect can be exploited in entropy coding by a switching probability model based on the quantization set or more generally on the state for the current quantization index.

[0137] Note that for proper switching of codeword tables or probability models, the paths of all previous quantization indices (binary functions of quantization indices) must be known when entropy decoding the current quantization index (or the corresponding binary decision of the current quantization index).

[0138] The quantization index can be encoded using binary arithmetic coding similar to H.264|MPEG-4AVC or H.265|MPEG-H HEVC. To do this, the non-binary quantization index is first mapped onto a series of binary decisions (commonly referred to as bins).

[0139] In the following, various examples are described about how, i.e., in what order and using what context, the quantization indices resulting from dependent quantization are binarized and arithmetically encoded. Here, the quantization indices are transmitted as absolute values, and for absolute values ​​greater than 0, the sign is transmitted. When the sign is transmitted as a single binary bit, there are many possibilities for mapping the absolute value to a series of binary decisions, which are manifested in the examples described below. The following description first focuses on the coding order and the binarization scheme, and therefore gives various examples. In the following, different examples for context modeling are described. The latter can be combined with the previous embodiments involving the coding order and the binarization scheme, but the previous embodiments are not limited to the latter examples. Example 1:

[0140] The following binary and non-binary syntax elements are transmitted:

[0141] sig_flag: specifies whether the absolute value of the transform coefficient level is greater than 0;

[0142] If sig_flag is equal to 1, gt1_flag: specifies whether the absolute value of the transform coefficient level is greater than 1;

[0143] If gt1_flag is equal to 1, gt2_flag: specifies whether the absolute value of the transform coefficient level is greater than 1;

[0144] If gt2_flag is equal to 1, remainder: A non-binary syntax element used to specify the remainder of the absolute level. For example,

[0145] This syntax element is transmitted in bypass mode of the arithmetic coding engine using Golomb-Rice coding.

[0146] Existing syntax elements are not inferred to be equal to 0. At the decoder side, the absolute values ​​of the transform coefficient levels are reconstructed as follows:

[0147] absLevel=sig_flag+gt1_flag+gt2_flag+remainder

[0148] Additional gtX_flag's may be transmitted, or gt2_flag may be omitted, or both gt1_flag and gt2_flag may be omitted. sig_flag and gtx_flag's are encoded using an adaptive context model.

[0149] Example 2:

[0150] The following binary and non-binary syntax elements are transmitted:

[0151] sig_flag: specifies whether the absolute value of the transform coefficient level is greater than 0;

[0152] If sig_flag is equal to 1, then gt1_flag: specifies whether the absolute value of the transform coefficient level is greater than 1;

[0153] If gt1_flag is equal to 1, then:

[0154] ο par_flag: a parity bit that specifies the remainder of the absolute value of the transform coefficient level (i.e., the absolute value – 2);

[0155] remainder: a non-binary syntax element that specifies the absolute level remainder (i.e., the absolute value –2–

[0156] par_flag) / 2). The syntax element is transmitted in a bypass mode of the arithmetic coding engine, for example using a Golomb-Rice code.

[0157] Existing syntax elements are not inferred to be equal to 0. At the decoder side, the absolute values ​​of the transform coefficient levels are reconstructed as follows:

[0158] absLevel=sig_flag+gt1_flag+par_flag+2*remainder

[0159] Additional gtX_flag's may be transmitted, or gt1_flag may be omitted. As an example, instead of the remainder above, gt2_flag may be transmitted (specifying whether the absolute value is greater than 3) and (if gt2_flag is equal to 1) the corrected remainder (i.e., (absolute value – 3 – par_flag) / 2). The absolute value is then constructed according to

[0160] absLevel=sig_flag+gt1_flag+par_flag+2*(gt2_flag+remainder)

[0161] sig_flag, gtX_flag's and par_flag are encoded using an adaptive context model.

[0162] Example 3:

[0163] The following binary and non-binary syntax elements are transmitted:

[0164] sig_flag: specifies whether the absolute value of the transform coefficient level is greater than 0;

[0165] If sig_flag is equal to 1, then

[0166] ο par_flag: a parity bit that specifies the remainder of the absolute value of the transform coefficient level (i.e., the absolute value – 1);

[0167] gt1_flag: specifies the remainder of the absolute value of the transform coefficient level (i.e. (absolute value – 1 – par_flag) / 2)

[0168] Is it greater than 0?

[0169] If gt1_flag is equal to 1, then gt2_flag: specifies the remainder of the absolute value of the transform coefficient level (i.e., the absolute value of

[0170] –1–par_flag) / 2) is greater than 1;

[0171] If gt2_flag is equal to 1, remainder: A non-binary syntax element that specifies the remainder at the absolute level (i.e., (absolute value – 1 – par_flag) / 2-2). This syntax element is transmitted in bypass mode of the arithmetic coding engine, for example using GolombRice code.

[0172] Existing syntax elements are not inferred to be equal to 0. At the decoder side, the absolute values ​​of the transform coefficient levels are reconstructed as follows:

[0173] absLevel=sig_flag+par_flag+2*(gt1_flag+gt2_flag+remainder)

[0174] Additional gtX_flag's may be transmitted, or gt2_flag may be omitted. sig_flag, gtx_flag's and par_flag are encoded using an adaptive context model.

[0175] Further binarization is possible.

[0176] With respect to context modeling, the following examples are provided to illustrate the interaction between binarization, binary bit / coefficient ordering, and context derivation. In a specific example, the syntax for transmitting a quantization index for a transform block includes a binary bit that specifies whether the quantization index is equal to zero or not equal to 0 (sig_flag introduced above). A probability model for encoding this binary bit can be selected from a set of two or more probability models. The choice of the probability model used depends on the current state variable (the state variable represents the quantization set used). At this point, a set of different probability models can be used for all possible values ​​of the state variable, or the possible values ​​of the state variable can be clustered into two or more clusters, and a different set of probability models can be used for each cluster (e.g., a first set of probability models for states 0 and 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 states 0 and 1; and a second set of probability models for states 2 and 3).

[0177] It is also possible that the probability model selected for other binary syntax elements (eg gt1_flag or par_flag) also depends on the value of the current state variable.

[0178] Advantageously, dependent quantization of transform coefficients is combined with entropy coding, wherein the selection of a probability model for one or more bits of a binary representation of a quantization index (also called a quantization level) depends on a state variable for the current quantization index. The state variable is given by the quantization index (or a subset of bits representing the quantization index) of the previous transform coefficient in the coding and reconstruction order.

[0179] In particular, the selection of the described probability model is advantageously combined with one or more of the following entropy coding aspects:

[0180] • Transmitting a flag for a transform block, the flag specifying whether the quantization index for the transform block is not equal to zero, or whether all quantization indices for the transform block are equal to zero.

[0181] • Splitting the coefficients of a transform block (at least, for transform blocks exceeding a predefined size given by the size of the block or the number of samples contained) into a number of sub-blocks. Fig.12a This is exemplarily illustrated by the transform block 10 in FIG. 1 , where the coefficients 12 of the block are subdivided into sub-blocks 14, where coefficients of size 4×4 are exemplarily shown. If the transform block is divided into a plurality of sub-blocks 14, then for one or more sub-blocks, a flag is transmitted (unless inferred based on syntax elements already transmitted), which specifies whether the sub-block contains any non-zero quantization index. The sub-blocks may also be used to specify the encoding order of the bits. For example, the encoding of the bits may be divided into sub-blocks 14 so that all bits of a sub-block are encoded before any bits of the next sub-block 14 are transmitted. However, the bits of a particular sub-block 14 may be encoded multiple times on the transform coefficients within this sub-block. For example, all bits of the absolute value of the quantization index of a specified sub-block may be encoded before encoding any sign bits. As described above, the bits of the absolute value may also be divided into multiple passes.

[0182] · Transmit the first non-zero position in the coding order. The position is Fig.12a It can be transmitted as x and y coordinates specifying the position in the 2d array of transform coefficients, as an index into the scan order, or by any other means. Fig.12a As shown in , the position of the transmission of the first non-zero quantization index (or transform coefficient) in coding order is specified in coding order ( Fig.12a The white mark in the middle infers all transform coefficients 12 before the identified coefficient is equal to zero. Only for the coefficient at the specified position (in Fig.12a The markings are in black / bold) i.e., further data is transmitted first in the coding order and then in the coding order (in Fig.12a The coefficients following this coefficient (marked with shading in the middle) transmit further data. Fig.12a The example in shows a 16x16 transform block 10 with 4x4 sub-blocks 14; the encoding order used is H.265|MPEG-

[0183] H Sub-block azimuth diagonal scanning specified in HEVC. It should be noted that the encoding 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 bit that specifies whether the quantization index is not equal to 0, this bit will not be sent for the quantization index at the specified position (it is already known that the coefficient is not equal to 0), but the bit will be inferred to be equal to 1.

[0184] The binarization of the absolute value of the quantization index comprises an adaptively coded binary bit which specifies whether the quantization index is not equal to 0. The probability model used to code this binary bit (called context) is selected from a set of candidate probability models. The selected candidate probability model may be determined not only by the state variable of the current quantization index, but also, in addition, by the quantization index that has been transmitted for the transform block. In a preferred embodiment, the state variable determines a subset of the available probability models (also called context set), and the value of the quantization index that has been coded determines the probability model used within this subset (context set).

[0185] In a preferred embodiment, the probability model used within the context set is determined based on the value of the quantization index encoded in the local neighborhood 52 of the current transform coefficient 50, i.e. one of the coefficients whose bins are currently being encoded / decoded, and therefore the same context needs to be determined. An example of such a local neighborhood 52 is Figure 12b . In the figure, the current transform coefficient 50 is marked in black, while the local neighborhood 52 is marked in shade. In the following, some exemplary metrics are listed, which can be derived based on the values ​​of the quantization index of the neighboring coefficients 51 within the local neighborhood 52, and then can be used to select the probability model of the predetermined context set.

[0186] In addition, other data available to the decoder can be used (either explicitly or in combination with the metrics listed above) to derive a probability model in a predetermined set of contexts. These data include:

[0187] o The position of the current transform coefficient (x-coordinate, y-coordinate, number of diagonals, or any combination thereof).

[0188] o The size of the current block (vertical size, horizontal size, number of samples, or any combination thereof).

[0189] ο The aspect ratio of the current transform block.

[0190] The binarization of the absolute value of the quantization index includes an adaptively coded bit that specifies whether the absolute value of the quantization index is greater than 1. The probability model used to encode this bit is selected from a set of candidate probability models (called context). The selected probability model is determined by the transmitted transform block quantization index. For selecting the probability model, any of the above methods can be used (for the bit that specifies whether the quantization index is not equal to 0).

[0191] As mentioned above, the coding order of the bins of the binarization of the quantization index of the coefficient 12 has an impact on the efficiency of the coding of the block 10. For example, the probability model selected for at least one of the binary decisions (bins), usually sig_flag, depends on the value of the current state variable. And since the state variable is determined by the binary function path() at the level of the previous transform coefficient, the coding order of the bins must be arranged in such a way that when encoding sig_flag for the current transform coefficient (or more generally, the probability model depends on the binary syntax element of the state variable), the paths of all previous transform coefficients are known.

[0192] For example, all bins specifying the absolute value of a quantization index may be encoded consecutively. This means that all bins (for absolute value) of all previous quantization indices in the encoding / reconstruction order are encoded before the first bin of the current quantization index. The sign bit may or may not be encoded in a separate second pass of the transform coefficients (in practice it may depend on the quantization set used). The sign bit for a sub-block may be encoded after the bin for the absolute value of the sub-block, but before any bin for the next sub-block.

[0193] In another example, only a subset of the bits that specify the absolute value of the quantization index are encoded continuously in the first pass of the transform coefficients. However, these bits uniquely specify the state variable. The remaining bits are encoded in one or more additional passes on the transform coefficients. If we assume that the path is specified by the parity bits of the quantization index, the parity bits will be included in the first pass of the transform coefficients. The remaining bits can be transmitted through one or more additional passes. In other embodiments of the present invention, similar concepts are used. For example, the number of unary bits can be modified or even adjusted based on the symbols that have been transmitted. Different passes can be used on a sub-block basis, in which case the bits of the sub-block are encoded in multiple passes, but all the bits of the sub-block are transmitted before any bits of the next sub-block are transmitted.

[0194] Below, some examples are listed for binary decisions in multiple passes:

[0195] Example A:

[0196] This example uses the binarization of Example 3 above, and the path is given by the parity bit.

[0197] ·Pass 1: sig_flag, par_flag, gt1_flag

[0198] Pass 2: gt2_flag

[0199] Pass 3: remainder

[0200] Pass 4: Sign bit (Sign bit)

[0201] Example B:

[0202] This example uses the binarization of Example 3 above, and the path is given by the parity bit.

[0203] Pass 1: sig_flag, par_flag

[0204] Pass 2: gt1_flag

[0205] Pass 3: gt2_flag

[0206] Pass 4: remainder

[0207] Pass 5: Sign bit

[0208] Example C:

[0209] This example uses the binarization of Example 1 above, and the path specifies whether the absolute value is greater than 0.

[0210] Pass 1: sig_flag

[0211] Pass 2: gt1_flag

[0212] Pass 3: gt2_flag

[0213] Pass 4: remainder

[0214] Pass 5: Sign bit

[0215] Example D:

[0216] This example uses the binarization of Example 2 above, and the paths are given by the parity bits.

[0217] ·Pass 1: sig_flag, gt1_flag, par_flag

[0218] Pass 2: remainder

[0219] Pass 3: Sign bit

[0220] Example E:

[0221] This example uses the binarization of example 2 above with an additional gt2_flag; the path is given by the parity bit.

[0222] ·Pass 1: sig_flag,gt1_flag,par_flag,gt2_flag

[0223] Pass 2: remainder

[0224] Pass 3: Sign bit

[0225] As a slight modification of this example, gt2_flag can also be transmitted in a separate pass.

[0226] Further coding sequences or combinations are binarized and coding sequences are possible.

[0227] To achieve a high throughput decoder implementation, it is best to keep the number of context coded bits (also called regular coded bits) as small as possible (while not degrading performance). This can be achieved by limiting the maximum number of certain bits (similar to HEVC). The remaining information is encoded using the bypass mode of the arithmetic coding engine.

[0228] The method for reducing the maximum number of binary bits for context coding described below may be combined with one or more of the following aspects already taken above:

[0229] • Multiple sets of reconstruction levels for quantization of transform coefficients. In particular, there are two sets: the first set includes all even integer multiples of the quantization step size; the second set includes all odd integer multiples of the quantization step size and zero.

[0230] (at least for a portion of the transform coefficients within a transform block)

[0231] The set of reconstruction levels selected depends on the state variable. For the first coefficient in the reconstruction order, the state variable is set equal to 0. For all other coefficients, the following conditions apply. The value of the state variable for the current transform coefficient is determined by a binary function (path) of the value of the state variable for the previous transform coefficient level and the value of the previous transform coefficient level

[0232] Sure.

[0233] The transform coefficient levels are binarized using binary arithmetic coding and the bits are entropy coded. The binarization includes sig_flag, which specifies whether the transform coefficient level is not equal to zero. This flag is encoded using an adaptive probability model, where the probability model chosen depends on the number of bits used for the current transform coefficient (and possibly other parameters).

[0234] The value of the state variable.

[0235] In the following, several embodiments are described for reducing the number of context coding bits used to rely on scalar quantization. For these embodiments, the worst-case decoding complexity is limited on a sub-block basis. Typically, as in HEVC, a larger transform block is split into 4x4 sub-blocks, and the following conditions apply:

[0236] The syntax of the transform block includes a syntax element (e.g., coded_block_flag) that specifies whether there are any 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 rules apply;

[0237] Transmit the x and y coordinates of the first significant transform coefficient in scan order (sometimes referred to as the last significant coefficient because the actual scan order specifies scanning from high frequency components to low frequency components);

[0238] The scanning of transform coefficients is performed on a sub-block (usually 4x4 sub-block) basis; all transform coefficient levels of a sub-block are encoded before encoding any transform coefficient level of any other sub-block; sub-blocks are processed in a predetermined scanning order, starting with the sub-block containing the first significant coefficient in the scanning order and ending with the sub-block containing the DC coefficient;

[0239] The syntax includes a coded_subblock_flag indicating whether the subblock contains any non-zero transform coefficient levels; for the first and last subblocks in scan order (i.e., the subblock containing the first significant coefficient in scan order and the subblock containing the DC coefficient), this flag is not transmitted but is inferred to be equal to 1; when coded_subblock_flag is transmitted, it is typically transmitted at the beginning of a subblock;

[0240] For each subblock with coded_subblock_flag equal to 1, the transform coefficient levels transmitted in multiple scan passes over the scan positions of the subblock;

[0241] The following embodiments apply to encoding at the transform coefficient level of a subblock with coded_subblock_flag equal to 1. However, the embodiments are not limited to this case. The embodiments may also be applied to a complete transform block (without a subblock structure). In this case, the subblock structure (as described above) may also be used, but the worst case complexity may be limited (as described below) to complete the transform block (rather than limiting it to the subblocks individually). Example 1

[0242] In a first embodiment, the transform coefficient levels are encoded in multiple scan passes. It has the following properties:

[0243] Quantization-dependent state machines are driven by the parity bits at the transform coefficient level, i.e. a binary function path (level) returns the parity bits of its argument;

[0244] A probability model for selecting sig_flag's for the first pass, based on the corresponding values ​​of the state variables (and optionally other parameters available to the decoder, see above);

[0245] First time : In the first pass of scanning positions, the following context-coded bits are transmitted:

[0246] sig_flag, indicating whether the transform coefficient is not equal to 0; if sig_flag can be inferred to be equal to 1 (i.e., for example, the case of the first valid scan position in the transform block (explicitly signaled by x and y coordinates), sig_flag is not transmitted.

[0247] If sig_flag is equal to 1 (coded or inferred value), the following is additionally transmitted for the current scan position:

[0248] ο par_flag specifies the absolute level of parity bit minus 1;

[0249] ο gt1_flag specifies whether the remainder (given by (absolutelevel-1-par_flag) / 2) is greater than zero.

[0250] If the predefined maximum number of context coded bits is reached, the first pass will terminate. Let MAX_REG_BINS be the maximum number of bits that can be transmitted in the first pass, and let regBins represent the number of regular coded bits that are still available. Then, the following conditions apply:

[0251] ο regBins is initially set equal to MAX_REG_BINS;

[0252] ο After encoding any binary bit (sig_flag, gt1_flag, par_flag), regBins will be reduced by 1;

[0253] o If the binary bit in the transmit scan position (sig_flag and sig_flag are equal to 1, gt1_flag,

[0254] par_flag), the first scan pass will terminate if the number of available binary bit regBins is less than 3 (i.e., the next scan position cannot transmit sig_flag, par_flag and gt1_flag), then the first scan pass will terminate.

[0255] Second pass : In the second pass of scanning positions, the following context-coded bits are transmitted:

[0256] If gt1_flag is equal to 1 for the scan position, gt2_flag is transmitted, which specifies whether the remainder (given by (absolute level - 3 - par_flag) / 2) is greater than 0.

[0257] • If a maximum predefined number of context-coded gt2_flags have been transmitted, the second pass will terminate.

[0258] If a scan position is reached that did not transmit any data in the first pass (i.e., for such scan positions,

[0259] If no data is transmitted in the second pass, the second pass is also terminated.

[0260] The third time : In the third pass of the scan positions, for the remainder of the absolute value (i.e., data not yet specified by the transmitted sig_flag, par_flag, gt1_flag, and gt2_flag), it is transmitted at all scan positions where sig_flag is encoded in the first pass. Non-binary syntactic element remainders are binarized using a structured code (such as a Golomb-Rice code) and then the binary bits are encoded in the bypass mode of the arithmetic coding engine. The remainders are transmitted to the following scan positions:

[0261] For all scan positions, gt2_flag equal to 1 is transmitted in the second pass:

[0262] For these scan positions, the transmitted non-binary syntax element remainder specifies the following:

[0263] (absolute value – 5 – par_flag) / 2

[0264] • For all scan positions, gt1_flag equal to 1 was transmitted in the first pass, but all scan positions for which gt2_flag was not transmitted in the second pass.

[0265] For these scan positions, the transmitted non-binary syntax element remainder specifies the following:

[0266] (absolute value – 3 – par_flag) / 2

[0267] The fourth time : In the fourth pass, the absolute levels of all scan positions are encoded, for which no data was transmitted in the first pass. The absolute levels are first binarized using a structured code, the code used may depend on the local activity measure and the value of the current state variable. The bins are transmitted using the bypass mode of the arithmetic coding engine.

[0268] The fifth time : Finally, in the fifth pass, the signs are transmitted for all transform coefficient levels not equal to 0. The signs are transmitted in the bypass mode of the arithmetic coding engine.

[0269] An advantage of the described embodiment is that the number of context coded bins is effectively reduced relative to a version that does not limit the number of bins in the first and second passes. The complexity is reduced because the encoding and decoding of context coded bins requires a more complex implementation than bins coded in bypass mode.

[0270] Let us illustrate the above description by taking the pseudo code shown in Figure 13 as an example. Figure 13 shows a method for decoding a transform coefficient block according to the above embodiment, but by replacing all "decoding" with "encoding", the corresponding encoding embodiment can be easily derived therefrom.

[0271] The pseudo code shown in FIG. 13 shows the encoding / decoding process at the transform coefficient level inside a sub-block 14. The pseudo coding is shown from the decoder's point of view. The decoding from the data stream is performed in a sequence of passes 601 to 605 scanning the transform coefficient positions 12 of the block 10 along the scan order. The binarization used, i.e., the flag / binary bit used to define the quantization index of the coefficient, the encoding / decoding of the flag and the distribution of the residues over the encoding / decoding passes, is changed in the embodiments described subsequently, so the description of FIG. 13 focuses on the provisions of the overview or rough description also applies to the embodiments described subsequently.

[0272] The possibility of scanning order based on the pass has been compared with Fig.12a and 12b described and in Figure 12b13, but note that passes 601 to 605 do not need to scan all transform coefficient positions 12 of the transform block 10, but rather they all use the scan order 62; in addition, flags for some flag types can be transmitted in the same pass, as described with respect to the embodiment in Figure 13, but other possibilities exist.

[0273] The predefined values ​​MAX_REG_BINS and MAX_GT2_BINS appearing in FIG13 specify the maximum number of regular coded bins in pass 1 601 and pass 2 602, respectively. The Boolean variable firstSubblock specifies whether the current subblock is the first subblock to be coded / decoded in coding order for block 10 (within the transform block), such as a subblock containing Fig.12a 14. The firstSigScanIdx specifies the scan index corresponding to the position of the first significant transform coefficient in the transform block 10, i.e., the coefficient explicitly signaled at the beginning of the transform block syntax. The reference symbol 64 is used from now on to indicate the position. minSubblockScanIdx and maxSubblockScanIdx represent the minimum and maximum values ​​of the scan index for the current subblock, i.e., the subblock currently being decoded / encoded. Note that the first scan index startScanIdx for which any data is transmitted for the current subblock 14 depends on whether the subblock includes the first significant coefficient in the scan order. If this is the case, the first scan pass starts at the scan index corresponding to the first significant transform coefficient 64; otherwise, the first scan pass starts from the minimum scan index of the subblock, such as the lower left coefficient position of the subblock 14, or in other words, the subblock that is farthest from the DC position 66 to which the scan order 62 leads. Note again that although FIG. 13 is an embodiment using sub-block-by-sub-block coding, the concept can be easily modified to involve coefficient coding of a block or to relate some of the aspects described below to sub-blocks while other aspects relate to the entire block 10 .

[0274] In the sequence of passes 601 to 604, context-adaptive binary arithmetic coding / decoding is used to encode / decode flags or binary bits respectively selected from a set having one or more flag types, in the currently described embodiment 1, for example, including sig_flag, par_flag, gt1_flag and gt2_flag, and variable length codes are used to encode / decode the remainder values. That is, the binary bits of the codewords of the variable length code are encoded / decoded in the bypass mode of the binary arithmetic coding / decoding engine using a unified non-adaptive probability model, resulting in a compression rate of a single binary bit of 1, so that, respectively for the transform coefficient position currently scanned, such as, Figure 12bThe one indicated by 50 in , decodes each flag and each remainder value. In pseudo code, this current position is indicated by parameter or index k.

[0275] The decoding from the data stream in the sequence of passes 601 to 605 is performed in such a way that for each transform coefficient position in a coded set of transform coefficient positions, at least one of one or more flags and a remainder is coded / decoded. The "coded set of transform coefficient positions" for example extends between a predefined first transform coefficient position, such as startScanIdx, and a predefined last transform coefficient position, such as endScanIdx, wherein the predefined first and last transform coefficient positions specify a subset of transform coefficient positions in the transform block; alternatively, the coded set extends between the first non-zero coefficient 64 and a predefined coefficient, such as the DC coefficient 66. That is, there may be one or more coefficients in the coded set for which the remainder is coded / decoded but without a flag, one or more coefficients for which one or more flags and a remainder are coded / decoded, and one or more coefficients for which one or more flags but no remainder are coded / decoded. For each coefficient, the coding / decoding of its coded data, i.e., the flag and / or the remainder, is performed sequentially so as to limit the initial value range continuously in a sequential sense, or in other words stepwise. For example, the absolute value of the quantization index at each coefficient position is relative to Ω=0 to 2 x The initial value range of -1,egx=16 is represented in the x binary bit representation, where any absolute value of the quantization index for the transform coefficient position currently scanned must be located. Through sequential encoding / decoding, this initial value range is gradually restricted to include only the absolute value of the quantization index of the transform coefficient position currently scanned within the value range. That is, at the end, for a particular transform coefficient position, at least one of one or more flags and an encoded / decoded remainder value uniquely defines the latter outside the initial value range. Each flag restricts the value range of the absolute value of the quantization index for the transform coefficient position currently scanned to a first sub-part or a second sub-part, where the value range of the absolute value of the quantization index for the transform coefficient position currently scanned is divided into two parts. More precisely, each flag divides the value range part into two parts, where the absolute value of the quantization index of each coefficient is known to be in the value range part due to the previous one or more flags, if any. For example, sig_flag causes the value range Ω to be divided into A={0} and Then, par_flag will Restrict to odd or even numbers, and so on.

[0276] If a remainder value is encoded / decoded for a certain currently scanned transform coefficient position 50, the remainder value uniquely indicates the transform coefficient position for the current scan, if at least one flag is decoded for the currently scanned transform coefficient position, the absolute value of the quantization index is outside the value range, or if no flag is decoded for the currently scanned transform coefficient position, it is outside the initial value range. Note that for the transform coefficient positions for which no remainder value is encoded / decoded, the one or more flags encoded / decoded for these transform coefficient positions have restricted the value range to include only one absolute value. Regarding the sign, as taken in the present embodiment, if the transform coefficients are signified as a whole, but not necessarily in the modified embodiment, they can be encoded separately in bypass mode. In Figure 13, they are shown as being encoded / decoded separately in their own pass 605 for any non-zero quantization index, but this can be changed to reach further embodiments.

[0277] The dependent quantization is used to sequentially dequantize the quantization indices of the transform coefficient positions in the coded set of transform coefficient positions. By this measure, a reconstructed transform coefficient for this set of transform coefficient positions is obtained. For example, the state transition as described above can be used. For example, it can be embodied in the following way using a state transition table or a trellis diagram along the scan order 62: that is, by Fig.10 As shown in, for example, for the current transform coefficient position represented by index k, its quantization index is uniquely encoded / decoded by the above concept, based on the state taken by the state transition for the current transform coefficient position, by Figure 7 The "state" in indicates that 72 more than 73 sets of reconstruction levels are uniquely selected, i.e. Figure 7 76. The method of claim 74 is used to determine a reconstruction level set of trec[k] from among the sets 0 and 1 of quantization levels, and to dequantize 74 the quantization index level[k] to the reconstruction level trec[k] pointed to by the quantization index in the one reconstruction level set, i.e., the reconstructed transform coefficient is set equal to the reconstruction level, and to update 76 the state of the state transition taken for the current transform coefficient position, i.e., the transform coefficient position currently scanned during dependent quantization, so as to produce an updated state 78 for the transform coefficient position following the current transform coefficient in the scanning order. The updating 76 is performed according to the quantization index level[k] of the current transform coefficient position, as Fig.10 80 in which table 82 is used for this purpose. Likewise, quantization using the selected level set is performed on the encoder side.

[0278] As shown in the example above, state transitions can be Fig.10In addition, the updating can be performed by deciding between the first successor state and the second successor state 841 and 842 according to the following situation: a binary function 86, such as a parity check function, is applied to the quantization index 80 of the current transform coefficient position, wherein the first successor state and the second successor state depend on the state of the current transform coefficient position, as shown at 88. The encoder and decoder can be determined by a predetermined quantization step size, i.e. Figure 7 The Δ and Fig.10 2 of 2 shift The set of reconstruction levels is parameterized, wherein information about the predetermined quantization step size is transmitted, for example, in the data stream. Figure 7 As shown in , each reconstruction level set may consist of integer multiples of a predetermined quantization step size, which is constant or valid for all reconstruction level sets for the current transform coefficient position. Note that different step sizes may be used for different coefficients within a block 10, such as due to the above-mentioned scaling matrix. The number of reconstruction level sets in 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, which includes zero and even multiples of the predetermined quantization step size, and a second reconstruction level set, i.e., set 1, which includes zero and odd multiples of the predetermined quantization step size.

[0279] So far, the description of FIG. 13 also applies to the embodiments described subsequently. However, embodiment 1 uses the following mechanism to limit the number of flags for which context adaptive coding is used. In particular, in a certain pass of the pass sequence, i.e., pass 601 in FIG. 13, flags of the sig_flag type can only be used up to the point of encoding / decoding, "up to" being understood herein as the position before and including, although any reference to the position "starting from [position 112]" is understood to mean the position after position 112, excluding position 112 - the predetermined transform coefficient position, in which, in this pass, the predetermined termination criterion is filled for the first time in the scan order. In FIG. 13, not only the number of sig_flags is limited in this way, but also the number of par_flags and gt1_flags in pass 601 and gt2_flags in pass 602. Note that the limitation also affects binarization: as long as the termination criterion is met, the respective flag type is no longer used for the definition of the coefficient position after the predetermined transform coefficient position just mentioned in the scan order. That is, a flag of a predetermined flag type, i.e. subject to the number of encodings / decodings, is only encoded / decoded for the type preceding and including the predetermined transform coefficient position in the scan order. Thus, in FIG13 , once the criterion associated with pass 601 is met, i.e. associated with MAX_REG_BINS, for each encoded set of transform coefficient positions following the predetermined transform coefficient position in the scan order, here, in a further pass of the pass sequence, i.e. pass 603 in the case of the passes of FIG13 , one of the remainder values ​​is encoded such that the latter uniquely indicates the absolute value of the quantization index of the respective transform coefficient position outside the initial value range, i.e. not subject to any previous limitation of the initial value range by any flag of the flag type used for encoding / decoding the quantization index of the corresponding coefficient.

[0280] To illustrate the just outlined concept for limiting the number of context adaptive encoding / decoding flags, refer to Figure 14 to Figure 15 , except for Figure 13. Fig.14 The initial value range of the absolute value of the quantization index of the transform coefficient at 90 is shown. This initial value range can contain all integer values ​​between zero and a certain maximum value. The initial value range can also be an interval open to larger numbers. The number of integer values ​​in the initial value range 90 does not have to be a power of 2. In addition, Fig.14 92 shows various flag types involved in representing individual quantization indices, i.e., involved in representing their absolute values. The sig_flag type indicates whether the absolute value of a certain quantization index is zero. That is, sig_flag 92 doubles the initial value range 90 into two sub-parts, i.e., one includes only zeros, and the other includes all other possible values. That is, if sig_flag has been Fig.14The bottom of the quantization index is exactly zero, then sig_flag has already uniquely indicated the absolute value of the quantization index. The non-zero values ​​of the initial value range 90 form a value range 94, which is further divided into two by the flag type par_flag, that is, on the one hand, it becomes an odd number and on the other hand, it becomes an even number. The presence of par_flag 96 is only required when a certain quantization index is non-zero. With respect to the same double-divided value range 94, par_flag 96 does not produce uniqueness. It indicates that half is the next result (recursively defined) value range, so the next flag, gt1_flag 98, further divides this result value range into two after par_flag, that is, in the case of an odd value of the quantization index value, it is an odd non-zero value 100, and in the case of an even value of the quantization index value, it is a non-zero value 102. In particular, the double division of gt1_flag 98 is done in a way that one part only includes the smallest odd value of the value range 100 or the smallest non-zero even value of the domain 102. The other part includes all other values ​​of the corresponding domain 100 / 102. The latter remaining value range is further divided into two in the same way by the flag gt2_flag 104, that is, the minimum value represents one part and the other values ​​represent the other part. Fig.14 As shown at the bottom of , this means that if a certain transform coefficient quantization index happens to be zero, only sig_flag 92 is encoded as the quantization index of a certain transform coefficient, and sig_flag, par_flag and gt1_flag 92, 96 and 98 are encoded to represent the specific quantization index of the transform coefficient if the transform coefficient happens to fall into the value interval 106 including the absolute values ​​1 and 2, and all flags 92, 96, 98 and 104 are encoded to represent the absolute value of the quantization index of the specific transform coefficient, and if the transform coefficient happens to fall into the value interval 108 immediately following including the values ​​3 and 4, the quantization index of the transform coefficient is encoded as a remainder, and the absolute value of the transform coefficient is located in the remaining interval 110 outside the initial value range 90. Flags of flag types 92, 96 and 98 are encoded in the first pass 601. Flag 104 is encoded in the second pass 602. These flags are encoded using a context adaptive algorithm. However, the number of flags encoded in a pass can be limited and is limited according to Figure 13. In the example of FIG13 , the number of flags of a flag type in pass 601 is limited to max_rec_bins. Flags of flag types 92, 96, and 98 are encoded for the currently accessed transform coefficient position 12 in the first pass along sequence 62 only if all three flag types can still be encoded in pass 601 without the total number of flags encoded in pass 601 exceeding the maximum allowed number of flags to be encoded / decoded in pass 601. Fig.15, the last transform coefficient position that does not exceed the maximum number of flags allowed in pass 601 is shown to be 112. Similarly, flags of flag type 104 are encoded only at the currently visited transform coefficient position 12 along sequence 62 in the second pass, provided that the flag can still be encoded in pass 602 without the total number of encoded flags 104 in pass 602 exceeding the maximum allowed number of flags to be encoded / decoded in pass 602. Fig.15 , it is shown that the last transform coefficient position that does not exceed the maximum allowed number of flags in pass 602 is 116.

[0281] Fig.15 The encoding of the transform coefficient or its quantization index relative to the sub-block 14 is shown, but as described above, as long as the entire process of FIG. 13 is applied as a whole to the block 10, the embodiment of FIG. 13 can be varied within this range. In addition, Fig.15 1 shows the case where the coded set of transform coefficients includes all coefficients, which is the case, for example, for the sub-block following the sub-block in the scanning order 62 that includes the first non-zero transform coefficient position 64. Fig.15 The transform coefficient positions shown with hatching in the figure are related to transform coefficients whose quantization indices are represented in a manner including flag types 92, 96 and 98. Therefore, in the first pass 601, flags of these flag types 92, 96 and 98 are encoded 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 encoded, while for all other three flag types, they are included in the pass 601 and encoded / decoded. Fig.15 The data stream is shown to accordingly include a corresponding portion 114 into which the flags of these flag types 92, 96 and 98 are encoded within the pass 601. In a second pass 602, the transform coefficient position 12 is traversed again along the scan order 62 until the maximum number of gt2_flags that can be encoded during the pass 602, i.e. the number of these flags does not exceed max_gt2_bins, then a gt2_flag is encoded for the transform coefficient, wherein said gt2_flag 98 indicates that the absolute value of the corresponding quantization index is within the remaining value range portion including the intervals 108 and 118. Fig.15 All transform coefficient positions 12 along the scan order 62 up to position 116 are shown as being shaded and distinguished from subsequent transform coefficient positions 12 up to position 112, which is simply shaded. Fig.15All transform coefficient positions 12 after position 112 are shown unhatched in FIG. 1 . The gt2_flag 104 encoded during pass 602 is encoded as portion 118 of the data stream, which immediately follows portion 114. No other data is encoded during pass 602 after position 116. In the next two passes 603, 604, which may be interpreted as half of a pass, hints are encoded into portion 120 of the data stream, immediately following portion 118. In particular, in a first sub-portion of portion 120, hints for transform coefficient positions 12 up to position 112 are encoded during pass 603. Thus, these remainders indicate the absolute value of the quantization index for a transform coefficient position 12 outside the interval 110 of the cross-hatched transform coefficient position 12, i.e. the transform coefficient position 12 up to position 116 and a quantized coefficient position 12 outside the remaining value range including the intervals 108 and 110 for the simple hatched transform coefficient position 12, i.e. those following position 116 up to position 112. In a sub-portion 122, the remainders of the transform coefficient positions 12 up to position 112, and another sub-portion in the pass 604, the remainders of each transform coefficient position 12 after position 112, i.e. each non-hatched transform coefficient position 12, are encoded into the data stream. The latter remainders directly indicate the quantization index, i.e. directly indicate that the absolute value exceeds the initial value range 90. In this way, the number of context-adaptively coded flags 92, 96, 98 and 104 is reduced, and the number of bits coded using the bypass mode, i.e. using a fixed equiprobable mode, has been increased, i.e. the binarized bits of the remainders.

[0282] That is, in Figure 13, the above-mentioned abort criterion is related to whether the number of flags decoded in the first pass exceeds a predetermined threshold.In addition to sig_flags, flags of types 96 and 98 are also counted.

[0283] It may be that the variable length code for encoding / decoding the residual value of the currently scanned transform coefficient position is selected from a predefined set of variable length codes such as Golomb-Rice codes. Fig.15 13 , the code selected may be different, wherein in the case of FIG. 13 the selection may even depend on whether the position is between positions 112 and 116. For example, the encoding / decoding of the remainder may include a different VLC code than in pass 604 instead of pass 603 or a different VLC code than when the code is performed at 128 in FIG. 13 . Fig.15 The simple cross-hatching of the remainder of the coefficients is compared when encoding / decoding using different VLC codes at 130 Fig.15The VLC code used when encoding / decoding the remainder of the shadow coefficients. The selection involves parameterization of the parameterizable VLC code, such as selecting the order of the exponential Golomb code, or the Rice parameters as described below. Alternatively, the parameters indicating the selected variable length code can be inferred from 60 3,4 The binarization parameter may be kept constant in the process and may be changed incrementally when the quantization index of the previous transform coefficient position meets the predetermined criteria. Alternatively, the binarization parameter may be selected according to the quantization index of the transform coefficient position adjacent to the currently scanned transform coefficient position when encoding the remainder. For example, only for Fig.15 This dependency can be used only in the case where the current transform coefficient position of the remainder before the scan order 62 is encoded or is a predetermined transform coefficient position 112. This aspect will be outlined below.

[0284] The codeword selected from the selected / parameterized code also depends on the coefficient position at which the remainder is encoded / decoded: the absolute value of the quantization index minus the first and second pass 60 that can be parameterized 1,2 The maximum value represented by the flags 92, 96, 98 and 104, i.e. 4, plus 1, i.e. 5, or represented by the binarization of the remainder of the quantization index of any coefficient in the case of the coefficient to which the quantization coefficient belongs or VLC encoded to position 116, the absolute value of the quantization index minus the maximum value representable by the flags 92, 96, 98 of the first pass 601, i.e. 2 plus 1, i.e. 3, or represented by the binarization of the remainder of the quantization index of any coefficient in the case of the coefficient to which the quantization coefficient belongs or VLC encoded to position 116 after position 112, and the absolute value of the quantization coefficient is directly represented or VLC encoded in the case of the coefficient to which the quantization index belongs, and the binarization of the remainder of the quantization index of any coefficient is located after position 112.

[0285] Several variations of the embodiment of FIG. 13 may apply. For example, gt2_flag may not be encoded / decoded in a separate pass 602, but rather included in the first pass 601. The number of encoded gt2_flags may then be included in the count of context-coded bins in the first pass 601, and the first pass terminates if the number of available context-coded bins is less than 4. That is, in this case, a single threshold for the number of context-coded bins is used. Alternatively, gt2_flag is not transmitted at all, in which case the remainder is encoded if gt1_flag is equal to 1.

[0286] In another variation of the described embodiment, one or more additional gtx_flags are included. Similar to gt2_flag, these flags are only encoded if the previous gty_flag (y=x-1) is equal to 1. They indicate whether the absolute value of the quantization index is greater than the minimum possible value specified by the previous gtx_flags. The reconstruction of the absolute value is given by

[0287] absLevel=sig_flag+par_flag+2*(gt1_flag+gt2_flag+gt3_flag+…+remainder).

[0288] These flags can be encoded in the same pass as gt2_flag (this includes the case where gt2_flag is included in the first pass), or they can be encoded in one or more additional passes. In the latter case, other thresholds can be applied to limit the number of gtx_flags.

[0289] The second embodiment described below differs from the first embodiment in one respect: the order of par_flag and gt1_flag is swapped (and the meaning of these flags changes accordingly). If sig_flag is equal to 1, gt1_flag is transmitted first, which specifies whether the absolute value of the transform coefficient level is greater than 1. If gt1_flag is equal to 1, par_flag specifies the parity bit of the remainder (i.e., the absolute level -2). For the first embodiment, the following applies:

[0290] Quantization-dependent state machines driven by parity bits at the transform coefficient level, i.e. binary function paths (levels)

[0291] Returns the parity bit of its argument;

[0292] Depending on the corresponding values ​​of the state variables (and optionally other parameters available to the decoder, see above),

[0293] Select the probability model of sig_flag in the first pass;

[0294] First pass: In the first pass of scanning positions, the following context-encoded bins are transmitted:

[0295] sig_flag, indicating whether the transform coefficient is not equal to 0; if it can be inferred that sig_flag is equal to 1 (i.e., for example, the case of the first valid scan position in the transform block (signaled explicitly by x and y coordinates), sig_flag is not transmitted.

[0296] If sig_flag is equal to 1 (encoded or inferred value), the following is additionally transmitted for the current scan position:

[0297] οgt1_flag specifies whether the absolute level is greater than 1;

[0298] ο If gt1_flag is equal to 1, then par_flag specifies the absolute level of parity bits minus 2;

[0299] If the predefined maximum number of context-coded bits is reached, the first pass will terminate. Let MAX_REG_BINS be the maximum number of bits that can be transmitted in the first pass, and let regBins represent the number of regular coded bits that are still available. Then, the following conditions apply:

[0300] οregBins is initially set equal to MAX_REG_BINS;

[0301] ο After encoding any binary bit (sig_flag, gt1_flag, par_flag), regBins will be reduced by one;

[0302] ο If after transmitting the bins of a scan position (sig_flag, gt1_flag if applicable and par_flag), the number of binregBins still available is less than 3 (i.e., it is not possible to transmit sig_flag, par_flag and gt1_flag for the next scan position), the first pass scan will be terminated.

[0303] Second pass: In the second pass of the scan position, the following context-coded bins are transmitted:

[0304] If gt1_flag is equal to 1 for the scan position, gt2_flag is transmitted, which specifies whether the remainder (given by (absolute level - 2 - par_flag) / 2) is greater than 0.

[0305] • If a maximum predefined number of context-coded gt2_flags have been transmitted, the second pass will terminate.

[0306] If a scan position is reached for which no date was transmitted in the first pass (ie for such scan position no data was transmitted in the second pass), the second pass is also terminated.

[0307] The third time:In the third pass of the scan positions, the remainders of the absolute values ​​(i.e., data not yet specified by the transmitted sig_flag, par_flag, gt1_flag, and gt2_flag) are transmitted for all scan positions where sig_flag is located and encoded in the first pass. The non-binary syntax element remainders are binarized using a structured code (such as a Golomb-Rice code) and then encoded in binary bits in the bypass mode of the arithmetic coding engine. The remainders are transmitted to the following scan positions:

[0308] For all scan positions, gt2_flag equal to 1 is transmitted in the second pass:

[0309] For these scan positions, the transmitted non-binary syntax element remainder specifies the following:

[0310] (absolute value–4–par_flag) / 2

[0311] • For all scan positions, gt1_flag equal to 1 was transmitted in the first pass, but all scan positions for which gt2_flag was not transmitted in the second pass.

[0312] For these scan positions, the transmitted non-binary syntax element remainder specifies the following:

[0313] (absolute value–2–par_flag) / 2

[0314] Fourth time: In the fourth pass, the absolute levels of all scan positions are encoded, without any data being transmitted in the first pass. The absolute levels are first binarized using a structured code, which may depend on the local activity measure and the value of the current state variable. The bins are transmitted using the bypass mode of the arithmetic coding engine.

[0315] Fifth time: Finally, in the fifth pass, the signs are transmitted for all transform coefficient levels not equal to 0. The signs are transmitted in the bypass mode of the arithmetic coding engine.

[0316] The encoding / decoding process at the transform coefficient level within a sub-block is further illustrated in the pseudo code of Figure 16. The same comments as for the first embodiment apply. Fig.17 Show Fig.14 A modified version of , which is applicable to FIG16 . Fig.15The same is valid for FIG. 16 except that details such as the start of the range, the remainder relating to the coefficients between positions 112 and 116, i.e. the maximum value indicated using flags 92, 96 and 98, is 2 in the case of FIG. 13 and 1 in the case of FIG. 16. It can be seen that, unlike the case of FIG. 13, the encoding / decoding of the flag par_flag in the first pass 601 occurs exclusively for transform coefficient positions at and after said transform coefficient positions where the flag gt1_flag indicates that the quantization index of the corresponding scanned transform coefficient is greater than one in magnitude. In the case of FIG. 13, this encoding / decoding inevitably occurs in the case indicated by the corresponding sig_flag as non-zero.

[0317] In a variation of this embodiment, gt2_flag is not encoded in a separate pass, but is included in the first pass. The number of encoded gt2_flags is then included in the count of context coded bins of the first pass, and the first pass is terminated if the number of available context coded bins is less than 4. That is, in this case a single threshold for the number of context coded bins is used.

[0318] Alternatively, gt2_flag is not transmitted at all, in which case the remainder is encoded if gt1_flag is equal to 1.

[0319] In another variation of the described embodiment, one or more additional gtx_flags are included. Similar to gt2_flag, these flags are only encoded if the previous gty_flag (y=x-1) is equal to 1. They indicate whether the absolute value of the quantization index is greater than the minimum possible value specified by the previous gtx_flags. The reconstruction of the absolute value is given by

[0320] absLevel=sig_flag+gt1_flag+par_flag+2*(gt2_flag+gt3_flag+…+remainder)

[0321] These flags can be encoded in the same pass as gt2_flag (this includes the case where gt2_flag is included in the first pass), or they can be encoded in one or more other passes. In the latter case, further thresholds can be applied to limit the number of gtx_flags.

[0322] The third embodiment differs from the first embodiment in that sig_flag in the first pass is encoded for all scan positions. Only the presence of par_flag and gt1_flag is determined by the number of context coding bits transmitted. For the first embodiment, the following conditions apply:

[0323] Quantization-dependent state machines are driven by the parity bits of the transform coefficient levels, i.e. a binary function path (level) returns the parity bits of its arguments;

[0324] Select a probability model for sig_flag in the first pass, based on the corresponding values ​​of the state variables (and optionally other parameters available to the decoder, see above);

[0325] First time : In the first pass of scanning positions, the following context-coded bits are transmitted:

[0326] sig_flag, indicating whether the transform coefficient is not equal to 0; if it can be inferred that sig_flag is equal to 1 (i.e., for example, the case of the first valid scan position in the transform block (signaled explicitly by x and y coordinates), sig_flag is not transmitted.

[0327] If sig_flag is equal to 1 (coded or inferred value), the following is additionally transmitted for the current scan position:

[0328] οpar_flag specifies the absolute level of parity bit minus 1;

[0329] gt1_flag specifies whether the remainder (given by (absolute level-1-par_flag) / 2) is greater than zero.

[0330] If the maximum predefined number of context coded bits (including sig_flags not yet coded) is reached, the transmission of par_flag and gt1_flag is skipped. Let MAX_REG_BINS be the maximum number of bits that can be transmitted in the first pass, and let regBins represent the number of regular coded bits that are still available. Then, the following applies:

[0331] oregBins is initially set to MAX_REG_BINS minus the number of sig_flags to be transmitted in the first pass (this number is determined by the first scan index in the first pass, the last scan index of the sub-block, and whether the sub-block contains the first significant coefficient in scan order);

[0332] ο After encoding any gt1_flag or par_flag, decrement regBins by 1;

[0333] ο If the binary bit in the transmission scan position (sig_flag, if sig_flag is equal to 1, gt1_flag,

[0334] par_flag), the number of binregBins still available is less than 2 (i.e., par_flag cannot be transferred

[0335] and gt1_flag for the next scan position), then for all subsequent scan indices in the first pass, only sig_flag is transmitted.

[0336] Second pass : In the second pass of scanning positions, the following context-coded bits are transmitted:

[0337] If the gt1_flag of the scanned position is equal to 1, the gt2_flag is transmitted, which specifies the remainder (given by (absolutelevel

[0338] -3-par_flag) / 2) gives whether) is greater than 0.

[0339] • If a maximum predefined number of context-coded gt2_flags have been transmitted, the second pass will terminate.

[0340] The second pass is also terminated if only sig_flag equal to sig_flag is transmitted to a scan position in the first pass (i.e., for such scan position no data is transmitted in the second pass)

[0341] The third time : In the third pass through the scan positions, transmit the remainders of the absolute levels of all scan positions encoded by sig_flag, par_flag, gt1_flag and par_flag in one pass (i.e., the data specified by sig_flag, par_flag, gt1_flag and gt2_flag that are not sent). Binarize the non-binary syntax element remainders using a structured code (such as a Golomb-Rice code) and then encode the binary bits in the bypass mode of the arithmetic coding engine. The remainders will be transmitted to the following scan positions:

[0342] For all scan positions, gt2_flag equal to 1 is transmitted in the second pass:

[0343] For these scan positions, the transmitted non-binary syntax element remainder specifies the following:

[0344] (absolute value–5–par_flag) / 2

[0345] • For all scan positions, gt1_flag equal to 1 was transmitted in the first pass, but all scan positions for which gt2_flag was not transmitted in the second pass.

[0346] For these scan positions, the transmitted non-binary syntax element remainder specifies the following:

[0347] (absolute value–3–par_flag) / 2

[0348] Fourth time: In the fourth pass, the absolute value minus 1 is encoded for all scan positions, in the first pass only sig_flag equal to 1 is encoded (but gt1_flag is not transmitted). The remainder (absolute level minus 1) is first binarized using a structured code, the code used may depend on the local activity measure and the value of the current state variable. The bins are transmitted using the bypass mode of the arithmetic coding engine.

[0349] Fifth time Finally, in the fifth pass, the symbols are transmitted for all transform coefficient levels not equal to 0. The symbols are transmitted in the bypass mode of the arithmetic coding engine.

[0350] The encoding process at the transform coefficient level within a sub-block is further illustrated in the pseudo code of Figure 18. The same comments as for the first embodiment apply. Fig.14 and Fig.15 The same is valid for Figure 18, except for the fact that position 112 indicates that starting from said position along the scanning order 62, flags 96 and 98 are no longer encoded, and sig_flag can be used for the entire position block, so the remainder of the coefficient position downstream of position 112, which is not hatched, does not immediately represent the quantization index of the corresponding coefficient, but only the coefficients after position 112 are encoded, only their sig_flag represents non-zero and represents only the absolute value of the quantization index minus 1.

[0351] Note that after encoding the first sig_flag equal to 1, the state variables are unknown, there is no gt1_flag / par_flag following. Therefore, for subsequent sig_flags, the probability model used must be derived independently of the state variables (for previous sig_flags, it still depends on the state variables).

[0352] The following variations of Example 3 are possible:

[0353] 1. The state machine is driven by sig_flag (i.e., information that the transform coefficient level is equal to or not equal to zero). The binary function path specifies whether the level is not equal to zero. In this case, the parity bit flag does not need to be transmitted, and in addition to sig_flag, only the following data is transmitted:

[0354] First pass: gt1_flag (transmitted sig_flag equal to 1; specifies whether the absolute level is greater than 1);

[0355] Second pass: gt2_flag (transmitted gt1_flag equal to 1; specifies whether the absolute level is greater than 2).

[0356] This has the advantage that for all sig_flags the state variable is known, so the probability model used to encode sig_flag can select sig_flag based on the state variable.

[0357] Additionally, one can remove the gt1_flag from the first pass and encode it in a standalone like this:

[0358] First pass: Transmit sig_flags

[0359] Second pass: transmit gt1_flags (up to the maximum number of gt1_flags);

[0360] The third pass: transmit gt2_flags (up to the maximum number of gt2_flags);

[0361] Fourth pass: for the remainder of the scan index where (a) gt2_flag equal to 1 is transmitted and (b) gt1_flag equal to 1 is transmitted but gt2_flag is not transmitted;

[0362] • Fifth pass: The absolute level of the scan positions where sig_flag is equal to 1 is subtracted by 1, but gt1_flag is not transmitted.

[0363] • Sixth pass: All transform coefficient levels not equal to zero sign.

[0364] 2. The state machine switches from the parity bit driven state machine to the valid bit driven state machine. This means:

[0365] For all scan indices where regBins (specified in the pseudocode above) is greater than or equal to 2, the state variables are updated with the parity bits (i.e., the parity bits at the level of the transform coefficients specified by the binary function path);

[0366] After regBins is less than 2, the state variables are updated with valid bit information (i.e., the binary function path (level) specifies whether level is not equal to zero).

[0367] The advantage of this is that all state variables of sig_flag are known, so the probability model for encoding sig_flag can be selected based on the state variables. Compared with variant 1 (the state machine is always driven by sig-flag), it has a higher packing density in N-dimensional space, so higher coding efficiency can be achieved.

[0368] That is, the state transition at 76, which has been described so far as purely parity bit driven, can be varied to the extent that the updating of the state of the state transition depends on Fig.10 The current transform coefficient position given by k in , relative to scan 601, is located before the scan order 62, or is located at the predetermined transform coefficient position 112, that is, at Fig.15 or is located outside the predetermined transform coefficient position 112, that is, located at Fig.15 If the current transform coefficient position does not exceed the predetermined transform coefficient position 112 along the scan order 62, i.e. is before or equal to the predetermined transform coefficient position 112, then the flag coefficient position of the second flag type 96 depending on the current transform, i.e. the parity bit, is updated, as described above, but the current transform coefficient position is located after the predetermined transform coefficient position in the scan order, i.e. exceeds said position along the scan order 62, and the flag of the first flag type depending on the current transform coefficient position is updated, i.e. depends on the zero degree of the current coefficient. Then, when the context adaptive entropy decoding of the flag of the predetermined first flag type, i.e. sig_flag participates, according to the present embodiment, even beyond the representation of the quantization index of each coefficient beyond the encoded coefficient position 112 different from the parity flag and the gt1 flag stopping at 112, this can be utilized: thus, the decoder and the encoder can determine the context of such sig_flag for all previous transform coefficient positions for the currently scanned transform coefficient, including then, according to the state taken by the currently scanned transform coefficient position according to the state transition, following the predetermined transform coefficient position 112.

[0369] Even alternatively, one may choose to complete the state update in any manner, such as driven entirely by the parity bits and depending on the dependency quantized state until the context of sig_flags up to position 112 is completed independent of the state after position 112 .

[0370] Similar to Example 1, the following changes may be made:

[0371] gt2_flag is included in the first pass;

[0372] gt2_flag is not encoded at all.

[0373] Additional gtx_flag is encoded.

[0374] That is, in the case of the third embodiment, there are a flag 92 of a predetermined first flag type, i.e., sig_flag, and a flag 96 of a predetermined second flag type, i.e., par_flag, and as in other embodiments, they are encoded / decoded in such a manner that the flag restricting the value range of the absolute value of the quantization index of the first transform coefficient position is encoded / decoded before the flag restricting the value range of the absolute value of the quantization index of the second transform coefficient position after the first transform coefficient position in the scan order 62. That is, any sig_flag[k] and par_flag[k] are encoded / decoded before any sig_flag[k+1] and par_flag[k+1]. Referring to FIG. 13 , before encoding / decoding of the flag of the predetermined second flag type, i.e., par_flag, is performed to the predetermined transform coefficient position 112, which is indexed by "startIdxBypass-1" in FIG. 18 , the termination criteria are filled for the first time along the scan order 62 in the first pass 601. For example the number of coded flags in the first pass 601 exceeds a certain threshold - a flag of a predetermined first flag type, i.e. the encoding / decoding of sig_flag is performed in a scanning order 62 beyond the predetermined transform coefficient positions 112, i.e. for all transform coefficients or all positions 64 except the first non-zero quantization index, without investigating any termination criteria.

[0375] The fourth embodiment differs from the third embodiment in one respect: the order of par_flag and gt1_flag is swapped (and the meaning of these flags changes accordingly). If sig_flag is equal to 1, gt1_flag is transmitted first, which specifies whether the absolute value of the transform coefficient level is greater than 1. If gt1_flag is equal to 1, par_flag specifies the parity bit of the remainder (i.e., the absolute level -2). As for the first embodiment, the following conditions apply:

[0376] For quantization-dependent state machines driven by the parity bits of the transform coefficient level, i.e., a binary function path (level) returns the parity bits of its argument;

[0377] A probability model for selecting sig_flag for the first pass, based on the values ​​of the state variables (and optionally other parameters available to the decoder, see above);

[0378] First time : In the first pass of the scan position, the following context coded bits are transmitted:

[0379] sig_flag, indicating whether the transform coefficient is not equal to 0; if it can be inferred that sig_flag is equal to 1 (i.e., for example, the case of the first valid scan position in the transform block (signaled explicitly by x and y coordinates), sig_flag is not transmitted.

[0380] If sig_flag is equal to 1 (coded or inferred value), the following is additionally transmitted for the current scan position:

[0381] ο gt1_flag specifies whether the absolute level is greater than 1;

[0382] ο If gt1_flag is equal to 1, then par_flag specifies the absolute level of parity bits minus 2;

[0383] If the maximum predefined number of context coded bits (including sig_flags not yet coded) is reached, the transmission of par_flag and gt1_flag is skipped. Let MAX_REG_BINS be the maximum number of bits that can be transmitted in the first pass, and let regBins represent the number of regular coded bits that are still available. Then, the following conditions apply:

[0384] o regBins is initially set to MAX_REG_BINS minus the number of sig_flags to be transmitted in the first pass (this number is determined by the first scan index of the first pass, the last scan index of the sub-block, and whether the sub-block contains the first significant coefficient in scan order);

[0385] ο After encoding any gt1_flag or par_flag, decrement regBins by 1;

[0386] ο If the binary bit in the transmission scan position (sig_flag, if sig_flag is equal to 1, gt1_flag, par_flag)

[0387] Afterwards, the number of still available bins regBins is less than 2 (ie, par_flag and gt1_flag cannot be transmitted for the next scan position), then only sig_flag is transmitted for all following scan indices in the scan in the first pass.

[0388] Second pass : In the second pass of scanning the positions, the following context-encoded bins are transmitted:

[0389] If the gt1_flag of the scanned position is equal to 1, the gt2_flag is transmitted, which specifies the remainder (given by (absolutelevel

[0390] -2-par_flag) / 2) gives whether ) is greater than 0.

[0391] If the predefined maximum number of context-coded gt2_flags has been transmitted, the second pass will terminate. The second pass also terminates if a scan position is reached for which only skip_flag equal to 1 was transmitted in the first pass (i.e., for such scan positions no data is transmitted in the second pass).

[0392] The third time : In the third pass of the scan positions, the remainders for the absolute level (i.e., the data specified by sig_flag, par_flag, gt1_flag, and gt2_flag that have not been transmitted) are transmitted for all scan positions for which sig_flag, gt1_flag, and par_flag were encoded in the first pass. The non-binary syntax element remainders are binarized using a structured code (e.g., a Golomb-Rice code) and then the binary bits are encoded in the bypass mode of the arithmetic coding engine. The remainders are transmitted to the following scan positions:

[0393] For all scan positions, gt2_flag equal to 1 is transmitted in the second pass:

[0394] For these scan positions, the transmitted non-binary syntax element remainder specifies the following:

[0395] (absolute value–4–par_flag) / 2

[0396] • For all scan positions, a gt1_flag equal to 1 is transmitted in the first pass, but a gt2_flag is not transmitted in the second pass.

[0397] For these scan positions, the transmitted non-binary syntax element remainder specifies the following:

[0398] (absolute value–2–par_flag) / 2

[0399] The fourth time : In the fourth pass, the absolute value minus one is encoded for all scan positions where only sig_flag equal to 1 was encoded in the first pass (but gt1_flag is not transmitted). The remainder (absolute level minus 1) is first binarized using a structured code, the code used may depend on the local activity measure and the value of the current state variable. The bins are transmitted using the bypass mode of the arithmetic coding engine.

[0400] The fifth time: Finally, in the fifth pass, the signs are transmitted for all transform coefficient levels not equal to 0. The signs are transmitted in the bypass mode of the arithmetic coding engine.

[0401] The pseudo code of Figure 19 further illustrates the encoding process at the transform coefficient level within a sub-block. Fig.17 and Fig.15 The same comments as for the first and third embodiments also apply to FIG. 19 , in which Fig.15 19 , the start of the value range to which the remainder of the coefficient between positions 112 and 116 refers, i.e., using flags 92 , 96 and 98 , is 2 in the case of FIG. 13 and 1 in the case of FIG. 19 .

[0402] For Example 4, the same variations as for Example 3 are possible. This includes the following aspects (similar to Example 2):

[0403] gt2_flag is included in the first pass;

[0404] gt2_flag is not encoded at all.

[0405] Additional gtx_flag is encoded.

[0406] The following aspects can be combined with any of the above embodiments:

[0407] Probabilistic model selection for sig_flag

[0408] The adaptive probability model used to encode the current sig_flag is selected from the set of probability models. For simplicity, let us assume that the available probability models are organized in a 4-dimensional array

[0409] probModelSig[cSig][sSig][dSig][aSig],

[0410] where cSig specifies indices that depend on the current color channel, sSig specifies indices that depend on state variables, dSig specifies indices that depend on x and y positions within a transform block, and aSig specifies indices that depend on a local activity measure. The actual organization of the probability models is an aspect of actual implementation. For example, they can be organized as one-dimensional arrays, in which case a combined index can be derived based on the values ​​of cSig, sSig, dSig, and aSig.

[0411] In the following, we describe an example method for deriving the indices cSig, sSig, dSig and aSig. However, it should be noted that different ways of deriving these indices (or partial indices) may be employed.

[0412] Color channel index cSig

[0413] In a preferred embodiment, the color channel index cSig is set equal to 0 if and only if the current color channel represents the luma channel (or more generally, the first color channel). cSig is set equal to 1 only if the current color channel represents the chroma channel (or more generally, is not the first color channel):

[0414] cSig=(current channel is luma? 0:1)

[0415] Alternatively, the cSig of the luma channel may be set equal to 0, the cSig of the Cb channel may be set equal to 1, and the cSig of the Cr channel may be set equal to 2.

[0416] Status index sSig

[0417] In a preferred embodiment, the index sSig is set equal to

[0418]

[0419] This means that one set of probability models is for state variables equal to 0 and 1, a second set is for state variables equal to 2, and a third set is for state variables equal to 3.

[0420] Alternatively, the index sSig may be set equal to the state variable (sSig=state), in which case a separate set of probability models will be used for each possible value of the state variable. Or as another alternative, the index sSig may be set according to sSig=state>>1, in which case a separate set of context models will be used for each of the two quantizers Q0 and Q1 (note that when state is equal to 0 or 1, quantizer Q0 is used, and when state is equal to 2 or 3, quantizer Q1 is used).

[0421] Position index dSig

[0422] In a preferred embodiment, the index dSig is set as follows:

[0423] If the index cSig is equal to 0 (i.e. the current color channel represents the brightness channel), then dSig is set according to the following

[0424]

[0425] If the index cSig is equal to 1 (i.e. the current color channel represents the chrominance channel), then the following sets dSig

[0426]

[0427] Here diag represents the diagonal position given by diag=x+y, where x and y represent the x and y coordinates of the current scan position inside the transform block.

[0428] Alternatively, any other clustering of diagonal positions is also possible.Or alternatively, the (x,y) positions within the transform block may be divided into a number of classes and the index dSig may be set equal to the corresponding class index.

[0429] Local activity index aSig

[0430] Finally, in a preferred embodiment of the present invention, the index aSig is set according to the following items:

[0431] aSig=min(MAX_ABS1, sumAbs1),

[0432] Where MAX_ABS1 is a predefined value and sumAbs1 refers to the sum of the minimum absolute transform coefficient levels in the local template, the minimum absolute value of which is given by the data transmitted in the first pass (see above). Alternatively, a function of sumAbs1 or a function of min(MAX_ABS1, sumAbs1) can be used to derive aSig.

[0433] In a preferred embodiment of the present invention, the predefined value MAX_ABS1 is set equal to 5.

[0434] In a preferred embodiment of the present invention, the Figure 12b The partial template shown. Note that the template includes the adjacent positions encoded before the current position. Other partial templates with these properties (adjacent positions scanned / encoded before the current position) can also be used. Such other templates can be similar to Figure 12b The templates shown in differ in: (1) the number of transform coefficient positions included and (b) the positions of the transform coefficient positions included.

[0435] Let absLevel1[i] be the partially reconstructed absolute value of the transform coefficient level at scan index i. And let T(k) designate the set of scan indices within the template for the current scan index k. Then, the sumAbs1 for the change in the current scan index k is derived according to

[0436]

[0437] That is, sumAbs1 represents the sum of the absolute values ​​of the partial reconstructions within the template.

[0438] absLevel1[k] represents the absolute value of the partial reconstruction of the transform coefficient level at scan index k. The partial reconstruction uses only the data transmitted in the first pass. In the following, some examples are specified:

[0439] If sig_flag, par_flag, and gt1_flag are transmitted in the first pass as defined in Example 1 and Example 3 (see above: par_flag specifies the parity bit of the absolute value minus 1, and gt1_flag specifies whether (absolute level–1–par_flag) / 2 is greater than 0), the partially reconstructed value can be derived according to the following formula

[0440] absLevel1[k]=sig_flag[k]+par_flag[k]+2*gt1_flag[k],

[0441] The values ​​of par_flag and gt1_flag that are not explicitly coded are inferred to be equal to 0.

[0442] When gt2_flag is included in the first pass (a variation of embodiments 1 and 3), it can be additionally used to derive the smallest possible absolute value. In this case, the partially reconstructed value can be calculated based on

[0443] absLevel1[k]=sig_flag[k]+par_flag[k]+2*(gt1_flag[k]+gt2_flag[k]),

[0444] The gt2_flag that is not explicitly coded is inferred to be equal to 0.

[0445] If sig_flag, gt1_flag and par_flag are transmitted in the first pass according to the definitions of Embodiment 2 and Embodiment 4

[0446] (See above: gt1_flag specifies whether the absolute level is greater than 1, par_flag specifies the parity bit of (absolutelevel-2), then the partially reconstructed value can be derived according to the following formula

[0447] absLevel1[k]=sig_flag[k]+gt1_flag[k]+par_flag[k],

[0448] The values ​​of par_flag and gt1_flag that are not explicitly coded are inferred to be equal to 0.

[0449] When gt2_flag is included in the first pass (a variation of embodiments 2 and 4), it can be additionally used to derive the smallest possible absolute value. In this case, the partially reconstructed value can be derived according to

[0450] absLevel1[k]=sig_flag[k]+g1_flag[k]+par_flag[k]+2*gt2_flag[k],

[0451] The gt2_flag that is not explicitly coded is inferred to be equal to 0.

[0452] If only sig_flag and par_flag are encoded in the first pass, the partially reconstructed value can be derived according to the following formula:

[0453] absLevel1[k]=sig_flag[k]+par_flag[k].

[0454] If only sig_flag is encoded in the first pass, the partially reconstructed value can be derived according to the following formula:

[0455] absLevel1[k]=sig_flag[k].

[0456] Partial refactoring can be specified for other configurations in a similar manner.

[0457] Probabilistic model selection for par_flag, gt1_flag, and gt2_flag

[0458] The adaptive probability model used to encode the current par_flag is selected from the set of probability models. Similar to the valid bit flag, let us assume that the available probability models are organized in a 4-dimensional array

[0459] probModelPar[cPar][sPar][dPar][aPar],

[0460] Where cPar specifies indices that depend on the current color channel, sPar specifies indices that depend on state variables, dPar specifies indices that depend on x and y positions within the transform block, and aPar specifies indices that depend on local activity measures.

[0461] The same concept is used for gt1_flag and par_flag:

[0462] probModelGt1[cGt1][sGt1][dGt1][aGt1],

[0463] probModelGt2[cGt2][sGt2][dGt2][aGt2]

[0464] In a preferred embodiment, the same index is used for the three flags par_flag, gt1_flag and gt2_flag. The advantage of this is that each scan index only needs to calculate the index (or combined index):

[0465] cGt2=cGt1=cPar

[0466] sGt2=sGt1=sPar

[0467] dGt2=dGt1=dPar

[0468] Gt2=aGt1=aPar

[0469] Even if the index is the same, different sets of probability models are used for the three flags par-flag, gt1_flag and gt2_flag. In different embodiments, 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 encoded using the same probability model).

[0470] It is also possible to use different methods to derive the index of a single flag.

[0471] In the following, we take the derivation of indexes cPar, sPar, dPar, and aPar as an example for description. The same method applies to the corresponding indexes of gt1_flag and gt2_flag.

[0472] Color channel index cPar

[0473] Similar to the valid bit flag, in a preferred embodiment, the color channel index cSig is set according to the following steps:

[0474] cPar=(current channel is luma? 0:1)

[0475] Alternatively, the alternatives described above for cSig may be used.

[0476] Status Index sPar

[0477] In a preferred embodiment, the index spar is set equal to 0. This means that the selected probability model does not depend on the state variables. Therefore, the probability model set can be represented as a 3-dimensional array

[0478] probModelPar[cPar][dPar][aPar],

[0479] probModelGt1[cGt1][dGt1][aGt1],

[0480] probModelGt2[cGt2][dGt2][aGt2]

[0481] Or combined index, can be exported using 3 indexes cPar, dPar and aPar.

[0482] Alternatively, any of the methods described above for sPar may be used.

[0483] Position index dPar

[0484] In a preferred embodiment, the index dPar is set as follows:

[0485] If the index cPar is equal to 0 (i.e. the current color channel represents the brightness channel), then dPar is set according to the following formula:

[0486]

[0487] If the index cPar is equal to 1 (i.e. the current color channel represents the chrominance channel), then dPar is set according to the following formula

[0488]

[0489] At this diag is represented the diagonal position given by diag=x+y, where x and y represent the x and y coordinates of the current scan position inside the transform block. The Boolean variable firstNonZero specifies whether the current scan position represents the scan position of the first non-zero level in the coding order (i.e., the position identified by the x and y coordinates (or similar) transmitted after the coded block flag). Therefore, for the first non-zero level in the coding order, a different set of probability models will be used (independent of the diagonal position).

[0490] Alternatively, any other clustering of diagonal positions is also possible. Or alternatively, the (x, y) positions within the transform block can be divided into multiple categories, and the index dPar can be set equal to the corresponding category index. Also for such a setting, a special value of dPar can be used for the first valid scanning position.

[0491] Local activity index aPar

[0492] Finally, in a preferred embodiment of the present invention, according to

[0493] aPar=min(MAX_ABS1_SIG,sumAbs1-numSig),

[0494] where MAX_ABS1_SIG is a predefined value, sumAbs1 refers to the sum of the minimum absolute transform coefficient levels in the local template given by the data transmitted in the first pass (see description above), and numSig specifies the number of non-zero levels in the local template.

[0495] In a preferred embodiment of the present invention, the predefined value MAX_ABS1_SIG is set equal to 4.

[0496] In a preferred embodiment of the present invention, the Figure 12b The partial template shown. Note that the template includes the adjacent positions encoded before the current position. Other partial templates with these properties (adjacent positions scanned / encoded before the current position) can also be used. Such other templates can be similar to Figure 12b The templates shown differ in: (1) the number of transform coefficient positions included and (b) the positions of the transform coefficient positions included.

[0497] Let T(k) specify the set of scan indices within the template for the current scan index k. As above, sig_flag(sec.0) is assigned to obtain the variable sumAbs1, and numSig for the current scan index k is obtained according to the following formula

[0498]

[0499] That is, numSig represents the number of non-zero transform coefficients within the template (indicated by sig_flag being equal to 1).

[0500] Alternatively, different maximum values ​​or different functions for sumAbs1 and numSig may be used.

[0501] Binarization of remainders (except for coefficients that are completely bypassed)

[0502] In a preferred embodiment of the invention, the syntactic element remainders are encoded in a bypass mode of the arithmetic coding engine. The compression efficiency depends on the binarization used. In HEVC, similar syntactic elements are encoded using a class of binarization codes called Golomb-Rice codes. Such codes are parameterized by so-called Rice parameters. The Rice parameters can be adjusted during the encoding process so that the binarization used depends on the previous syntactic element.

[0503] In a preferred embodiment of the invention, the syntactic element remainder is binarized using a so-called Golomb-Rice code. A Golomb-Rice code consists of a prefix part and, if the value to be encoded exceeds a predefined threshold, a suffix part. The prefix part represents a truncated Rice code (see HEVC), the parameters of which are parameterized by Rice parameters (RP) and a maximum symbol value (cMax). If the value to be encoded (remainder) is greater than or equal to cMax, the suffix binary bit string is added to the prefix binary bit string. The suffix binary bit string is given by an exponential Golomb code of order kEG. In order to parameterize the concatenated code by a single parameter, the values ​​of cMax and kEG used represent a function of the Rice parameter (RP). In a specific setting, cMax and kEG (the order of the exponential Golomb code) are derived according to the following formula:

[0504] cMax=(RP==1?6:7)< <RP,

[0505] kEG=RP+1

[0506] Other functional relationships of cMax(RP) and kEG(RP) are also possible. In addition, other parameterized sets of structured coding may be used.

[0507] In the following, we describe two methods for tuning the Rice parameter (RP) or similar parameters for different classes of codes:

[0508] Method 1: If the last encoded value (or the last absolute level) exceeds the threshold, increase RP

[0509] At the beginning of a sub-block (or alternatively a transform block), the Rice parameter RP is set equal to a predefined value. In a specific embodiment, the predefined value is equal to 0. After decoding (or encoding) the syntax element remainder, the Rice parameter is updated according to the following formula if (RP<MAX_RP&&remainder> Threshold(RP)

[0510] {

[0511] RP=RP+1

[0512] }

[0513] Here, MAX_RP represents the predefined value of the maximum Rice parameter. In a preferred embodiment, MAX_RP is set to be equal to 3. Function Threshold(RP) represents a threshold value depending on the current value of the Rice parameter. In a preferred embodiment, this function is defined by the following formula:

[0514] Threshold(RP)=(3< <RP)–1,

[0515] Among them, the operator "<< " represents shifting binary bits to the right. That is, "3 << RP" is equivalent to 3 * 2^RP.

[0516] Any other definition of Threshold(RP), for example, a look-up table, is possible.

[0517] In a variant of the method, instead of the remainder of the encoded value, the reconstructed absolute level absLevel is used for comparison with the threshold. Then, the Rice parameter is updated according to the following formula

[0518] if(RP < MAX_RP && absLevel > Threshold(RP))

[0519] {

[0520] RP = RP + 1

[0521] }

[0522] Method 2: Determine RP based on the absolute level in the local neighborhood

[0523] In a preferred configuration, the sum of the absolute values of adjacent levels covered by a local template is used to derive the Rice parameter. Let sumAbs be the sum of the absolute values in the local template. In a preferred embodiment, the same template as the context model used to derive sig_flag is used.

[0524] The Rice parameter RP is derived from sumAbs (i.e., the sum of the absolute values in the local template). In a particularly preferred embodiment, the Rice parameter RP is derived according to the following formula:

[0525]

[0526] In other configurations, the threshold for switching the Rice parameter can be corrected. Alternatively, the Rice parameter can be derived based on other activity metrics of the local template. In addition, it can be specified that the Rice parameter is not allowed to decrease within a sub-block.

[0527] Binarization of the absolute level in bypass mode

[0528] In a preferred embodiment of the present invention, different binarization is used for the absolute levels fully encoded in bypass mode (i.e., in the fourth pass in Embodiments 1 and 2).

[0529] In the preferred configuration, the same Columbus-Rice code class as described above is used, but the Rice parameters are derived in a different way. In a preferred embodiment of the invention, the Rice parameters depend on both the sum of absolute values ​​in the local neighborhood and the state variable (for dependent quantization). The dependency RP(sumAbs, state) can be described by a two-dimensional lookup table. In this case, the sum of absolute values ​​is usually clipped to any maximum value MAX_SUM_ABS before accessing the lookup table. That is, the Rice parameter is derived by the following formula

[0530] RP=LookupTable[state][min(MAX_SUM_ABS,sumAbs)],

[0531] Where LookupTable specifies a predefined lookup table.

[0532] In a variation of this method, the absolute level absLevel is not encoded directly with the code determined by the derived Ricey parameter, but the following applies: the absolute value absLevel is first converted to the value codeValue and then transmitted using the Golomb–Rice code specified by the Ricey parameter RP.

[0533] As an example, the encoded value codeValue is determined as follows:

[0534]

[0535] The parameter zPos is derived by any of the following methods:

[0536] zPos is a function of the sum of the absolute values ​​sumAbs in the local neighborhood;

[0537] zPos is a function of the state variables.

[0538] zPos is derived as a function of the state variables and of the absolute values ​​sumAbs in the local neighborhood.

[0539] The value of sumAbs is the same as that used in the derivation of the Ricean parameters. The value of sumAbs is also clipped to the same maximum value MAX_SUM_ABS as in the derivation of the Ricean parameters. The dependency of zPos on the state variables and / or the clipped value min(MAX_SUM_ABS, sumAbs) can be specified via a predefined lookup table.

[0540] That is, the variable length code for encoding / decoding the remainder value of the currently scanned transform coefficient position may be selected from a predefined set of variable length codes, such as selected by the RP from another set than the Golomb-Rice code. The selection may be made depending on whether the currently scanned transform coefficient position at which the remainder is to be encoded / decoded is located up to the predetermined transform coefficient position 112 or downstream thereof in the scan order 62, i.e. different RPs are selected in the former and the latter cases. According to methods 1 and 2 outlined above, the RP parameter indicating the selected variable length code may typically be selected in the scan order 60. 3,4 During the period, the quantization index of the transform coefficient that is immediately decoded / encoded is kept constant, but the quantization index of the transform coefficient that meets the predetermined criteria is changed incrementally, such as exceeding a certain limit in method 1, or the quantization index of the coefficient position near the transform coefficient position based on the current scan is changed to meet a certain criterion, such as their sum exceeds a certain limit. For example, this dependency or incremental change can be used only in the following cases: if the current transform coefficient position whose remaining number has been encoded is located up to the predetermined transform coefficient position 112, that is, for Fig.15 In addition to the quantization indices of neighboring coefficients, the dependent quantization state can also be used to select binarization code parameters.

[0541] The following aspects, although possibly combined with the above embodiments, may optionally be implemented together with the above embodiments to improve coding efficiency: This aspect relates to explicit signaling of blocks / subblocks that do not contain any transform coefficient levels with an absolute value greater than 1.

[0542] In order to reduce the number of bits used to encode the transform coefficient levels, a dedicated flag is introduced on a transform block or sub-block basis, which indicates whether any absolute level in that block or sub-block is greater than 1:

[0543] For sub-blocks with coded_subblock_flag equal to 1 (coded or inferred), a second flag will be transmitted for the sub-block. This flag (gt1_subblock_flag) specifies whether the sub-block contains any transform coefficient levels with an absolute level greater than 1.

[0544] If gt1_subblock_flag is equal to 0, only the significance information (sig_flag) and the sign bit for transform coefficient levels not equal to 0 are transmitted.

[0545] If gt1_subblock_flag is equal to 1, encoding of the transform coefficient levels is performed as described in embodiments 1 to 4. A further condition may be included, namely that when the last scan index in a subblock is reached and all previous absolute levels in the subblock are equal to 1, it can be inferred that the last absolute level is greater than 1. – Therefore, the corresponding gt1_flag can be inferred to be equal to 1. For embodiments 1 and 3, in this case, the parity flag par_flag can also be inferred to be equal to 0.

[0546] Instead of being on a subblock basis, a flag specifying all levels with absolute values ​​equal to 1 may also be transmitted for the entire transform block. It is also possible to transmit this flag only for selected subblocks (e.g., a subblock comprising the first significant coefficient).

[0547] That is, here the transform coefficient block 10 is encoded / decoded in the following manner. For each of the at least one set of sub-blocks 14 into which the transform coefficient block 10 is divided, a sub-block size flag, i.e., gt1_subblock_flag, indicating whether the corresponding sub-block 14 contains any transform coefficient 12, the absolute value of the quantized coefficient being greater than a predetermined non-zero threshold, such as a threshold, is transmitted. The transform coefficients of the transform coefficient block within each sub-block 14, wherein the sub-block size flag indicates that at least one transform coefficient in each sub-block 14 has an absolute value of a quantized index greater than the predetermined non-zero threshold, are encoded / decoded as described above, i.e., by sequentially encoding / decoding each transform coefficient within the corresponding sub-block, a series of one or more flags 92, 96, 98, 194 or other flags recursively divides the value range of the corresponding transform coefficient into two partitions, and indicates in which of the two partitions the quantized index of the corresponding transform coefficient is located, and stops decoding as soon as the value range includes only one value, or if the value range is interpreted only as a defined signed value, then an equal value in an absolute sense. If the value range still includes more than one value that is different in absolute terms, the remainder representing the absolute value of the quantization index of each transform coefficient in the value range is encoded / decoded. However, in each subblock, the subblock size flag indicates that there is no transform coefficient in each subblock whose absolute value of the quantization coefficient is greater than a predetermined non-zero threshold, and the sequential decoding of the sequence of one or more flags for each transform coefficient in the corresponding subblock stops as soon as the value range includes one value, only one value, or values ​​that are equal in absolute terms, according to the indices of all coefficients in the corresponding subblock not exceeding the predetermined non-zero threshold. The first stopping criterion arises from the fact that once the remaining value range or the remaining value interval determined for each coefficient by the previously encoded / decoded flags only includes one value that meets the requirements of the subblock size flag, this value of the value range is the quantization index.

[0548] Thus, the following embodiments are described above, among other things.

[0549] A1. An apparatus for decoding a transform coefficient block, the apparatus being configured to decode the following from a data stream in a sequence of passes that scan the transform coefficient positions of the block along a scan order, (note that these passes need not scan the transform coefficient positions of all transform blocks, but they all use the scan order; in addition, flags of certain flag types may be transmitted in the same pass), using context-adaptive binary arithmetic decoding, decoding 1) flags, each flag being from a set having one or more flag types (e.g., embodiment 1: sig_flag, par_flag, gt1_flag, gt2_flag), and using a variable length code (e.g., using compression rate 1; transmitted in bypass mode; as described above, an arithmetic coding engine may be used to encode VLC code word bins, but rather than doing this context-adaptively, this is done using a (0.5; 0.5) probability bypass mode – representing binarization and non-adaptive binary arithmetic decoding, or for this 2) a remainder value (remainder) is decoded such that for a currently scanned transform coefficient position, each flag and each remainder (e.g., embodiment 1: index k) is decoded, respectively, such that 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, wherein the predefined first and last transform coefficient positions specify a subset of transform coefficient positions in a transform block; or, for example, extending between the last non-zero coefficient and a predefined coefficient, such as a DC coefficient), one or more flags and at least one of a remainder value are decoded sequentially (i.e., a remainder, no flag, one or more flags and a remainder, or one or more flags, no remainder) so as to successively (i.e., in a sequential sense) locate the absolute value of the quantization index for the currently scanned transform coefficient position within an initial value range (e.g., x binary bit representation →Ω=0 to 2 x -1; for example, x=16), restricted to include only the absolute values ​​of the quantization indices for the currently scanned transform coefficient positions (i.e., "at least one of the one or more flags and a remainder value" decoded for a certain transform coefficient position uniquely defines the latter outside the initial value range), wherein each flag restricts the value range of the absolute values ​​of the quantization indices for the currently scanned transform coefficient positions to the first subpart or the second subpart into which the value range of the absolute values ​​of the quantization indices for the currently scanned transform coefficient positions is doubly divided (e.g., sig_flag: the value range Ω is divided into A={0} and Then, par_flag will restricted to odd or even values ​​...), and, in the case where the remainder value is decoded for the currently scanned transform coefficient position, the remainder uniquely indicates (the following two options should be understood as covering all embodiments, including embodiment 1, in which only the remainder is encoded for certain transform coefficient positions, and embodiment 3, in which such transform coefficient positions do not exist) the absolute value of the quantization index for the currently scanned transform coefficient position in the value range in the case where at least one flag is decoded for the currently scanned transform coefficient position, or the absolute value of the quantization index for the currently scanned transform coefficient position in the initial value range in the case where no flag is decoded for the currently scanned transform coefficient position (note that in the transform coefficient positions for which the remainder value is not decoded, decoding one or more flags for these transform coefficient positions has restricted the value range to contain only one absolute value; in terms of symbols, if the TC is fully marked, it can be encoded separately in bypass mode), wherein the The device is configured (for example, in embodiments 1 to 4) to sequentially dequantize (i.e., using dependent quantization) the quantization indices of the encoded set of transform coefficient positions using state transitions along a scan order (see, for example, a grid diagram) by 1) selecting, for a current transform coefficient position, a set of reconstructed levels from a plurality of reconstruction level sets uniquely based on the state taken by the state transition for the current transform coefficient position, and dequantizing the quantization index to the reconstruction level at which the quantization index points to the reconstruction level set, and by 2) updating the state of the state transition taken by the current transform coefficient position (note that this is the position currently scanned during dependent quantization; "currently scanned" is used to refer to what is currently decoded in a pass, for (note that this term now indicates the intended purpose of the update or the effect of the update) the transform coefficient position after the current transform coefficient in the scan order depends on the quantization index of the current transform coefficient position.

[0550] A2. The apparatus of any one of embodiments B5 or A1, configured to perform state transitions between four different states.

[0551] A3. The device of any one of embodiments B5 or A1-A2 is configured to perform an update when updating the state of a state transition by deciding between a first successor state and a second successor state based on a binary function of a quantization index applied to a current transform coefficient position, wherein the first successor state and the second successor state depend on the state of the current transform coefficient position.

[0552] A4. The apparatus of any one of embodiments B5 or A1-A3, wherein the binary function produces a parity bit or a zero bit.

[0553] A5. The apparatus of any one of embodiments B5 or A1-A4, configured to parameterize multiple reconstruction level sets by a predetermined quantization step size and obtain information about the predetermined quantization step size from a data stream.

[0554] A6. An apparatus according to any one of embodiments B5 or A1-A5, wherein each of the multiple reconstruction level sets is composed of multiples of a predetermined quantization step size, and the predetermined quantization step size is constant for the multiple reconstruction level sets.

[0555] A7. An apparatus according to any one of embodiments B5 or A1-A6, wherein the number of quantization level sets of the multiple quantization level sets is two, and the multiple quantization level sets include a first quantization level set, the first quantization level set includes zero and even multiples of a predetermined quantization step size, and a second quantization level set, the second quantization level set includes zero and odd multiples of a predetermined quantization step size.

[0556] A8. An apparatus of any one of the aforementioned embodiments A1-A7, wherein, in a first pass in a sequence of passes, the decoder is configured (e.g., embodiments 3 and 4) to 1) decode from a data stream flag of a predetermined first flag type (e.g., sig_flag) and a flag of a predetermined second flag type (e.g., par_flag) in a manner such that before a flag that limits the range of values ​​of absolute values ​​of quantization indices for a second transform coefficient position following the first transform coefficient position in a scan order, the flag that limits the range of values ​​of absolute values ​​of quantization indices for the first transform coefficient position is decoded (i.e., before any sig_flag[k+1] and par_flag[k+1] before any sig_flag[k+1] _flag[k] and par_flag[k]), wherein decoding of a flag of a predetermined second flag type is performed until a predetermined transform coefficient position (e.g., embodiment 3: startIdxBypass-1), wherein a predetermined termination criterion is filled for the first time in a first pass along the scanning order (e.g., the number of encoded flags in the first pass exceeds a certain threshold), and decoding of a flag of a predetermined first flag type is performed outside the predetermined transform coefficient position in the scanning order (e.g., for all flags in the encoded set or except the first non-zero quantization index without investigating any termination criterion), the flag of the predetermined first flag type indicating whether the quantization index of the currently scanned transform coefficient is zero (e.g., sig_flag).

[0557] A9. In the apparatus of embodiment A8, wherein the flag of the predetermined second flag type indicates the parity of the quantization index for the currently scanned transform coefficient.

[0558] A10. An apparatus of any one of the aforementioned embodiments A8-A9, configured to decode the flag of the second predetermined flag type in the first pass specifically for the transform coefficient position, after which the flag of the first predetermined flag type indicates that the quantization index of the currently scanned transform coefficient is not zero.

[0559] A11. The apparatus of embodiment A8, wherein the predetermined termination criterion is whether the number of flags decoded in the first pass exceeds a predetermined threshold.

[0560] A12. The device of any one of the aforementioned embodiments A8 to A11 is configured to decode in the first pass a flag also having a third predetermined flag type, wherein the third predetermined flag type indicates, according to an absolute value, whether the quantization index of the transform coefficient position used for the current scan is the minimum value in the value range.

[0561] A13. The device of embodiment A12 is configured to decode the flag of the third predetermined flag type in the first pass, and the flag of the third predetermined flag type is specifically used for the transform coefficient position, for which the flag of the first predetermined flag type indicates that the quantization index of the currently scanned transform coefficient is not zero.

[0562] A14. The device of embodiment A13 (for example, embodiment 3) is configured to decode the transform coefficient position in a first pass, and for the transform coefficient position, after a first predetermined flag type, the flag of the first predetermined flag type indicates that the quantization index for the transform coefficient position for the current scan is not zero, and the flag of a third predetermined flag type is after the flag of the second predetermined flag type.

[0563] A15. The device of embodiment A13 (for example, embodiment 4) is configured to decode the transform coefficient position in the first pass, and for the transform coefficient position, after the first predetermined flag type, the flag of the first predetermined flag type indicates that the quantization index for the transform coefficient position of the current scan is not zero, the flag of the second predetermined flag type is specifically used for the transform coefficient position, wherein the flag of the third predetermined flag type indicates a maximum greater than 1.

[0564] A16. The device of any one of the aforementioned embodiments A8 to A15 is configured to decode in a second pass after the first pass, and the flag of the fourth predetermined flag type also indicates the quantization index for the transform coefficient position used for the current scan, and the transform coefficient position of the current scan is taken according to the absolute value, the minimum value in the value range or not restricted by the flag decoded in the first pass.

[0565] A17. The apparatus of embodiment A16, configured to decode the remainder values ​​in one or more additional passes after the second pass.

[0566] A18. The apparatus of any one of the preceding embodiments A8 to A17, configured to decode the remainder value in one or more passes after the first pass.

[0567] A19. The apparatus of any one of the preceding embodiments A8-A18, configured to decode the sign of the non-zero transform coefficients in a final pass.

[0568] A20. An apparatus of any one of the aforementioned embodiments A8 to A19, wherein the decoder is configured as (for example, embodiment 3, the second alternative “2. The state machine switches from a parity bit driven state machine to a valid bit driven state machine”) 1) in a state transition, performing an update of the state of the state transition according to the following situations: – if the current transform coefficient position is before or equal to a predetermined transform coefficient position in the scanning order, for the corresponding transform coefficient position – a flag of the second flag type of the corresponding transform coefficient position (for example, embodiment 3: par_flag) – if the corresponding transform coefficient position follows the predetermined transform coefficient position in the scanning order, for the corresponding transform coefficient position – a flag of the first flag type of the corresponding transform coefficient position (for example, embodiment 3: path (level) produces zero), 2) in context adaptive entropy decoding, determining a context for decoding the flag of the predetermined first flag type for the currently scanned transform coefficient, for all transform coefficient positions before, including and after the predetermined transform coefficient position, depending on the state taken by the state transition for the currently scanned transform coefficient position.

[0569] A21. An apparatus of any one of the aforementioned embodiments A8 to A19, wherein the decoder is configured (for example, embodiment 3) to determine, in context adaptive entropy decoding, for a currently scanned transform coefficient position, a context for decoding a flag of a predetermined first flag type, for transform coefficient positions before and including the predetermined transform coefficient position, depending on the state taken by the state transition for the currently scanned transform coefficient position, and for transform coefficient positions after the predetermined transform coefficient position, regardless of the state taken by the state transition for the currently scanned transform coefficient position.

[0570] A22. An apparatus of any one of the aforementioned embodiments A8 to A19, wherein the decoder is configured (for example, embodiment 3, first alternative) to: 1) determine, in context adaptive entropy decoding, for a currently scanned transform coefficient position, a context for decoding a flag of a predetermined first flag type, for all transform coefficient positions before, including and after the predetermined transform coefficient position, depending on the state taken by the state transition for the currently scanned transform coefficient position; 2) in a state transition, perform an update of the state of the state transition taken for the current transform coefficient position for the transform coefficient positions following each transform coefficient position in the scan order, based on the flag of the first flag type for the current transform coefficient position (for example, embodiment 3: the path (level) produces zero).

[0571] B1. An apparatus for decoding a transform coefficient block, configured to decode from a data stream and scan a sequence of passes of transform coefficient positions along a scan order (note that these passes need not scan all transform coefficient positions of the transform block, but they all use the scan order; in addition, flags of certain flag types may be transmitted in the same pass), 1) using context-adaptive binary arithmetic decoding, each flag not in a set of one or more flag types (e.g., embodiment 1: sig_flag, par_flag, gt1_flag, gt2_flag) and 2), using variable length codes (e.g., using compression rate 1; transmitted in bypass mode; also used in Note A1), a remainder value (remainder),

[0572] Thus, each flag and each remainder value is decoded for the currently scanned transform coefficient position, respectively (e.g., embodiment 1: index k), and for each transform coefficient position of the encoded set of transform coefficient positions (e.g., extending between a predefined first transform coefficient position and a predefined last transform coefficient position, wherein the predefined first and last transform coefficient positions specify a subset of transform coefficient positions in the transform block; or, for example, extending between the last non-zero coefficient, and a predefined coefficient, such as a DC coefficient, at least one of one or more flags and a remainder value (i.e., a remainder and no flag, one or more flags and a remainder, or one or more flags and no remainder) is sequentially decoded so as to continuously (i.e., in a sequential sense) restrict the initial value range (e.g., x binary bits representing Ω=0 to 2 x-1; for example, x=16) wherein the absolute value of the quantization index for the transform coefficient position for the current scan only includes the absolute value of the quantization index of the transform coefficient position for the previous scan within the value range (i.e., "at least one of the one or more flags and a remainder value" decoded for a certain transform coefficient position uniquely defines the latter outside the initial value range), wherein each flag restricts the value range of the absolute value of the quantization index for the transform coefficient position for the current scan to the first sub-part or the second sub-part, wherein the value range of the absolute value of the quantization index for the transform coefficient position for the current scan is divided into two (for example, sig_flag: the value range Ω is divided into A={0} and Then, par_flag will limited to odd or even values...), and, if a remainder value is decoded for the currently scanned transform coefficient position, the remainder uniquely indicates (the following two options should be understood as covering all embodiments, including embodiment 1, in which only the remainder is encoded for certain transform coefficient positions, and embodiment 3, in which such transform coefficient positions do not exist) if at least one flag is decoded for the currently scanned transform coefficient position, the absolute value of the quantization index for the currently scanned transform coefficient position exceeds the value range, if no flag is decoded for the currently scanned transform coefficient position, the currently scanned transform coefficient position exceeds the initial value range (note that among the transform coefficient positions for which no remainder value is decoded, decoding one or more flags for these transform coefficient positions has restricted the value range to contain only one absolute value; in terms of symbols, if the TC is fully marked, it can be encoded separately in bypass mode), wherein the device is configured For (e.g., embodiments 1 and 2) in the first pass through the sequence of passes, a) from a data stream flag of a predetermined first flag type until a predetermined transform coefficient position (e.g., embodiment 1: the one indexed by startIdxBypass-1), in its first pass, a predetermined termination criterion is met for the first time along the scan order (e.g., in embodiment 1: the number of predetermined flags has been decoded in the first pass), a flag of the predetermined first flag type indicates whether the quantization index for the transform coefficient position currently scanned is zero (e.g., sig_flag), b) the flag is decoded, only for the transform coefficient positions located before and including the predetermined transform coefficient position, and a set of transform coefficient position encodings after the predetermined transform coefficient position is decoded in the scan order, so that one of the remaining values ​​uniquely represents the absolute value of the quantization index of the corresponding transform coefficient position outside the initial value range.

[0573] B2. The device of embodiment B1 is configured to parameterize the variable length code used to decode the residual value of the currently scanned transform coefficient position according to whether the currently scanned transform coefficient position is before or after the predetermined transform coefficient position, or follows the predetermined transform coefficient position in the scanning order.

[0574] B3. An apparatus of embodiment B1 or B2, configured to parameterize a variable length code, the variable length code being used to incrementally change the remainder value of a decoded current decoded coefficient position by depending on the quantization index of a previous transform coefficient position satisfying a predetermined criterion, and / or if the currently scanned transform coefficient position is preceding (in the scanning order) or is a predetermined transform coefficient position, then depending on the quantization index of a transform coefficient position near the currently scanned transform coefficient position.

[0575] B4. The device of embodiment B1 or B2 or B3 is configured to parameterize a variable length code, which is used to decode the residual value of the currently scanned transform coefficient position based on the quantization index of the transform coefficient position near the currently scanned transform coefficient position, if the currently scanned transform coefficient position follows the predetermined transform coefficient position in the scanning order, then depends on the state taken by the currently scanned transform coefficient position in the state transition.

[0576] B5. An apparatus of any one of embodiments B1 to B4, wherein the decoder is configured (e.g., embodiments 1 to 4) to sequentially quantize (i.e., using dependent quantization) the quantization indices of the transform coefficient positions of the encoded set of dequantized transform coefficient positions using state transitions (e.g., see the grid diagram), by: a) for a current transform coefficient position, uniquely based on the state taken by the state transition for the current transform coefficient position, selecting a set of reconstruction levels from a plurality of reconstruction level sets, and dequantizing the quantization indices to reconstruction levels at which the quantization indices point to the set of reconstruction levels, and by b) updating the transition state to the state taken by the current transform coefficient position (note that this is what is currently scanned during dependent quantization; "currently scanned" is used to refer to what is currently decoded in a pass (note that this term now indicates an indication of the intended purpose of the update or the effect of the update), depending on the quantization index for the current transform coefficient position, for the transform coefficient positions after the current transform coefficient position in the scan order.

[0577] 3. The apparatus of any one of embodiments A1-A22 or B1-B5, configured to (e.g., embodiments 1 to 4) perform decoding such that, for each of a set of one or more flag types, a flag of the respective flag type is decoded in one of the passes through the sequence.

[0578] 4. The apparatus of any of the preceding embodiments (eg, embodiments 1-4, section 4.5.4), wherein the variable length code is a Golomb-Rice code.

[0579] 5. An apparatus according to any of the preceding embodiments, wherein (for example, in embodiments 1 to 4, methods 1 and 2 in 4.5.4), the apparatus is configured to parameterize a variable length code, the variable length code being used to decode a residual value of a currently scanned transform coefficient position by incrementally changing according to a quantization index of a previous transform coefficient position satisfying a predetermined criterion, and / or depending on a quantization index of a transform coefficient position near the currently scanned transform coefficient position.

[0580] 6. An apparatus of any of the foregoing embodiments, configured to (for example, embodiments 1 to 4) determine that a set of encodings of transform coefficient positions extends between the position of a first non-zero quantization index and a predefined transform coefficient position along a scan order, and locate the position of the first non-zero quantization index based on a data stream.

[0581] 7. The apparatus of any of the preceding embodiments, configured (eg, embodiments 1 to 4) to decode a sign bit from a data stream of each non-zero quantization index using an equal probability bypass mode.

[0582] 10. The apparatus according to any of the preceding embodiments, configured to decode a flag of a first flag type for a predetermined transform coefficient position by selecting a context according to a coefficient position of the predetermined transform coefficient using context adaptive entropy decoding.

[0583] 11. An apparatus according to any one of the preceding embodiments, configured to decode the flag of the first predetermined flag type for a predetermined transform coefficient position by context adaptive entropy decoding in the following manner: a) based on a set of adjacent transform coefficient positions within a local template around the predetermined transform coefficient position, decoding a set of flags before marking the predetermined flag type for the predetermined transform coefficient position, and b) selecting a context based on local activity.

[0584] 12. An apparatus according to embodiment 11, wherein the set of flags includes (at least; it may be even more, such as four) flags of a predetermined first flag type, flags of a predetermined second flag type, and flags of a predetermined third flag type decoded for the set of adjacent transform coefficient positions, and the apparatus is configured to calculate the activity based on the sum of addends for each adjacent transform coefficient position, the addend indicating the minimum taken absolute value or the minimum taken absolute reconstruction level of the quantization index of the adjacent transform coefficient position determined according to (at least) the flag of the predetermined first flag type, the flag of the predetermined second flag type, and the flag of the predetermined third flag type decoded for the adjacent transform coefficient position.

[0585] 13. An apparatus according to any of the preceding embodiments, wherein the decoder is configured to (for example, embodiments 1 to 4) 1) sequentially dequantize the quantization indices of the transform coefficient positions of the encoded set of transform coefficient positions (i.e., using dependent quantization), using state transitions along a scan order (for example, see a grid diagram), by the following steps: a) uniquely selecting a set of reconstruction levels from a plurality of reconstruction level sets for each transform coefficient position based on the state taken by the state transition for the corresponding transform coefficient position, and then dequantizing the quantization indices into reconstruction levels, at which the quantization indices point to the set of reconstruction levels, and by b) updating the transition state to the state taken by the current transform coefficient position (note, to the one currently scanned during a dependent quantization; the "currently scanned" one is used to mean the one currently decoded during a pass) (note, this terminology now indicates the intended purpose or effect of the update) for the transform coefficient position following the current transform coefficient in the scan order, which depends on the quantization index of the current transform coefficient, 2) decoding a flag of a first predetermined flag type for a predetermined transform coefficient position, and / or a set of quantization levels selected for the predetermined transform coefficient position, by using context adaptive entropy decoding, by selecting a context according to the state taken by the state transition for the predetermined transform coefficient position.

[0586] 20. An apparatus as in any preceding embodiment configured to decode a flag of a second flag type for a predetermined transform coefficient position using context adaptive entropy decoding by selecting a context according to a coefficient position of the predetermined transform coefficient.

[0587] 21. An apparatus according to any one of the preceding embodiments, configured to decode a flag of a second predetermined flag type for a predetermined transform coefficient position using context adaptive entropy decoding, by 1) determining local activity, and / or the number of transform coefficient positions within a local template near the predetermined transform coefficient position, based on a set of flags previously decoded for a group of adjacent transform coefficient positions in a local template around the predetermined transform coefficient position, based on the flag of the second predetermined flag type for the predetermined transform coefficient position, where the quantization index is not zero, and by 2) selecting a number that depends on the local activity and / or non-zero quantization index to determine the context.

[0588] 22. The apparatus of embodiment 21, configured to select the context based on a difference between the local activity and the number of non-zero quantization indices.

[0589] 23. An apparatus according to embodiment 20 or 21, wherein the set of flags includes a flag of a predetermined first flag type (for example, encoded in the first scanning pass as in embodiment 12 as well), a flag of a predetermined second flag type, and a flag of a predetermined third flag type decoded for the set of adjacent transform coefficient positions, and the apparatus is configured to calculate activity based on the sum of addends for each adjacent transform coefficient position, the addend indicating the minimum taken absolute value or the minimum taken absolute quantization index of the quantization index of the adjacent transform coefficient position determined according to (note that if more flags are transmitted in the first pass, more of the following flags may be used) a flag of a predetermined first flag type, a flag of a predetermined second flag type, and a flag of a predetermined third flag type decoded for the adjacent transform coefficient position.

[0590] 30. An apparatus according to any of the preceding embodiments, configured to decode a flag of a third predetermined flag type for a predetermined transform coefficient position by selecting a context according to a coefficient position of the predetermined transform coefficient using context adaptive entropy decoding.

[0591] 31. An apparatus of any one of the preceding embodiments, configured to use context adaptive entropy decoding to decode a flag of a third predetermined flag type for a predetermined transform coefficient position, by 1) for a set of adjacent transform coefficient positions in a local template around the predetermined transform coefficient position, based on a set of flags previously decoded for the second predetermined flag type for the predetermined transform coefficient, determining the local activity, and / or the number of transform coefficient positions within the local template near the predetermined transform coefficient position, where the quantization index is not zero, and by 2) selecting a context based on the local activity and / or the number of non-zero quantization indices.

[0592] 32. The apparatus of embodiment 31, configured to select a context depending on a difference between the local activity and the number of non-zero quantization indices.

[0593] 33. An apparatus according to embodiment 30 or 31, wherein the flag set includes (see the notes on embodiments 12 and 23) a flag of a predetermined first flag type, a flag of a predetermined second flag type, and a flag of a predetermined third flag type decoded for the set of adjacent transform coefficient positions, and the apparatus is configured to calculate activity based on the sum of addends for each adjacent transform coefficient position, the addend indicating the minimum absolute value or the minimum absolute quantization index of the quantization index of the adjacent transform coefficient position determined according to (see the notes on embodiments 12 and 23) the flag of the predetermined first flag type, the flag of the predetermined second flag type, and the flag of the predetermined third flag type decoded for the adjacent transform coefficient position.

[0594] C1. A decoder for decoding a transform coefficient block, configured to 1) decode, for each of a set of sub-blocks into which at least the transform coefficient block is divided, a sub-block size flag indicating whether the corresponding sub-block contains an absolute value of a quantization index of any transform coefficient, wherein the quantization index is greater than a predetermined non-zero threshold; 2) decode transform coefficients of the transform coefficient block within each sub-block, wherein in each sub-block, the sub-block size flag indicates that there is at least one transform coefficient in each sub-block whose absolute value of the quantization index is greater than a predetermined non-zero threshold; (a) by sequentially decoding each transform coefficient within each sub-block, a sequence of one or more flags, recursively divide the value range of the corresponding transform coefficient into two partitions, and indicate the corresponding transform coefficient; a) determining in which of the two partitions the quantization index of a number is located, and stopping the decoding sequence when the value range only includes one or more values ​​that are equal in an absolute sense, and if the value range still includes more than one value that is different in an absolute sense, the remainder value represents the absolute value of the quantization index of each transform coefficient in the value range, and in each sub-block, the sub-block size flag indicates that there is no transform coefficient in the sub-block whose absolute value of the quantization coefficient is greater than a predetermined non-zero threshold, b) by sequentially decoding each transform coefficient in each sub-block, a sequence of one or more flags, once the value range includes only one value that does not exceed the non-zero threshold, only one value or values ​​that are equal in an absolute sense, immediately stopping decoding the sequence.

[0595] C2. The apparatus of embodiment C1, wherein a first flag in the sequence of flags is a valid flag that indicates whether the transform coefficient for which the first flag is decoded is zero.

[0596] C3. A device of embodiment C2, wherein the predetermined non-zero threshold is 1, and the device is configured such that within each sub-block, the sub-block size flag indicates that there is no transform coefficient in the sub-block whose absolute value of the quantization coefficient is greater than 1, and the first flag is decoded sequentially for each transform coefficient in each sub-block.

[0597] C4. The apparatus of any one of the aforementioned embodiments C1-C3 is configured to 1) decode each sub-block in a set of at least another sub-block into which the transform coefficient block is divided, another sub-block size flag indicating whether the corresponding sub-block contains any transform coefficient not equal to zero, and 2) determine a set of sub-blocks, wherein the sub-block size flag is decoded to include the sub-block, wherein the another sub-block size flag of the sub-block indicates that the sub-block includes at least one transform coefficient not equal to zero, and 3) infer that the transform coefficient of the transform coefficient block is in each sub-block, another sub-block size flag indicating that there are no non-zero transform coefficients in the sub-block and all are zero.

[0598] In the above description, the concepts of quantization and entropy coding of transform coefficient levels (quantization indices) for block-based hybrid video coding are proposed. The techniques outlined above can be applied to lossy coding of blocks of residual samples. The residual samples can represent the difference between a block of original samples and samples of a prediction signal (the prediction signal can be obtained by intra-image prediction or inter-image prediction, or a combination of intra-image and inter-image prediction, or any other way; in special cases, the prediction signal can be set to zero).

[0599] The residual block of samples can be transformed using a signal transform. Typically, a linear and separable transform is used (linear means that the transform is linear, but additional rounding of the transform coefficients can be incorporated). Integer approximations of DCT-II or integer approximations of other transforms of the DCT / DST series are typically used. Different transforms can be used in the horizontal or vertical direction. The transform is not limited to linear transforms and separable transforms. Any other transform (linear and non-separable or non-linear) can be used. As a result of the signal transform, a transform coefficient block is obtained, which represents the original block of residual samples in different signal spaces. In special cases, the transform can be equal to the identification transform (that is, the transform coefficient block can be equal to the block of residual samples). The transform coefficient block is encoded using lossy coding. On the decoder side, the reconstructed transform coefficient block is inversely transformed to obtain a reconstructed block of residual samples. Finally, by adding a prediction signal, a reconstructed block of image samples is obtained.

[0600] In particular, suitable for lossy coding of transform coefficient blocks, the following aspects are used in the above embodiments:

[0601] Dependent scalar quantization of transform coefficients:

[0602] On the encoder side, a block of transform coefficients is mapped to a block of transform coefficient levels (i.e., quantization indices) that represent transform coefficients with reduced fidelity. On the decoder side, the quantization indices are mapped to reconstructed transform coefficients (which differ from the original transform coefficients due to quantization). In contrast to conventional scalar quantization, the transform coefficients are not independently quantized. Instead, the set of permissible reconstruction levels for a certain transform coefficient depends on the quantization indices selected for other transform coefficients.

[0603] Entropy coding at the transform coefficient level (quantization index):

[0604] The transform coefficient levels (for scalar quantization-dependent) representing the reconstructed transform coefficients are entropy coded using binary arithmetic coding. In this case, the quantization-dependent property is exploited to improve the efficiency of entropy coding.

[0605] Various embodiments and aspects are described above. The descriptions relate to various aspects, such as flag / remainder representation, distribution of flags and remainders over passes, context derivation, limitations of context adaptive coding flags, etc. These aspects, features, functions, and details described in different sections may be optionally introduced separately or together into the embodiments described herein.

[0606] Furthermore, the embodiments described herein may be used alone and may also be supplemented by any features, functions and details in another section.

[0607] In addition, it should be noted that the various aspects described herein can be used alone or in combination. Therefore, details can be added to each of the various aspects without adding details to another of the multiple aspects.

[0608] In particular, embodiments are also described in the claims. The embodiments described in the claims may optionally be supplemented by any of the features, functions and details described herein, either alone or in combination.

[0609] It should also be noted that the present disclosure explicitly or implicitly describes features that can be used in a video encoder (a device for providing an encoded representation of an input video signal) and a video decoder (a device for providing a decoded representation of a video signal based on the encoded representation of the video signal). Thus, any feature described herein can be used in the context of a video encoder and in the context of a video decoder.

[0610] In addition, the features and functions disclosed herein in relation to the method may also be used in the device (configured to perform such functions). In addition, any features and functions disclosed herein with respect to the device may also be used in the corresponding method. In other words, the method disclosed herein may be supplemented by any features and functions described with respect to the device.

[0611] In addition, as will be described in the "Implementation Alternatives" section, any features and functions described herein may be implemented in hardware or software, or may be implemented using a combination of hardware and software.

[0612] Although some aspects have been described in the context of an apparatus, it is clear that these aspects also represent a description of a corresponding method, where a block or device corresponds to a method step or a feature of a method step. Similarly, aspects described in the context of a method step also represent a description of a corresponding block or item or feature of a corresponding apparatus. Some or all of the method steps may be performed by (or using) a hardware device, such as a microprocessor, a programmable computer, or an electronic circuit. In some embodiments, one or more of the most important method steps may be performed by such a device.

[0613] Depending on certain implementation requirements, embodiments of the present invention may be implemented in hardware or software. This implementation may be performed using a digital storage medium having stored electronically readable control signals, such as a floppy disk, DVD, Blu-ray, CD, ROM, PROM, EPROM, EEPROM or FLASH memory, which cooperates (or can cooperate) with a programmable computer system to perform the corresponding method. Therefore, the digital storage medium may be computer readable.

[0614] Some embodiments according to the invention comprise a data carrier having electronically readable control signals, which are capable of cooperating with a programmable computer system, such that one of the methods described herein is performed.

[0615] Generally, the embodiments of the present invention can be implemented as a computer program product with a program code, and when the computer program product runs on a computer, the program code can be used to perform a method. The program code can be stored on a machine-readable carrier, for example.

[0616] Other embodiments comprise the computer program for performing one of the methods described herein, stored on a machine readable carrier.

[0617] In other words, therefore, an embodiment of the inventive method is a computer program having a program code for performing one of the method operations described herein when the computer program runs on a computer.

[0618] Therefore, a further embodiment of the inventive method is a data carrier (or a digital storage medium, or a computer-readable medium) comprising, recorded thereon, the computer program for performing one of the methods described herein. The data carrier, the digital storage medium or the recorded medium are typically tangible and / or non-transitory.

[0619] 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 the sequence of signals may, for example, be configured to be sent via a data communication connection, for example via the Internet.

[0620] 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.

[0621] A further embodiment comprises a computer on which is installed the computer program for performing one of the methods described herein.

[0622] A further embodiment according to the invention comprises an apparatus or a system configured to transfer (for example 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 storage device, etc. The apparatus or the system may, for example, comprise a file server for transferring the computer program to the receiver.

[0623] 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 method described herein. In some embodiments, a field programmable gate array may collaborate with a microprocessor to perform one of the methods described herein. Typically, the method is preferably performed by any hardware device.

[0624] The devices described herein may be implemented using hardware devices or using computers, or using a combination of hardware devices and computers.

[0625] The apparatus described herein or any component of an apparatus described herein may be implemented at least partially in hardware and / or software.

[0626] The methods described herein may be performed using a hardware device, or using a computer, or using a combination of a hardware device and a computer.

[0627] Any component of a method described herein or an apparatus described herein may be performed at least in part by hardware and / or software.

[0628] The embodiments described above are only used to illustrate the principles of the present invention. It should be understood that modifications and variations of the arrangements and details described herein will be apparent to other persons skilled in the art. Therefore, the present invention is intended to be limited only by the scope of the upcoming patent claims, and is not limited by the specific details given by the description and explanation of the embodiments herein.

Claims

1. A method for decoding an image from a data stream, the method comprising: identifying a number of available context coding bits for decoding a transform block representing a portion of an image; During a process of decoding at least one position, each position corresponding to a transform coefficient in a sub-block of a transform block, starting from a start position and proceeding along a scan order that sequentially traverses the at least one position: at least one context coding flag for the current position within the decoded sub-block, In response to decoding each of the at least one context coding flag, updating the number of available context coding bins, After decoding all context coding flags associated with the current position and before proceeding to a subsequent position immediately following the current position in the scanning order, comparing the updated number of available context coding bits with a predefined value, and terminating the decoding process based on the comparison indicating that the updated number of available context coding bits is less than the predefined value; and After terminating the decoding process and during at least one additional decoding process, for each position along the scan order starting from the subsequent position to the ending position within the sub-block: A Rice parameter is derived based on a sum of absolute levels associated with at least one transform coefficient neighboring the current transform coefficient at a corresponding position, Decode the value using the GolombRice code with Rice parameters, deriving a parameter zPos based at least in part on the sum of the absolute levels, and An absolute level associated with a current transform coefficient at a corresponding position is determined based in part on the parameter zPos and the decoded value. 2 . The method of claim 1 , wherein the local template specifies at least one transform coefficient adjacent to a current transform coefficient.

3. The method of claim 1 , wherein deriving the parameter zPos comprises: Determine state variables; as well as The parameter zPos is derived based on the sum of the absolute level and the state variable.

4. The method of claim 1 , further comprising determining the value based on a comparison, wherein: In response to the comparison indicating that the value is equal to zPos, the method includes setting an absolute level associated with the transform coefficient at the corresponding position to zero; In response to the comparison indicating that the value is greater than zPos, the method includes setting the absolute level associated with the transform coefficient at the corresponding position to the value; and In response to the comparison indicating that the value is less than zPos, the method includes setting an absolute level associated with the transform coefficient at the corresponding position to the value plus one.

5. A decoder for decoding an image from a data stream, the decoder being configured to: identifying a number of available context coding bits for decoding a transform block representing a portion of an image; During a process of decoding at least one position, each position corresponding to a transform coefficient in a sub-block of a transform block, starting from a start position and proceeding along a scan order that sequentially traverses the at least one position: at least one context coding flag for the current position within the decoded sub-block, In response to decoding each of the at least one context coding flag, updating the number of available context coding bins, After decoding all context coding flags associated with the current position and before proceeding to a subsequent position immediately following the current position in the scanning order, comparing the updated number of available context coding bits with a predefined value, and terminating the decoding process based on the comparison indicating that the updated number of available context coding bits is less than the predefined value; and After terminating the decoding process and during at least one additional decoding process, for each position along the scan order starting from the subsequent position to the ending position within the sub-block: A Rice parameter is derived based on a sum of absolute levels associated with at least one transform coefficient neighboring the current transform coefficient at a corresponding position, Decode the value using the GolombRice code with Rice parameters, deriving a parameter zPos based at least in part on the sum of the absolute levels, and An absolute level associated with a current transform coefficient at a corresponding position is determined based in part on the parameter zPos and the decoded value. The decoder of claim 5 , wherein the local template specifies at least one transform coefficient adjacent to a current transform coefficient.

7. The decoder according to claim 5, wherein to derive the parameter zPos, the decoder is configured to: determining state variables; and The parameter zPos is derived based on the sum of the absolute level and the state variable.

8. The decoder of claim 5, further configured to determine the value based on a comparison, wherein: In response to the comparison indicating that the value is equal to zPos, the decoder is further configured to set the absolute level associated with the transform coefficient at the corresponding position to zero; In response to the comparison indicating that the value is greater than zPos, the decoder is further configured to set the absolute level associated with the transform coefficient at the corresponding position to the value; and In response to the comparison indicating that the value is less than zPos, the decoder is further configured to set the absolute level associated with the transform coefficient at the corresponding position to the value plus one.

9. A non-transitory computer-readable medium comprising instructions that, when executed, cause at least one processor of an electronic device to: identifying a number of available context coding bits for decoding a transform block representing a portion of an image; During a process of decoding at least one position, each position corresponding to a transform coefficient in a sub-block of a transform block, starting from a start position and proceeding along a scan order that sequentially traverses the at least one position: at least one context coding flag for the current position within the decoded sub-block, In response to decoding each of the at least one context coding flag, updating the number of available context coding bins, After decoding all context coding flags associated with the current position and before proceeding to a subsequent position immediately following the current position in the scanning order, comparing the updated number of available context coding bits with a predefined value, and terminating the decoding process based on the comparison indicating that the updated number of available context coding bits is less than the predefined value; and After terminating the decoding process and during at least one additional decoding process, for each position along the scan order starting from the subsequent position to the ending position within the sub-block: A Rice parameter is derived based on a sum of absolute levels associated with at least one transform coefficient neighboring the current transform coefficient at a corresponding position, Decode the value using the GolombRice code with Rice parameters, deriving a parameter zPos based at least in part on the sum of the absolute levels, and An absolute level associated with a current transform coefficient at a corresponding position is determined based in part on the parameter zPos and the decoded value. 10 . The non-transitory computer-readable medium of claim 9 , wherein the local template specifies at least one transform coefficient that is adjacent to a current transform coefficient.

11. The non-transitory computer readable medium of claim 9, wherein when the instructions are executed, causing at least one processor to derive a parameter zPos comprises when the instructions are executed, causing at least one processor to: determining state variables; and The parameter zPos is derived based on the sum of the absolute level and the state variable.

12. The non-transitory computer readable medium of claim 9, wherein when the instructions are executed, cause at least one processor to determine the value based on a comparison, wherein: In response to the comparison indicating that the value is equal to zPos, the instructions, when executed, further cause the at least one processor to set an absolute level associated with the transform coefficient at the corresponding position to zero; In response to the comparison indicating that the value is greater than zPos, the instructions, when executed, further cause at least one processor to set the absolute level associated with the transform coefficient at the corresponding position to the value; and In response to the comparison indicating that the value is less than zPos, the instructions, when executed, further cause at least one processor to set an absolute level associated with the transform coefficient at the corresponding position to the value plus one.

13. A method for encoding an image, the method comprising: Setting the number of available context coding bits based on the size of a transform block representing a portion of the image; During a process of encoding at least one position, each position corresponding to a transform coefficient in a sub-block of a transform block, starting from a start position and proceeding along a scan order that sequentially traverses the at least one position: at least one context coding flag for the current position within the coding sub-block, In response to encoding each of the at least one context coding flag, updating the number of available context coding bits, After encoding all context coding flags associated with the current position and before proceeding to a subsequent position immediately following the current position in the scanning order, comparing the updated number of available context coding bits with a predefined value, and terminating the encoding process based on the comparison indicating that the updated number of available context coding bits is less than the predefined value; and After terminating the encoding process and during at least one additional encoding pass, for each position along the scan order starting from the subsequent position to the end position within the sub-block: A Rice parameter is derived based on a sum of absolute levels associated with at least one transform coefficient neighboring the current transform coefficient at a corresponding position, deriving a parameter zPos based at least in part on the sum of the absolute levels, comparing the parameter zPos with the absolute level associated with the current transform coefficient at the corresponding position, and setting the value associated with the current transform coefficient at the corresponding position based on the comparison result; and The value is encoded using the GolombRice code with Rice parameters. The method of claim 13 , wherein the local template specifies at least one transform coefficient adjacent to a current transform coefficient.

15. The method of claim 13, wherein deriving the parameter zPos comprises: Determine the state variables; as well as The parameter zPos is derived based on the sum of the absolute level and the state variable.

16. The method of claim 13, wherein: In response to the comparison indicating that the absolute level associated with the current transform coefficient at the corresponding position is equal to zero, the method includes setting the value as a parameter zPos; In response to the comparison indicating that the absolute level associated with the current transform coefficient at the corresponding position is greater than zero and less than or equal to zPos, the method includes setting the value to the absolute level minus one; and In response to the comparing indicating that an absolute level associated with the current transform coefficient at the corresponding position is greater than zPos, the method includes setting the value to the absolute level.

17. An encoder for encoding an image, the encoder being configured to: Setting the number of available context coding bits based on the size of a transform block representing a portion of the image; During a process of encoding at least one position, each position corresponding to a transform coefficient in a sub-block of a transform block, starting from a start position and proceeding along a scan order that sequentially traverses the at least one position: at least one context coding flag for the current position within the coding sub-block, In response to encoding each of the at least one context coding flag, updating the number of available context coding bits, After encoding all context coding flags associated with the current position and before proceeding to a subsequent position immediately following the current position in the scanning order, comparing the updated number of available context coding bits with a predefined value, and terminating the encoding process based on the comparison indicating that the updated number of available context coding bits is less than the predefined value; and After terminating the encoding process and during at least one additional encoding pass, for each position along the scan order starting from the subsequent position to the end position within the sub-block: A Rice parameter is derived based on a sum of absolute levels associated with at least one transform coefficient neighboring the current transform coefficient at a corresponding position, deriving a parameter zPos based at least in part on the sum of the absolute levels, comparing the parameter zPos with the absolute level associated with the current transform coefficient at the corresponding position, and setting the value associated with the current transform coefficient at the corresponding position based on the comparison result; and The value is encoded using the GolombRice code with Rice parameters.

18. The encoder of claim 17, wherein the local template specifies at least one transform coefficient adjacent to a current transform coefficient.

19. The encoder according to claim 17, wherein to derive the parameter zPos, the encoder is configured to: determining state variables; and The parameter zPos is derived based on the sum of the absolute level and the state variable.

20. The encoder of claim 17, wherein: In response to the comparison indicating that the absolute level associated with the current transform coefficient at the corresponding position is equal to zero, the method includes setting the value as a parameter zPos; In response to the comparison indicating that the absolute level associated with the current transform coefficient at the corresponding position is greater than zero and less than or equal to zPos, the method includes setting the value to the absolute level minus one; and In response to the comparing indicating that an absolute level associated with the current transform coefficient at the corresponding position is greater than zPos, the method includes setting the value to the absolute level.

21. A non-transitory computer-readable medium comprising instructions that, when executed, cause at least one processor of an electronic device to: Setting the number of available context coding bits based on the size of a transform block representing a portion of the image; During a process of encoding at least one position, each position corresponding to a transform coefficient in a sub-block of a transform block, starting from a start position and proceeding along a scan order that sequentially traverses the at least one position: at least one context coding flag for the current position within the coding sub-block, In response to encoding each of the at least one context coding flag, updating the number of available context coding bits, After encoding all context coding flags associated with the current position and before proceeding to a subsequent position immediately following the current position in the scanning order, comparing the updated number of available context coding bits with a predefined value, and terminating the encoding process based on the comparison indicating that the updated number of available context coding bits is less than the predefined value; and After terminating the encoding process and during at least one additional encoding pass, for each position along the scan order starting from the subsequent position to the end position within the sub-block: A Rice parameter is derived based on a sum of absolute levels associated with at least one transform coefficient neighboring the current transform coefficient at a corresponding position, deriving a parameter zPos based at least in part on the sum of the absolute levels, comparing the parameter zPos with the absolute level associated with the current transform coefficient at the corresponding position, and setting the value associated with the current transform coefficient at the corresponding position based on the comparison result; and The value is encoded using the GolombRice code with Rice parameters.

22. The non-transitory computer-readable medium of claim 21, wherein the local template specifies at least one transform coefficient that is adjacent to a current transform coefficient.

23. The non-transitory computer readable medium of claim 21 , wherein when the instructions are executed, causing at least one processor to derive a parameter zPos comprises when the instructions are executed, causing at least one processor to: determining state variables; and The parameter zPos is derived based on the sum of the absolute level and the state variable.

24. The non-transitory computer readable medium of claim 21, wherein: In response to the comparison indicating that the absolute level associated with the current transform coefficient at the corresponding position is equal to zero, the instructions, when executed, further cause at least one processor to set the value as a parameter zPos; In response to the comparison indicating that the absolute level associated with the current transform coefficient at the corresponding position is greater than zero and less than or equal to zPos, the instructions, when executed, further cause at least one processor to set the value to the absolute level minus one; and In response to the comparison indicating that the absolute level associated with the current transform coefficient at the corresponding position is greater than zPos, the instructions, when executed, further cause at least one processor to set the value to the absolute level.

Citation Information

Patent Citations

  • Unified transform coefficient encoding and decoding

    US20130235925A1