| OLD | NEW |
| 1 /* Copyright (c) 2012 Xiph.Org Foundation | 1 /* Copyright (c) 2012 Xiph.Org Foundation |
| 2 Written by Jean-Marc Valin */ | 2 Written by Jean-Marc Valin */ |
| 3 /* | 3 /* |
| 4 Redistribution and use in source and binary forms, with or without | 4 Redistribution and use in source and binary forms, with or without |
| 5 modification, are permitted provided that the following conditions | 5 modification, are permitted provided that the following conditions |
| 6 are met: | 6 are met: |
| 7 | 7 |
| 8 - Redistributions of source code must retain the above copyright | 8 - Redistributions of source code must retain the above copyright |
| 9 notice, this list of conditions and the following disclaimer. | 9 notice, this list of conditions and the following disclaimer. |
| 10 | 10 |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 #define OPUS_GET_VOICE_RATIO(x) OPUS_GET_VOICE_RATIO_REQUEST, __opus_check_int_p
tr(x) | 79 #define OPUS_GET_VOICE_RATIO(x) OPUS_GET_VOICE_RATIO_REQUEST, __opus_check_int_p
tr(x) |
| 80 | 80 |
| 81 | 81 |
| 82 #define OPUS_SET_FORCE_MODE_REQUEST 11002 | 82 #define OPUS_SET_FORCE_MODE_REQUEST 11002 |
| 83 #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) |
| 84 | 84 |
| 85 typedef void (*downmix_func)(const void *, opus_val32 *, int, int, int, int, int
); | 85 typedef void (*downmix_func)(const void *, opus_val32 *, int, int, int, int, int
); |
| 86 void downmix_float(const void *_x, opus_val32 *sub, int subframe, int offset, in
t c1, int c2, int C); | 86 void downmix_float(const void *_x, opus_val32 *sub, int subframe, int offset, in
t c1, int c2, int C); |
| 87 void downmix_int(const void *_x, opus_val32 *sub, int subframe, int offset, int
c1, int c2, int C); | 87 void downmix_int(const void *_x, opus_val32 *sub, int subframe, int offset, int
c1, int c2, int C); |
| 88 | 88 |
| 89 int optimize_framesize(const opus_val16 *x, int len, int C, opus_int32 Fs, | |
| 90 int bitrate, opus_val16 tonality, float *mem, int buffering, | |
| 91 downmix_func downmix); | |
| 92 | |
| 93 int encode_size(int size, unsigned char *data); | 89 int encode_size(int size, unsigned char *data); |
| 94 | 90 |
| 95 opus_int32 frame_size_select(opus_int32 frame_size, int variable_duration, opus_
int32 Fs); | 91 opus_int32 frame_size_select(opus_int32 frame_size, int variable_duration, opus_
int32 Fs); |
| 96 | 92 |
| 97 opus_int32 compute_frame_size(const void *analysis_pcm, int frame_size, | 93 opus_int32 compute_frame_size(const void *analysis_pcm, int frame_size, |
| 98 int variable_duration, int C, opus_int32 Fs, int bitrate_bps, | 94 int variable_duration, int C, opus_int32 Fs, int bitrate_bps, |
| 99 int delay_compensation, downmix_func downmix | 95 int delay_compensation, downmix_func downmix |
| 100 #ifndef DISABLE_FLOAT_API | 96 #ifndef DISABLE_FLOAT_API |
| 101 , float *subframe_mem | 97 , float *subframe_mem |
| 102 #endif | 98 #endif |
| 103 ); | 99 ); |
| 104 | 100 |
| 105 opus_int32 opus_encode_native(OpusEncoder *st, const opus_val16 *pcm, int frame_
size, | 101 opus_int32 opus_encode_native(OpusEncoder *st, const opus_val16 *pcm, int frame_
size, |
| 106 unsigned char *data, opus_int32 out_data_bytes, int lsb_depth, | 102 unsigned char *data, opus_int32 out_data_bytes, int lsb_depth, |
| 107 const void *analysis_pcm, opus_int32 analysis_size, int c1, int c2, int an
alysis_channels, downmix_func downmix); | 103 const void *analysis_pcm, opus_int32 analysis_size, int c1, int c2, |
| 104 int analysis_channels, downmix_func downmix, int float_api); |
| 108 | 105 |
| 109 int opus_decode_native(OpusDecoder *st, const unsigned char *data, opus_int32 le
n, | 106 int opus_decode_native(OpusDecoder *st, const unsigned char *data, opus_int32 le
n, |
| 110 opus_val16 *pcm, int frame_size, int decode_fec, int self_delimited, | 107 opus_val16 *pcm, int frame_size, int decode_fec, int self_delimited, |
| 111 opus_int32 *packet_offset, int soft_clip); | 108 opus_int32 *packet_offset, int soft_clip); |
| 112 | 109 |
| 113 /* Make sure everything's aligned to sizeof(void *) bytes */ | 110 /* Make sure everything's aligned to sizeof(void *) bytes */ |
| 114 static OPUS_INLINE int align(int i) | 111 static OPUS_INLINE int align(int i) |
| 115 { | 112 { |
| 116 return (i+(int)sizeof(void *)-1)&-(int)sizeof(void *); | 113 return (i+(int)sizeof(void *)-1)&-(int)sizeof(void *); |
| 117 } | 114 } |
| 118 | 115 |
| 119 int opus_packet_parse_impl(const unsigned char *data, opus_int32 len, | 116 int opus_packet_parse_impl(const unsigned char *data, opus_int32 len, |
| 120 int self_delimited, unsigned char *out_toc, | 117 int self_delimited, unsigned char *out_toc, |
| 121 const unsigned char *frames[48], opus_int16 size[48], | 118 const unsigned char *frames[48], opus_int16 size[48], |
| 122 int *payload_offset, opus_int32 *packet_offset); | 119 int *payload_offset, opus_int32 *packet_offset); |
| 123 | 120 |
| 124 opus_int32 opus_repacketizer_out_range_impl(OpusRepacketizer *rp, int begin, int
end, | 121 opus_int32 opus_repacketizer_out_range_impl(OpusRepacketizer *rp, int begin, int
end, |
| 125 unsigned char *data, opus_int32 maxlen, int self_delimited, int pad); | 122 unsigned char *data, opus_int32 maxlen, int self_delimited, int pad); |
| 126 | 123 |
| 127 int pad_frame(unsigned char *data, opus_int32 len, opus_int32 new_len); | 124 int pad_frame(unsigned char *data, opus_int32 len, opus_int32 new_len); |
| 128 | 125 |
| 129 #endif /* OPUS_PRIVATE_H */ | 126 #endif /* OPUS_PRIVATE_H */ |
| OLD | NEW |