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

Michael Niedermayer michaelni
Sat Jun 19 20:58:17 CEST 2010


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


> +                               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


> +    dct32(tmp, sb_samples);
> +    for(j=0;j<32;j++) {
> +        /* NOTE: can cause a loss in precision if very high amplitude
> +           sound */
> +        synth_buf[j] = av_clip_int16(tmp[j]);
> +    }
> +#else
> +    dct32(synth_buf, sb_samples);
> +#endif
> +
> +    apply_window_mp3_c(synth_buf, window, dither_state, samples, incr);
>  
>      offset = (offset - 32) & 511;
>      *synth_buf_offset = offset;
>  }
> +#endif
>  
>  #define C3 FIXHR(0.86602540378443864676/2)
>  
> @@ -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
> +                         s->synth_buf[ch], &(s->synth_buf_offset[ch]),
>                           RENAME(ff_mpa_synth_window), &s->dither_state,
>                           samples_ptr, s->nb_channels,
>                           s->sb_samples[ch][i]);
> _______________________________________________
> ffmpeg-cvslog mailing list
> ffmpeg-cvslog at mplayerhq.hu
> https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-cvslog
> 

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

> ... defining _GNU_SOURCE...
For the love of all that is holy, and some that is not, don't do that.
-- Luca & Mans
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-cvslog/attachments/20100619/7b310b7e/attachment-0001.pgp>



More information about the ffmpeg-cvslog mailing list