GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Main page
  • Contents
  • Current events
  • Random article
  • About Wikipedia
  • Contact us
  • Help
  • Learn to edit
  • Community portal
  • Recent changes
  • Upload file
  • Special pages
  • Search
  • Donate

This view

  • Original page
  • New address

GeezerVison is showing en.wikipedia.org — Context-adaptive variable-length coding - Wikipedia

icon
This article relies on a single source. Please help improve this article by adding citations to reliable sources. Unsourced material may be challenged and removed.
Find sources: "Context-adaptive variable-length coding" – news · newspapers · books · scholar · JSTOR
(November 2024) (Learn how and when to remove this message)

Context-adaptive variable-length coding (CAVLC) is a form of entropy coding used in H.264/MPEG-4 AVC video encoding. It is an inherently lossless compression technique, like almost all entropy-coders. In H.264/MPEG-4 AVC, it is used to encode residual, zig-zag order, blocks of transform coefficients. It is an alternative to context-adaptive binary arithmetic coding (CABAC). CAVLC requires considerably less processing to decode than CABAC, although it does not compress the data quite as effectively. CAVLC is supported in all H.264 profiles, unlike CABAC which is not supported in Baseline and Extended profiles.

CAVLC is used to encode residual, zig-zag ordered 4×4 (and 2×2) blocks of transform coefficients. CAVLC is designed to take advantage of several characteristics of quantized 4×4 blocks:

  • After prediction, transformation and quantization, blocks are typically sparse (containing mostly zeros).
  • The highest non-zero coefficients after zig-zag scan are often sequences of +/− 1. CAVLC signals the number of high-frequency +/−1 coefficients in a compact way.
  • The number of non-zero coefficients in neighbouring blocks is correlated. The number of coefficients is encoded using a look-up table; the choice of look-up table depends on the number of non-zero coefficients in neighbouring blocks.
  • The level (magnitude) of non-zero coefficients tends to be higher at the start of the reordered array (near the DC coefficient) and lower towards the higher frequencies. CAVLC takes advantage of this by adapting the choice of VLC look-up table for the "level" parameter depending on recently coded level magnitudes.

Coded elements

Parameters that are required to be encoded and transmitted include the following table:

Parameters Description
Macroblock type Prediction method for each coded macroblock
Coded block pattern Indicates which blocks within a macroblock contain coded coefficients
Quantizer parameter reference frame Transmitted as a delta value from the previous value of QP
Reference frame index Identify reference frame(s) for inter prediction
Motion vector Transmitted as a difference (mvd) from predicted motion vector
Residual data Coefficient data for each 4×4 or 2×2 block

CAVLC examples

Element Value Code
coeff_token TotalCoeffs=5, T1s=3 0000100
T1 sign (4) + 0
T1 sign (3) - 1
T1 sign (2) - 1
Level (1) +1 (use Level_VLC0) 1
Level (0) +3 (use Level_VLC1) 0010
TotalZeros 3 111
run_before(4) ZerosLeft=3; run_before=1 10
run_before(3) ZerosLeft=2; run_before=0 1
run_before(2) ZerosLeft=2; run_before=0 1
run_before(1) ZerosLeft=2; run_before=1 01
run_before(0) ZerosLeft=1; run_before=1 No code required; last coefficient.
Code Element Value Output array
0000100 coeff_token Total Coeffs=5, T1s=3 Empty
0 T1 sign + 1
1 T1 sign - −1, 1
1 T1 sign - −1, −1, 1
1 Level +1 1, −1, −1, 1
0010 Level +3 3, 1, −1, −1, 1
111 TotalZeros 3 3, 1, −1, −1, 1
10 run_before 1 3, 1, −1, −1, 0, 1
1 run_before 0 3, 1, −1, −1, 0, 1
1 run_before 0 3, 1, −1, −1, 0, 1
01 run_before 1 3, 0, 1, −1, −1, 0, 1

In all following examples, we assume that table Num-VLC0 is used to encode coeff_token.

0, 3, 0, 1, −1, −1, 0, 1, 0… TotalCoeffs = 5 (indexed from highest frequency [4] to lowest frequency [0])

TotalZeros = 3

T1s = 3 (in fact there are 4 trailing ones but only 3 can be encoded as a "special case")

Encoding:

The transmitted bitstream for this block is 000010001110010111101101.

Decoding: The output array is "built up" from the decoded values as shown below. Values added to the output array at each stage are underlined.

The decoder has inserted two zeros; however, TotalZeros is equal to 3 and so another 1 zero is inserted before the lowest coefficient, making the final output array: 0, 3, 0, 1, −1, −1, 0, 1

See also

  • H.264 (entropy coding)
  • Data compression
  • Lossless compression

References

  • Richardson, Iain (August 28, 2011). "H.264 / AVC Context Adaptive Variable Length Coding" (PDF). Vcodex. Retrieved 17 November 2024.
Stub icon

This computer science article is a stub. You can help Wikipedia by adding missing information.

  • v
  • t
  • e
Retrieved from "https://en.wikipedia.org/w/index.php?title=Context-adaptive_variable-length_coding&oldid=1371224213"
Categories:
  • Entropy coding
  • MPEG
  • Video compression
  • Computer science stubs
Hidden categories:
  • Articles needing additional references from November 2024
  • All articles needing additional references
  • All stub articles
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.