diff options
author | Justin Ruggles <justin.ruggles@gmail.com> | 2011-01-30 18:06:46 +0300 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-02-04 05:08:09 +0300 |
commit | fe2ff6d24745f0739bfde9061092c1268557310b (patch) | |
tree | 9cbcf8b2472dd7612dd84c8b6b237d9d02b4daf9 /libavcodec/dca.c | |
parent | a35d782d28ef0497f2b65eb300c2e6a6028fc165 (diff) |
Separate format conversion DSP functions from DSPContext.
This will be beneficial for use with the audio conversion API without
requiring it to depend on all of dsputil.
Signed-off-by: Mans Rullgard <mans@mansr.com>
(cherry picked from commit c73d99e672329c8f2df290736ffc474c360ac4ae)
Diffstat (limited to 'libavcodec/dca.c')
-rw-r--r-- | libavcodec/dca.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/libavcodec/dca.c b/libavcodec/dca.c index 3a3eb25d0b..63ea32992e 100644 --- a/libavcodec/dca.c +++ b/libavcodec/dca.c @@ -40,6 +40,7 @@ #include "dca.h" #include "synth_filter.h" #include "dcadsp.h" +#include "fmtconvert.h" //#define TRACE @@ -347,6 +348,7 @@ typedef struct { FFTContext imdct; SynthFilterContext synth; DCADSPContext dcadsp; + FmtConvertContext fmt_conv; } DCAContext; static const uint16_t dca_vlc_offs[] = { @@ -1115,7 +1117,7 @@ static int dca_subsubframe(DCAContext * s, int base_channel, int block_index) block[m] = get_bitalloc(&s->gb, &dca_smpl_bitalloc[abits], sel); } - s->dsp.int32_to_float_fmul_scalar(subband_samples[k][l], + s->fmt_conv.int32_to_float_fmul_scalar(subband_samples[k][l], block, rscale, 8); } @@ -1802,7 +1804,7 @@ static int dca_decode_frame(AVCodecContext * avctx, } } - s->dsp.float_to_int16_interleave(samples, s->samples_chanptr, 256, channels); + s->fmt_conv.float_to_int16_interleave(samples, s->samples_chanptr, 256, channels); samples += 256 * channels; } @@ -1835,6 +1837,7 @@ static av_cold int dca_decode_init(AVCodecContext * avctx) ff_mdct_init(&s->imdct, 6, 1, 1.0); ff_synth_filter_init(&s->synth); ff_dcadsp_init(&s->dcadsp); + ff_fmt_convert_init(&s->fmt_conv, avctx); for (i = 0; i < DCA_PRIM_CHANNELS_MAX+1; i++) s->samples_chanptr[i] = s->samples + i * 256; |