WO2007019790A1 - Procede et appareil de codage d'un bloc de coefficients - Google Patents
Procede et appareil de codage d'un bloc de coefficients Download PDFInfo
- Publication number
- WO2007019790A1 WO2007019790A1 PCT/CN2006/002036 CN2006002036W WO2007019790A1 WO 2007019790 A1 WO2007019790 A1 WO 2007019790A1 CN 2006002036 W CN2006002036 W CN 2006002036W WO 2007019790 A1 WO2007019790 A1 WO 2007019790A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- coefficient
- strip
- group
- encoding
- bar
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Ceased
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/102—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
- H04N19/129—Scanning of coding units, e.g. zig-zag scan of transform coefficients or flexible macroblock ordering [FMO]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/169—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
- H04N19/17—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
- H04N19/174—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a slice, e.g. a line of blocks or a group of blocks
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/169—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
- H04N19/17—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
- H04N19/176—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a block, e.g. a macroblock
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/60—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding
Definitions
- the present invention relates to image coding techniques, and more particularly to a method and apparatus for encoding coefficient blocks. Background of the invention
- image compression coding standards are: Active Image Coding Standards H, 261, H.263 developed by the ITU-T Video Coding Experts Group (VCEG); ISO/IEC The Moving Picture Experts Group (MPEG) developed the still picture coding standards JPEG and JPEG2000, the moving picture coding standard MPEG1, MPEG4-Part2; the international video coding standard jointly proposed by the ITU-T Video Coding Experts Group (VCEG) and ISO/IEC MPEG MPEG2/H, 262, H.264/AVC; Active Image Coding Standards in Audio and Video Coding Standards (AVS), etc.
- VCEG Video Coding Experts Group
- MPEG Moving Picture Experts Group
- MPEG the moving picture coding standard JPEG and JPEG2000, the moving picture coding standard MPEG1, MPEG4-Part2
- the international video coding standard jointly proposed by the ITU-T Video Coding Experts Group (VCEG) and ISO/IEC MPEG MPEG2/H, 262, H.264/AVC
- Moving picture video coding involves the following basic steps: prediction, residual, transform, quantization, and coding.
- Still image coding involves the following basic steps: transform, quantization, and coding.
- the size of the transformed and quantized coefficient block is 16x 16, 8x8, 4x4, 2x2, and the like.
- the 8x8 coefficient block is taken as an example, but the technique can be extended to 16x16, 4x4, 2x2 and other coefficient blocks.
- the encoding of the transformed and quantized coefficient blocks by the above image coding standard includes coefficient scanning and entropy coding.
- Coefficient scanning is to scan all the coefficients of the two-dimensional coefficient block into a one-dimensional array in the agreed order. For example, in H.264/AVC frame mode, the scanning order of 8x8 coefficient blocks is shown in Table 1, and the numbers in Table 1 are used from small to small. The up to and arrow indicate the order of the scan, and all the coefficients in the 8 X 8 coefficient block are scanned into a one-dimensional 1 X 64 array according to the scan order. 0 + 1 5- ⁇ 6 14+15 27+28
- the 8x8 coefficient block to be encoded is shown in Table 2:
- H.264/AVC entropy coding is performed on a one-dimensional array of scan outputs.
- Context-based Adaptive Binary Arithmetic Coding (CAB AC) is one of the entropy coding schemes used in H.264/AVC. It has high coding compression efficiency, but it also has higher computational complexity. degree.
- CABAC coding consists of three main parts: binarization, selection probability model, arithmetic coding code.
- the binarization process defines a mapping rule that maps the values of the syntax elements into a string of binary strings, where the syntax elements are the basic units of the encoding, any code to be encoded
- a certain type of data is a syntax element, such as the coefficient value to be encoded is a syntax element, and the coefficient position is also a syntax element.
- the syntax element can take values 0, 1, 2, and the following mapping rules can be defined:
- mapping rule is called a binarization scheme, and the binarization method can also be replaced by other multi-valued methods.
- Each bit (bit) of the binary string obtained after binarization is hereinafter referred to as a bin, and an appropriate probability model is selected.
- the processing of the binarized symbol string can also be extended to multi-valued symbol string processing for multi-valued.
- the bins obtained by binarization of each syntax element are set with corresponding probability models. For some bins, there are more than one corresponding probability models.
- Step 1 For the one-dimensional array obtained by scanning, encode whether the current coefficient value is 0 from the first coefficient. If the current coefficient value is not 0, whether the current coefficient is the last non-zero coefficient in the one-dimensional array, if yes, proceed to step 2, otherwise continue to encode the next coefficient; if the current coefficient value is 0, continue encoding a coefficient.
- Step 2 After processing in step 1, it is possible to obtain all the information of whether the coefficient value at each position of the one-dimensional array is 0. Then, for all non-zero coefficients, the code is sequentially reversed from the last one.
- all non-zero coefficients are 5, -6, 3, -20, 1, 3, 1, 1, 1, -7, 3, -2.
- the corresponding absolute value minus 1 is a non-negative integer; the corresponding binarization method defined in H.264 is a unary prefix code plus an exponential Columbus suffix code; for example, encoding the above non-zero coefficient - 7,
- the absolute value is reduced to 1 to 6, which is assumed to be 1111110 after binarization according to the preset mapping rules.
- H.264 is the first bin—a total of 5 possible probability models are set. Which one is selected in the encoding is determined by the number of equals 1 and greater than 1 coefficient in the encoded non-zero coefficients. . For example, if the non-zero coefficient that has been encoded at -7 is 3, -2, then the first bin of its binarized string uses the fifth model.
- H.264 five possible probability models are set for other bins except the first bin. Which one is selected in the encoding is determined by the number of more than one coefficient of the non-zero coefficients that have been encoded. For example, when encoding -7, the non-zero coefficients that have been encoded have 3, -2, then the bins other than the first bin of the binarized string are used in the third model.
- Estimated probability value from adaptation Make a bin for each symbol to be encoded, and CABAC sets the corresponding probability model to be a ctx.
- Each ctx includes 7-bit information, a 6-bit state value, and a 1-bit large probability symbol (MPS) value. This 7-bit information constitutes a complete probability estimate.
- MPS large probability symbol
- the value of the bin to be encoded in CABAC is only 0, 1 and 2, when estimating the probability value of the current bin value 0/1, only one 1-bit MPS value is needed, and the flag is estimated to be 0.
- the probability of 1 is a bit larger; a 6-bit state value, which indicates the probability estimate of the bin taking the MPS value.
- After encoding the current bin adjust the ctx according to the actual encoded bin value. Probability estimate. If the actually encoded bin is an MPS value, it means that the probability of MPS is larger, and the state value is adjusted to the direction in which the MPS probability estimate increases; otherwise, the probability of occurrence of MPS becomes smaller, and the state value is estimated to the MPS probability. Reduced direction adjustment. This achieves the goal of dynamically adaptively estimating the probability value during the encoding process.
- Such a method yields a better probability estimate for a probabilistic model after encoding a number of bins.
- the estimation effect of the initial probability model may not be good; and different quantization parameters (QP) are taken.
- QP quantization parameters
- the statistical characteristics of the encoded data have a great impact.
- CAB AC has made a linear model, which roughly estimates the initial value of each probability model, that is, the initial probability estimate, for different QPs. The purpose is to obtain a more accurate probability estimate at the beginning of coding. To improve the compression efficiency at the beginning of coding.
- preCtxState Clip3(l,126,((m*QP)»4)+n) ( 1 )
- the Clip3 function is calculated as: If ((m*QP)»4)+n ⁇ l, the result is 1; if ((m*QP)»4)+n>126, the result is 126; otherwise, the result is ((m*QP)»4)+n.
- m, n are deterministic empirical parameters about the probability model, and each probability model has its own corresponding (m, n) value. The (m, n) values of all probability models are pre-stored in a fixed table.
- the current initialization method only makes a linear model for QP, and in fact, different sequences and different resolutions have a large impact on the statistical characteristics of the data.
- the initialization coding efficiency is not as good as the initialization of the probabilistic model without the initialization, that is, the state value of the probability model and the coding efficiency of the MPS value of all 0s.
- Another object of the present invention is to provide an apparatus for encoding a coefficient block, which can improve coding efficiency.
- a method of encoding a coefficient block comprising:
- the strip group mode used by the coefficient block is: a horizontal strip group, or a vertical strip group, or a diagonal strip group, or a J strip group, or an inverted L strip group;
- Different coefficient blocks use different strip group patterns or the same strip group pattern.
- Each strip group in the strip group contains more than one coefficient bar or one coefficient bar.
- step A The method for dividing the strip group in step A is as follows:
- Each coefficient bar of the coefficient block includes all zero strips, and/or non-zero, that is, one strip and one or more strips of coefficient strips are respectively divided into corresponding all-zero strip groups, and/or non-zero 1 strip group and / or greater than 1 strip group.
- the method for dividing a strip group in step A further includes:
- the first 0 bars appearing in the coefficient block are the boundary line.
- the coefficient bar before the bar is used as a strip group, and the coefficient bar after the bar is used as a strip group.
- the method for dividing a strip group in step A further includes:
- the method for dividing a strip group in step A further includes:
- the last non-zero strip from the front to the back of the coefficient block is used as the dividing line, and the coefficient strip after the strip is regarded as an all-zero strip group, and the previous coefficient strip of the strip is further divided by the coefficient strip containing the last one greater than 1.
- the boundary line is preceded by a group greater than 1 and then a non-zero or 1 group.
- the method for determining the strip group mode in step A is: selecting a strip group mode according to the position distribution characteristics of the coefficients of 0, 1 and greater than 1 in the coefficient block.
- the determining method is specifically: determining the position and the position of the last zero-coefficient strip of the non-zero coefficient in the horizontal and vertical directions of the coefficient block, respectively.
- the position of an all-zero coefficient strip is determined based on the above position using the horizontal strip group mode or the vertical strip group mode.
- the method further includes: determining an encoding mode of the current coefficient block based on an encoding mode selected by the neighboring coefficient block.
- the method for determining the strip group mode in the step A is: encoding the coefficient blocks by using different strip group modes, and selecting the strip group mode with the highest compression efficiency as the strip group mode of the coefficient block.
- the step B specifically includes:
- step B2 If it is determined that any J group meets the predetermined condition, the J group is further divided into a plurality of J groups, and step Bl is performed.
- the step B2 described includes:
- step B21 Determine whether the coefficient in the current J-strip group is all 0. If yes, execute step B22. Otherwise, if the J-strip group includes multiple J-scores, perform step B23. If no J-strips are included, Directly perform step B1;
- step B22 selecting the next J group, and performing step B21; B23.
- the J group is further divided into a plurality of J groups, and step B1 is performed.
- the step B1 further includes:
- the coefficient value information in the coded strip group includes: a number of non-zero coefficients of a plurality of groups in the encoded strip group, or a sum of non-zero coefficients.
- a threshold value G is set, and when each of the probabilistic models encodes the first G symbols, a large probability symbol appears.
- the MPS adjustment state state value has a jump step size greater than or equal to two.
- the strip group is a J group
- the encoding method in the step B includes: whether the strip is an all-zero coefficient, and if so, directly encoding a symbol; otherwise, continuing to include the horizontal or vertical branch of the J strip
- Each coefficient is encoded.
- the horizontal strip position information is encoded from left to right in turn, the vertical strip position information is encoded from top to bottom, and the horizontal strip non-zero coefficient value information is encoded from right to left from the last non-zero coefficient of the horizontal strip, from the last of the vertical strips
- the non-zero coefficient encodes the non-zero coefficient value information of the vertical bar from bottom to top; or
- the horizontal strip position information is encoded from left to right in turn, and the horizontal strip non-zero coefficient value information is encoded from right to left from the last non-zero coefficient of the horizontal strip, and the vertical strip position information is encoded from top to bottom, from the last of the vertical strips.
- the non-zero coefficient encodes the vertical bar non-zero coefficient value information from bottom to top.
- the step B specifically includes:
- the step B specifically includes:
- the last non-zero coefficient is encoded by the unary code method but It is not limited to one-ary code encoding, and a corresponding probability model is separately assigned to the coefficient.
- the step B specifically includes: when encoding the position of the boundary coefficient bar as the boundary of the strip component, using an identifier in the code stream to mark whether the strip is a demarcation coefficient strip, and assigning a probability model to the identifier.
- the step B further includes: assigning a probability model to the information symbol encoding whether the current coefficient bar is all 0 according to the position of the current coefficient bar and the information already encoded by the adjacent coefficient block.
- the step B further includes: assigning the same probability model to the plurality of symbols in the symbol.
- the step B further includes: when there are a plurality of demarcation coefficient bars as the bar component boundary, the encoding is performed based on the position of the previously encoded demarcation coefficient bar when encoding the position of the subsequent delimitation coefficient bar.
- the step B specifically includes: sequentially encoding each coefficient included in the strip group in the reverse order of the respective scanning order.
- the respective scanning orders are:
- For the vertical bar group scan all the coefficients according to the zigzag from left to right and top to bottom; for the horizontal bar group, scan all the coefficients from top to bottom and left to right according to the zigzag; for the diagonal bar group From the top left to the bottom right, scan all the coefficients according to the zigzag pattern; for the inverted L group, from left to right, sequentially reverse the L bars from left to right, then scan all coefficients from top to bottom, or, from From left to right, all the inverted L bars are scanned from top to bottom and then left to right.
- step B When the coefficients in the strips included in the strip group are encoded, the coefficient information according to the encoded adjacent positions is classified as a classification criterion for encoding the current coefficients, and:
- the coefficient information of the adjacent position includes: a maximum value among adjacent coefficients.
- An apparatus for encoding a coefficient block comprising: a strip group setting unit and an encoding unit; wherein
- a strip group setting unit storing a predetermined rule, receiving a transform-quantized coefficient block in the image encoding, determining a strip group pattern according to a predetermined rule, and dividing the received coefficient block according to the determined strip group pattern;
- the subsequent strip group is sent to the coding unit;
- the coding unit encodes the received strip group and outputs the encoded stream.
- the strip group setting unit includes: a strip group mode unit and a strip group dividing unit; wherein, the strip group mode unit is determined, a predetermined rule is stored, a strip group mode is determined according to a predetermined rule, and the strip group dividing unit is notified;
- the strip group dividing unit receives the transform quantized coefficient block in the image coding, and divides the received coefficient block according to the determined strip group pattern; and sends the divided strip group to the encoding unit.
- the present invention determines a strip group mode according to a predetermined rule, and divides the coefficient block in the image encoding according to the determined strip group pattern, and divides the strip group according to the determined strip group, and based on the divided strip group
- the encoding method improves the encoding efficiency, and the present invention has better compression efficiency in the case of the H.264 complexity, and the scanning and anti-scanning process is also omitted.
- Figure 1 is a schematic diagram of J-coded mode
- FIG. 2 is a schematic diagram showing the composition of an apparatus for encoding a coefficient block according to the present invention. Mode for carrying out the invention
- the core idea of the present invention is: determining a strip group mode according to a predetermined rule, and dividing a coefficient block of the transform-quantized image block in the image encoding according to the determined strip group pattern; and encoding the coefficient block based on the divided strip group .
- an 8x8 coefficient block is taken as an example, and the coefficient block mentioned below is an 8 ⁇ 8 coefficient block.
- the terms involved in the present invention are explained as follows:
- Horizontal bar One of the coefficient blocks acts as a horizontal bar, which is recorded as the 0th to 7th horizontal bars from top to bottom.
- Vertical bars One column of the coefficient block is a vertical bar, which is recorded as the 0th to 7th vertical bars from left to right.
- Oblique bar Each of the coefficient blocks has a diagonal of 45 degrees from the lower left to the upper right. As shown in Table 1, the number 0 is the first diagonal line, and the numbers 1 and 2 form the second oblique line. The number 3 4, 5 form the third oblique line, the numbers 6, 7, 8, and 9 are the fourth oblique lines.
- J The definition of J is as shown in Table 3: JO Jl J2 J3 J4 J5 J6 J7
- an 8x8 coefficient block is called block8x 8.
- This coefficient block can be divided into 8 J bars from the upper left to the lower right, and the coefficient of the corner point of each J is the coefficient.
- the coefficients on the diagonal line in the block form a J strip according to the coefficient of the corner point and the upward and leftward order, and the eight J strips are respectively marked as J0 ⁇ J7.
- Inverted L Take the coefficient from the upper right corner to the lower left corner of the coefficient block as the corner point of the inverted L. All the coefficients of the corner point to the right and the downward form an inverted L, as shown in Table 1. Show that 63 constitutes the first inverted L, 61, 59, 62 constitutes the second inverted L, 60, 55, 51, 56, 58 constitutes the third inverted L and so on.
- Horizontal bar group consists of several adjacent or non-adjacent horizontal bars
- Vertical bar group consists of several adjacent or non-adjacent vertical bars
- Diagonal strip group consists of several adjacent or non-adjacent diagonal strips
- J group consists of several adjacent or non-adjacent J strips.
- Inverted L-strip group consists of several adjacent or non-adjacent inverted L-bars.
- the scanning order for each group mode is:
- For the vertical bar group scan all the coefficients according to the zigzag from left to right and top to bottom; For the horizontal bar group, scan all the coefficients according to the zigzag from top to bottom and left to right; for the diagonal bar group, scan all the coefficients from the upper left to the lower right according to the zigzag; for the inverted L group, from the left To the right, scan all the coefficients from left to right, then from top to bottom, or from left to right, and then scan all the inverted L bars from top to bottom, then from left to right. coefficient;
- each inverted L strip in the inverted L strip group in the order from the upper left to the lower right, the coefficients in each inverted L strip are sequentially scanned from the inflection point and all the horizontal strips are scanned from left to right. The coefficient, then scan the vertical bar coefficients except the coefficients at the inflection point from top to bottom until all the coefficients in the inverted L group are scanned; and vice versa. It should be noted that after selecting a scanning mode, each of the inverted L groups uses the same scanning method.
- the method of scanning the specific horizontal branch or vertical branch in the J-group is as follows:
- the horizontal strip position information is encoded from left to right in turn, the vertical strip position information is encoded from top to bottom, and the horizontal strip non-zero coefficient value information is encoded from the last non-zero system of the horizontal strip from right to left, from the last of the vertical strips.
- the non-zero coefficient encodes the non-zero coefficient value information of the vertical bar from bottom to top; or, the horizontal bar position information is encoded from left to right in turn, and the horizontal bar non-zero coefficient value is encoded from right to left from the last non-zero coefficient of the horizontal bar.
- a strip mode When encoding a coefficient block, it is necessary to appropriately select a strip mode to obtain better coding efficiency.
- a horizontal strip group mode As can be seen from the above description, in the present invention, there are five types of strip patterns to be selected: a horizontal strip group mode, a vertical strip group mode, a diagonal strip group mode, a J strip group mode, and an inverted L strip group mode. The following describes how to choose to apply each group mode.
- the coefficient block may be selected to be divided into a horizontal bar group, a vertical bar group, a diagonal strip group, a J strip group, or an inverted L strip group according to the position distribution characteristics of the coefficients of 0, 1 and greater than 1 in the coefficient block. That is, if the non-zero coefficients in the coefficient block are concentrated in the lateral direction, longitudinally or obliquely In the direction of the bar, the corresponding horizontal bar group, vertical bar group or diagonal bar group will be selected.
- a horizontal bar group, a vertical bar group, and a diagonal bar group mode may be sequentially selected. If the coefficients of all 0s in the coefficient block are concentrated in the lower right corner, the inverted L-strip mode can be selected.
- the current coefficient block may further determine the strip group mode of the current coefficient block according to the strip group mode selected by the adjacent coefficient block, for example,
- the same strip pattern can be selected with adjacent coefficient blocks, which can be left or upper coefficient blocks.
- the following example illustrates a method of selecting a strip mode in two strip mode modes, horizontal and vertical. The direction of the distribution of the coefficients can be measured by the position of the last strip containing non-zero coefficients in the horizontal and vertical directions, taking the 8x8 coefficient block shown in Table 7 as an example:
- hengtiao-allno + hengtiao-Inz and shutiao-allno + shutiao-Inz are used as the measurement parameters in which the coefficients are concentrated in the horizontal direction or the vertical direction, wherein:
- Hengtiao one allno is the first full 0 position in the horizontal direction
- Hengtiao—Inz is the position of the last strip with a non-zero coefficient in the horizontal direction
- the horizontal or vertical corresponding horizontal bar group or vertical bar group having a smaller median value of the ear and hengtiao-allno + hengtiao-Inz and shutiao-allno + shutiao-lnz is used as the coding mode.
- a fixed coded strip mode is often difficult to adapt to coefficient blocks of various distribution characteristics. Therefore, we can first examine the characteristics of the coefficient block distribution, and divide it into several categories according to the general characteristics of each coefficient block distribution. Each type of coefficient block is coded by various strip group modes, and then the best effect strip group is selected. The mode is used as the coding scheme for the coefficient block of this type.
- coefficient blocks are not easily and intuitively assigned to one of the classes.
- the coefficient block can be separately coded by using different strip mode, and then the stripe mode with high efficiency is taken as the coefficient block.
- the coding scheme Of course, it is necessary to write corresponding information in the code stream to indicate the selected coding scheme, that is, the selected strip group mode.
- the comparison selection may be performed in the inverse L-group coding scheme and the J-segment coding scheme, and then it is determined that the two schemes are respectively designed for the block with the non-zero coefficient and the non-zero coefficient distribution sparsely. In this way, the corresponding strip mode can be selected as the encoding mode of the coefficient block according to the basis.
- the information of the selected strip group mode needs to be written in the code stream, and one or a certain coefficient block is marked.
- the coefficient block is divided into several groups, each group consists of several pieces.
- the purpose of the strip group is to encode the entire coefficient block according to the statistical characteristics of the coefficients.
- the strip group can be divided in any of the following four ways:
- the first strip containing the non-zero coefficient is used as the boundary coefficient strip, and the strip and all the previous coefficient strips are taken as a group, after which all the coefficients are zero, as a strip group;
- All the coefficient bars in the coefficient block are divided into three groups from the heading, the first strip group includes coefficients greater than 1, and the second strip group includes only coefficients with values of 0, 1, and the third The coefficient values in the strip groups are all zero;
- the first 0 occurrence is the boundary coefficient bar.
- the previous coefficient of the article is taken as a strip group.
- the coefficient after the strip is used as a strip group.
- the coefficients after the strip can be further divided into two strip groups. : One strip group includes non-zero coefficients, and the other strip group coefficients are all zero;
- 8 inverted L bars can be divided into two strip groups. From the lower right L bar to the upper left, the first inverted L bar with non-zero coefficients is found. All the coefficients after this one are only Contains zero, as a strip group, this strip and all the inverted L strips before this strip as a group.
- the present invention can also be grouped by the following schemes for the J-strip group, and still take Table 3 as an example, and the strategies for grouping the corresponding eight J-strips are as follows:
- J J0 ⁇ J3 are a group, which is a 4x4 coefficient block, also called block4x4; J J4 ⁇ J7 are another group, called block8x 8-J.
- each group includes four J bars.
- the encoded layer groups are grouped by the second layer as needed. Specifically: When encoding block8x 8 J, in the second layer grouping, J4 ⁇ J5 is divided into one Group, called block8x8 j-0, J6 ⁇ J7 is divided into one group, called block8x8__J-1; when encoding block4x4, the second layer grouping method is similar to the grouping method of encoding block8x8-J first layer, J0 ⁇ J1 is divided into One group, called block2x2, J2 ⁇ J3 is divided into a group called block4x4__J. In the second layer group, one backup group includes two J bars. ⁇
- the encoded layer group is subjected to the third layer grouping as needed.
- the third layer grouping the two J strips in the J group are separated, and then each J strip is encoded separately.
- the coding methods of the various strip groups must be programmed into the corresponding syntax element of the label strip group in the code stream structure, that is, the common statistical distribution of all the coefficients in one or a few of the labeled coefficient blocks at the beginning. Characteristic information.
- Each strip in each strip group does not have to be contiguous in position, nor does it have to be contiguous in the encoding process.
- tiao_allno determines the position of the first all 0s. If it is the horizontal mode, tiao_allno means hengtiao—allno; if it is vertical bar mode, tiao—allno means shutiao—allno.
- tiao__allno can take values 0 ⁇ 8
- tiao-allno equals 8 means that there are no zeros in the coefficient block, which can be directly encoded with the binary value of 4 bits.
- a bit is sequentially encoded to indicate whether this is all 0s, and if so, this bit is 0, otherwise it is 1. If this bit of a certain bit is 0, it means that this is the first all 0s.
- Table 9 the coefficient block shown in Table 9:
- the 0, 1, and 2 bars of the vertical bar need to be encoded as 1, 1, 0.
- encoding the corresponding bits requires selecting a corresponding probability model based on the information corresponding to the neighboring blocks. For example, in Table 9, the bit 0 of the second strip of the vertical bar is encoded according to whether the second bar of the left-coded coefficient block is the all-zero selection model. A different probability model is assigned to the bits indicating whether the k ( 0 k 7 ) bar of the bar and the k ( 0 ⁇ k ⁇ 7 ) bar of the bar are all 0, specifically encoding a bit of the bit, and then coding according to the left side.
- the coefficient block corresponds to whether the position bar is all 0s and allocates 2 probability models, a total of 32 probability models.
- bit is the kth bar of the corresponding bar or the kth bar of the vertical bar (k may take values 0 ⁇ 7), and the value of the bit corresponding to the bar of the same position on the left side of the coded system is 0 or 1 (This value is known when encoding the current block) Select the model so that a total of 32 models are set for this bit.
- the binarization method of ( tiao - lnz - tiao - allno ) can use the unary code method, that is, the mapping relationship is - 1->0,1->10,2->110,3->1110, .
- the first bin is given a probability model alone, and the latter bin can be combined with a probability model or a respective probability model.
- the coefficients to be encoded have all the coefficients from the first all zeros to the last non-all zeros, and all the coefficients before the first all zeros.
- the vertical bar mode should be adopted.
- the first all-zero vertical bar is the second bar
- the last non-all-zero bar is the sixth bar.
- the value of the corresponding coefficient is not 0 or 1 in most cases. It can be called non-zero or 1 group, and the distribution of 0 and 1 is not regular.
- the method can be: encoding the coefficients from top to bottom in the horizontal bar mode, each encoding each coefficient from left to right; in the vertical mode Each coefficient is encoded from left to right, and each coefficient encodes each coefficient from top to bottom. Encode one bit allO_back_gtl, allO_back_gtl is used to indicate whether the coefficient value of each strip from tiao_allno is not 0 or 1, assigning a probability model to this bit; for example, the vertical bars in Table 10 are 3, 4, 5 The coefficient values of the six bars are not 0 or 1, and the corresponding bits are 0.
- Encoding one bit indicates whether the current bar is all 0s, assigning a probability model to this bit.
- Table 10 the 3rd, 4th, 5th, and 6th bars of the vertical bar are marked, and the corresponding bits indicating whether all 0s are 1, 0, 1, 0.
- the coefficients are encoded in order.
- the coding coefficient is first encoded with its absolute value, and then its symbol is encoded.
- the absolute value of the code is a binary code method.
- the first bin determines whether its absolute value is 0 or greater than 0, and assigns a probability model based on the position of this coefficient.
- a probability model may be assigned to the coefficients of each position, or a probability model may be used for the coefficients of several positions, for example, when encoding the horizontal bar coefficients, from left to right, the position is from The 0th to the 7th are assigned 4 probability models, which are used for the positions of the four groups of positions 0, 1, (2, 3), (4, 5, 6, 7). The encoding of a bin.
- the absolute value of each coefficient may only take the value 0 or 1, no subsequent bin; otherwise, the absolute value of the coefficient whose absolute value is greater than 0 needs to continue.
- the bin after the code indicates whether its absolute value is 1 or greater than 1. If it is greater than 1, it is 2 or greater than 2, ....
- the latter bin can be assigned separately to the probability model, or the same probability model code can be uniformly assigned.
- the method of encoding the position of tiao-lnz can also encode the current strip according to the method of encoding tiao_allno, according to whether the corresponding strip of the encoded adjacent coefficient block contains a non-zero coefficient. For example, for the current block from the tiao-allno strip, each strip encodes a bit, indicating whether the following strips are all 0s. If the encoding to a certain bit indicates that all the strips are followed by 0, then this is the last.
- a non-all 0 (if this is not the tiao-allno), or the first (tiao-allno - 1) is the last non-all 0 (if this is the tiao-allno).
- the probability model assignment of this bit can be similarly encoded tiao-allno, first classified according to the kth (0 ⁇ k ⁇ 7) bar and the kth (0 ⁇ k ⁇ 7) bar, and then according to the coded adjacent coefficient. Whether the bar corresponding to the position of the block is the last one is allocated 0 probability models.
- Table 11 The methods for encoding these strip coefficients are various. A feasible specific scheme is given below: For the horizontal strip group mode, each coefficient is encoded from bottom to top, and each coefficient encodes each coefficient value from right to left; In group mode, each coefficient is encoded from right to left, and each coefficient encodes each coefficient value from bottom to top.
- the coefficient block shown in Table 11 is coded according to the vertical bar group mode.
- the first all zeros are the second one.
- the coefficients of the respective lines before the second vertical bar are encoded.
- the first one is encoded, and the first one is encoded from the bottom to the top.
- the coefficient then encode the 0th, and encode the coefficients from the bottom up.
- the position of the last non-zero coefficient of the current strip is estimated based on the position of the last non-zero coefficient of the encoded subsequent strip.
- the coefficient block shown in Table 11 when encoding the 0th vertical bar, the 1st vertical bar has been encoded, and the last (non-zero coefficient - 1) position is 3. From the statistical characteristics, most of the coefficient blocks are 0.
- the position of the last non-zero coefficient of the vertical bar is not less than the position of the last non-zero coefficient of the first vertical bar, which means that the position of the last non-zero coefficient of the encoded subsequent one contains a certain last non-zero of the current bar.
- the information of the position of the 0 coefficient therefore, the information can be used for encoding compression.
- a possible compression coding scheme is given below, which shows how to estimate the position of the last non-zero coefficient of the current strip using the position of the last non-zero coefficient of the encoded next strip.
- a bit is first encoded to determine if the position of the last non-zero coefficient of the current bar is less than 6. This bit model is selected based on the position of the last non-zero coefficient of the encoded next block.
- the position of the last non-zero coefficient of the coded subsequent one may take a value - 1 ⁇ 5, -1 means that the following one is encoded all 0s, corresponding to the 7 probability models assigned to this bit.
- the position of the last non-zero coefficient of the current bar is not less than 6, then re-encode a bit to determine whether the position of the last non-zero coefficient of the current bar is 6 or 7, and the probability model of this bit is based on the last of the encoded next block.
- the absolute value of the last non-zero coefficient is first encoded, and then the symbol is encoded, and the absolute value of the code is encoded by a binary method of the unary code, A bin is assigned a probability model, and the subsequent bins share a probability model, and then the coefficient values are encoded one by one from the previous coefficient of the last non-zero coefficient.
- Table 11 the 0th column of the vertical bar is encoded, and the position of the last non-zero coefficient of the coded subsequent block is 3, and the position of the last non-zero coefficient of the current bar is determined to be 6.
- the coefficient of the 0th vertical bar position 6 is first encoded, and then the coefficient of the 0th vertical bar position 5 is encoded one by one to the coefficient of the 0th vertical bar position 0.
- the coefficient value is encoded one by one from the coefficient of the 5th position of the current bar.
- the first bar of the vertical bar is encoded, and the position of the last non-zero coefficient of the coded subsequent one is -1, and the position of the last non-zero coefficient of the current bar is determined to be no more than 5.
- Coefficients are coded one by one from the coefficient of the first vertical bar position 5 to the coefficient of the first vertical bar position 0.
- the coefficient of the seventh position at the last position of the current bar is directly encoded one by one coefficient value.
- the position of the current coding coefficient is (jj, ii), jj is its abscissa, and ii is its ordinate.
- the coefficient of the coefficient 7 in the coefficient block shown in Table 11 is (0, 0)
- the coordinate of the coefficient - 7 is ( 1,0 )
- the coordinate of coefficient 5 is (0,1 ).
- the coefficient 7 of the position (0,0) in the coefficient block shown in Table 11 has an adjacent coefficient of -7 And 5, max_ neighbor is equal to 7. It can be divided into several types according to max_near.
- the binarization method can be set separately and the model can be assigned. There are a variety of methods for encoding binarization and model assignment in each class based on the max-near classification.
- max-neighbor is 0, 1 , 2, and greater than 2 is divided into four categories A, B, C, D; for max-neighbor is 0, called class A, using the binary method of the unary code, the first Bin distinguishes whether the absolute value of the current coefficient is 0 or greater than 0, and assigns a probability model; the first bin distinguishes whether the absolute value of the current coefficient is 1 or greater, and assigns a probability model; the latter bin shares a probability model;
- the first bin distinguishes whether the current coefficient absolute value is less than or equal to 1, and assigns a probability model to it. If the first bin is 0 (the absolute value of the current coefficient is less than or equal to 1), the second bin distinguishes whether the absolute value of the current coefficient is 0 or 1, and assigns a probability model to it; otherwise, the subsequent second bin distinguishes the current coefficient from absolute. Whether the value is 2 or greater than 2, the second bin distinguishes whether the current coefficient has an absolute value of 3 or greater than 3. The third bin distinguishes whether the current coefficient has an absolute value of 4 or greater than 4... These bins can be assigned a probability model separately or shared. A probability model.
- C D
- D the way to binarize and allocate models is also diverse, and can be coded according to the method of class A or class B.
- more efficient binarization and probability model allocation schemes can be designed separately. .
- the adjacent coefficients further include the already encoded coefficients of the left oblique lower, the left oblique upper, the right oblique lower, and the right oblique, and are classified according to the corresponding coefficient values.
- the left oblique lower position of the current coefficient position (jj, ii ) is the coefficient of (jj + l, ii - 1 ) (if any), and the right oblique lower position is ( jj + ⁇ , ⁇ + 1 )
- the coefficients (if any) have also been encoded. These two coefficients can also be used as the nearest coefficients of the current coefficients to calculate the maximum value of the adjacent coefficients, ie the position (jj + l, ii ), (jj, ii + l ) and (jj + i - 1) Calculate max_neighbo from the maximum of the absolute values of the coefficients
- the coefficient of the (jj - l, ii + l) position of the current coefficient position (jj, ii) (if present) has also been encoded, and this coefficient can also be used as the adjacent of the current coefficient.
- the coefficients are used to calculate the maximum value of the adjacent coefficients, ie, the maximum of the absolute values of the coefficients at the positions (jj + l, ii ), (jj, ii + 1 ) and ( jj + l, ii - 1 ) Max_neighbor.
- the position of the stripe bounding coefficient strip of the inverted L strip in the coded strip group is the same as the method of encoding the cross-column stripe bounding coefficient strip. From the first inverted L strip, encoding a bin indicates whether it is a strip component bounding coefficient article.
- the probability model of Bin assigns a probability model according to the position of the bar and the value of the bin corresponding to the same position bar of the adjacent block;
- the coefficients of each inverted L strip can be encoded backwards. For each inverted L strip, all the coefficients of the horizontal strip are encoded first, then all the coefficients of the vertical strip are encoded, and the coefficient of the last encoded position is on the diagonal. .
- the following coding scheme can be used for the J-strip group, so that for some types of coefficient blocks, such as a non-zero coefficient distribution, the coefficient block can obtain better coding efficiency.
- the specific process description is as follows:
- block8 x 8_J_1, ie J6 ⁇ J7, is coded, and then block8x8_J-0, ie J4 ⁇ J5, is encoded.
- block8x8-J-1 first write a bit such as block8x8_J-1 - A110 to identify whether the group is all zero, if all zero, directly encode block8x8-J-0; if not all zero, block8x8j-1
- a third layer of block coding is performed, and then a bit is written to indicate whether block 8x8J_0 is all zero. If not all 0, block 3x8_J-0 is subjected to third layer block coding.
- Block 4x4 layer 2 block coding a block coding method similar to the block 8x8 layer 1 is employed.
- First encode block4x4—J is J2 ⁇ J3, then encode block2x2 ie J0 ⁇ J1.
- first write a bit such as block4x4—J_A110 to identify whether the group is all zero. If all is zero, directly encode block2x2. At this time, there must be a non-zero coefficient in block2x2, because the coefficient of block4x4 cannot be All 0; otherwise, block 3x block-coded for block 4x4-J, then write a bit to indicate whether the block2x2 block is all 0, if not all 0, encode block2x2.
- the coded strip group contains two J strips, first encoding the right J strip, and then encoding the upper left J strip.
- Fig. 1 is a schematic diagram of J encoding mode.
- the horizontal bars and vertical bars do not include the coefficients of the top corner position.
- the coefficients of the top corner positions can be merged into the horizontal bars or vertical bars.
- the horizontal strip position information encoding method is: writing a bit before encoding the position information, indicating whether the horizontal strip is all 0, and if so, skipping the horizontal strip position information encoding process; otherwise, encoding according to the position information encoding direction.
- encoding first write the information to determine whether the bit is zero. If it is zero, write a bit. If it is not zero, write the information to determine whether it is the last non-zero coefficient. If it is not the last one, continue. Otherwise, it ends. But when encoding to the last position has not encountered the last non-zero coefficient, then it must be the last bit, no need to write any bits at this time;
- the encoding of the vertical strip position information may adopt an encoding method similar to the horizontal strip position information.
- Coding coefficient value information According to the location information, if there is a non-zero coefficient in the bar, the coefficient is encoded. The symbol information of the coefficient is first written, and then the absolute value of the coding coefficient is decremented by one.
- the position of the current coding coefficient is (jj, ii), jj is its row coordinate, and ii is its column coordinate.
- the coordinate of coefficient 7 in Table 11 is (0, 0)
- the coordinate of coefficient - 7 is (1, 0).
- the coordinate of coefficient 5 is (0, 1).
- the coefficients at these two locations are called adjacent coefficients of the current coefficient.
- the classification is based on the absolute value of the largest absolute value of the adjacent coefficients of the current coefficient, that is, max_near.
- the coefficient 7 of the position (0, 0) in Table 11 has adjacent coefficients of -7 and 5, and max_ neighbor is equal to 7.
- max-near it can be divided into several types.
- the binarization method can be set separately and the model can be assigned. There are a variety of methods for encoding binarization and model assignment in each class based on the max-near classification.
- 0, 1, 2, and greater than 2 are divided into four categories: A, B, C, and D. Specifically, it can be:
- the binarization method of the unary code is used.
- the first bin distinguishes whether the absolute value of the current coefficient is 0 or greater than 0, and assigns a model; the first bin distinguishes the current coefficient from the absolute value to be 1 Still greater than 1, assign a model; the latter bin shares a model; for max-neighbor is 1 (class B), the first bin distinguishes whether the absolute value of the current coefficient is less than or equal to 1, and assigns a model to it.
- the second bin distinguishes whether the absolute value of the current coefficient is 0 or 1, and assigns a model to it; otherwise, the subsequent second bin distinguishes the current coefficient absolutely. Whether the value is 2 or greater than 2, the second bin distinguishes whether the current coefficient has an absolute value of 3 or greater than 3. The third bin distinguishes whether the current coefficient has an absolute value of 4 or greater than 4...
- C D
- the way to binarize and allocate models is also diverse, and can be coded according to the A or B method, or a more efficient binarization and probabilistic model allocation scheme can be designed separately.
- the model will be extremely complicated and difficult to implement. And just considering the impact of QP is not the vast majority 2006/002036 Obtain a good initial probability estimate. Therefore, in the early stage of coding, the method of speeding up adaptive estimation can be accelerated to achieve the purpose of improving the compression efficiency at the initial stage of coding.
- the present invention is in the early stage of encoding, that is, for the first 10 bins of each ctx code, if MPS is present, the state value is adjusted by twice the step size in the existing method.
- the state value is adjusted to the direction in which the MPS probability estimation value increases.
- the specific method is that the state value is incremented by 1, which is called the jump step size is 1.
- the state value is increased by 2 at this time. It is called the jump step size is 2.
- the adjustment method is the same as in the prior art.
- the experimental data shows that the initialization method of the method for encoding data fast in the present invention can obtain a good probability estimation value at a relatively early stage of coding.
- the present invention proposes a new coding method for the coefficient block, which can have better compression efficiency under the condition of H.264 complexity, and eliminates the scanning and anti-scanning process.
- FIG. 2 is a schematic diagram of the composition of the apparatus for encoding a coefficient block according to the present invention.
- the apparatus includes: a strip group setting unit and an encoding. Unit; among them,
- a strip group setting unit storing a predetermined rule, receiving a transform-quantized coefficient block in the image encoding, determining a strip group pattern according to a predetermined rule, and dividing the received coefficient block according to the determined strip group pattern;
- the subsequent strip group is sent to the coding unit;
- the coding unit encodes the received strip group and outputs the encoded stream.
- the strip group setting unit includes: a strip group mode unit and a strip group dividing unit; wherein, the strip group mode unit is determined, a predetermined rule is stored, a strip group mode is determined according to a predetermined rule, and the strip group dividing unit is notified;
- a strip division unit receives a transform-quantized coefficient block in the image coding, and divides the received coefficient block according to the determined strip group pattern; and sends the divided strip group to the code list Yuan.
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Compression Or Coding Systems Of Tv Signals (AREA)
- Compression, Expansion, Code Conversion, And Decoders (AREA)
Description
对系数块进行编码的方法及装置
技术领域
本发明涉及图像编码技术, 尤指一种对系数块进行编码的方法及装 置。 发明背景
目前, 图像压缩编码标准有: 国际电信联盟标准化部 ( ITU-T )视 频编码专家組(VCEG ) 制定的活动图像编码标准 H,261、 H.263; 国际 标准化组织 /国际电工委员会(ISO/IEC )移动图像专家组(MPEG ) 制 定的静止图像编码标准 JPEG和 JPEG2000, 活动图像编码标准 MPEG1、 MPEG4-Part2; ITU-T视频编码专家組(VCEG )和 ISO/IEC MPEG共同 提出的国际视频编码标准 MPEG2/H,262、 H.264/AVC; 音视频编码标准 ( AVS ) 中的活动图像编码标准等。
活动图像视频编码包括以下几个基本步骤: 预测、 求残差、 变换、 量化和编码。静止图像编码包括以下几个基本步骤: 变换、量化和编码。
变换、 量化后的系数块的尺寸有 16x 16、 8x8、 4x4、 2x2等类型。 在 H.264/AVC 的高级档次(High Profile ) 中有 8x8系数块, AVS视频编 码标准中只用 8x8系数块。 本文中以 8x 8系数块为例进行说明, 但本技术 可扩展到 16x 16、 4x4、 2x2等系数块。
上述图像编码标准对变换、 量化后的系数块的编码包括系数扫描和 熵编码。 系数扫描就是对二维系数块所有系数按照约定的顺序扫描成为 一维数组, 例如, H.264/AVC帧模式下, 对 8x8系数块的扫描次序如表 1 所示, 表 1中采用数字从小到大及箭头标明了扫描的顺序, 依据该扫描 顺序将 8 X 8系数块中的所有系数扫描到一个一维 1 X 64的数组中。
0 + 1 5-^ 6 14+15 27+28
/ /
2 4 7 13 16 26 29 42
^ / / ^
3 8 12 17 25 30 41 43
/ /
9 11 18 24 31 40 44 53
\ / / / /
10 19 23 32 39 45 52 54
20 22 33 38 46 51 55 60
\ /
21 34 37 47 50 56 59 61
/
35+36 48+49 57+58 62+63 表 1
例如, 待编码的 8x8系数块如表 2所示:
5 -6 0 0 0 0 0 0
3 1 0 1 □ 0 0 0
-20 0 0 □ □ 0 0 0
0 0 0 0 0 0 0 0
3 1 0 0 0 0 0 0
-7 0 0 0 □ 0 0 0
3 0 0 0 0 0 0 0
-2 0 0 0 G 0 0 0
表 2
对表 2所示的 8 X 8系数块, 按照表 1所示顺序扫描后得到的一维 1 X 64 数组是:
5, -6, 3, -20, 1, 0, 0, 0, 0, 0, 3, 0, 0, 1, 0, 0, 0, 0, 0, 1, -7,3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2, 0, 0, 0, 0, ... (后面全部是 0)。
H.264/AVC熵编码是对扫描输出的一维数组进行的。 自适应上下文 二值算术编码 (CAB AC, Context-based Adaptive Binary Arithmetic Coding )是 H.264/AVC中采用的熵编码方案之一, 具有较高的编码压缩 效率, 但也具有更高的计算复杂度。
CABAC的编码包括三个主要部分: 二值化, 选择概率模型, 算术编
码。
对每个待编码的语法元素( Syntax Element ) , 二值化过程定义了一 种映射规则, 将语法元素的值映射成为一串二值字符串, 这里语法元素 是编码的基本单位, 任何待编码的某一类数据都是一种语法元素, 比如 待编码的系数值是一种语法元素, 系数位置也是一种语法元素。 比如语 法元素可以取值 0, 1 , 2, 可以定义如下的映射规则:
0映射为 0即 0->0, 1映射为 10即 1->10, 2映射为 11即 2->11 , 这样对 二值字符串编码可以唯一的恢复原语法元素的值信息。 这种映射规则称 为二值化方案, 所述的二值化方法也可以被其它多值化方法代替。
对二值化后得到的二值字符串的每个比特(bit ) , 以下称之为一个 bin, 选择合适的概率模型。对于二值化符号串的处理也可以延伸至对于 多值化的多值符号串处理。 H.264中为各个语法元素二值化得到的 bin设 置了相应的概率模型, 对某些 bin, 其对应的概率模型不止一个。 编码时 需要根据相邻已编码宏块信息选择正确的概率模型。为 bin选择好概率模 型之后, 即可调用算术编码器进行二值算术编码。
H.264中对编码系数块的 CABAC的编码步骤是:
步骤 1 : 对扫描得到的一维数组, 从第一个系数起编码当前系数值 是否是 0。 如果当前系数值不是 0, 则编码当前系数是否是一维数组中的 最后一个非 0系数, 如果是, 则进入步骤 2, 否则继续编码下一系数; 如 果当前系数值是 0, 则继续编码下一系数。
步骤 2: 经步骤 1处理后, 可以得到一维数组各位置上系数值是否是 0的全部信息。 然后对所有的非 0系数, 从最后一个开始逆向依次编码。
如上例中, 所有非 0系数为 5, -6, 3, -20, 1, 3, 1, 1, -7, 3, -2。
从最后 个非 0系数往前重复下面的编码过程直至编码完所有系 数, 具体的编码过程为:
( 1 )对每个非 0系数, 首先编码其绝对值减 1;
( 2 )相应的绝对值减 1取值为非负整数; H.264中定义的相应的二 值化方法是一元前缀码加指数哥伦布后缀码; 例如, 编码上面的非 0系 数- 7, 其绝对值减 1为 6, 假设按照预先设置的映射规则二值化后为 1111110。 对这 7个 bin, H.264中为第一个 bin—共设置了 5个可能的概率 模型, 编码时选择哪一个由已经编码的后面非 0系数中等于 1和大于 1个 系数个数决定。 例如编码 - 7时已经编码的非 0系数有 3,-2, 那么其二值 化字符串的第一个 bin用到第五个模型。 H.264中为除第一个 bin以外的其 它 bin—共设置了 5个可能的概率模型 , 编码时选择哪一个由已经编码的 后面非 0系数中大于 1个系数个数决定。 例如编码- 7时, 已经编码的非 0 系数有 3,-2 , 那么其二值化字符串的除第一个 bin以外的其它 bin用到第三 个模型。
( 3 ) 为二值化后的各个 bin选定模型后对每个 bin进行二值算术编 码。 完成对系数绝对值的编码后, 用 1个比特编码其符号。
在实际应用过程中, 对系数块的编码方式有多种选择, 目前的分类 和概率模型分配的方案仍然还有进一步改进的空间, 以提高编码效率。 来自适应的估计概率值。 对每个待编码的符号记做一个 bin, CABAC都 为之设定了相应的概率模型记做一个 ctx。每个 ctx包括 7比特信息, 6比特 的状态 (state )值和 1比特的大概率符号 (MPS )值。 这 7比特信息构成 一个完整的概率估计值。
因为 CABAC中待编码 bin的取值只有 0, 1两种, 所以对当前 bin取值 0/1的概率值作估计时, 只需要一个 1比特的 MPS值, 标志估计要编码的 bin是 0还是 1的可能性更大一点; 一个 6比特 state值, 标志这个 bin取 MPS 值的概率估计值。 对当前 bin编码后, 根据实际编码的 bin值调整 ctx中的
概率估计值。 如果实际编码的 bin是 MPS值, 意味着出现 MPS的概率又大 一点, state值向 MPS概率估计值增大的方向调整; 否则意味着出现 MPS 的概率变小一点, state值向 MPS概率估计值减小的方向调整。 这样就达 到了在编码过程中动态自适应的估计概率值的目的。
这样的方法对一个概率模型而言,在编码若干 bin之后会获得比较好 的概率估计值。 但是在编码初期由于已编码的符号信息量很小, 有些情 况下需要一个比较长的自适应估计过程, 所以在初期概率模型的估计效 果可能不好; 而且不同的量化参数 ( QP )取偉对编码数据的统计特点有 很大的影响。基于以上两点原因, CAB AC做了一个线性模型, 针对不同 的 QP粗略的估计每个概率模型的初始化值即初始的概率估计值,其目的 在于, 在编码初期能够获得比较准确的概率估计值, 以提高编码初期的 压缩效率。
CABAC中的基于 QP值的线性模型如公式(1 )所示:
preCtxState = Clip3(l,126,((m*QP)»4)+n) ( 1 ) 在公式(1 ) 中, Clip3函数的计算方法是: 如果 ((m*QP)»4)+n<l , 则结果为 1 ; 如果 ((m*QP)»4)+n>126, 则结果为 126; 否则, 结果为 ((m*QP)»4)+n。公式( 1 )中, m, n是关于概率模型的确定性经验参数, 每个概率模型有自身对应的 (m, n)值。 全部概率模型的 (m, n)值都预先 存储在一个固定的表中。
目前的初始化方法仅针对 QP做了一个线性模型, 而事实上, 不同的 序列、 不同的分辨率都会对数据统计特点有^ ί艮大的影响。 通过测试一些 序列发现: 在相当一部分情况下, 初始化编码效率甚至不如无需初始化 即初始化概率模型的 state值和 MPS值为全 0的编码效率。
而且初始化过程的 (m, n)参数存储需要不小的空间, CABAC Main Profile中所需要的大约为 6400字节 (bytes ) 。 初始化每个 ctx的计算过程
也很复杂, 涉及到一次乘法, 一次移位, 一次加法, 降低了编码效率。 发明内容
有鉴于此, 本发明的主要目的在于提供一种对系数块进行编码的方 法, 能够提高编码效率。
本发明的另一目的在于提供一种对系数块进行编码的装置, 能够提 高编码效率。
为达到上述目的, 本发明的技术方案具体是这样实现的:
一种对系数块进行编码的方法, 包括:
A、 按照预定规则确定一种条组模式, 对图像编码中变换量化后的 系数块按照确定的条组模式划分条组;
B、 基于划分的条组对所述的系数块进行编码。
所述系数块使用的条组模式为: 横条组, 或竖条组, 或斜条組, 或 J条组, 或倒 L条组;
不同的系数块使用不同的条组模式或者相同的条组模式。
所述条组中的每个条组包含一个以上系数条或一个系数条。
步骤 A中所述划分条组的方法为:
将所述系数块的各个系数条中包含全 0条、 和 /或非 0即 1条和 /或大于 1条的系数条, 分别划分组成相应的全 0条条组、 和 /或非 0即 1条条组和 / 或大于 1条条组。
步骤 A中所述划分条组的方法还包括:
以所述系数块中从前到后第一个出现的全 0条为分界线, 该条之前 的系数条作为一个条组, 该条以后的系数条作为一个条组。
步骤 A中所述划分条組的方法还包括:
将所述第一个出现的全 0条以后的系数条再划分为两个条组, 一个
条组包括有非 0系数, 另一个条组系数值全部为零。
步骤 A中所述划分条组的方法还包括:
以所述系数块中从前到后的最后一个非 0条为分界线, 该条以后的 系数条作为一个全 0条組, 该条以前的系数条再以最后一个包含大于 1的 系数条作为分界线, 之前为一个大于 1条组, 之后为一个非 0即 1条组。
步骤 A中所述确定条组模式的方法为: 根据所述系数块中 0、 1及大 于 1的系数的位置分布特性选择一种条组模式。
在仅使用横条组模式或竖条组模式的情况下, 所述确定的方法具体 为: 分别确定所述系数块的横向和纵向最后一个含有非 0系数的非全 0系 数条的位置和第一个全 0系数条的位置, 基于上述位置确定采用横条組 模式或竖条组模式。
该方法还包括: 根据相邻系数块选择的编码模式确定当前系数块的 编码模式。
步骤 A中所述确定条组模式的方法为: 对所述系数块分别采用不同 的条组模式进行编码, 并选择压缩效率最高的条组模式确定为该系数块 的条组模式。
当采用 J条组进行编码时, 所述步骤 B具体包括:
Bl、 对各个 J条组分别进行编码处理;
B2、 确定任一 J条组符合预定的条件时, 则将该 J条组进一步划分为 若干 J条组, 并执行步骤 Bl。
所述的步骤 B2包括:
B21、判断当前 J条组中的系数是否为全 0,如果是,则执行步骤 B22, 否则, 如果该 J条组包含多个 J条, 则执行步骤 B23 , 如果不包含多个 J条, 则直接执行步骤 B1 ;
B22、 选择下一条 J条組, 并执行步骤 B21;
B23、 将该 J条组进一步划分为若干 J条组, 并执行步骤 Bl。
所述步骤 B1还包括:
在对各个 J条组中包含的各个系数进行编码处理过程中,当编码任一 J条组内系数是否为全 0的信息时, 则该信息的概率模型的分配取决于已 编码条组中的系数值信息。
所述已编码条组中的系数值信息包括: 已编码条组中若干条组的非 0系数个数, 或者, 非 0系数之和。
设定一个门限值 G,在每个所述概率模型编码前 G个符号时, 出现大 概率符号 MPS调整状态 state值的跳转步长为大于或等于 2。
所述条组为 J条組, 步骤 B中所述编码的方法包括: 支条是否为全 0系数, 如果是, 则直接编码一个符号, 否则, 继续对 J条 的横向或竖向分支条包含的各系数进行编码。 依次从左向右编码横向条位置信息, 从上至下编码竖向条位置信 息, 从横向条最后一个非 0系数起从右至左编码横向条非 0系数值信息, 从竖向条最后一个非 0系数起从下至上编码竖向条非 0系数值信息; 或者,
依次从左向右编码横向条位置信息, 从横向条最后一个非 0系数起 从右至左编码横向条非 0系数值信息, 从上至下编码竖向条位置信息, 从竖向条最后一个非 0系数起从下至上编码竖向条非 0系数值信息。
所述步骤 B具体包括:
在编码各个条组包含的系数条的过程中, 当编码一个系数条的全部 系数时, 根据已编码的系数条的最后一个非 0系数的位置对当前系数条 的最后一个非 0系数的位置进行估计, 并根据估计的位置信息对当前系
数条进行编码。
所迷步骤 B具体包括:
在编码各个条组包含的系数条的过程中, 当编码一个系数条的全部 系数时, 如果该系数条的最后一个非 0系数的位置被完全确定, 最后一 个非 0系数采用一元码方法编码但不限于一元码编码, 并为该系数单独 分配相应的概率模型。
所述步骤 B具体包括:对作为条组分界的分界系数条的位置编码时, 在码流中采用标识符来标记该条是否为分界系数条, 并为该标识符分配 概率模型。
所迷步骤 B还包括: 根据当前系数条的位置以及相邻系数块已经编 码的信息为编码当前系数条是否为全 0的信息符号分配概率模型。
所述步骤 B还包括: 为所述符号中的多个符号分配相同的概率模型。 所迷步骤 B还包括: 当作为条组分界的分界系数条为多个时, 则在 编码后面的分界系数条的位置时基于先前已编码的分界系数条的位置 进行编码。
所述步骤 B具体包括: 对条组包含的各个系数按照各自的扫描顺序 的反向顺序依次进行编码。
所述各自的扫描顺序分别为:
对于竖条组, 从左到右、 从上到下按照 "之" 字形扫描所有系数; 对于横条组, 从上到下、 从左到右按照 "之" 字形扫描所有系数; 对于斜条组, 从左上到右下按照 "之" 字形扫描所有系数; 对于倒 L条组, 从左到右, 依次对各倒 L条先从左到右, 后从上到下 扫描所有系数, 或者, 从左到右, 依次对各倒 L条先从上到下, 后从左 到右扫描所有系数。
在所述步骤 B中:
当对条组包含的条中的系数进行编码时, 根据已编码的相邻位置的 系数信息作为编码当前系数的分类标准进行分类, 并且:
分別为不同的类设置各自的二值化方案, 或者多值化方案, 以及编 码各个符号的概率模型 , 或者多值化符号串各个符号的概率模型;
或者, 为若干个类设置相同的二值化方案, 或者多值化方案, 以及, 为若干个类设置相同的编码各个符号的 }既率模型, 或者为若干个类设置 相同的编码各个多值化符号串各个符号的概率模型。
所述相邻位置的系数信息包括: 相邻系数中的最大值。
一种对系数块进行编码的装置, 该装置包括: 条组设置单元和编码 单元; 其中,
条组设置单元, 存储有预定规则, 接收图像编码中变换量化后的系 数块, 按照预定规则确定一种条组模式, 并对接收到的系数块按照确定 的条組模式划分条组; 将划分后的条组发送给编码单元;
编码单元, 对接收到的条组进行编码并输出编码流。
所述条组设置单元包括:确定条组模式单元和条組划分单元;其中, 确定条组模式单元, 存储有预定规则, 按照预定规则确定一种条组 模式, 并通知条组划分单元;
条组划分单元, 接收图像编码中变换量化后的系数块, 并对接收到 的系数块按照确定的条組模式划分条组; 将划分后的条組发送给编码单 元。
由上述技术方案可见, 本发明按照预定规则确定一种条组模式, 对 图像编码中变换量化后的系数块按照确定的条组模式划分条组, 并基于 划分的条组对所述的系数块进行编码的方法, 提高了编码效率, 而且, 本发明在与 H.264复杂度相当的情况下, 具有更优的压缩效率, 同时, 还省去了扫描和反扫描的过程。
附图简要说明
图 1是 J条编码方式示意图;
图 2是本发明对系数块进行编码的装置的組成示意图。 实施本发明的方式
本发明的核心思想是: 按照预定规则确定一种条组模式, 对图像编 码中变换量化后的系数块按照确定的条组模式划分条组; 基于划分的条 组对所述的系数块进行编码。
为使本发明的目的、 技术方案及优点更加清楚明白, 以下参照附图 并举较佳实施例, 对本发明进一步详细说明。
为了便亍理解本发明, 首先以 8x 8系数块为例, 下文提到的系数块 为 8 X 8系数块, 对本发明中涉及的各名词进行解释如下:
1、 条的定义
本发明中可选的条模式有 5类:
横条: 系数块的一行为一个横条, 从上到下顺序记为第 0到 7横条。 竖条: 系数块的一列为一个竖条, 从左到右顺序记为第 0到 7竖条。 斜条: 系数块中的每一个左下到右上 45度斜线元素为一斜条, 如表 1所示, 数字 0为第一个斜线条, 数字 1、 2組成第二个斜线条, 数字 3、 4、 5组成第三个斜线条, 数字 6、 7、 8、 9为第四个斜线条等。
J条: J条定义如表 3所示:
JO Jl J2 J3 J4 J5 J6 J7
0j 1 1 0 0 0 0 0
0 0 1 0 0 0 0 0
0 0 0 1 1 0 0 0
0 1 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 表 3 表 3中, 一个 8x8系数块称为 block8x 8, 对此系数块从左上到右下可 以分为 8个 J条, 每个 J条的拐角点系数为系数块中位于对角线上的系数, 基于拐角点系数依次向上向左的系数组成一个 J条,所述的 8个 J条分别标 记为 J0 ~ J7。
倒 L条: 以系数块中的由右上角到左下角的对角线上的系数作为倒 L 的拐角点,该拐角点向右及向下的所有系数构成一个倒 L条,如表 1所示, 63组成第一个倒 L条, 61、 59、 62组成第二个倒 L条, 60、 55、 51、 56、 58组成第三个倒 L条等。
2、 条组的定义
本发明中对应 5种条的条组模式也有 5类:
横条组: 由若干个相邻或不相邻的横条组成;
竖条组: 由若干个相邻或不相邻的竖条组成;
斜条组: 由若干个相邻或不相邻的斜条组成;
J条组: 由若干个相邻或不相邻的 J条組成。
倒 L条组: 由若干个相邻或不相邻的倒 L条组成。
对各条组模式的扫描顺序为:
对于竖条组, 从左到右、 从上到下按照 "之" 字形扫描所有系数;
对于横条组, 从上到下、 从左到右按照 "之" 字形扫描所有系数; 对于斜条组, 从左上到右下按照 "之" 字形扫描所有系数; 对于倒 L条组, 从左到右, 依次对各倒 L条先从左到右, 后从上到 下扫描所有系数, 或者, 从左到右, 依次对各倒 L条先从上到下, 后从 左到右扫描所有系数;
也就是说,对于倒 L条组中的各倒 L条,依照从左上到右下的顺序, 依次对每个倒 L条中的系数, 从拐点处系数开始从左向右扫描完所有横 条系数, 再从上到下扫描除拐点处系数外的竖条系数, 直到扫描完该倒 L条组中的所有系数; 反之亦然。 需要说明的是, 选择好一种扫描方式 后, 倒 L条组中的各条均采用同样的扫描方式。
对于 J条组, 扫描 J条組中具体的横向分支条或者竖向分支条的方法 具体为:
依次从左向右编码横向条位置信息, 从上至下编码竖向条位置信 息, 从横向条最后一个非 0系 ^从右至左编码横向条非 0系数值信息, 从竖向条最后一个非 0系数起从下至上编码竖向条非 0系数值信息; 或 者, 依次从左向右编码横向条位置信息, 从横向条最后一个非 0系数起 从右至左编码横向条非 0系数值信息, 从上至下编码竖向条位置信息, 从竖向条最后一个非 0系数起从下至上编码竖向条非 0系数值信息。
对系数块编码时需要适当选择一种条组模式获得更好的编码效率。 从上面的描述可知, 本发明中, 可供选择的条组模式有五种: 横条组模 式、 竖条组模式、 斜条组模式、 J条组模式和倒 L条组模式。 下面将描述 如何选择应用各条组模式。
本发明中, 具体可以根据系数块中 0、 1及大于 1的系数的位置分布 特性, 选择将系数块划分为横条組、 竖条组、斜条组、 J条組或倒 L条組。 也就是说, 如果系数块中的非 0系数集中分布在横向上, 纵向上或者斜
条方向上, 则将选择相应的横条组、 竖条组或斜条组。
下面是系数分别集中分布在横向上, 纵向上, 斜条方向上的三个典 型系数块示例, 分别如表 4、 表 5和表 6所示:
60 2 D 9 2 1 0 0 0
0 G Q 0 0 0 □ □
0 □ 0 0 0 0 0 0
□ 0 □ 0 0 0 Q G
Q □ 0 □ 0 □ 0 □
0 G □ 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 □ 0 □ □ □ 0
表 4
10 3 1 0 □ 0 □ 0
2 1 0 0 0 □ 0 □
1 0 0 Q 0 0 0 □
□ 0 0 0 0 □ 0 0
0 0 0 0 0 0 0 □
□ 0 □ 0 □ 0 G □
0 0 0 0 0 □ 0 0
0 0 0 0 0 □ 0 0
表' 5
3 2 2 1 0 □ 0 0
3 3 2 0 0 0 □ 0
2 0 0 1 0 0 0 0
□ 3 2 1 G D □ □
1 2 2 1 0 0 □ 0
0 1 1 0 0 0 0 0
0 0 0 0 0 □ □ 0
Q 1 Q 0 □ 0 □ □
表 6
对于上述各系数块可以依次选择横条组、 竖条组和斜条组模式。 如 果系数块中全 0的系数集中在右下角, 则可以选择倒 L条组模式。
本发明中, 对于相邻的系数块已经采用了相应的条模式进行条组的 划分, 则当前系数块还可以根据相邻系数块选择的条组模式确定当前系 数块的条组模式, 例如, 可以与相邻系数块选择同样的条模式, 所述的 相邻的系数块可以为左侧或上方的系数块。
下面举例说明在横、 竖条两种条组模式中选择一种条组模式方法。 可以用横向和竖向上最后一个含有非 0系数的条的位置衡量系数集 中分布的方向, 以表 7所示的 8x8系数块为例:
5 -6 0 0 0 0 0 0
3 1 0 1 0 0 0 0
-20 0 G Q 0 0 0 0
0 0 0 0 0 0 0 D
3 1 0 0 0 0 0 0
-7 0 0 0 0 0 0 0
3 0 Q 0 0 0 0 0
-2 0 Q 0 0 O 0 0
表 7
在表 7中, 横向上从上至下最后一个含有非 0系数的条的位置为 7, 纵向上从左至右最后一个含有非 0系数的条的位置为 3。 所以当前块选择 按照竖条的条组模式编码。 .
为了避免系数分布如下的系数块选择错误的编码模式, 本发明中用 hengtiao— allno + hengtiao— Inz和 shutiao— allno + shutiao— Inz作为系数集中 在横向还是纵向的衡量参数, 其中:
hengtiao一 allno为横向第一个全 0条位置;
hengtiao— Inz为横向最后一个含有非 0系数的条的位置;
shutiao— allno为纵向第一个全 0条位置;
shutiao— Inz为纵向最后一个含有非 0系数的条的位置。
本发明中具体为耳又 hengtiao— allno + hengtiao— Inz和 shutiao— allno + shutiao—lnz中值较小的横向或纵向对应的横条组或竖条组作为编码模 式。
显然, 如果用横向和竖向上最后一个含有非 0系数的条的位置衡量, 下面表 8所示的系数块应该用竖条組模式编码, 但是下面块的系数集中 在横向上。 对下面的块 hengtiao— allno , hengtiao— Inz分另' J为 1 , 0;
shutiao—allno, shutiao_lnz分别为 0, 3, 因此, 确定选择横条组模式; 用 hengtiao— allno + hengtiao— Inz和 shutiao—allno + shutiao— Inz作为系数集中 在横向还是纵向的衡量参数则能够得到合理的编码模式。
0 1 1 1 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 Q 0 0 Q G 0
0 0 0 0 0 0 0 0
□ ο ϋ θ ϋ ο ο ο
0 0 0 0 0 0 0 0
Ο ϋ ϋ θ θ ϋ ϋ ϋ
表 8
一种固定的编码条组模式通常很难适应各种分布特点的系数块。 因 此, 可以首先考察系数块分布的特点, 并根据各系数块分布的大致特点 分为若干类, 对每一类系数块分别采用各种条组模式进行编码处理, 之 后选择最佳效果的条组模式作为该类型系数块的编码方案。
另外, 有的系数块不容易直观的分到其中某一类中去, 此时, 还可 以采用不同的条组模式分别对该系数块进行编码, 然后取效率高的条组 模式作为该系数块的编码方案。 当然, 需要在码流中写入相应的信息, 指示所选择的编码方案, 即选择的条组模式。
比如, 可以在倒 L条组编码方案和 J条组编码方案中进行比较选择, 之后, 确定这两种方案是分别针对上述非零系数较多的块和非零系数分 布稀疏的块设计的, 这样, 便可以根据该依据选择相应的条组模式作为 系数块的编码模式。
选择了一定的条组模式以后, 则按照选定的模式逐条编码全部的系 数块内信息, 下面将对编码过程进行说明。
确定按照横条组、 竖条组、斜条組、 J奈組或倒 L条组模式编码之后, 则需要在码流中写入选择的条组模式的信息, 标示系数块中一条或者某
几条中所有系数所具有的共同的统计分布特点。
根据不同的统计特点, 将系数块划分为若干条组, 每条组都由若干 条组成。 条组的目的是将整个系数块根据系数的统计特点分别编码, 比 如, 可以以下面四种方式中的任一种方式进行条組的划分:
( 1 )将所有非 0条作为一条組, 所有全 0条作为一条组;
( 2 )将第一个含有非 0系数 的条作为分界系数条,该条和前面所 有系数条作为一条组, 其后所有系数都是零, 作为一个条组;
( 3 )将含有大于 1的系数的若干条作为一条组, 将其它条作为一条 組;
( 4 )将系数块中的所有系数条从前往后分为三条组, 第一个条组 中包括有大于 1的系数, 第二个条组中仅包括值为 0, 1的系数, 第三个 条组中的系数值全部为零;
( 5 ) 以第一个出现的全 0条为分界系数条, 该条以前的系数作为一 个条组, 该条以后的系数作为一个条组, 该条以后的系数还可以分为两 个条组: 一个条组包括有非 0系数, 另一个条組系数全部为零;
( 6 )对于 8x8系数块可以将 8个倒 L条分为两个条组, 从右下的倒 L 条往左上找到第一个含有非 0系数的倒 L条, 这一条之后的所有系数只含 有零, 作为一个条组, 这一条以及这一条之前的全部倒 L条作为一条组。
另外, 本发明针对 J条组还可以采用以下的方案进行分组, 仍以表 3 为例, 对相应的 8个 J条分层分组的策略如下:
第一层分组中, J条 J0 ~ J3为一組, 这是一个 4x4的系数块, 也称为 block4x4; J条 J4〜J7为另一组, 称为 block8x 8— J。 第一层分组中, 每一个 组包括 4个 J条。
在对第一层的这两个 J条組编码时,根据需要对编码的条組进行第二 层的分组。 具体为: 编码 block8x 8 J时, 在第二层分组中, J4〜J5分为一
组,称为 block8x8 j— 0, J6〜J7分为一组,称为 block8x8__J— 1;编码 block4x4 时, 第二层分组的方法类似编码 block8x8—J第一层的分组方法, J0~J1 分为一组, 称为 block2x2, J2~J3分为一组, 称为 block4x4__J。 第二层分 组中, 一个备组包括 2个 J条。 ·
对第二层分组的 J条组编码时,根据需要会对编码的条组进行第三层 分组。 第三层分组中, 将该 J条组中的两个 J条分开, 然后对每一个 J条分 别进行编码。
各种条组的编码方法都必须在码流结构中编入相应的标示条组的 语法元素, 也即开始所述的标示系数块中一条或者某几条中所有系数所 具有的共同的统计分布特点的信息。
每个条組中的各条不必在位置上连续, 也不必在编码过程连续。 下面以上述第四种条组方法为例说明一种可行的编码方案。
首先, 需要编码 tiao一 allno, 即确定第一个全 0条的位置, 如果是横 条模式, 则 tiao_allno是指 hengtiao—allno; 如果是竖条模式, 则 tiao— allno 是指 shutiao— allno。
编码 tiao一 allno的方式很多, tiao__allno可以取值 0 ~ 8, tiao— allno等于 8意味着系数块中无全 0条, 可以用 4·比特的二进制值直接编码。 或者, 也可以从第 0条起, 依次编码一个比特指示这一条是否为全 0, 如果是则 这一比特为 0, 否则为 1。 如果某一条对应的这一比特为 0, 意味着这是 第一个全 0条。 例如对表 9所示的系数块:
5 -6 0 0 0 0 0 0
3 1 0 1 0 0 0 0
-20 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
3 1 0 0 0 0 0 0
-7 0 0 0 0 0 0 0
3 0 0 0 0 0 0 0
-2 0 0 0 0 0 0 0
表 9
纵条第 0, 1 , 2条需要编码的比特为 1 , 1, 0。
为提高效率, 编码相应比特需要根据相邻块对应的信息选择相应的 概率模型。 例如, 表 9中编码纵条第 2条的比特 0, 则根据左边已编码系 数块纵条第 2条是否是全 0条选择模型。 对编码指示横条第 k ( 0 k 7 ) 条以及纵条第 k ( 0 < k < 7 )条是否全 0的比特单独分配不同的概率模型, 具体编码某一条的比特, 再根据左边已编码系数块对应位置条是否全 0 分配 2个概率模型, 一共 32个概率模型。 也就是根据这个比特是对应横 条第 k条或者竖条第 k条(k可能取值 0〜7 ) , 还有左边已编码系.数块同样 位置的条对应的这个比特的值是 0还是 1 (这个值在编码当前块时已知) 选择模型, 这样为这个比特一共设置了 32个模型。
然后, 编码 ( tiao— lnz - tiao— allno ) , 即最后一个含有非 0系数的条 的位置与第一个全 0条的位置之差: 如果是横条模式, 则编码 ( hengtiao— lnz - hengtiao一 allno ) ; 否则 , 编码 ( shutiao_lnz ― shutiao_allno ) , 确定最后一个含有非 0系数的条的位置 tiao__lnz。
由于 tiao— lnz不可能等于 tiao— allno, ( tiao— lnz - tiao— allno )的差值可 能取值为 {-1 }U{ 1,2,3... }。 ( tiao— lnz - tiao— allno ) 的二值化方法可以用 一元码方法, 即映射关系为 - 1->0,1->10,2->110,3->1110, 。 对二值化 得到的 bin, 第一个 bin单独给一个概率模型, 后面的 bin可以合用一个概 率模型, 也可分配各自的概率模型。
将所有系数分为若干条组以后, 逐条组编码所有系数。 的实现方案。 显然, 在上述方案下, 需要编码的系数有第一个全 0条到 最后一个非全 0条之间的所有系数, 以及第一个全 0条之前的全部系数。
首先 , 编码位于第一个全 0条到最后一个非全 0条之间的所有系数。
如对表 10所示的系数块编码, 则应采用竖条模式, 第一个全 0竖条 是第 2条, 最后一个非全 0竖条是第 6条, 需要编码的是竖条第 2条到第 6 条之间的全部系数, 相应的系数的取值大多数情况下非 0即 1 , 可以称为 非 0即 1条组, 而且 0、 1分布比较没有规律。
7 5 0 0 0 0 0 0
-7 0 Q G 0 0 1 0
0 -4 0 0 0 0 □ 0
2 一 1 0 0 0 0 0 0
- 1 0 0 0 0 0 0 0
1 0 0 0 0 0 0 0
0 0 0 0 1 0 0 0
0 0 0 0 0 0 0 0 表 10
编码非 0即 1条组中各条系数的方法是多种多样的, 具体可以为: 横条模式下从上至下编码各条系数, 每条从左至右编码各个系数; 竖条模式下从左至右编码各条系数, 每条从上至下编码各个系数。 编码一个比特 allO_back—gtl, allO—back_gtl用于指示是否从 tiao— allno 以后各条的系数值非 0即 1, 为这个比特分配一个概率模型; 例如, 表 10 中竖条第 3, 4, 5, 6条的系数值非 0即 1 , 对应的比特则为 0。
编码一个比特指示当前条是否为全 0条, 为这个比特分配一个概率 模型。 表 10中编码竖条第 3 , 4, 5 , 6条, 对应的指示是否全 0的比特分 别是 1 , 0, 1, 0。
如果当前条不是全 0条, 则按照顺序编码各个系数。 编码系数先编 码其绝对值, 之后编码其符号。 编绝对值采用一元码二值化的方法。 第 一个 bin决定其绝对值是 0还是大于 0, 根据这个系数的位置分配概率模 型。
具体可以为每个位置的系数分配一个概率模型, 也可若干位置的系 数合用一个概率模型, 例如, 在编码横条系数时, 从左至右, 其位置从
第 0个到第 7个分配 4个概率模型,这 4个概率模型分别用于位置 0, 1, (2, 3) , (4, 5, 6, 7)这四组位置上的系数的第一个 bin的编码。
如果从 tiao— allno以后各条的系数值非 0即 1 , 每个系数的绝对值只可 能取值 0或者 1, 无后续 bin; 否则, 对绝对值大于 0的系数的绝对值, 还 需要继续编码后面的 bin, 指示其绝对值是 1还是大于 1, 如果大于 1, 是 2 还是大于 2, ......。 后面的 bin可分开分别分配概率模型, 也可以统一分 配同一个概率模型编码。
本发明中, 编码 tiao— lnz (非全 0条) 的位置的方法也可以仿照编码 tiao— allno的方法, 根据已编码相邻系数块的对应条是否含有非 0系数来 编码当前条。 例如, 对当前块从第 tiao— allno条起往后, 每条编码一个比 特, 指示此条后面各条是否全 0, 如果编码到某条这个比特指示此条后 面全 0, 则这一条就是最后一个非全 0条(如果此条不是第 tiao— allno条) , 或者第 ( tiao— allno - 1 )条是最后一个非全 0条(如果此条是第 tiao— allno 条) 。 这个比特的概率模型分配可以类似编码 tiao— allno, 先根据是横条 第 k (0<k<7)条以及纵条第 k (0<k<7)条分类, 然后根据已编码相 邻系数块对应位置的条是不是最后一个全 0条分配 2个概率模型。
然后, 编码第一个全 0条以前的全部系数。
以表 11所示的系数块为例说明编码第一个全 0条以前各条的全部系 数的方法。 ·
7 5 0 □ 0 0 0 0
-7 0 0 0 0 0 1 □
0 -4 0 0 □ 0 □ 0
2 -1 0 0 0 0 0 0
-1 0 0 □ 0 0 0 0
1 0 0 0 0 □ □ □
1 0 0 0 1 0 0 0
0 D 0 0 0 0 0 0
表 11
编码这些条系数的方法是多种多样的, 下面给出一个可行的具体方 案: 对于横条组模式, 则从下至上编码各条系数, 每条从右至左编码各 个系数值; 对于竖条组模式, 则从右至左编码各条系数, 每条从下至上 编码各个系数值。
例如, 表 11所示的系数块按照竖条组模式编码, 第一个全 0条是第 2 条, 编码第 2竖条之前各条的系数, 首先编码第 1条, 从下往上编码各系 数, 然后编码第 0条, 从下往上编码各系数。
在编码当前系数条包含的各系数之前, 根据已编码的后面一条的最 后一个非 0系数的位置对当前条的最后一个非 0系数的位置做估计。 以表 11所示的系数块为例, 编码第 0竖条时, 第 1竖条已经编码完成, 其最后 一个(非 0系数- 1 )位置为 3 , 从统计特点看, 大多系数块第 0竖条的最 后一个非 0系数的位置不小于第 1竖条的最后一个非 0系数的位置, 这意 味着已编码的后面一条的最后一个非 0系数的位置包含一定的当前条的 最后一个非 0系数的位置的信息, 因此, 可利用该信息进行编码压缩。
下面给出一种可行的压缩编码方案, 说明如何利用已编码的后面一 条的最后一个非 0系数的位置对当前条的最后一个非 0系數的位置做估 计。
如果已编码的后面一条的最后一个非 0系数的位置小于 6, 则首先编 码一个比特, 确定当前条的最后一个非 0系数的位置是否小于 6。 这个比 特的模型根据已编码的后面一条的最后一个非 0系数的位置选择。 已编 码的后面一条的最后一个非 0系数的位置可能取值- 1 ~ 5, - 1意味着已 编码的后面一条全 0 , 对应分配给这个比特 7个概率模型。
如果当前条的最后一个非 0系数的位置不小于 6, 则再编码一个比 特, 确定当前条的最后一个非 0系数的位置是 6还是 7, 这个比特的概率 模型根据已编码的后面一条的最后一个非 0系数的位置选择, 一共有 7个
概率模型; 否则, 当前条的最后一个非 0系数的位置不大于 5。
如果当前条的最后一个非 0系数的位置或者被确定为 6或 7, 则首先 编码最后一个非 0系数的绝对值, 然后编码其符号, 编码其绝对值采用 一元码的二植化方法, 第一个 bin分配一个概率模型, 后续 bin共用一个 概率模型, 然后从最后一个非 0系数的前一个系数起往前逐个编码系数 值。 例如, 表 11中编码竖条第 0条, 其已编码的后面一条的最后一个非 0 系数的位置为 3 , 当前条的最后一个非 0系数的位置被确定为 6。 第 0竖条 位置 6的系数首先编码, 然后从第 0竖条位置 5的系数往上逐个编码系数 至第 0竖条位置 0的系数。
如果当前条的最后一个非 0系数的位置被确定为不大于 5, 则从当前 条第 5个位置的系数往前逐个编码系数值。例如,表 11中编码竖条第 1条, 其已编码的后面一条的最后一个非 0系数的位置为 - 1 , 当前条的最后一 个非 0系数的位置被确定为不大于 5。 从第 1竖条位置 5的系数往上逐个编 码系数至第 1竖条位置 0的系数。
如果已编码的后面一条的最后一个非 0系数的位置不小于 6, 则直接 从当前条最后一个位置第 7个位置的系数往前编码逐个系数值。
在编码每个系数条的系数绝对值时, 采用根据相邻已编码系数中的 绝对值最大的那个系数分类的方案, 具体描述如下:
当前编码系数的位置是(jj,ii ) , jj是其横坐标, ii是其纵坐标, 例 如表 11所示的系数块中系数 7的坐标是( 0,0 ) , 系数 - 7的坐标是 ( 1,0 ) , 系数 5的坐标是(0,1 ) 。 根据上面描述的编码顺序, 如果位置(jj + l,ii ) 或者 (jj,ii + l )上有系数的话, 则这些系数是已经被编码过的系数, 将 这两个位置上的系数称为当前系数的相邻系数, 根据当前系数的相邻系 数中绝对值最大的那个绝对值(记为 max— neighbor )进行分类。
例如, 表 11所示的系数块中位置(0,0 )的系数 7, 其相邻系数为 - 7
和 5 , max— neighbor等于 7。 可根据 max— neighbor分成若干类型, 对每一 类, 可以分别设定二值化方法并分配模型。 根据 max— neighbor分类, 以 及每一类中的编码二值化和模型分配的方法是多种多样的。
下面举一例说明具体的分类实现方法, 例如:
根据 max— neighbor为 0, 1 , 2, 以及大于 2分为 A, B , C, D四类; 对于 max— neighbor为 0, 称为 A类, 采用一元码的二值化方法, 第一 个 bin区分当前系数绝对值是 0还是大于 0,分配一个概率模型;第一个 bin 区分当前系数绝对值是 1还是大于 1 , 分配一个概率模型; 后面的 bin共用 一个概率模型;
对于 max— neighbor为 1, 称为 B类, 第一个 bin区分当前系数绝对值是 否小于或等于 1, 为之分配一个概率模型。 如果第一个 bin为 0 (当前系数 绝对值小于或等于 1 ) , 第二个 bin区分当前系数绝对值是 0还是 1 , 为之 分配一个概率模型; 否则, 后续第二个 bin区分当前系数绝对值是 2还是 大于 2, 第二个 bin区分当前系数绝对值是 3还是大于 3 , 第三个 bin区分当 前系数绝对值是 4还是大于 4...这些 bin可以单独分配概率模型,也可共用 一个概率模型。
对于 C, D类, 其二值化和分配模型的方式也是多种多样的, 可以按 照 A类或者 B类的方法编码, 当然,也可单独设计更为高效的二值化和概 率模型分配方案。
所述的相邻的系数还包括左斜下方、 左斜上方、 右斜下方和右斜上 方的已经编码的系数, 并根据相应的系数值进行分类。
对于横条编码模式, 当前系数位置(jj,ii ) 的左斜下方位置为 (jj + l,ii - 1 )的系数(如果存在), 右斜下方位置为( jj + Ι,η + 1 )的系数(如 果存在)也已经被编码, 这两个系数也可作为当前系数的相邻系数被用 于计算相邻系数的最大值, 即用位置(jj + l,ii ), (jj,ii + l )和(jj + i
- 1 )上的系数绝对值中的最大值计算 max— neighbo
对于竖条编码模式, 当前系数位置 (jj,ii ) 的右斜上方位置为 (jj - l,ii + l ) 的系数(如果存在)也已经被编码, 这个系数也可作为当前系 数的相邻系数被用于计算相邻系数的最大值,即用位置(jj + l,ii ) , (jj,ii + 1 )和( jj + l,ii - 1 )上的系数绝对值中的最大值计算 max_neighbor。
对倒 L条组在编码过程中与前面描述不同之处说明如下。
编码条组中的倒 L条的条组分界系数条的位置和编码横竖条组分界 系数条的方法是一样的, 从第一个倒 L条起, 编码一个 bin指示其是否是 条组分界系数条。 Bin的概率模型根据条的位置以及相邻块同一位置条所 对应的这个 bin的值分配概率模型;
在编码过程中, 具体可以倒着编码各个倒 L条的系数, 对每一个倒 L 条, 先编码其横条所有系数, 再编码竖条所有系数, 最后编码位置处于 对角线上的那个系数。 编码横条所有系数时, 根据已编码的下一个倒 L 条的横条的最后一个非 0系数的位置估计当前倒 L条横条的最后一个非 0 系数的位置; 编码竖条所有系数时, 根据已编码的下一个倒 L条的竖条 的最后一个非 0系数的位置估计当前倒 L条竖条的最后一个非 0系数的位 置; 对最后一个非 0系数位置确定的情况而言, 其最后一个非 0系数用一 元码方式二值化, 并且单独分配概率模型。 同样, 在编码各个系数时, 可以根据其相邻位置的系数的最大值分类, 具体的分类方式前面已经描 述, 这里不再详述。
对于 J条组可以采用以下编码方案,这样对于一些类型的系数块如非 零系数分布比较^:的系数块可以获得更好的编码效率。 具体过程说明 如下:
( 1 )首先对全系数块 block8x 8统计, 写入一个比特如 allOl表示该系 数块非 0系数是否全为 1。
6
(2)对全系数块进行第一层分组, 先编 block8x8— J即 J4~J7, 然后 编 block4x4即 JO ~ J3。 编码 block8 χ 8—: [时, 首先写入一个比特如 block8x8— J—A110标识该条组系数是否全为零,如果全为零,则对 block4x4 块进行编码; 如果不全为零, 则对 block8x8_J进行第二层分组编码, 然 后写入一个比特标识 block4x4块是否全为 0, 如果不是全 0, 对 block4x4 块进行编码。
( 3 )在对 block8 X 8— J第二层分組编码中 , 先对 block8 x 8_J_1即 J6~J7 进行编码, 再对 block8x8— J— 0即 J4~J5进行编码。 编码 block8x8— J— 1时, 首先写入一个比特如 block8x8_J— 1— A110标识该条组是否全为零, 如果全 为零, 直接编码 block8x8—J— 0; 如果不全为零, 对 block8x8j— 1进行第 三层分组编码, 然后写入一个比特表示 block8x8J_0是否全为零, 如果 不是全 0, 对 block8x8— J— 0进行第三层分組编码。
(4)在对 block4x4第二层分组编码中, 采用与 block8x8第一层相似 的分组编码方法。先编码 block4x4— J即 J2~J3,然后编码 block2x2即 J0~J1。 编码 block4x4—J时, 首先写入一个比特如 block4x4—J_A110标识该条组是 否全为零, 如果全为零, 直接编码 block2x2, 此时 block2x2中肯定有非 0 系数, 因为 block4x4的系数不可能为全 0; 否则对 block4x4— J进行第三层 分組编码, 然后写一个比特表示 block2x2块是否全为 0, 如果不是全 0, 对 block2x2编码。
(5) 第三层分组编码中, 编码的条组包含, 两个 J条, 首先编码右 下方 J条, 然后编码左上方 J条。 编码右下方 J条时, 首先写入一个比特标 识该条是否全为零, 如果全为零, 直接编码左上方 J条, 此时左上方 J条 中肯定有非 0系数, 因为编码的 J条組不可能为全 0; 否则编码右下方 J条, 然后写入一个比特标识左上方 J条是否全为零, 如果不是全 0, 编码该 J 条。
完成对各个 J条组的编码后, 还需要对 J条组包含的各 J条进行编码, 相应的编码方法如下所述:
( 1 )对每个 J条 ( J0-J7 )进行编码时, 首先编码位置信息, 然后编 码绝对值。 编码位置信息和编码绝对值信息的扫描方向相反, 如图 1所 示,图 1是 J条编码方式示意图。图 1中横条和竖条不包括頂角位置的系数, 当然顶角位置的系数可以归并到横条或者竖条中。
( 2 )编码位置信息, 也即这个位置上的系数是否非 0。 首先编码横 条系数位置信息, 然后是竖条位置信息。
横条位置信息编码方法是: 编码位置信息前写入一个比特, 标志该 横条是否为全 0, 如果是, 则跳过横条位置信息编码过程, 否则, 按照 位置信息编码方向编码。 编码时首先写入信息确定该位是否为零, 如果 是零则写下一个位, 如果不为零再写入信息确定是否是最后一个非 0系 数, 如果不是最后一个则继续, 否则结束。 但是当编码到最后一个位置 还没有遇到最后一个非 0系数, 那么一定是最后一位, 此时不需要写入 任何比特;
对竖条位置信息编码可以采用类似横条位置信息的编码方法。
( 3 )编码系数值信息。 据位置信息, 如果该条中有非 0系数, 则 编码该系数。首先写入该系数的符号信息,然后编码系数的绝对值减一。
其中所述的编码系数绝对值的方法如下:
( 1 )根据 allOl判断, 如果该系数块系数非 0即 1 , 那么编码该系数 的符号即可。
( 2 )如果该系数块有大于 1的系数, 那么根据相邻系数的信息对当 前编码系数分类。 选择 ctx进行编码。 具体的方法描述如下:
当前编码系数的位置是 (jj,ii), jj是其行坐标, ii是其列坐标, 例如, 表 11中系数 7的坐标是 (0,0),系数- 7的坐标是 (1,0),系数 5的坐标是 (0,1)。
根据上面描述的编码顺序, 如果位置 (jj + l,ii)或者 (jj,ii + 1)上有系数的 话, 这些系数已经被编码过了。 这两个位置上的系数称为当前系数的相 邻系数。 根据当前系数的相邻系数中绝对值最大的那个绝对值即 max— neighbor进行分类。 例如表 11中位置 (0,0)的系数 7, 其相邻系数为- 7和 5, max— neighbor等于 7。 可才艮据 max— neighbor分成若干类型, 对每一 类, 可以分别设定二值化方法并分配模型。 根据 max— neighbor分类, 以 及每一类中的编码二值化和模型分配的方法是多种多样的。
下面举一例说明具体的分类实现方法。
例如, 根据 max— neighbor为 0, 1, 2, 以及大于 2分为 A, B, C, D 四类。 具体可以为:
对于 max— neighbor为 0(A类), 采用一元码的二值化方法, 第一个 bin 区分当前系数绝对值是 0还是大于 0, 分配一个模型; 第一个 bin区分当前 系数绝对值是 1还是大于 1 , 分配一个模型; 后面的 bin共用一个模型; 对于 max— neighbor为 1 (B类), 第一个 bin区分当前系数绝对值是否小 于或等于 1 , 为之分配一个模型。 如果第一个 bin为 0(当前系数绝对值小 于或等于 1),'第二个 bin区分当前系数绝对值是 0还是 1 , 为之分配一个模 型; 否则,后续第二个 bin区分当前系数绝对值是 2还是大于 2, 第二个 bin 区分当前系数绝对值是 3还是大于 3, 第三个 bin区分当前系数绝对值是 4 还是大于 4...这些 bin可以单独分配概率模型, 也可共用一个模型;
对于 C, D类, 其二值化和分配模型的方式也是多种多样的, 可以按 照 A类或者 B类的方法编码,也可单独设计更为高效的二值化和概率模型 分配方案。
在针对各个 bin的概率模型的选择过程中,由于概率模型的估计值受 到序列, 分辨率, QP等诸多因素的影响, 如果把这些因素都考虑进去, 其模型会极其复杂, 难以实现。 而仅仅考虑 QP的影响并不能在绝大多数
2006/002036 获得一个好的初始概率估计值。 因此, 在编码初期, 可以通过加快自适 应估计的方法以达到提高编码初期压缩效率的目的。
为此, 本发明在编码初期, 也即对每个 ctx编码的前 10个 bin, 如果 出现 MPS, 其 state值调整的步长为现有方法中的两倍。 现有方法中每出 现一个 MPS, state值向 MPS概率估计值增大的方向调整,具体方式为 state 值加 1, 称作跳转步长为 1, 本发明中, 此时 state值加 2, 称作跳转步长为 2。 如果出现的不是 MPS, state值向 MPS概率估计值减小的方向调整, 这 种情况下调整的方法和现有技术一样。
实验数据表明, 本发明对数据快进行编码的方法中初始化方法能够 在编码初期比较快的获得好的概率估计值。
综上所述, 本发明提出了对系数块全新的编码方法, 在与 H.264复 杂度相当的情况下能够有更优的压缩效率, 而且省去了扫描和反扫描的 过程。
结合本发明方法, 还提出了一种对系数块进行编码的装置, 图 2是 本发明对系数块进行编码的装置的组成示意图, 如图 2所示, 该装置包 括: 条组设置单元和编码单元; 其中,
条组设置单元, 存储有预定规则, 接收图像编码中变换量化后的系 数块, 按照预定规则确定一种条组模式, 并对接收到的系数块按照确定 的条組模式划分条组; 将划分后的条组发送给编码单元;
编码单元, 对接收到的条组进行编码并输出编码流。
所述条组设置单元包括:确定条组模式单元和条組划分单元;其中, 确定条组模式单元, 存储有预定规则, 按照预定规则确定一种条组 模式, 并通知条组划分单元;
条组划分单元, 接收图像编码中变换量化后的系数块, 并对接收到 的系数块按照确定的条组模式划分条组; 将划分后的条组发送给编码单
元。
以上所述, 仅为本发明的较佳实施例而已, 并非用于限定本发明的 保护范围, 凡在本发明的精神和原则之内所做的任何修改、 等同替换、 改进等, 均应包含在本发明的保护范围之内。
Claims
1、 一种对系数块进行编码的方法, 其特征在于, 包括:
A、 按照预定规则确定一种条组模式, 对图像编码中变换量化后的 系数块按照确定的条组模式划分条组;
B、 基于划分的条组对所述的系数块进行编码。
2、 根据权利要求 1所述的方法, 其特征在于, 所述系数块使用的条 组模式为: 横条组, 或竖条组, 或斜条組, 或 J条组, 或倒 L条组;
不同的系数块使用不同的条组模式或者相同的条组模式。
3、 根据权利要求 1所述的方法, 其特征在于, 所述条组中的每个条 组包含一个以上系数条或一个系数条。
4、 根据权利要求 1所述的方法, 其特征在于, 步骤 A中所述划分条 组的方法为:
将所述系数块的各个系数条中包含全 0条、 和 /或非 0即 1条和 /或大于 1条的系数条, 分别划分组成相应的全 0条条组、 和 /或非 0即 1条条组和 / 或大于 1条奈组。
5、 根据权利要求 4所述的方法, 其特征在于, 步骤 A中所述划分条 组的方法还包括:
以所述系数块中从前到后第一个出现的全 0条为分界线, 该条之前 的系数条作为一个条组, 该条以后的系数条作为一个条组。
6、 根据权利要求 5所述的方法, 其特征在于, 步骤 A中所述划分条 組的方法还包括:
将所述第一个出现的全 0条以后的系数条再划分为两个条组, 一个 条组包括有非 0系数, 另一个条组系数值全部为零。
7、 根据权利要求 4所述的方法, 其特征在于, 步骤 A中所述划分条 組的方法还包括:
以所述系数块中从前到后的最后一个非 0条为分界线, 该条以后的 系数条作为一个全 0条组, 该条以前的系数条再以最后一个包含大于 1的 系数条作为分界线, 之前为一个大于 1条组, 之后为一个非 0即 1条組。
8、 根据权利要求 1所述的方法, 其特征在于, 步骤 A中所述确定条 组模式的方法为: 根据所述系数块中 0、 1及大于 1的系数的位置分布特 性选择一种条组模式。
9、 根据权利要求 8所述的方法, 其特征在于, 在仅使用横条组模式 或竖条组模式的情况下, 所述确定的方法具体为: 分别确定所述系数块 的横向和纵向最后一个含有非 0系数的非全 0系数条的位置和第一个全 0 系数条的位置, 基于上述位置确定采用横条组模式或竖条组模式。
10、 根据权利要求 1、 8或 9所述的方法, 其特征在于, 该方法还包 括: 根据相邻系数块选择的编码模式确定当前系数块的编码模式。
11、 根据权利要求 1所述的方法, 其特征在于, 步骤 A中所述确定条 组模式的方法为: 对所述系数块分别采用不同的条组模式进行编码, 并 选择压缩效率最高的条组模式确定为该系数块的条组模式。
12、 根据权利要求 1所述的方法, 其特征在于, 当采用 J条组进行编 码时, 所述步骤 B具体包括:
B 1、 对各个 J条组分别进行编码处理;
B2、 确定任一J条组符合预定的条件时, 则将该 J条组进一步划分为 若干 J条组, 并执行步骤 Bl。
13、根据权利要求 12所述的方法,其特征在于,所述的步骤; B2包括: B21、判断当前 J条組中的系数是否为全 0,如果是,则执行步骤 B22, 否则, 如果该 J条组包含多个 J条, 则执行步骤 B23, 如果不包含多个 J条, 则直接执行步骤 B1;
B22、 选择下一条 J条組, 并执行步骤 B21;
B23、 将该 J条组进一步划分为若干 J条组, 并执行步骤 Bl。
14、根据权利要求 12所述的方法,其特征在于,所述步骤 B1还包括: 在对各个 J条组中包含的各个系数进行编码处理过程中 ,当编码任一
J条组内系数是否为全 0的信息时, 则该信息的概率模型的分配取决于已 编码条组中的系数值信息。
15、 根据权利要求 14所述的方法, 其特征在于, 所述已编码条组中 的系数值信息包括: 已编码条组中若干条组的非 0系数个数, 或者, 非 0 系数之和。
16、 根据权利要求 14所述的方法, 其特征在于, 设定一个门限值 G, 在每个所述概率模型编码前 G个符号时 , 出现大概率符号 MPS调整状态 state值的跳转步长为大于或等于 2。
17、 根据权利要求 1所述的方法, 其特征在于, 所述条组为 J条组, 步骤 B中所述编码的方法包括:
在编码 J条组中的各个 J条的横向或者竖向分支条之前先确定相应分 支条是否为全 0系数, 如果是, 则直接编码一个符号, 否则, 继续对 J条 的横向或竖向分支条包含的各系数进行编码。
18、根据权利要求 17所述的方法, 其特征在于, 所述编码 J条组中具 体的横向分支条或者竖向分支条的方法具体为:
依次从左向右编码横向条位置信息, 从上至下编码竖向条位置信 息, 从横向条最后一个非 0系 从右至左编码横向条非 0系数值信息, 从竖向条最后一个非 0系数起从下至上编码竖向条非 0系数值信息;
或者,
依次从左向右编码横向条位置信息, 从横向条最后一个非 0系数起 从右至左编码横向条非 0系数值信息, 从上至下编码竖向条位置信息, 从竖向条最后一个非 0系数起从下至上编码竖向条非 0系数值信息。
19、根据权利要求 1所述的方法,其特征在于,所述步骤 B具体包括: 在编码各个条组包含的系数条的过程中, 当编码一个系数条的全部 系数时, 根据已编码的系数条的最后一个非 0系数的位置对当前系数条 的最后一个非 0系数的位置进行估计, 并根据估计的位置信息对当前系 数条进行编码。
20、根据权利要求 1所述的方法,其特征在于,所述步骤 B具体包括: 在编码各个条組包含的系数条的过程中, 当编码一个系数条的全部 系数时, 如果该系数条的最后一个非 0系数的位置被完全确定, 最后一 个非 0系数采用一元码方法编码但不限于一元码编码, 并为该系数单独 分配相应的概率模型。
21、根据权利要求 1所述的方法,其特征在于,所述步骤 B具体包括: 对作为条组分界的分界系数条的位置编码时, 在码流中采用标识符来标 记该条是否为分界系数奈, 并为该标识符分配概率模型。
22、 根据权利要求 21所述的方法, 其特征在于, 所述步驟 B还包括: 根据当前系数 ' 条的位置以及相邻系数块已经编码的信息为编码当前系 数条是否为全 0的信息符号分配概率模型。
23、 根据权利要求 22所述的方法, 其特征在于, 所述步骤 B还包括: 为所述符号中的多个符号分配相同的概率模型。
24、 根据权利要求 22所述的方法, 其特征在于, 所述步骤 B还包括: 当作为条组分界的分界系数条为多个时, 则在编码后面的分界系数条的 位置时基于先前已编码的分界系数条的位置进行编码。
25、根据权利要求 1所述的方法,其特征在于,所述步骤 B具体包括: 对条組包含的各个系数按照各自的扫描顺序的反向顺序依次进行编码。
26、 根据权利要求 25所述的方法, 其特征在于, 所述各自的扫描顺 序分别为:
对于竖条组, 从左到右、 从上到下按照 "之" 字形扫描所有系数; 对于横条组, 从上到下、 从左到右按照 "之" 字形扫描所有系数; 对于斜条组, 从左上到右下按照 "之" 字形扫描所有系数; 对于倒 L条组, 从左到右, 依次对各倒 L条先从左到右, 后从上到下 扫描所有系数, 或者, 从左到右, 依次对各倒 L条先从上到下, 后从左 到右扫描所有系数。
27、 根据权利要求 1所述的方法, 其特征在于, 在所述步骤 B中: 当对条组包含的条中的系数进行编码时, 居已编码的相邻位置的 系数信息作为编码当前系数的分类标准进行分类, 并且:
分别为不同的类设置各自的二值化方案, 或者多值化方案, 以及编 码各个符号的概率模型 , 或者多值化符号串各个符号的概率模型;
或者, 为若干个类设置相同的二值化方案, 或者多值化方案, 以及, 为若干个类设置相同的编码各个符号的概率模型, 或者为若干个类设置 相同的编码各个多值化符号串各个符号的概率模型。
28、 根据权利要求 27所述的方法, 其特征在于, 所述相邻位置的系 数信息包括: 相邻系数中的最大值。
29、 一种对系数块进行编码的装置, 其特征在于, 该装置包括: 条 组设置单元和编码单元; 其中,
条组设置单元, 存储有预定规则, 接收图像编码中变换量化后的系 数块, 按照预定规则确定一种条组模式, 并对接收到的系数块按照确定 的条组模式划分条组; 将划分后的条組发送给编码单元;
编码单元, 对接收到的条组进行编码并输出编码流。
30、 根据权利要求 29所述的装置, 其特征在于, 所述条组设置单元 包括: 确定条組模式单元和条组划分单元; 其中,
确定条组模式单元, 存储有预定规则, 按照预定规则确定一种条组
模式, 并通知条组划分单元;
条组划分单元, 接收图像编码中变换量化后的系数块, 并对接收到 的系数块按照确定的条组模式划分条组; 将划分后的条组发送给编码单 元。
Applications Claiming Priority (4)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN200510092546 | 2005-08-15 | ||
| CN200510092546.5 | 2005-08-15 | ||
| CN200510093682.6 | 2005-09-01 | ||
| CN 200510093682 CN1917645B (zh) | 2005-08-15 | 2005-09-01 | 对系数块进行编码的方法 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2007019790A1 true WO2007019790A1 (fr) | 2007-02-22 |
Family
ID=37738512
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2006/002036 Ceased WO2007019790A1 (fr) | 2005-08-15 | 2006-08-11 | Procede et appareil de codage d'un bloc de coefficients |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN1917645B (zh) |
| WO (1) | WO2007019790A1 (zh) |
Cited By (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2009033432A1 (fr) * | 2007-09-14 | 2009-03-19 | Huawei Technologies Co., Ltd. | Procédé et appareil pour codage et décodage vidéo |
| CN101682786A (zh) * | 2007-05-16 | 2010-03-24 | 汤姆森特许公司 | 解码多视图视频编码信息中使用码片组的方法和装置 |
| US8831107B2 (en) | 2007-09-14 | 2014-09-09 | Tsinghua University | Method and device for video coding and decoding |
| WO2024096896A1 (en) * | 2022-11-02 | 2024-05-10 | Google Llc | Jointly designed context model and scan order for transform coefficient coding |
| WO2024096895A1 (en) * | 2022-11-02 | 2024-05-10 | Google Llc | Wavefront scan order for transform coefficient coding |
Families Citing this family (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101771868B (zh) * | 2008-12-31 | 2016-03-02 | 华为技术有限公司 | 对图像的量化处理方法及装置 |
| CN112449188B (zh) * | 2019-08-28 | 2021-08-20 | 腾讯科技(深圳)有限公司 | 视频解码方法、编码方法、装置、介质及电子设备 |
| WO2023240662A1 (zh) * | 2022-06-17 | 2023-12-21 | Oppo广东移动通信有限公司 | 编解码方法、编码器、解码器以及存储介质 |
Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN1386380A (zh) * | 2000-06-01 | 2002-12-18 | 皇家菲利浦电子有限公司 | 视频信号编码和缓存器管理 |
| WO2004100150A2 (en) * | 2003-05-12 | 2004-11-18 | Koninklijke Philips Electronics N.V. | Iterative stripewise trellis-based symbol detection method and device for multi-dimensional recording systems |
| CN1596536A (zh) * | 2002-09-27 | 2005-03-16 | 三菱电机株式会社 | 图像编码装置、图像编码方法及图像处理装置 |
Family Cites Families (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US4776030A (en) * | 1986-03-28 | 1988-10-04 | Gte Laboratories Incorporated | Block quantizer for transform coding |
| US5748244A (en) * | 1995-03-28 | 1998-05-05 | Daewoo Electronics Co., Ltd. | Adaptive runlength coding based on zero and non-zero subblocks |
| US5790706A (en) * | 1996-07-03 | 1998-08-04 | Motorola, Inc. | Method and apparatus for scanning of transform coefficients |
-
2005
- 2005-09-01 CN CN 200510093682 patent/CN1917645B/zh not_active Expired - Fee Related
-
2006
- 2006-08-11 WO PCT/CN2006/002036 patent/WO2007019790A1/zh not_active Ceased
Patent Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN1386380A (zh) * | 2000-06-01 | 2002-12-18 | 皇家菲利浦电子有限公司 | 视频信号编码和缓存器管理 |
| CN1596536A (zh) * | 2002-09-27 | 2005-03-16 | 三菱电机株式会社 | 图像编码装置、图像编码方法及图像处理装置 |
| WO2004100150A2 (en) * | 2003-05-12 | 2004-11-18 | Koninklijke Philips Electronics N.V. | Iterative stripewise trellis-based symbol detection method and device for multi-dimensional recording systems |
Cited By (13)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US10158886B2 (en) | 2007-05-16 | 2018-12-18 | Interdigital Madison Patent Holdings | Methods and apparatus for the use of slice groups in encoding multi-view video coding (MVC) information |
| CN101682786A (zh) * | 2007-05-16 | 2010-03-24 | 汤姆森特许公司 | 解码多视图视频编码信息中使用码片组的方法和装置 |
| CN101682786B (zh) * | 2007-05-16 | 2016-05-18 | 汤姆森特许公司 | 解码多视图视频编码信息中使用码片组的方法和装置 |
| US9883206B2 (en) | 2007-05-16 | 2018-01-30 | Thomson Licensing | Methods and apparatus for the use of slice groups in encoding multi-view video coding (MVC) information |
| US8831107B2 (en) | 2007-09-14 | 2014-09-09 | Tsinghua University | Method and device for video coding and decoding |
| US9769482B2 (en) | 2007-09-14 | 2017-09-19 | Huawei Technologies Co., Ltd. | Method and device for video coding and decoding |
| WO2009033432A1 (fr) * | 2007-09-14 | 2009-03-19 | Huawei Technologies Co., Ltd. | Procédé et appareil pour codage et décodage vidéo |
| US10432938B2 (en) | 2007-09-14 | 2019-10-01 | Huawei Technologies Co., Ltd. | Method and device for video coding and decoding |
| US10939112B2 (en) | 2007-09-14 | 2021-03-02 | Huawei Technologies Co., Ltd. | Method and device for video coding and decoding |
| US11659184B2 (en) | 2007-09-14 | 2023-05-23 | Huawei Technologies Co., Ltd. | Method and device for video coding and decoding |
| US12382046B2 (en) | 2007-09-14 | 2025-08-05 | Huawei Technologies Co., Ltd. | Method and device for video coding and decoding |
| WO2024096896A1 (en) * | 2022-11-02 | 2024-05-10 | Google Llc | Jointly designed context model and scan order for transform coefficient coding |
| WO2024096895A1 (en) * | 2022-11-02 | 2024-05-10 | Google Llc | Wavefront scan order for transform coefficient coding |
Also Published As
| Publication number | Publication date |
|---|---|
| CN1917645B (zh) | 2012-12-19 |
| CN1917645A (zh) | 2007-02-21 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN104272735B (zh) | 针对视频的上下文自适应二进制熵编码的变换系数编码 | |
| KR101356733B1 (ko) | 컨텍스트 기반 적응적 이진 산술 부호화, 복호화 방법 및장치 | |
| CN102771125B (zh) | 使用树形结构的编码/解码方法和装置 | |
| KR100751869B1 (ko) | 적응 블록 변환을 위한 콘텍스트-기반 적응 가변장 부호화 | |
| JP4057595B2 (ja) | 変換係数を算術符号化、復号化するための方法と装置および対応するコンピュータプログラムと対応するコンピュータによる読み出し可能な記憶媒体 | |
| EP3270591B1 (en) | Modified coding for a transform skipped block for cabac in hevc | |
| CN111083476B (zh) | 编码和解码视频数据的方法及视频数据编码器和解码器 | |
| US20140286417A1 (en) | Data encoding and decoding | |
| JP2006014342A5 (zh) | ||
| CN103636203A (zh) | 内部预测模式编码的方法及装置 | |
| CN107257488A (zh) | 基于四叉树编码和解码自适应量化参数的方法及装置 | |
| CN102685487B (zh) | 图像编解码方法、图像编解码设备及网络系统 | |
| CN103597838A (zh) | 对末位有效系数的位置进行编码和解码的方法和设备 | |
| WO2012006738A1 (en) | Methods and devices for data compression using context-based coding order | |
| CN101742330B (zh) | 一种图像编码方法及装置 | |
| CN116074499B (zh) | 一种视频编解码方法及装置 | |
| CN108810532A (zh) | 图像解码装置 | |
| WO2007019790A1 (fr) | Procede et appareil de codage d'un bloc de coefficients | |
| GB2496210A (en) | Context adaptive (CABAC) data encoding and decoding | |
| CN101500159A (zh) | 一种图像熵编码、熵解码的方法及装置 | |
| CN100551064C (zh) | 变长编码方法及装置 | |
| CN104144347A (zh) | 一种基于可逆数据隐藏的h.264/avc视频i帧错误恢复方法 | |
| HK40064083B (zh) | 图像增强方法、装置及机器可读存储介质 | |
| CN116918328A (zh) | 视频信号编码/解码方法和存储由编码方法生成的数据流的记录介质 | |
| HK1217255B (zh) | 图像解码装置 |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application | ||
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 06775354 Country of ref document: EP Kind code of ref document: A1 |