summaryrefslogtreecommitdiff
path: root/libavcodec/opus.h
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-12-28 17:46:44 +0100
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-12-31 23:23:03 +0100
commitf03eade8690d9914fce574afb1795f16c036bb6b (patch)
treef5c52528dbc16290b63aaa8ff6135838b0f1e797 /libavcodec/opus.h
parent794fb18369be7dae9f9844c83040bb06611ff890 (diff)
avcodec/opusdec: Move per-stream fields to OpusStreamContext
Besides being more natural it also avoids allocations for separate arrays of decoded samples/output buffers/.... Reviewed-by: Lynne <dev@lynne.ee> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Diffstat (limited to 'libavcodec/opus.h')
-rw-r--r--libavcodec/opus.h24
1 files changed, 12 insertions, 12 deletions
diff --git a/libavcodec/opus.h b/libavcodec/opus.h
index 63ecd0aff7..fa63353e9b 100644
--- a/libavcodec/opus.h
+++ b/libavcodec/opus.h
@@ -101,6 +101,15 @@ typedef struct OpusStreamContext {
AVCodecContext *avctx;
int output_channels;
+ /* number of decoded samples for this stream */
+ int decoded_samples;
+ /* current output buffers for this stream */
+ float *out[2];
+ int out_size;
+ /* Buffer with samples from this stream for synchronizing
+ * the streams when they have different resampling delays */
+ AVAudioFifo *sync_buffer;
+
OpusRangeCoder rc;
OpusRangeCoder redundancy_rc;
SilkContext *silk;
@@ -115,9 +124,9 @@ typedef struct OpusStreamContext {
DECLARE_ALIGNED(32, float, redundancy_buf)[2][960];
float *redundancy_output[2];
- /* data buffers for the final output data */
- float *out[2];
- int out_size;
+ /* buffers for the next samples to be decoded */
+ float *cur_out[2];
+ int remaining_out_size;
float *out_dummy;
int out_dummy_allocated_size;
@@ -154,15 +163,6 @@ typedef struct OpusContext {
OpusStreamContext *streams;
int apply_phase_inv;
- /* current output buffers for each streams */
- float **out;
- int *out_size;
- /* Buffers for synchronizing the streams when they have different
- * resampling delays */
- AVAudioFifo **sync_buffers;
- /* number of decoded samples for each stream */
- int *decoded_samples;
-
int nb_streams;
int nb_stereo_streams;