Bester
29th June 2006, 10:15
I'm trying to write a MPEG-1 encoder and don't know how to encode the DC values.
The Documentation tells:
...At the beginning of each slice, all three DC predictors for Y, Cb and Cr, are set to 1024 (128*8).
My thoughts:
After the FDCT the DC values have a dynamic range of [0, ..., 2040] and are then quantized by 8 giving a range of [0, ..., 255].
Now, if I use 1024 as the first predictor at the beginning of a slice and the DC value has any value in the quantized range, the difference diff=DCValue-1024 is smaller than -769. But there are only VLC codes for values abs(0,...,255).
It would only make sense if 1024 also has to be quantized (divided by 8 = 128).
Any ideas?
The Documentation tells:
...At the beginning of each slice, all three DC predictors for Y, Cb and Cr, are set to 1024 (128*8).
My thoughts:
After the FDCT the DC values have a dynamic range of [0, ..., 2040] and are then quantized by 8 giving a range of [0, ..., 255].
Now, if I use 1024 as the first predictor at the beginning of a slice and the DC value has any value in the quantized range, the difference diff=DCValue-1024 is smaller than -769. But there are only VLC codes for values abs(0,...,255).
It would only make sense if 1024 also has to be quantized (divided by 8 = 128).
Any ideas?