diff options
author | Justin Ruggles <justin.ruggles@gmail.com> | 2012-05-21 12:58:41 -0400 |
---|---|---|
committer | Justin Ruggles <justin.ruggles@gmail.com> | 2012-06-08 13:14:38 -0400 |
commit | d5a7229ba4aabc2b6407c731d9175879ae54c5ea (patch) | |
tree | 0596aaae9622f0f7b7e5d689b20ab3dc82f59897 /libavcodec/twinvq.c | |
parent | 98db4e2a4e35ccc2406004216270ceaa1c6a7d00 (diff) | |
download | ffmpeg-d5a7229ba4aabc2b6407c731d9175879ae54c5ea.tar.gz |
Add a float DSP framework to libavutil
Move vector_fmul() from DSPContext to AVFloatDSPContext.
Diffstat (limited to 'libavcodec/twinvq.c')
-rw-r--r-- | libavcodec/twinvq.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/libavcodec/twinvq.c b/libavcodec/twinvq.c index 67bc16088e..4421074d80 100644 --- a/libavcodec/twinvq.c +++ b/libavcodec/twinvq.c @@ -19,6 +19,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include "libavutil/float_dsp.h" #include "avcodec.h" #include "get_bits.h" #include "dsputil.h" @@ -176,6 +177,7 @@ typedef struct TwinContext { AVCodecContext *avctx; AVFrame frame; DSPContext dsp; + AVFloatDSPContext fdsp; FFTContext mdct_ctx[3]; const ModeTab *mtab; @@ -787,8 +789,8 @@ static void read_and_decode_spectrum(TwinContext *tctx, GetBitContext *gb, dec_bark_env(tctx, bark1[i][j], bark_use_hist[i][j], i, tctx->tmp_buf, gain[sub*i+j], ftype); - tctx->dsp.vector_fmul(chunk + block_size*j, chunk + block_size*j, tctx->tmp_buf, - block_size); + tctx->fdsp.vector_fmul(chunk + block_size*j, chunk + block_size*j, + tctx->tmp_buf, block_size); } @@ -809,7 +811,7 @@ static void read_and_decode_spectrum(TwinContext *tctx, GetBitContext *gb, dec_lpc_spectrum_inv(tctx, lsp, ftype, tctx->tmp_buf); for (j = 0; j < mtab->fmode[ftype].sub; j++) { - tctx->dsp.vector_fmul(chunk, chunk, tctx->tmp_buf, block_size); + tctx->fdsp.vector_fmul(chunk, chunk, tctx->tmp_buf, block_size); chunk += block_size; } } @@ -1156,6 +1158,7 @@ static av_cold int twin_decode_init(AVCodecContext *avctx) } ff_dsputil_init(&tctx->dsp, avctx); + avpriv_float_dsp_init(&tctx->fdsp, avctx->flags & CODEC_FLAG_BITEXACT); if ((ret = init_mdct_win(tctx))) { av_log(avctx, AV_LOG_ERROR, "Error initializing MDCT\n"); twin_decode_close(avctx); |