diff options
author | Christophe Gisquet <christophe.gisquet@gmail.com> | 2012-03-04 13:28:16 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-02-10 21:45:55 +0100 |
commit | c3390fd56cf55259ea7665ecea6c8aeddf56e2fc (patch) | |
tree | 75bec46420b7d4a9eddbfa499af648922a8bc93c /libavcodec/ra144.h | |
parent | dfc99ca04d7698b8f4101dd4f017c1b023ad95f8 (diff) | |
download | ffmpeg-c3390fd56cf55259ea7665ecea6c8aeddf56e2fc.tar.gz |
ra144: use scalarproduct_int16
The buffer holding the coefficients must be padded with 0 so as to use DSP
functions that may overread. Currently, the SSE2/3 versions is an example,
as they process batches of 16 bytes.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/ra144.h')
-rw-r--r-- | libavcodec/ra144.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libavcodec/ra144.h b/libavcodec/ra144.h index 763495dce7..c2ee59b2dc 100644 --- a/libavcodec/ra144.h +++ b/libavcodec/ra144.h @@ -25,6 +25,7 @@ #include <stdint.h> #include "lpc.h" #include "audio_frame_queue.h" +#include "dsputil.h" #define NBLOCKS 4 ///< number of subblocks within a block #define BLOCKSIZE 40 ///< subblock size in 16-bit words @@ -35,6 +36,7 @@ typedef struct RA144Context { AVCodecContext *avctx; + DSPContext dsp; LPCContext lpc_ctx; AudioFrameQueue afq; int last_frame; @@ -57,6 +59,8 @@ typedef struct RA144Context { /** Adaptive codebook, its size is two units bigger to avoid a * buffer overflow. */ int16_t adapt_cb[146+2]; + + DECLARE_ALIGNED(16, int16_t, buffer_a)[FFALIGN(BLOCKSIZE,16)]; } RA144Context; void ff_copy_and_dup(int16_t *target, const int16_t *source, int offset); @@ -68,7 +72,7 @@ unsigned int ff_rms(const int *data); int ff_interp(RA144Context *ractx, int16_t *out, int a, int copyold, int energy); unsigned int ff_rescale_rms(unsigned int rms, unsigned int energy); -int ff_irms(const int16_t *data); +int ff_irms(DSPContext *dsp, const int16_t *data/*align 16*/); void ff_subblock_synthesis(RA144Context *ractx, const int16_t *lpc_coefs, int cba_idx, int cb1_idx, int cb2_idx, int gval, int gain); |