[FFmpeg-cvslog] r23646 - in trunk/libavcodec: mpegaudio.h mpegaudiodec.c

Vitor Sessak vitor1001
Sat Jun 19 22:10:57 CEST 2010


On 06/19/2010 08:58 PM, Michael Niedermayer wrote:
> On Sat, Jun 19, 2010 at 03:33:50PM +0200, Vitor Sessak wrote:
>> > On 06/19/2010 01:13 PM, M?ns Rullg?rd wrote:
>>> >> vitor<subversion at mplayerhq.hu>  writes:
> [...]
>>>> >>> @@ -2227,7 +2262,11 @@ static int mp_decode_frame(MPADecodeCont
>>>> >>>       for(ch=0;ch<s->nb_channels;ch++) {
>>>> >>>           samples_ptr = samples + ch;
>>>> >>>           for(i=0;i<nb_frames;i++) {
>>>> >>> -
>>>> >>> RENAME(ff_mpa_synth_filter)(s->synth_buf[ch],&(s->synth_buf_offset[ch]),
>>>> >>> +            RENAME(ff_mpa_synth_filter)(
>>>> >>> +#if CONFIG_FLOAT
>>>> >>> +                         s,
>>>> >>> +#endif
>>> >>
>>> >> Do I really need to tell you that this is hideously ugly?
>> >
>> > No, that's why I was expecting some suggestion ;)
> you could wait with applying before the patch is approved

Sorry, I misunderstood your message.

> anyway, you can pass s to the fixed point one too if you
> benchmark it and its not meassuerably slower

Ugh, it _is_ measurably slower (of about 5%). Patch attached for anyone 
who want to test (to be applied after reverting r23646).

> On Sat, Jun 19, 2010 at 11:56:06AM +0200, vitor wrote:
>> Author: vitor
>> Date: Sat Jun 19 11:56:05 2010
>> New Revision: 23646
>>
>> Log:
>> Factorize the mpegaudio windowing code in a function and call it by a
>> function pointer. Should allow for ASM optimizations.
>>
> [...]
>> @@ -909,10 +891,63 @@ void RENAME(ff_mpa_synth_filter)(MPA_INT
>>       SUM8(MLSS, sum, w + 32, p);
>>       *samples = round_sample(&sum);
>>       *dither_state= sum;
>> +}
>> +
>> +
>> +/* 32 sub band synthesis filter. Input: 32 sub band samples, Output:
>> +   32 samples. */
>> +/* XXX: optimize by avoiding ring buffer usage */
>> +#if CONFIG_FLOAT
>> +void ff_mpa_synth_filter_float(MPADecodeContext *s, float *synth_buf_ptr,
>
> This should go into mpegaudiodec_float.c which avoids the ifdef
> and we might (or might not) want a matching mpegaudiodec_fix.c

Good point. I'll do this too once we reach a consensus.

>> +                               int *synth_buf_offset,
>> +                               float *window, int *dither_state,
>> +                               float *samples, int incr,
>> +                               float sb_samples[SBLIMIT])
>> +{
>> +    float *synth_buf;
>> +    int offset;
>> +
>> +    offset = *synth_buf_offset;
>> +    synth_buf = synth_buf_ptr + offset;
>> +
>> +    dct32(synth_buf, sb_samples);
>> +    s->apply_window_mp3(synth_buf, window, dither_state, samples, incr);
>> +
>> +    offset = (offset - 32)&  511;
>> +    *synth_buf_offset = offset;
>> +}
>> +#else
>
>> +void ff_mpa_synth_filter(MPA_INT *synth_buf_ptr, int *synth_buf_offset,
>> +                         MPA_INT *window, int *dither_state,
>> +                         OUT_INT *samples, int incr,
>> +                         INTFLOAT sb_samples[SBLIMIT])
>> +{
>> +    register MPA_INT *synth_buf;
>> +    int offset;
>> +#if FRAC_BITS<= 15
>> +    int32_t tmp[32];
>> +#endif
>> +
>> +    offset = *synth_buf_offset;
>> +    synth_buf = synth_buf_ptr + offset;
>> +
>> +#if FRAC_BITS<= 15&&  !CONFIG_FLOAT
>
> mans said it already i think, you are in code that is under if !CONFIG_FLOAT

Yes, diff did not the job I wanted it to do :p

[...]

-Vitor
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mp3_dspfy6.diff
Type: text/x-patch
Size: 8842 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-cvslog/attachments/20100619/05b33a61/attachment.bin>



More information about the ffmpeg-cvslog mailing list