diff options
author | Rostislav Pehlivanov <atomnuker@gmail.com> | 2017-05-10 06:47:44 +0100 |
---|---|---|
committer | Rostislav Pehlivanov <atomnuker@gmail.com> | 2017-05-16 11:22:07 +0100 |
commit | 8e7e74df93d18c903164a67c861a428bd4244cb1 (patch) | |
tree | 53bc9d9c22ee0a41bbac22560acafc0025829e60 /libavcodec/opus_pvq.h | |
parent | e6ec482b429b241de0fb3088d87e28777d70ded5 (diff) | |
download | ffmpeg-streaming-8e7e74df93d18c903164a67c861a428bd4244cb1.zip ffmpeg-streaming-8e7e74df93d18c903164a67c861a428bd4244cb1.tar.gz |
opus_pvq: port to allow for SIMD functions
Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
Diffstat (limited to 'libavcodec/opus_pvq.h')
-rw-r--r-- | libavcodec/opus_pvq.h | 32 |
1 files changed, 19 insertions, 13 deletions
diff --git a/libavcodec/opus_pvq.h b/libavcodec/opus_pvq.h index 0450154..6691494 100644 --- a/libavcodec/opus_pvq.h +++ b/libavcodec/opus_pvq.h @@ -23,22 +23,28 @@ #ifndef AVCODEC_OPUS_PVQ_H #define AVCODEC_OPUS_PVQ_H -#include "opus.h" #include "opus_celt.h" -/* Decodes a band using PVQ */ -uint32_t ff_celt_decode_band(CeltFrame *f, OpusRangeCoder *rc, const int band, - float *X, float *Y, int N, int b, uint32_t blocks, - float *lowband, int duration, float *lowband_out, int level, - float gain, float *lowband_scratch, int fill); +#define QUANT_FN(name) uint32_t (name)(struct CeltPVQ *pvq, CeltFrame *f, \ + OpusRangeCoder *rc, const int band, float *X, \ + float *Y, int N, int b, uint32_t blocks, \ + float *lowband, int duration, \ + float *lowband_out, int level, float gain, \ + float *lowband_scratch, int fill) -/* Encodes a band using PVQ */ -uint32_t ff_celt_encode_band(CeltFrame *f, OpusRangeCoder *rc, const int band, - float *X, float *Y, int N, int b, uint32_t blocks, - float *lowband, int duration, float *lowband_out, int level, - float gain, float *lowband_scratch, int fill); +struct CeltPVQ { + DECLARE_ALIGNED(32, int, qcoeff )[176]; + DECLARE_ALIGNED(32, float, hadamard_tmp)[176]; -float ff_celt_quant_band_cost(CeltFrame *f, OpusRangeCoder *rc, int band, - float *bits, float lambda); + float (*pvq_search)(float *X, int *y, int K, int N); + + QUANT_FN(*decode_band); + QUANT_FN(*encode_band); + float (*band_cost)(struct CeltPVQ *pvq, CeltFrame *f, OpusRangeCoder *rc, + int band, float *bits, float lambda); +}; + +int ff_celt_pvq_init (struct CeltPVQ **pvq); +void ff_celt_pvq_uninit(struct CeltPVQ **pvq); #endif /* AVCODEC_OPUS_PVQ_H */ |