WO2012015312A1 - Implementation of run level coding - Google Patents

Implementation of run level coding Download PDF

Info

Publication number
WO2012015312A1
WO2012015312A1 PCT/NO2011/000212 NO2011000212W WO2012015312A1 WO 2012015312 A1 WO2012015312 A1 WO 2012015312A1 NO 2011000212 W NO2011000212 W NO 2011000212W WO 2012015312 A1 WO2012015312 A1 WO 2012015312A1
Authority
WO
WIPO (PCT)
Prior art keywords
positions
zigzag
raster
current
coefficients
Prior art date
Application number
PCT/NO2011/000212
Other languages
French (fr)
Inventor
Lars Petter Endresen
Stian Selnes
Original Assignee
Cisco Technology, Inc
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Cisco Technology, Inc filed Critical Cisco Technology, Inc
Publication of WO2012015312A1 publication Critical patent/WO2012015312A1/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/90Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using coding techniques not provided for in groups H04N19/10-H04N19/85, e.g. fractals
    • H04N19/93Run-length coding
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods 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/129Scanning of coding units, e.g. zig-zag scan of transform coefficients or flexible macroblock ordering [FMO]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods 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/18Methods 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 a set of transform coefficients
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/42Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by implementation details or hardware specially adapted for video compression or decompression, e.g. dedicated software implementation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/60Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding
    • H04N19/61Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding in combination with predictive coding

