OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2011 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 |
11 #include "webrtc/modules/audio_coding/codecs/isac/fix/source/pitch_estimator.h" | 11 #include "webrtc/modules/audio_coding/codecs/isac/fix/source/pitch_estimator.h" |
12 #include "webrtc/common_audio/signal_processing/include/signal_processing_librar
y.h" | 12 #include "webrtc/common_audio/signal_processing/include/signal_processing_librar
y.h" |
13 #include "webrtc/system_wrappers/interface/compile_assert_c.h" | 13 #include "webrtc/system_wrappers/include/compile_assert_c.h" |
14 | 14 |
15 extern int32_t WebRtcIsacfix_Log2Q8(uint32_t x); | 15 extern int32_t WebRtcIsacfix_Log2Q8(uint32_t x); |
16 | 16 |
17 void WebRtcIsacfix_PCorr2Q32(const int16_t* in, int32_t* logcorQ8) { | 17 void WebRtcIsacfix_PCorr2Q32(const int16_t* in, int32_t* logcorQ8) { |
18 int16_t scaling,n,k; | 18 int16_t scaling,n,k; |
19 int32_t ysum32,csum32, lys, lcs; | 19 int32_t ysum32,csum32, lys, lcs; |
20 const int32_t oneQ8 = 1 << 8; // 1.00 in Q8 | 20 const int32_t oneQ8 = 1 << 8; // 1.00 in Q8 |
21 const int16_t* x; | 21 const int16_t* x; |
22 const int16_t* inptr; | 22 const int16_t* inptr; |
23 | 23 |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 if (lcs > (lys + oneQ8)) { // csum/sqrt(ysum) > 2 | 184 if (lcs > (lys + oneQ8)) { // csum/sqrt(ysum) > 2 |
185 *logcorQ8 = lcs - lys; // log2(csum/sqrt(ysum)) | 185 *logcorQ8 = lcs - lys; // log2(csum/sqrt(ysum)) |
186 } else { | 186 } else { |
187 *logcorQ8 = oneQ8; // 1.00 | 187 *logcorQ8 = oneQ8; // 1.00 |
188 } | 188 } |
189 } else { | 189 } else { |
190 *logcorQ8 = 0; | 190 *logcorQ8 = 0; |
191 } | 191 } |
192 } | 192 } |
193 } | 193 } |
OLD | NEW |