Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRostislav Pehlivanov <atomnuker@gmail.com>2017-05-10 08:47:44 +0300
committerRostislav Pehlivanov <atomnuker@gmail.com>2017-05-16 13:22:07 +0300
commit8e7e74df93d18c903164a67c861a428bd4244cb1 (patch)
tree53bc9d9c22ee0a41bbac22560acafc0025829e60 /libavcodec/opus_pvq.h
parente6ec482b429b241de0fb3088d87e28777d70ded5 (diff)
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.h32
1 files changed, 19 insertions, 13 deletions
diff --git a/libavcodec/opus_pvq.h b/libavcodec/opus_pvq.h
index 045015406b..6691494838 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 */