summaryrefslogtreecommitdiff
path: root/libavcodec/opus_celt.h
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-10-03 22:27:13 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-10-05 02:15:04 +0200
commit81b927a53bafd51b3874ae7c36c6948cc632c267 (patch)
treea4ee1131391ffd93a38a8b28ec95de5d7ba3a94e /libavcodec/opus_celt.h
parent542c334eb5450ea8a2ef74ca3b46b3defff61c79 (diff)
downloadffmpeg-81b927a53bafd51b3874ae7c36c6948cc632c267.tar.gz
avcodec/opus: Move remaining celt declarations to opus_celt.h
Reviewed-by: Lynne <dev@lynne.ee> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavcodec/opus_celt.h')
-rw-r--r--libavcodec/opus_celt.h13
1 files changed, 10 insertions, 3 deletions
diff --git a/libavcodec/opus_celt.h b/libavcodec/opus_celt.h
index c812b6645c..3dbf197160 100644
--- a/libavcodec/opus_celt.h
+++ b/libavcodec/opus_celt.h
@@ -1,5 +1,5 @@
/*
- * Opus decoder/demuxer common functions
+ * Opus decoder/encoder CELT functions
* Copyright (c) 2012 Andrew D'Addesio
* Copyright (c) 2013-2014 Mozilla Corporation
* Copyright (c) 2016 Rostislav Pehlivanov <atomnuker@gmail.com>
@@ -28,6 +28,7 @@
#include "opus.h"
#include "opusdsp.h"
+#include "opus_rc.h"
#include "libavutil/float_dsp.h"
#include "libavutil/libm.h"
@@ -87,7 +88,7 @@ typedef struct CeltBlock {
float emph_coeff;
} CeltBlock;
-struct CeltFrame {
+typedef struct CeltFrame {
// constant values that do not change during context lifetime
AVCodecContext *avctx;
AVTXContext *tx[4];
@@ -136,7 +137,7 @@ struct CeltFrame {
int fine_priority[CELT_MAX_BANDS];
int pulses [CELT_MAX_BANDS];
int tf_change [CELT_MAX_BANDS];
-};
+} CeltFrame;
/* LCG for noise generation */
static av_always_inline uint32_t celt_rng(CeltFrame *f)
@@ -167,4 +168,10 @@ void ff_celt_flush(CeltFrame *f);
int ff_celt_decode_frame(CeltFrame *f, OpusRangeCoder *rc, float **output,
int coded_channels, int frame_size, int startband, int endband);
+/* Encode or decode CELT bands */
+void ff_celt_quant_bands(CeltFrame *f, OpusRangeCoder *rc);
+
+/* Encode or decode CELT bitallocation */
+void ff_celt_bitalloc(CeltFrame *f, OpusRangeCoder *rc, int encode);
+
#endif /* AVCODEC_OPUS_CELT_H */