[FFmpeg-devel] [PATCH] SSE optimization for DCA decoder

Alexander E. Patrakov patrakov
Mon Sep 1 18:24:39 CEST 2008

Michael Niedermayer wrote:

> On Mon, Sep 01, 2008 at 01:36:16PM +0600, Alexander E. Patrakov wrote:

> As ive said the funky indexing is due to the use of half_imdct instead
> of full. There is no magic here at all. There are not 2 transforms,
> if you consider the full period imdct a longer transform than the half
> period is of course a question of the viewpoint.

Yes, it seems to be the case. I will look again tomorrow.

>> Note especially these lines:
>> for (k = 0; k < 32; k++)
>>   accum[k] = accum[k] - accum[64 + k] - accum[63 - k] + accum[127 - k];
> this looks wrong, as if the less significant terms had been dropped,
> though of course i could be wrong.

This just uses the facts that cos(PI + x) = -cos(x) and that cos (PI - X)
= -cos(x), and factors out this common cos. The error in the integer-only
encoder therefore, as compared to the "right" case, drops by a factor of 4
if the input is chosen the same as the 0-th band synthesis window (i.e.,
expected to be encoded to something-large in 0th band followed by all

> Also as far as i can tell your encoder is just applying the windowed mdct
> as inverse of the windowed imdct of the decoder. It just has some sign
> flips removed from the window and done explicitly in the code.

Yes, it seems that you are right. It also doesn't have the "noidea" history

> the lowpass plot looks like the absolute values of the window

Yes, thanks! The difference is indeed only by a factor of sqrt(0.125)
or -sqrt(0.125), and the sign changes every 64 values.

> I suspect such funky shape is needed for TDAC to work with longer windows

What is TDAC?

Alexander E. Patrakov

More information about the ffmpeg-devel mailing list