Browse Source

avcodec/opusdec: Use avpriv_float_dsp_alloc()

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tags/n2.5
Michael Niedermayer 11 years ago
parent
commit
e316caf712
2 changed files with 7 additions and 4 deletions
  1. +1
    -1
      libavcodec/opus.h
  2. +6
    -3
      libavcodec/opusdec.c

+ 1
- 1
libavcodec/opus.h View File

@@ -176,7 +176,7 @@ typedef struct OpusContext {
int nb_streams;
int nb_stereo_streams;

AVFloatDSPContext fdsp;
AVFloatDSPContext *fdsp;
int16_t gain_i;
float gain;



+ 6
- 3
libavcodec/opusdec.c View File

@@ -535,7 +535,7 @@ static int opus_decode_packet(AVCodecContext *avctx, void *data,
}

if (c->gain_i) {
c->fdsp.vector_fmul_scalar((float*)frame->extended_data[i],
c->fdsp->vector_fmul_scalar((float*)frame->extended_data[i],
(float*)frame->extended_data[i],
c->gain, FFALIGN(decoded_samples, 8));
}
@@ -589,6 +589,7 @@ static av_cold int opus_decode_close(AVCodecContext *avctx)
c->nb_streams = 0;

av_freep(&c->channel_maps);
av_freep(&c->fdsp);

return 0;
}
@@ -601,7 +602,9 @@ static av_cold int opus_decode_init(AVCodecContext *avctx)
avctx->sample_fmt = AV_SAMPLE_FMT_FLTP;
avctx->sample_rate = 48000;

avpriv_float_dsp_init(&c->fdsp, 0);
c->fdsp = avpriv_float_dsp_alloc(0);
if (!c->fdsp)
return AVERROR(ENOMEM);

/* find out the channel configuration */
ret = ff_opus_parse_extradata(avctx, c);
@@ -630,7 +633,7 @@ static av_cold int opus_decode_init(AVCodecContext *avctx)
s->redundancy_output[j] = s->redundancy_buf[j];
}

s->fdsp = &c->fdsp;
s->fdsp = c->fdsp;

s->swr =swr_alloc();
if (!s->swr)


Loading…
Cancel
Save