[Ffmpeg-devel] Re: DCT data

Paolo paolo.mosna
Tue Feb 20 08:51:06 CET 2007


Michael Niedermayer <michaelni <at> gmx.at> writes:

> 
> if your video is not intra only (when in doubt it isnt)
> then the dct coeffs
> are differences from a motion compensated previous frame
> 
> to reconstruct the frame you will have to implement half a mpeg decoder
> 
> [...]

You are right, but I think my problem is a little bit different.
In my mpeg video i have the following frame type sequence
i-b-b-p-b-b-p-b-b-p-i...

If i look at the monochrome image obtained applying iDCT (inverse DCT) 
to the DCT frame
coefficients, some blocks 8x8 result to be correct other result to
be wrong.
Correct 8x8 blocks are in the right spatial position and correctly
represent the original frame content. Wrong 8x8 blocks
(which result to be the most) are just
black-and-white but do not represent original frame.

If I look in the dct-coeff-matrix obtained extracting data from
AVFrame->dct_coeff, the 8x8 blocks which appear to be correct 
in iDCT matrix, have all an high DC value in position <0,0>. 
Meanwhile, wrong 8x8 blocks have almost all a zero or very low 
value for DC component in position <0,0> inside 8x8 block.

When I proceed with processing an I reach the 11th frame in 
the sequence (which is an I-frame) the whole iDCT matrix 
result to be correct, so the matrix represent correctly the Y 
component of the frame. 
The the process repeats itself...again the 22th iDCM matrix 
result to be correct.

I do not really why this would happen.

What bother me more is the fact that the 8x8 block in position 
upper left of the frame, (the first 64 short in the dct_coeff array) 
result to have a null DC component value 
(value in position <0,0> of the block).

Am I missing something?

I would appreciate a lot any suggestion.
Thanks in advance.





More information about the ffmpeg-devel mailing list