[Ffmpeg-devel] H264 decoder internals

Michael Niedermayer michaelni
Sun Jun 19 02:25:21 CEST 2005


Hi

On Sunday 19 June 2005 01:03, M?ns Rullg?rd wrote:
> Michael Niedermayer <michaelni at gmx.at> writes:
> > Hi
> >
> > On Saturday 18 June 2005 16:26, M?ns Rullg?rd wrote:
> >> I'm messing around with the H.264 decoder, and I'm having some trouble
> >> figuring out how the standard maps to the code.
> >>
> >> Around section 8.5.10 in the H.264 spec, there are a number of
> >> equations similar to 8-339:
> >>
> >>   d_ij = (c_ij * LevelScale(qP % 6, i, j) + 2^(3-qP/6)) >> (4 - qP / 6)
> >>
> >> I looks like the value of LevelScale() is precomputed for all
> >> combinations in the dequant_coeff array.  What I'm having some trouble
> >> with, is understanding where the final value of that equation is
> >> calculated.  I suppose it's disguised in some clever optimization.
> >> Could someone please explain what's going on?
> >
> > dequantization is done during bitstream decoding or during the dc
> > inverse transform
>
> I figured as much.  I just can't quite make out for certain what
> happens where.  The multiplication I can see, but the add and the
> shift have me confused.  

these where probably not part of the spec in their current form when this part 
of the code was implemented
and with the default scaling matrix with constant 16 the right shift of up to 
4 is really not needed, and neither is the add

btw, am i the only one who thinks that the h.264 spec is the most obfuscated 
and unreadable spec ever?

[...]
-- 
Michael





More information about the ffmpeg-devel mailing list