[FFmpeg-devel] [PATCH] MMX implementation of VC-1 inverse transforms

Christophe GISQUET christophe.gisquet
Sat Jan 19 19:20:32 CET 2008


Michael Niedermayer a ?crit :
> On Sat, Jan 19, 2008 at 01:38:52PM +0100, Christophe GISQUET wrote:
> i just have a draft (s421m.pdf) freely downloaded from smpte.org a while ago,
> iam not sure though if its still freely available  ...

Not anymore indeed. Anyway, the part you pasted indeed brings detailed

>                                  Figure 158: Matrix for 1-D 4-point Inverse Transform
>                                           EMxN = ( DMxN . TM + 4) >> 3
>                                   RMxN = (T?N . EMxN + CN . 1M + 64) >> 7
>  E8x8 , E8x4 , E4x8 , E4x4   are intermediate matrices. The values in the intermediate matrices
> shall be limited to the range >=-4096 and <4095.

That means that EMxN<<3, the result of the initial horizontal pass
before shift, has values in the -32768..32752 range.

Wouldn't that imply that the final result of any of the combinations in
both 1D idcts is within that range? Then 16bits signed arithmetics
without bias can be used. The code wouldn't even have to perform the
pre-shifting we discussed for the 4x4 dct.

Maybe my hopes are a bit too high there...

> one could now argue that the limiting is a little unclearly defined. But IMO
> the equations clearly define the relation between input and output and they
> dont contain any limiting themselfs so the encoder has to ensure that the
> limits are not violated.

The initial terms in input are within -2048..2046. I bet there are not
many beyond +/-1024, and maybe only the equivalent of dc coefficient...

Best regards,
Christophe GISQUET

More information about the ffmpeg-devel mailing list