diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-11-29 18:54:27 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-11-29 18:54:27 +0100 |
commit | cae851c78921affbd178b1eb522fbf619715c1c4 (patch) | |
tree | cb1f2f474c9d37113bb3d1fc4ca162c969a9a69e | |
parent | 5bf4cd8e5b77a975b3c9ef43892a0a6ae65e3b44 (diff) | |
download | ffmpeg-cae851c78921affbd178b1eb522fbf619715c1c4.tar.gz |
avcodec/ac3enc: Use avpriv_float_dsp_alloc()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/ac3enc.c | 1 | ||||
-rw-r--r-- | libavcodec/ac3enc.h | 2 | ||||
-rw-r--r-- | libavcodec/ac3enc_float.c | 4 | ||||
-rw-r--r-- | libavcodec/ac3enc_template.c | 2 |
4 files changed, 6 insertions, 3 deletions
diff --git a/libavcodec/ac3enc.c b/libavcodec/ac3enc.c index 8fc9952e66..dc529087b2 100644 --- a/libavcodec/ac3enc.c +++ b/libavcodec/ac3enc.c @@ -2035,6 +2035,7 @@ av_cold int ff_ac3_encode_close(AVCodecContext *avctx) av_freep(&s->qmant_buffer); av_freep(&s->cpl_coord_exp_buffer); av_freep(&s->cpl_coord_mant_buffer); + av_freep(&s->fdsp); for (blk = 0; blk < s->num_blocks; blk++) { AC3Block *block = &s->blocks[blk]; av_freep(&block->mdct_coef); diff --git a/libavcodec/ac3enc.h b/libavcodec/ac3enc.h index 74da612613..a2442d0e55 100644 --- a/libavcodec/ac3enc.h +++ b/libavcodec/ac3enc.h @@ -165,7 +165,7 @@ typedef struct AC3EncodeContext { AVCodecContext *avctx; ///< parent AVCodecContext PutBitContext pb; ///< bitstream writer context AudioDSPContext adsp; - AVFloatDSPContext fdsp; + AVFloatDSPContext *fdsp; MECmpContext mecc; AC3DSPContext ac3dsp; ///< AC-3 optimized functions FFTContext mdct; ///< FFT context for MDCT calculation diff --git a/libavcodec/ac3enc_float.c b/libavcodec/ac3enc_float.c index fa6e50981b..766b14ec13 100644 --- a/libavcodec/ac3enc_float.c +++ b/libavcodec/ac3enc_float.c @@ -139,7 +139,9 @@ static CoefType calc_cpl_coord(CoefSumType energy_ch, CoefSumType energy_cpl) av_cold int ff_ac3_float_encode_init(AVCodecContext *avctx) { AC3EncodeContext *s = avctx->priv_data; - 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); return ff_ac3_encode_init(avctx); } diff --git a/libavcodec/ac3enc_template.c b/libavcodec/ac3enc_template.c index 3e02408bd5..c3ad76f429 100644 --- a/libavcodec/ac3enc_template.c +++ b/libavcodec/ac3enc_template.c @@ -108,7 +108,7 @@ static void apply_mdct(AC3EncodeContext *s) const SampleType *input_samples = &s->planar_samples[ch][blk * AC3_BLOCK_SIZE]; #if CONFIG_AC3ENC_FLOAT - s->fdsp.vector_fmul(s->windowed_samples, input_samples, + s->fdsp->vector_fmul(s->windowed_samples, input_samples, s->mdct_window, AC3_WINDOW_SIZE); #else s->ac3dsp.apply_window_int16(s->windowed_samples, input_samples, |