diff options
Diffstat (limited to 'lib/rbcodec/codecs/libopus/opus_private.h')
-rw-r--r-- | lib/rbcodec/codecs/libopus/opus_private.h | 37 |
1 files changed, 34 insertions, 3 deletions
diff --git a/lib/rbcodec/codecs/libopus/opus_private.h b/lib/rbcodec/codecs/libopus/opus_private.h index 52482bc18c..9d8210b5f0 100644 --- a/lib/rbcodec/codecs/libopus/opus_private.h +++ b/lib/rbcodec/codecs/libopus/opus_private.h | |||
@@ -31,15 +31,29 @@ | |||
31 | 31 | ||
32 | #include "arch.h" | 32 | #include "arch.h" |
33 | #include "opus.h" | 33 | #include "opus.h" |
34 | #include "celt.h" | ||
34 | 35 | ||
35 | struct OpusRepacketizer { | 36 | struct OpusRepacketizer { |
36 | unsigned char toc; | 37 | unsigned char toc; |
37 | int nb_frames; | 38 | int nb_frames; |
38 | const unsigned char *frames[48]; | 39 | const unsigned char *frames[48]; |
39 | short len[48]; | 40 | opus_int16 len[48]; |
40 | int framesize; | 41 | int framesize; |
41 | }; | 42 | }; |
42 | 43 | ||
44 | typedef struct ChannelLayout { | ||
45 | int nb_channels; | ||
46 | int nb_streams; | ||
47 | int nb_coupled_streams; | ||
48 | unsigned char mapping[256]; | ||
49 | } ChannelLayout; | ||
50 | |||
51 | int validate_layout(const ChannelLayout *layout); | ||
52 | int get_left_channel(const ChannelLayout *layout, int stream_id, int prev); | ||
53 | int get_right_channel(const ChannelLayout *layout, int stream_id, int prev); | ||
54 | int get_mono_channel(const ChannelLayout *layout, int stream_id, int prev); | ||
55 | |||
56 | |||
43 | 57 | ||
44 | #define MODE_SILK_ONLY 1000 | 58 | #define MODE_SILK_ONLY 1000 |
45 | #define MODE_HYBRID 1001 | 59 | #define MODE_HYBRID 1001 |
@@ -68,16 +82,33 @@ struct OpusRepacketizer { | |||
68 | #define OPUS_SET_FORCE_MODE_REQUEST 11002 | 82 | #define OPUS_SET_FORCE_MODE_REQUEST 11002 |
69 | #define OPUS_SET_FORCE_MODE(x) OPUS_SET_FORCE_MODE_REQUEST, __opus_check_int(x) | 83 | #define OPUS_SET_FORCE_MODE(x) OPUS_SET_FORCE_MODE_REQUEST, __opus_check_int(x) |
70 | 84 | ||
85 | typedef void (*downmix_func)(const void *, float *, int, int, int); | ||
86 | void downmix_float(const void *_x, float *sub, int subframe, int offset, int C); | ||
87 | void downmix_int(const void *_x, float *sub, int subframe, int offset, int C); | ||
88 | |||
89 | int optimize_framesize(const opus_val16 *x, int len, int C, opus_int32 Fs, | ||
90 | int bitrate, opus_val16 tonality, opus_val32 *mem, int buffering, | ||
91 | downmix_func downmix); | ||
71 | 92 | ||
72 | int encode_size(int size, unsigned char *data); | 93 | int encode_size(int size, unsigned char *data); |
73 | 94 | ||
95 | opus_int32 frame_size_select(opus_int32 frame_size, int variable_duration, opus_int32 Fs); | ||
96 | |||
97 | opus_int32 opus_encode_native(OpusEncoder *st, const opus_val16 *pcm, int frame_size, | ||
98 | unsigned char *data, opus_int32 out_data_bytes, int lsb_depth | ||
99 | #ifndef FIXED_POINT | ||
100 | , AnalysisInfo *analysis_info | ||
101 | #endif | ||
102 | ); | ||
103 | |||
74 | int opus_decode_native(OpusDecoder *st, const unsigned char *data, opus_int32 len, | 104 | int opus_decode_native(OpusDecoder *st, const unsigned char *data, opus_int32 len, |
75 | opus_val16 *pcm, int frame_size, int decode_fec, int self_delimited, int *packet_offset); | 105 | opus_val16 *pcm, int frame_size, int decode_fec, int self_delimited, |
106 | int *packet_offset, int soft_clip); | ||
76 | 107 | ||
77 | /* Make sure everything's aligned to sizeof(void *) bytes */ | 108 | /* Make sure everything's aligned to sizeof(void *) bytes */ |
78 | static inline int align(int i) | 109 | static inline int align(int i) |
79 | { | 110 | { |
80 | return (i+sizeof(void *)-1)&-((int)sizeof(void *)); | 111 | return (i+(int)sizeof(void *)-1)&-(int)sizeof(void *); |
81 | } | 112 | } |
82 | 113 | ||
83 | opus_int32 opus_repacketizer_out_range_impl(OpusRepacketizer *rp, int begin, int end, unsigned char *data, opus_int32 maxlen, int self_delimited); | 114 | opus_int32 opus_repacketizer_out_range_impl(OpusRepacketizer *rp, int begin, int end, unsigned char *data, opus_int32 maxlen, int self_delimited); |