[Ffmpeg-devel] Fixed point arithmetic RealAudio G2 (cook) decoder
Benjamin Larsson
banan
Tue Mar 13 21:05:45 CET 2007
Ian Braithwaite wrote:
> 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
>
Applied. Can you split the 4:th patch in cosmetics and non cosmetics and
repost it ?
MvH
Benjamin Larsson
More information about the ffmpeg-devel
mailing list