[FFmpeg-devel] [PATCH] 1D DCT for dsputil

Vitor Sessak vitor1001
Tue Jan 19 05:11:35 CET 2010


Loren Merritt wrote:
> On Mon, 18 Jan 2010, Vitor Sessak wrote:
> 
>> + data[i    ] =   COS(s,n,i) * val1 + SIN(s,n,i) * val2;
>> + data[i + 1] =   SIN(s,n,i) * val1 - COS(s,n,i) * val2;
> 
> data aliases costab, so the SIN/COS loads will be duplicated.

Done.

>> + float tmp1 = data[i        ] * (1./n);
>> + float tmp2 = data[n - i - 1] * (1./n);
>> + float sin1 = 0.5/SIN(s,n,2*i+1);
> 
> division?

I don't see how it is avoidable, I've tried a LUT and it is slower.

>> +typedef struct {
>> +    int nbits;
>> +    int inverse;
>> +    FFTSample *data;
>> +    RDFTContext rdft;
>> +    const float *costab
>> +} DCTContext;
> 
> libavcodec/dsputil.h:902: warning: no semicolon at end of struct or union

Fixed.

New version attached with the above changes, indentation nits and added 
myself to the copyright.

-Vitor
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dct2.diff
Type: text/x-patch
Size: 9324 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100118/7e1d69a9/attachment.bin>



More information about the ffmpeg-devel mailing list