You are on page 1of 12

PATEL GAURAV M (11EC65RO4) SANDIKA BISWAS (11EC65R11) RAWOCHAN KASOMWOSHI (11EC65R17)

CAVLC DECODING STEPS


Coeff_token (TotalCoeffs & Trailing_ones)

Sign of Trailing ones Level Decoding Total Zeros Decoding Run Before Decoding

Decoding Coeff_token ( TotalCoeffs & Trailing_ones)


The total number of nonzero coefficients and the

number of trailing ones without sign are decoded Parameter N ((Nu+Nl)/2) decides VLC table to be referred Nu & Nl are nonzero coefficients in upper & left Macroblocks respectively The code segment is searched into the table to find the values of TotalCoeffs and TrailingOnes

Selection of table
N 0,1 Table Num_VLC0

2,3
4,5,6,7 8 and above

Num_VLC1
Num_VLC2 Num_FLC

Example
Input :

'000000011010001001000010111001100 N=0 Num_VLC0 Code found : 0000000110 TotalCoeffs =5 Trailing_ones =1 Code remaining : 10001001000010111001100

Decoding Sign of TrailingOnes


Each TrailingOnes decoded in reverse order

+1

-1

Example:

input: code found: Trailing one : Code remaining :

10001001000010111001100 1 -1 0001001000010111001100

Decoding Level
Each level decoded using Level_VLC table For the first coefficient Level_VLC0 is used For further coefficients next tables are used based on the thresholds as given below
Current VLC table VLC0 VLC1 VLC2 VLC3 VLC4 VLC5 VLC6 Threshold to increment table 0 3 6 12 24 48 N/A (Highest table)

Special case:

If number of trailing 1s are less than 3 the first decoded nonzero level is decremented if negative and incremented if positive.

Example : Input : '0001001000010111001100 Code found 0001 (VLC0) -2 0010 (VLC1) 3 00010(VLC1) 4 111 (VLC2) -2 Code remaining : 001100

-3 (special case)

Decoding TotalZeros
TotalZeros is the sum of all zeros preceding the highest

non-zero coefficient in the reordered array TotalZeros are decoded from TotalZeros_VLC table using already encoded TotalCoeffs Example: input: code found: TotalZeros : Code remaining :

001100 0011 2 00

Decoding run_before
run_before is the number of zeros which leads every

nonzero coefficient For decoding a run_before_VLC table is used Table is determined by zeroleft zeroleft is initialised with TotalZeros zeroleft is updated by subtracting previous runbefore from zeroleft

Special cases: 1. [run_before] = TotalZeros 2. run_before for the final (lowest frequency) non-zero coefficient

Example: Input: 00 Run_before: 2 Final Output: -2 ,4, 3, -3, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0 Rearranged coefficients 0 3 -1 0 0 -1 1 0 1 0 0 0 0 0 0 0

References
[1]. Iain E.G. Richardson, H.264 and MPEG-4 Video Compression video coding for next generation multimedia, John Wiley & Sons, 2003, pp.187-207. [2]. Venkata Rao. Kakani, Implementation of VLSI Architecture for the H.264/AVC Video codec , IIT Kharagpur, May 2009. [3]. Joint Video Team (JVT) of ISO/IEC MPEG and ITU-T VCEG, Draft ITU-T Recommendation and Final Draft International Standard of Joint Video Specification (ITU-T Rec. H.264 | ISO/IEC 14496-10 AVC),March 2003

You might also like