[FFmpeg-cvslog] avcodec/aacenc: Use avpriv_float_dsp_alloc()

Michael Niedermayer git at videolan.org
Sat Nov 29 19:08:43 CET 2014


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sat Nov 29 18:58:13 2014 +0100| [14285c3331bc3b9c80a2da2862830069ad265415] | committer: Michael Niedermayer

avcodec/aacenc: Use avpriv_float_dsp_alloc()

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=14285c3331bc3b9c80a2da2862830069ad265415
---

 libavcodec/aacenc.c |    7 +++++--
 libavcodec/aacenc.h |    2 +-
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/libavcodec/aacenc.c b/libavcodec/aacenc.c
index be0c950..d9c7215 100644
--- a/libavcodec/aacenc.c
+++ b/libavcodec/aacenc.c
@@ -252,7 +252,7 @@ static void apply_window_and_mdct(AACEncContext *s, SingleChannelElement *sce,
     int i;
     float *output = sce->ret_buf;
 
-    apply_window[sce->ics.window_sequence[0]](&s->fdsp, sce, audio);
+    apply_window[sce->ics.window_sequence[0]](s->fdsp, sce, audio);
 
     if (sce->ics.window_sequence[0] != EIGHT_SHORT_SEQUENCE)
         s->mdct1024.mdct_calc(&s->mdct1024, sce->coeffs, output);
@@ -682,6 +682,7 @@ static av_cold int aac_encode_end(AVCodecContext *avctx)
         ff_psy_preprocess_end(s->psypp);
     av_freep(&s->buffer.samples);
     av_freep(&s->cpe);
+    av_freep(&s->fdsp);
     ff_af_queue_close(&s->afq);
     return 0;
 }
@@ -690,7 +691,9 @@ static av_cold int dsp_init(AVCodecContext *avctx, AACEncContext *s)
 {
     int ret = 0;
 
-    avpriv_float_dsp_init(&s->fdsp, avctx->flags & CODEC_FLAG_BITEXACT);
+    s->fdsp = avpriv_float_dsp_alloc(avctx->flags & CODEC_FLAG_BITEXACT);
+    if (!s->fdsp)
+        return AVERROR(ENOMEM);
 
     // window init
     ff_kbd_window_init(ff_aac_kbd_long_1024, 4.0, 1024);
diff --git a/libavcodec/aacenc.h b/libavcodec/aacenc.h
index ecd6811..0decb1d 100644
--- a/libavcodec/aacenc.h
+++ b/libavcodec/aacenc.h
@@ -67,7 +67,7 @@ typedef struct AACEncContext {
     PutBitContext pb;
     FFTContext mdct1024;                         ///< long (1024 samples) frame transform context
     FFTContext mdct128;                          ///< short (128 samples) frame transform context
-    AVFloatDSPContext fdsp;
+    AVFloatDSPContext *fdsp;
     float *planar_samples[6];                    ///< saved preprocessed input
 
     int samplerate_index;                        ///< MPEG-4 samplerate index



More information about the ffmpeg-cvslog mailing list