Definitions

  • the invention is related to implementation of entropy coding/decoding of transform coefficient data of video compression systems in computer devices.
  • Transmission of moving pictures in real-time is employed in several applications like e.g. video conferencing, net meetings, TV broadcasting and video telephony.
  • the main goal is to represent the video information with as little capacity as possible. Capacity is defined with bits, either as a constant value or as bits/time unit. In both cases, the main goal is to reduce the number of bits.
  • the most common video coding method is described in the MPEG* and H.26* standards.
  • the video data undergo four main processes before transmission, namely prediction,
  • the prediction process significantly reduces the amount of bits required for each picture in a video sequence to be transferred. It takes advantage of the similarity of parts of the sequence with other parts of the sequence. Since the predictor part is known to both encoder and decoder, only the difference has to be transferred. This difference typically requires much less capacity for its
  • the prediction is mainly based on vectors representing movements.
  • the prediction process is typically performed on square block sizes (e.g. 16x16 pixels). Note that in some cases, predictions of pixels based on the adjacent pixels in the same picture rather than pixels of preceding pictures are used. This is referred to as intra prediction, as opposed to inter prediction.
  • the residual represented as a block of data still contains internal correlation.
  • a well-known method of taking advantage of this is to perform a two dimensional block transform.
  • H.263 an 8x8 Discrete
  • DCT Cosine Transform
  • H.264 uses a 4x4 integer type transform. This transforms 4x4 pixels into 4x4 transform coefficients and they can usually be represented by fewer bits than the pixel representation. Transform of a 4x4 array of pixels with internal correlation will
  • quantisation part is referred to as quantized transform coefficients .
  • Entropy coding is a special form of lossless data
  • RLE encoding
  • the DCT coefficients for a block are reordered to group together non-zero coefficients in an array, enabling efficient representation of the remaining zero-valued coefficients.
  • the zigzag reordering path (scan order) is shown in Figure 1.
  • the pattern of the order of the zig-zag scan is configured according to the probability of non-zero coefficients in each positions. Due to the characteristics of the preceding DCT, the probability of non-zero coefficients in a block decreases the downward right diagonal direction of a DCT block. When reordering the coefficients in a zigzag pattern as illustrated in figure 1, the non-zero coefficients will tend to
  • the output of the reordering process is i.e. an one
  • the array is further represented as a series of (run, level) pairs where run indicate the number of zeros preceding a nonzero coefficient, and level indicates the magnitude of the nonzero coefficient.
  • run-level values (0,16), (2,-3), (0,5), (0,6), (4,-7)...
  • WO-2010/077148 discloses an implementation of a process for representing transform coefficients in
  • Quantized transform coefficients representing a block of pixels in a video picture are packed to half the memory size, and then masked so as to generate an array of l's and 0's defining the positions of non-zero coefficients in the corresponding array of packed transform coefficients. This preparation avoids parsing through positions in the array of transform coefficients were zero values occur when generating run-level
  • the present invention provides a method in a video coding or decoding process in a computer device for calculating run and level representations of respective quantized transform coefficients representing pixel values in a block of a video picture which is inserted row by row in a one dimensional array C, wherein the method includes the steps of packing each quantized transform coefficients in C in a value interval [Max, Min] by setting all quantized
  • transform coefficients greater than Max equal to Max and all quantized transform coefficients less than Min equal to Min, masking C by generating an array M containing l's in positions corresponding to positions of C having non-zero values, and O's in positions corresponding to positions of C having zero values, setting a current raster position to zero, where a raster position refers to a raster scan order of the coefficients in the block, for each position
  • a current zigzag position deriving from current raster position through a table mapping raster positions to zigzag positions, where a zigzag position refers to a zigzag scan order of the coefficients in the block, if current zigzag position is not zero and if current zigzag position minus last zigzag position minus 1 is less than zero, then discarding all stored runs and levels and calculating new runs and levels with an
  • Figure 1 illustrates the zigzag pattern that is used in prior art to order the transform coefficients before entropy coding
  • Figure 2 illustrates the raster scan pattern that is used in the present invention
  • Figure 3 is a flow sheet illustrating how the run-level code is calculated according to MPEG4 and H.264,
  • Figure 4 is a flow chart illustrating a method of the type disclosed in WO-2010/077148 .
  • Figure 5 is a flow chart illustrating an example
  • application domains include systems software, device drivers, embedded software, high-performance server and client applications, and entertainment software as well as for implementing coding and decoding of real-time video in general purpose computers.
  • Figure 3 is a flow sheet illustrating how the run-level code according to MPEG4 and H.264 is calculated in a first implementation according to prior art.
  • the quantized coefficients are reordered to a one dimensional array according to the earlier mentioned zigzag pattern.
  • the process then enters into a loop for parsing the array for determining the run-level values. First it is checked whether the number of positions in the array is exceeded (I ⁇ 16) . If not, it is then checked whether current position in the array contains a zero. If so, both the Run variable and the position index (I) is incremented, and the process is proceeding to the start of the loop again. If not (current position contains a non-zero value) , the current Run variable and the value of the current position is stored as the Run-Level value. The Run variable is then reset, before both the Run variable and the position index
  • coefficients in C are zero, and it is computationally expensive to loop over all coefficients and check whether they are non-zero.
  • Figure 4 is a flow chart illustrating a second
  • bit- masks and bit-scan instructions which makes it possible to efficiently jump over all the zero valued coefficients is used. It starts as in by quantizing the transform
  • coefficients in the block In the example, there are 16 coefficients that are stored in the vector C.
  • the process then proceeds by packing and re-ordering all the quantized coefficients. This is done by the C++ instruction PACKUSWB, which transforms 16 signed words to unsigned integers and saturates. This means that if a coefficient is larger or smaller than the range of an unsigned byte, the coefficient is set to respectively max or min value of the range, which in this implementation is 255 and 0. In this way, the memory size of each coefficient is reduced from 2 to one byte.
  • the nest step is to mask the quantized, packed and
  • the C++ function BSF can be used to calculate the index of the first nonzero value of C.
  • BSF returns the bit index of the least significant bit of an integer, i.e. in the case of M, the first position of a 1 starting from the right-hand side.
  • this index returned by BSF when applied on M is equal to the run and is used directly as lookup in the C array to determine the level. This is possible since C is already shuffled using PSHUFB instruction.
  • the Run-value as indicated by the BSF function is then stored, and after looking up the value localized at that position in the C is stored as the level value.
  • M is finally shifted to the right run+1 times to clear the index bit from M and prepare M for the next iteration in the loop.
  • the present invention is, i.a., based on the observation that in practice runs of zero coefficients in 4x4 raster scan order as illustrated in figure 2, most often is equivalent to runs in 4x4 zig-zag order as illustrated in figure 1. In the cases where a criterion for this
  • both scans will return the four coefficients in the same order, but with different runs.
  • the raster scan runs can then be converted to the equivalent zigzag run.
  • the following mapping between the raster scan positions and the zigzag scan position applies: 0-0, 1-1, 2-5, 3-6, 4-2, 5-4, 6-7, 7-12, 8-3, 9-8, 10-11, 11-13, 12-9, 13-10, 14-14, 15-15.
  • the criterion to trigger the fallback is to test whether a calculated run for the raster scan order yields a negative result .
  • the run calculation is performed by measuring whether one or more run value in raster scan order is negative when using corresponding zigzag scan index in the calculation. I.e. the current raster scan index is derived and mapped to the corresponding zigzag index, using a normal zigzag table as defined in the H.264 recommendation. The calculation is described in detail in the following.
  • R k denotes the run value for the k' th occurrence of a nonzero value in a zigzag scan order
  • R' k the run value of the k' th occurrence of a nonzero value in raster scan order when using zigzag scan index in the calculation.
  • N is the last k index so that N+l is the total number of nonzeros.
  • a run value for a nonzero coefficient position x k can be calculated as x k - Xk-i ⁇ 1 ⁇ For the zigzag scan order, this is always a positive value since,
  • the raster scan order of the nonzero coefficients may differ from the zigzag scan order.
  • this will always lead to at least one negative raster scan run, since any permutation of the positions in (1) will violate (1) .
  • the zigzag order returns xo, Xi, x 2
  • the raster scan returns XQ, x 2 , xi ⁇ The total run for the two cases then becomes
  • Figure 5 is a flow chart illustrating an example

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)
  • Dc Digital Transmission (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

The present invention is related to an implementation of a process for representing transform coefficients in compression/decompression of digital video systems in multi-purpose processors. It provides a method significantly reducing the required processor capacity compared to implementation according to prior art.

Description

IMPLEMENTATION OF RUN LEVEL CODING
Field of the invention
The invention is related to implementation of entropy coding/decoding of transform coefficient data of video compression systems in computer devices.
Background of the invention
Transmission of moving pictures in real-time is employed in several applications like e.g. video conferencing, net meetings, TV broadcasting and video telephony.
However, representing moving pictures requires bulk
information as digital video typically is described by representing each pixel in a picture with 8 bits (1 Byte) . Such uncompressed video data results in large bit volumes, and can not be transferred over conventional communication networks and transmission lines in real time due to limited bandwidth .
Thus, enabling real time video transmission requires a large extent of data compression. Data compression may, however, compromise with picture quality. Therefore, great efforts have been made to develop compression techniques allowing real time transmission of high quality video over bandwidth limited data connections.
In video compression systems, the main goal is to represent the video information with as little capacity as possible. Capacity is defined with bits, either as a constant value or as bits/time unit. In both cases, the main goal is to reduce the number of bits.
The most common video coding method is described in the MPEG* and H.26* standards. The video data undergo four main processes before transmission, namely prediction,
transformation, quantization and entropy coding.
The prediction process significantly reduces the amount of bits required for each picture in a video sequence to be transferred. It takes advantage of the similarity of parts of the sequence with other parts of the sequence. Since the predictor part is known to both encoder and decoder, only the difference has to be transferred. This difference typically requires much less capacity for its
representation. The prediction is mainly based on vectors representing movements. The prediction process is typically performed on square block sizes (e.g. 16x16 pixels). Note that in some cases, predictions of pixels based on the adjacent pixels in the same picture rather than pixels of preceding pictures are used. This is referred to as intra prediction, as opposed to inter prediction.
The residual represented as a block of data (e.g. 4x4 pixels) still contains internal correlation. A well-known method of taking advantage of this is to perform a two dimensional block transform. In H.263 an 8x8 Discrete
Cosine Transform (DCT) is used, whereas H.264 uses a 4x4 integer type transform. This transforms 4x4 pixels into 4x4 transform coefficients and they can usually be represented by fewer bits than the pixel representation. Transform of a 4x4 array of pixels with internal correlation will
probability result in a 4x4 block of transform coefficients with much fewer non-zero values than the original 4x4 pixel block .
Direct representation of the transform coefficients is still too costly for many applications. A quantization process is carried out for a further reduction of the data representation. Hence the transform coefficients undergo quantization. A simple version of quantisation is to divide parameter values by a number - resulting in a smaller number that may be represented by fewer bits. It should be mentioned that this quantization process has as a result that the reconstructed video sequence is somewhat different from the uncompressed sequence. This phenomenon is
referred to as "lossy coding". The outcome from the
quantisation part is referred to as quantized transform coefficients .
Entropy coding is a special form of lossless data
compression. It involves i.a. arranging the image
components in a "zigzag" order employing run-length
encoding (RLE) algorithm that groups similar frequencies together, inserting length coding zeros, and then using Huffman coding on what is left.
In H.264 encoding the DCT coefficients for a block are reordered to group together non-zero coefficients in an array, enabling efficient representation of the remaining zero-valued coefficients. The zigzag reordering path (scan order) is shown in Figure 1. The pattern of the order of the zig-zag scan is configured according to the probability of non-zero coefficients in each positions. Due to the characteristics of the preceding DCT, the probability of non-zero coefficients in a block decreases the downward right diagonal direction of a DCT block. When reordering the coefficients in a zigzag pattern as illustrated in figure 1, the non-zero coefficients will tend to
concentrate in the first positions of the array.
The output of the reordering process is i.e. an one
dimensional array that typically contains one or more clusters of nonzero coefficients near the start, followed by strings of zero coefficients. Due to the large number of zero values, the array is further represented as a series of (run, level) pairs where run indicate the number of zeros preceding a nonzero coefficient, and level indicates the magnitude of the nonzero coefficient. As an example, the input array 16, 0, 0, -3, 5, 6, 0, 0, 0, 0, -7, ... will have the following corresponding run-level values (0,16), (2,-3), (0,5), (0,6), (4,-7)...
When transforming the zigzag array to run-level values, it is computationally expensive to loop over all coefficients and check whether they are non-zero. As the picture resolution increases, this will require a considerable amount of processor capacity an even introduce too much delay, especially if the encoding process is implemented on general purpose shared processors, e.g. on personal computers .
WO-2010/077148 discloses an implementation of a process for representing transform coefficients in
compression/decompression of digital video systems in multi-purpose processors. Quantized transform coefficients representing a block of pixels in a video picture are packed to half the memory size, and then masked so as to generate an array of l's and 0's defining the positions of non-zero coefficients in the corresponding array of packed transform coefficients. This preparation avoids parsing through positions in the array of transform coefficients were zero values occur when generating run-level
representations of the coefficients, thus significantly reducing the required number of loops to execute. However, this method requires that a certain shuffle function reordering data entries in the memory to any order is available as a hard coded process in the processor. This function is p.t. only available in new generation Intel processors. Thus, an alternative method is needed for utilizing the effectiveness of this invention also without access to the shuffle function.
Summary of the invention
The present invention provides a method in a video coding or decoding process in a computer device for calculating run and level representations of respective quantized transform coefficients representing pixel values in a block of a video picture which is inserted row by row in a one dimensional array C, wherein the method includes the steps of packing each quantized transform coefficients in C in a value interval [Max, Min] by setting all quantized
transform coefficients greater than Max equal to Max, and all quantized transform coefficients less than Min equal to Min, masking C by generating an array M containing l's in positions corresponding to positions of C having non-zero values, and O's in positions corresponding to positions of C having zero values, setting a current raster position to zero, where a raster position refers to a raster scan order of the coefficients in the block, for each position
containing a 1 in M, deriving a current zigzag position from current raster position through a table mapping raster positions to zigzag positions, where a zigzag position refers to a zigzag scan order of the coefficients in the block, if current zigzag position is not zero and if current zigzag position minus last zigzag position minus 1 is less than zero, then discarding all stored runs and levels and calculating new runs and levels with an
alternative fall back method, if not, setting run equal to current zigzag position minus last zigzag position minus 1 and level equal to occurring value in the position of C corresponding to current raster position, storing run and level, setting last zigzag position equal to current zigzag position, and incrementing current raster position with the number of positions to the next 1 in M.
Brief description of the drawings
In order to make the invention more readily understandable; the discussion that follows will refer to the accompanying drawings .
Figure 1 illustrates the zigzag pattern that is used in prior art to order the transform coefficients before entropy coding, Figure 2 illustrates the raster scan pattern that is used in the present invention,
Figure 3 is a flow sheet illustrating how the run-level code is calculated according to MPEG4 and H.264,
Figure 4 is a flow chart illustrating a method of the type disclosed in WO-2010/077148 , and
Figure 5 is a flow chart illustrating an example
implementation according to the present invention.
Detailed description of the present invention
In the following description, reference will be made to some standard functions in the library of the general purpose programming language C++ that are directly mapped to compact and efficient low-level CPU instructions. C++ is widely used in the software industry. Some of its
application domains include systems software, device drivers, embedded software, high-performance server and client applications, and entertainment software as well as for implementing coding and decoding of real-time video in general purpose computers.
Figure 3 is a flow sheet illustrating how the run-level code according to MPEG4 and H.264 is calculated in a first implementation according to prior art. After quantizing the transform coefficients (Quant C) in a block, the quantized coefficients are reordered to a one dimensional array according to the earlier mentioned zigzag pattern. The process then enters into a loop for parsing the array for determining the run-level values. First it is checked whether the number of positions in the array is exceeded (I≥16) . If not, it is then checked whether current position in the array contains a zero. If so, both the Run variable and the position index (I) is incremented, and the process is proceeding to the start of the loop again. If not (current position contains a non-zero value) , the current Run variable and the value of the current position is stored as the Run-Level value. The Run variable is then reset, before both the Run variable and the position index
(I) are incremented and the process is proceeding to the start of the loop again. The process ends whenever the position index exceeds the maximum size of the array, which in the example illustrated in figure 3 is 16.
As can be seen from the example of a prior art
implementation illustrated in figure 3, it always has to run through the run-level encoding loop as many times as there are positions in the array (16 times in the
examples) . This becomes very inefficient as most
coefficients in C are zero, and it is computationally expensive to loop over all coefficients and check whether they are non-zero.
Figure 4 is a flow chart illustrating a second
implementation according to the above-mentioned method disclosed in WO-2010/077148. In this implementation, bit- masks and bit-scan instructions which makes it possible to efficiently jump over all the zero valued coefficients is used. It starts as in by quantizing the transform
coefficients in the block. In the example, there are 16 coefficients that are stored in the vector C.
The process then proceeds by packing and re-ordering all the quantized coefficients. This is done by the C++ instruction PACKUSWB, which transforms 16 signed words to unsigned integers and saturates. This means that if a coefficient is larger or smaller than the range of an unsigned byte, the coefficient is set to respectively max or min value of the range, which in this implementation is 255 and 0. In this way, the memory size of each coefficient is reduced from 2 to one byte. The nest step is to mask the quantized, packed and
reordered coefficients. This is done by e.g. applying the C++ functions PCMPGTB and PMOVMSKB. The PCMPGTB function fills a whole byte of l'es in the position of non-zero values, and leave the O'es unchanged in the position of zeros. The PMOVMSKB function creates a 16-bit mask from the most significant bits of 16 bytes. The result of these two functions when applied on the array of quantized, packed and reordered coefficients (C) is a 16-bits array (M) where the l'es indicates the corresponding positions of the nonzero values of C.
If M is nonzero, the C++ function BSF can be used to calculate the index of the first nonzero value of C. BSF returns the bit index of the least significant bit of an integer, i.e. in the case of M, the first position of a 1 starting from the right-hand side.
Hence, this index returned by BSF when applied on M is equal to the run and is used directly as lookup in the C array to determine the level. This is possible since C is already shuffled using PSHUFB instruction.
The Run-value as indicated by the BSF function is then stored, and after looking up the value localized at that position in the C is stored as the level value.
M is finally shifted to the right run+1 times to clear the index bit from M and prepare M for the next iteration in the loop. By doing this, the content of M corresponding to Run-Level values already calculated is removed from M, and the loop can be applied in the same way to calculate the reminding Run-Level values.
Since all the zeroes are being jumped over by effectively by using the BSF instruction, only nonzero coefficients runs are required to calculate all level and run values. The present invention is, i.a., based on the observation that in practice runs of zero coefficients in 4x4 raster scan order as illustrated in figure 2, most often is equivalent to runs in 4x4 zig-zag order as illustrated in figure 1. In the cases where a criterion for this
conversion is fulfilled a method similar to the second implementation according to prior art as described with the shuffle function omitted is used, and in the cases where a criterion for this conversion is not fulfilled a fallback method e.g. according to the first implementation of prior art described above is used. The effect is that in most cases zig-zag scanning is not performed, but only the more effective raster scan and a run-conversion for the non-zero coefficients .
The run-conversion is valid for all cases where the nonzero coefficients appear in the same order for both scans. In theory this is not the most probable case considering all possible permutations, but in practice it is.
Measurements done by the inventors have shown that non-zero coefficients appear in the same order for both scans in 98.5% of the coding time.
According to certain aspects of the present invention, if coefficients with raster scan index 0, 1, 4 and 5 are nonzero, then both scans will return the four coefficients in the same order, but with different runs. The raster scan runs can then be converted to the equivalent zigzag run. As can be seen from figure 1 and 2, the following mapping between the raster scan positions and the zigzag scan position applies: 0-0, 1-1, 2-5, 3-6, 4-2, 5-4, 6-7, 7-12, 8-3, 9-8, 10-11, 11-13, 12-9, 13-10, 14-14, 15-15. In the example above, when the runs for a raster scan indicates non-zeros for scan index 0, 1, 4 and 5, this mapping will imply 0, 1, 2 and 4 as the corresponding zig-zag scan index. Hence, when the order of non-zeros are the same for raster scan and zig-zag scan, the second and the most effective prior art implementation described above can be used, but there is no need to reorder the coefficients, and the shuffle function can be omitted.
Contrary, if for example the raster scan indexes 0, 2 and 4 are non-zero, the order of appearance will be different for the two scans, and since the shuffle function is not available a fallback method for example according to the first implementation according to prior art described above must be used.
The criterion to trigger the fallback is to test whether a calculated run for the raster scan order yields a negative result .
The run calculation is performed by measuring whether one or more run value in raster scan order is negative when using corresponding zigzag scan index in the calculation. I.e. the current raster scan index is derived and mapped to the corresponding zigzag index, using a normal zigzag table as defined in the H.264 recommendation. The calculation is described in detail in the following.
Let Xk denote the zigzag position of the nonzero
coefficients wherein k indexes the occurrence of nonzero coefficients. Further, let Rk denote the run value for the k' th occurrence of a nonzero value in a zigzag scan order, R' k the run value of the k' th occurrence of a nonzero value in raster scan order when using zigzag scan index in the calculation. N is the last k index so that N+l is the total number of nonzeros. A run value for a nonzero coefficient position xk can be calculated as xk - Xk-i ~ 1· For the zigzag scan order, this is always a positive value since,
Figure imgf000012_0001
The total run RT for N+l runs is, R0 + Ri + R2 + - + = x0 + (xi - XQ-1) + (X2 - i-l) +
Figure imgf000013_0001
(2)
In general, however, the raster scan order of the nonzero coefficients may differ from the zigzag scan order. When using the zigzag positions xk in the calculation for the corresponding raster positions, this will always lead to at least one negative raster scan run, since any permutation of the positions in (1) will violate (1) . Imagine for example three nonzero coefficients and that the zigzag order returns xo, Xi, x2, while the raster scan returns XQ, x2, xi · The total run for the two cases then becomes
Zig-zag: RT = R0 + Ri + R2 = Xo + (xi _ Xo~l) + (x2 - xi~l) = X2-2
(3)
Raster: R' T = R'0 + R'i + R' 2 = o + ( 2 " Q-1) + (xi - x2~ 1) = Xi-2
(4)
The last run R' 2 in (4) is negative since xi < x2. Hence, the criterion for the fallback method is triggered.
Figure 5 is a flow chart illustrating an example
implementation according to the present invention. As earlier indicated, the procedure may bear some resemblance to the second implementation of prior art as described above, but without the need for reordering data, since the data is processed in the raster scan order which is the same order as the data already is stored in the memory. The differences are explained below. Thus, figure 5 and the following description should be read in conjunction with the remaining specification, in particular figure 4 and the corresponding description above.
In "Quant C" the transformed coefficients of a 4x4 block C is quantized. C is simply a one dimensional data array where the coefficients are inserted consecutively row by row starting from the upper row of the block. The
coefficients are thereby arranged in a raster scan order. "Mask M=C" creates a 16 bit mask M from the packet
coefficients C where a 1-bit indicates a non-zero
coefficient. In the decision box "M=0" the procedure is exited when there is no more non-zero coefficients left to process. "Scan M" scans the mask M in order to find the raster run R'k. In "Derive Run" run Rk is derived from R' k via raster index calculation and zigzag table lookup. In decision box "Run<0", it is decided whether to fall back to a conventional run-level coding according to the first implementation of prior art as described above and
illustrated in fig 5, ignoring the previously stored runs and levels, or to proceed by storing current level and run and then loop back to decision box "M=l". The decision to fall back is made if a negative run Rk is detected.

Claims

P a t e n t c l a i m s
1. A method in a video coding or decoding process performed in a computer device for calculating run and level representations of respective quantized
transform coefficients representing pixel values in a block of a video picture which is inserted row by row in a one dimensional array C,
c h a r a c t e r i z e d i n the following steps: packing each quantized transform coefficients in C in a value interval ( [Max, Min] ) by setting all quantized transform coefficients greater than Max equal to Max, and all quantized transform coefficients less than Min equal to Min, masking C by generating an array M containing l's in positions corresponding to positions of C having nonzero values, and 0's in positions corresponding to positions of C having zero values, setting a current raster position to zero, where a raster position refers to a raster scan order of the coefficients in the block, for each position containing a 1 in M, deriving a current zigzag position from current raster position through a table mapping raster positions to zigzag positions, where a zigzag position refers to a zigzag scan order of the coefficients in the block, if current zigzag position is not zero and if current zigzag position minus last zigzag
position minus 1 is less than zero, then discarding all stored runs and levels and calculating new runs and levels with an alternative fall back method, if not, setting run equal to current zigzag position minus last zigzag position minus 1 and level equal to occurring value in the position of C corresponding to current raster position, storing run and level, setting last zigzag position equal to current zigzag position, incrementing current raster position with the number of positions to the next 1 in M.
2. A method according to claim 1,
c h a r a c t e r i z e d i n that the table mapping raster positions to zigzag positions has the following entries: 0-0, 1-1, 2-5, 3-6, 4-2, 5-4, 6-7, 7-12, 8-3, 10-11, 11-13, 12-9, 13-10, 14-14, 15-15.
3. A method according to claim 1 or 2,
c h a r a c t e r i z e d i n that the step of masking further includes the following steps: creating an array C from C where positions
corresponding to positions of non-zero values in C are filled with l's, and positions corresponding to positions of zero values in C are filled with 0's, creating M from C by extracting the most significant bit from values in respective position of C and inserting the bits in corresponding positions in M.
4. A method according to claim 3,
c h a r a c t e r i z e d i n that the step of creating an array C is executed by a C++ function PCMPGTB, and the step of creating M from C is executed by a C++ function PMOVMSKB.
5. A method according to claim 4,
c h a r a c t e r i z e d i n that the step of
determining positions containing non-zero values in C is executed by a C++ function BSF.
6. A method according to one of the claims 1 - 5,
c h a r a c t e r i z e d i n that Max is 255 and Min is 0.
7. A method according to one of the claims 1 - 6,
c h a r a c t e r i z e d i n that the zigzag scan order follows a zigzag path of transform coefficient positions in the block starting in upper left corner heading towards lower right corner, and the raster scan order follows a raster path of transform coefficient positions in the block starting in upper left corner running through coefficient positions from left to right row by row ending in the lower right corner.
PCT/NO2011/000212 2010-07-30 2011-07-22 Implementation of run level coding WO2012015312A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
NO20101088 2010-07-30
NO20101088A NO332357B1 (en) 2010-07-30 2010-07-30 Implementation of run / level coding

Publications (1)

Publication Number Publication Date
WO2012015312A1 true WO2012015312A1 (en) 2012-02-02

Family

ID=43661907

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/NO2011/000212 WO2012015312A1 (en) 2010-07-30 2011-07-22 Implementation of run level coding

Country Status (2)

Country Link
NO (1) NO332357B1 (en)
WO (1) WO2012015312A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB2496197A (en) * 2011-11-07 2013-05-08 Sony Corp Frequency Domain Video Data Reordering for Encoding
NO336215B1 (en) * 2012-12-27 2015-06-15 Pexip AS Simultaneous and loop-free vector calculation of all run-level pairs in video compression.

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080046698A1 (en) * 2006-08-21 2008-02-21 Kapil Ahuja Run Length Encoding in VLIW Architecture
US20080266151A1 (en) * 2007-04-26 2008-10-30 Jagadeesh Sankaran Method of CABAC Coefficient Magnitude and Sign Decoding Suitable for Use on VLIW Data Processors
WO2010077148A1 (en) * 2008-12-30 2010-07-08 Tandberg Telecom As Method, apparatus and computer readable medium for calculating run and level representations of quantized transform coefficients representing pixel values included in a block of a video picture

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080046698A1 (en) * 2006-08-21 2008-02-21 Kapil Ahuja Run Length Encoding in VLIW Architecture
US20080266151A1 (en) * 2007-04-26 2008-10-30 Jagadeesh Sankaran Method of CABAC Coefficient Magnitude and Sign Decoding Suitable for Use on VLIW Data Processors
WO2010077148A1 (en) * 2008-12-30 2010-07-08 Tandberg Telecom As Method, apparatus and computer readable medium for calculating run and level representations of quantized transform coefficients representing pixel values included in a block of a video picture

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB2496197A (en) * 2011-11-07 2013-05-08 Sony Corp Frequency Domain Video Data Reordering for Encoding
NO336215B1 (en) * 2012-12-27 2015-06-15 Pexip AS Simultaneous and loop-free vector calculation of all run-level pairs in video compression.
US9407933B2 (en) 2012-12-27 2016-08-02 Pexip AS Simultaneous and loopless vector calculation of all run-level pairs in video compression

Also Published As

Publication number Publication date
NO332357B1 (en) 2012-09-03
NO20101088A1 (en) 2012-01-31

Similar Documents

Publication Publication Date Title
AU2005234613B2 (en) Adaptive coefficient scan order
US7843998B2 (en) Method for improved entropy coding
KR100491333B1 (en) Real time algorithms and architectures for coding images compressed by dwt-based techniques
CN110800299B (en) Scan order adaptation for entropy coding blocks of image data
JP2022048351A (en) Coding of last significant coefficient flag
CN115514978A (en) Mixing of probabilities for entropy coding in video compression
US20120027081A1 (en) Method, system, and computer readable medium for implementing run-level coding
CN102378991A (en) Compressed domain system and method for compression gains in encoded data
US11558619B2 (en) Adaptation of scan order for entropy coding
EP2223528A1 (en) Method of video coding and decoding
US9407933B2 (en) Simultaneous and loopless vector calculation of all run-level pairs in video compression
WO2012015312A1 (en) Implementation of run level coding
US10715821B2 (en) Embedding information about EOB positions
NO332205B1 (en) Implementation of entropy coding / decoding of transformation coefficient data for video compression systems in computer devices
Farhan Fast intra-frame compression for video conferencing using adaptive shift coding
US20100166076A1 (en) Method, apparatus, and computer readable medium for calculating run and level representations of quantized transform coefficients representing pixel values included in a block of a video picture
KR100219218B1 (en) A rub-length coder
Rajović et al. Hardware realization of fast image encoder with minimum memory size
Karthikeyan et al. Comparative Study of Different Encoder Schemes of DCT for Image Compression
JP2002152516A (en) Image processor and processing method and storage medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 11812826

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 11812826

Country of ref document: EP

Kind code of ref document: A1