[Ffmpeg-devel] Fixed point arithmetic RealAudio G2 (cook) decoder

Ian Braithwaite ian
Tue Mar 13 17:14:11 CET 2007


Benjamin Larsson wrote:
> Ian Braithwaite wrote:

>> +    ff_imdct_calc(&q->mdct_ctx, outbuffer, inbuffer,
> q->mdct_ctx.fft.imdct_calc

Yes, sorry, missed that.


>> -    for(i = 0; i < q->samples_per_channel; i++){
>> -        float tmp = outbuffer[i];
>> -
>> -        outbuffer[i] = q->mlt_window[i] * outbuffer[q->samples_per_channel+i];
>> -        outbuffer[q->samples_per_channel + i] =
>>              q->mlt_window[q->samples_per_channel - 1 - i] * -tmp;
>> -    }
...
>> -    /* Overlap with the previous block. */
>> -    for(i=0 ; i<q->samples_per_channel ; i++) {
>> -        buffer[i] *= fc;
>> -        buffer[i] += previous_buffer[i];

>> +    /* Apply window and overlap */
>> +    for(i = 0; i < q->samples_per_channel; i++){
>> +        buffer1[i] = buffer1[i] * fc * q->mlt_window[i] -
>> +          previous_buffer[i] * q->mlt_window[q->samples_per_channel - 1 - i];
>>      }

> To me all this saves a negation and it simplifies some code, but is it
> any faster ?

It just merges the two loops, the computation is the same.
It saves two buffer transfers (2*2Kbyte) memory->cpu and two
transfers back again.
Nothing huge - I'm not going to lose sleep over it!


Regards,
Ian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mlt2b.patch
Type: text/x-patch
Size: 4425 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070313/c83864ba/attachment.bin>



More information about the ffmpeg-devel mailing list