Runlength encoding
- Since low frequencies are preserved by DCT/quantisation
process and high frequencies dropped, non-zero components occur in top left of matrix
- For efficient RLE require long unbroken runs of 0
- Zigzag sequence used
- DC (mean) coefficient does not typically vary much from block to block, so difference from last block is stored
- DC stored as (SIZE, AMPLITUDE) pair
- Assuming DC component of previous block was +12, difference is +3, hence DC encoded as (2,3), ie. 2 bits, amplitude 3
- AC components stored as (NUMBER OF PRECEEDING ZEROES, SIZE, AMPLITUDE)
- For above therefore:
(2,3) (1,2)(-2) (0,1)(-1) (0,1)(-1) (0,1)(0,1) (2,1)(-1) (0,0)
- (0,0) is EOB (end of block)
[Next] [Contents]