X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fwmaprodec.c;h=4989cab162515157b21ab1b0c70fff65a6fee661;hb=6fb40779cd3457a819e20d6db91a142c47cad3c2;hp=c5cc46b5ce4b296a0adad5bd385b799238fdda80;hpb=386fc67c79b746760711be60e69fd5a10f42ab5f;p=ffmpeg diff --git a/libavcodec/wmaprodec.c b/libavcodec/wmaprodec.c index c5cc46b5ce4..4989cab1625 100644 --- a/libavcodec/wmaprodec.c +++ b/libavcodec/wmaprodec.c @@ -86,6 +86,7 @@ * subframe in order to reconstruct the output samples. */ +#include "libavutil/float_dsp.h" #include "libavutil/intfloat.h" #include "libavutil/intreadwrite.h" #include "avcodec.h" @@ -170,6 +171,7 @@ typedef struct WMAProDecodeCtx { AVCodecContext* avctx; ///< codec context for av_log AVFrame frame; ///< AVFrame for decoded output DSPContext dsp; ///< accelerated DSP functions + AVFloatDSPContext fdsp; uint8_t frame_data[MAX_FRAMESIZE + FF_INPUT_BUFFER_PADDING_SIZE];///< compressed frame data PutBitContext pb; ///< context for filling the frame_data buffer @@ -280,6 +282,8 @@ static av_cold int decode_init(AVCodecContext *avctx) s->avctx = avctx; ff_dsputil_init(&s->dsp, avctx); + avpriv_float_dsp_init(&s->fdsp, avctx->flags & CODEC_FLAG_BITEXACT); + init_put_bits(&s->pb, s->frame_data, MAX_FRAMESIZE); avctx->sample_fmt = AV_SAMPLE_FMT_FLTP; @@ -1018,12 +1022,12 @@ static void inverse_channel_transform(WMAProDecodeCtx *s) } } else if (s->avctx->channels == 2) { int len = FFMIN(sfb[1], s->subframe_len) - sfb[0]; - s->dsp.vector_fmul_scalar(ch_data[0] + sfb[0], - ch_data[0] + sfb[0], - 181.0 / 128, len); - s->dsp.vector_fmul_scalar(ch_data[1] + sfb[0], - ch_data[1] + sfb[0], - 181.0 / 128, len); + s->fdsp.vector_fmul_scalar(ch_data[0] + sfb[0], + ch_data[0] + sfb[0], + 181.0 / 128, len); + s->fdsp.vector_fmul_scalar(ch_data[1] + sfb[0], + ch_data[1] + sfb[0], + 181.0 / 128, len); } } } @@ -1270,9 +1274,9 @@ static int decode_subframe(WMAProDecodeCtx *s) s->channel[c].scale_factor_step; const float quant = pow(10.0, exp / 20.0); int start = s->cur_sfb_offsets[b]; - s->dsp.vector_fmul_scalar(s->tmp + start, - s->channel[c].coeffs + start, - quant, end - start); + s->fdsp.vector_fmul_scalar(s->tmp + start, + s->channel[c].coeffs + start, + quant, end - start); } /** apply imdct (imdct_half == DCTIV with reverse) */ @@ -1376,7 +1380,7 @@ static int decode_frame(WMAProDecodeCtx *s, int *got_frame_ptr) /* get output buffer */ s->frame.nb_samples = s->samples_per_frame; - if ((ret = avctx->get_buffer(avctx, &s->frame)) < 0) { + if ((ret = ff_get_buffer(avctx, &s->frame)) < 0) { av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); s->packet_loss = 1; return 0;