Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(210)

Side by Side Diff: webrtc/modules/audio_coding/codecs/isac/main/source/codec.h

Issue 1177993003: iSAC: Move global trig tables into the codec instance (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 13 matching lines...) Expand all
24 24
25 void WebRtcIsac_ResetBitstream(Bitstr* bit_stream); 25 void WebRtcIsac_ResetBitstream(Bitstr* bit_stream);
26 26
27 int WebRtcIsac_EstimateBandwidth(BwEstimatorstr* bwest_str, Bitstr* streamdata, 27 int WebRtcIsac_EstimateBandwidth(BwEstimatorstr* bwest_str, Bitstr* streamdata,
28 int32_t packet_size, 28 int32_t packet_size,
29 uint16_t rtp_seq_number, 29 uint16_t rtp_seq_number,
30 uint32_t send_ts, uint32_t arr_ts, 30 uint32_t send_ts, uint32_t arr_ts,
31 enum IsacSamplingRate encoderSampRate, 31 enum IsacSamplingRate encoderSampRate,
32 enum IsacSamplingRate decoderSampRate); 32 enum IsacSamplingRate decoderSampRate);
33 33
34 int WebRtcIsac_DecodeLb(float* signal_out, ISACLBDecStruct* ISACdec_obj, 34 int WebRtcIsac_DecodeLb(const TransformTables* transform_tables,
35 float* signal_out,
36 ISACLBDecStruct* ISACdec_obj,
35 int16_t* current_framesamples, 37 int16_t* current_framesamples,
36 int16_t isRCUPayload); 38 int16_t isRCUPayload);
37 39
38 int WebRtcIsac_DecodeRcuLb(float* signal_out, ISACLBDecStruct* ISACdec_obj, 40 int WebRtcIsac_DecodeRcuLb(float* signal_out, ISACLBDecStruct* ISACdec_obj,
39 int16_t* current_framesamples); 41 int16_t* current_framesamples);
40 42
41 int WebRtcIsac_EncodeLb(float* in, ISACLBEncStruct* ISACencLB_obj, 43 int WebRtcIsac_EncodeLb(const TransformTables* transform_tables,
42 int16_t codingMode, int16_t 44 float* in,
43 bottleneckIndex); 45 ISACLBEncStruct* ISACencLB_obj,
46 int16_t codingMode,
47 int16_t bottleneckIndex);
44 48
45 int WebRtcIsac_EncodeStoredDataLb(const IsacSaveEncoderData* ISACSavedEnc_obj, 49 int WebRtcIsac_EncodeStoredDataLb(const IsacSaveEncoderData* ISACSavedEnc_obj,
46 Bitstr* ISACBitStr_obj, int BWnumber, 50 Bitstr* ISACBitStr_obj, int BWnumber,
47 float scale); 51 float scale);
48 52
49 int WebRtcIsac_EncodeStoredDataUb( 53 int WebRtcIsac_EncodeStoredDataUb(
50 const ISACUBSaveEncDataStruct* ISACSavedEnc_obj, Bitstr* bitStream, 54 const ISACUBSaveEncDataStruct* ISACSavedEnc_obj, Bitstr* bitStream,
51 int32_t jitterInfo, float scale, enum ISACBandwidth bandwidth); 55 int32_t jitterInfo, float scale, enum ISACBandwidth bandwidth);
52 56
53 int16_t WebRtcIsac_GetRedPayloadUb( 57 int16_t WebRtcIsac_GetRedPayloadUb(
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 * Input/Output: 90 * Input/Output:
87 * -ISACdec_obj : pointer to the upper-band decoder object. The 91 * -ISACdec_obj : pointer to the upper-band decoder object. The
88 * bit-stream is stored inside the decoder object. 92 * bit-stream is stored inside the decoder object.
89 * 93 *
90 * Output: 94 * Output:
91 * -signal_out : decoded audio, 480 samples 30 ms. 95 * -signal_out : decoded audio, 480 samples 30 ms.
92 * 96 *
93 * Return value : >0 number of decoded bytes. 97 * Return value : >0 number of decoded bytes.
94 * <0 if an error occurred. 98 * <0 if an error occurred.
95 */ 99 */
96 int WebRtcIsac_DecodeUb16(float* signal_out, ISACUBDecStruct* ISACdec_obj, 100 int WebRtcIsac_DecodeUb16(const TransformTables* transform_tables,
101 float* signal_out,
102 ISACUBDecStruct* ISACdec_obj,
97 int16_t isRCUPayload); 103 int16_t isRCUPayload);
98 104
99
100 /****************************************************************************** 105 /******************************************************************************
101 * WebRtcIsac_DecodeUb12() 106 * WebRtcIsac_DecodeUb12()
102 * 107 *
103 * Decode the upper-band if the codec is in 0-12 kHz mode. 108 * Decode the upper-band if the codec is in 0-12 kHz mode.
104 * 109 *
105 * Input/Output: 110 * Input/Output:
106 * -ISACdec_obj : pointer to the upper-band decoder object. The 111 * -ISACdec_obj : pointer to the upper-band decoder object. The
107 * bit-stream is stored inside the decoder object. 112 * bit-stream is stored inside the decoder object.
108 * 113 *
109 * Output: 114 * Output:
110 * -signal_out : decoded audio, 480 samples 30 ms. 115 * -signal_out : decoded audio, 480 samples 30 ms.
111 * 116 *
112 * Return value : >0 number of decoded bytes. 117 * Return value : >0 number of decoded bytes.
113 * <0 if an error occurred. 118 * <0 if an error occurred.
114 */ 119 */
115 int WebRtcIsac_DecodeUb12(float* signal_out, ISACUBDecStruct* ISACdec_obj, 120 int WebRtcIsac_DecodeUb12(const TransformTables* transform_tables,
121 float* signal_out,
122 ISACUBDecStruct* ISACdec_obj,
116 int16_t isRCUPayload); 123 int16_t isRCUPayload);
117 124
118
119 /****************************************************************************** 125 /******************************************************************************
120 * WebRtcIsac_EncodeUb16() 126 * WebRtcIsac_EncodeUb16()
121 * 127 *
122 * Encode the upper-band if the codec is in 0-16 kHz mode. 128 * Encode the upper-band if the codec is in 0-16 kHz mode.
123 * 129 *
124 * Input: 130 * Input:
125 * -in : upper-band audio, 160 samples (10 ms). 131 * -in : upper-band audio, 160 samples (10 ms).
126 * 132 *
127 * Input/Output: 133 * Input/Output:
128 * -ISACdec_obj : pointer to the upper-band encoder object. The 134 * -ISACdec_obj : pointer to the upper-band encoder object. The
129 * bit-stream is stored inside the encoder object. 135 * bit-stream is stored inside the encoder object.
130 * 136 *
131 * Return value : >0 number of encoded bytes. 137 * Return value : >0 number of encoded bytes.
132 * <0 if an error occurred. 138 * <0 if an error occurred.
133 */ 139 */
134 int WebRtcIsac_EncodeUb16(float* in, ISACUBEncStruct* ISACenc_obj, 140 int WebRtcIsac_EncodeUb16(const TransformTables* transform_tables,
141 float* in,
142 ISACUBEncStruct* ISACenc_obj,
135 int32_t jitterInfo); 143 int32_t jitterInfo);
136 144
137
138 /****************************************************************************** 145 /******************************************************************************
139 * WebRtcIsac_EncodeUb12() 146 * WebRtcIsac_EncodeUb12()
140 * 147 *
141 * Encode the upper-band if the codec is in 0-12 kHz mode. 148 * Encode the upper-band if the codec is in 0-12 kHz mode.
142 * 149 *
143 * Input: 150 * Input:
144 * -in : upper-band audio, 160 samples (10 ms). 151 * -in : upper-band audio, 160 samples (10 ms).
145 * 152 *
146 * Input/Output: 153 * Input/Output:
147 * -ISACdec_obj : pointer to the upper-band encoder object. The 154 * -ISACdec_obj : pointer to the upper-band encoder object. The
148 * bit-stream is stored inside the encoder object. 155 * bit-stream is stored inside the encoder object.
149 * 156 *
150 * Return value : >0 number of encoded bytes. 157 * Return value : >0 number of encoded bytes.
151 * <0 if an error occurred. 158 * <0 if an error occurred.
152 */ 159 */
153 int WebRtcIsac_EncodeUb12(float* in, ISACUBEncStruct* ISACenc_obj, 160 int WebRtcIsac_EncodeUb12(const TransformTables* transform_tables,
161 float* in,
162 ISACUBEncStruct* ISACenc_obj,
154 int32_t jitterInfo); 163 int32_t jitterInfo);
155 164
156 /************************** initialization functions *************************/ 165 /************************** initialization functions *************************/
157 166
158 void WebRtcIsac_InitMasking(MaskFiltstr* maskdata); 167 void WebRtcIsac_InitMasking(MaskFiltstr* maskdata);
159 168
160 void WebRtcIsac_InitPreFilterbank(PreFiltBankstr* prefiltdata); 169 void WebRtcIsac_InitPreFilterbank(PreFiltBankstr* prefiltdata);
161 170
162 void WebRtcIsac_InitPostFilterbank(PostFiltBankstr* postfiltdata); 171 void WebRtcIsac_InitPostFilterbank(PostFiltBankstr* postfiltdata);
163 172
164 void WebRtcIsac_InitPitchFilter(PitchFiltstr* pitchfiltdata); 173 void WebRtcIsac_InitPitchFilter(PitchFiltstr* pitchfiltdata);
165 174
166 void WebRtcIsac_InitPitchAnalysis(PitchAnalysisStruct* State); 175 void WebRtcIsac_InitPitchAnalysis(PitchAnalysisStruct* State);
167 176
168 177
169 /**************************** transform functions ****************************/ 178 /**************************** transform functions ****************************/
170 179
171 void WebRtcIsac_InitTransform(); 180 void WebRtcIsac_InitTransform(TransformTables* tables);
172 181
173 void WebRtcIsac_Time2Spec(double* inre1, double* inre2, int16_t* outre, 182 void WebRtcIsac_Time2Spec(const TransformTables* tables,
174 int16_t* outim, FFTstr* fftstr_obj); 183 double* inre1,
184 double* inre2,
185 int16_t* outre,
186 int16_t* outim,
187 FFTstr* fftstr_obj);
175 188
176 void WebRtcIsac_Spec2time(double* inre, double* inim, double* outre1, 189 void WebRtcIsac_Spec2time(const TransformTables* tables,
177 double* outre2, FFTstr* fftstr_obj); 190 double* inre,
178 191 double* inim,
192 double* outre1,
193 double* outre2,
194 FFTstr* fftstr_obj);
179 195
180 /******************************* filter functions ****************************/ 196 /******************************* filter functions ****************************/
181 197
182 void WebRtcIsac_AllPoleFilter(double* InOut, double* Coef, int lengthInOut, 198 void WebRtcIsac_AllPoleFilter(double* InOut, double* Coef, int lengthInOut,
183 int orderCoef); 199 int orderCoef);
184 200
185 void WebRtcIsac_AllZeroFilter(double* In, double* Coef, int lengthInOut, 201 void WebRtcIsac_AllZeroFilter(double* In, double* Coef, int lengthInOut,
186 int orderCoef, double* Out); 202 int orderCoef, double* Out);
187 203
188 void WebRtcIsac_ZeroPoleFilter(double* In, double* ZeroCoef, double* PoleCoef, 204 void WebRtcIsac_ZeroPoleFilter(double* In, double* ZeroCoef, double* PoleCoef,
(...skipping 19 matching lines...) Expand all
208 224
209 void WebRtcIsac_NormLatticeFilterAr(int orderCoef, float* stateF, float* stateG, 225 void WebRtcIsac_NormLatticeFilterAr(int orderCoef, float* stateF, float* stateG,
210 double* lat_in, double* lo_filt_coef, 226 double* lat_in, double* lo_filt_coef,
211 float* lat_out); 227 float* lat_out);
212 228
213 void WebRtcIsac_Dir2Lat(double* a, int orderCoef, float* sth, float* cth); 229 void WebRtcIsac_Dir2Lat(double* a, int orderCoef, float* sth, float* cth);
214 230
215 void WebRtcIsac_AutoCorr(double* r, const double* x, int N, int order); 231 void WebRtcIsac_AutoCorr(double* r, const double* x, int N, int order);
216 232
217 #endif /* WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_MAIN_SOURCE_CODEC_H_ */ 233 #endif /* WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_MAIN_SOURCE_CODEC_H_ */
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698