OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2014 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 | 12 |
13 #ifdef WEBRTC_HAS_NEON | 13 #ifdef WEBRTC_HAS_NEON |
14 #include <arm_neon.h> | 14 #include <arm_neon.h> |
15 #endif | 15 #endif |
16 | 16 |
17 #include "webrtc/common_audio/signal_processing/include/signal_processing_librar
y.h" | 17 #include "webrtc/common_audio/signal_processing/include/signal_processing_librar
y.h" |
18 #include "webrtc/system_wrappers/interface/compile_assert_c.h" | 18 #include "webrtc/system_wrappers/include/compile_assert_c.h" |
19 | 19 |
20 extern int32_t WebRtcIsacfix_Log2Q8(uint32_t x); | 20 extern int32_t WebRtcIsacfix_Log2Q8(uint32_t x); |
21 | 21 |
22 void WebRtcIsacfix_PCorr2Q32(const int16_t* in, int32_t* logcorQ8) { | 22 void WebRtcIsacfix_PCorr2Q32(const int16_t* in, int32_t* logcorQ8) { |
23 int16_t scaling,n,k; | 23 int16_t scaling,n,k; |
24 int32_t ysum32,csum32, lys, lcs; | 24 int32_t ysum32,csum32, lys, lcs; |
25 const int32_t oneQ8 = 1 << 8; // 1.00 in Q8 | 25 const int32_t oneQ8 = 1 << 8; // 1.00 in Q8 |
26 const int16_t* x; | 26 const int16_t* x; |
27 const int16_t* inptr; | 27 const int16_t* inptr; |
28 | 28 |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 if (lcs > (lys + oneQ8)) { // csum/sqrt(ysum) > 2 | 105 if (lcs > (lys + oneQ8)) { // csum/sqrt(ysum) > 2 |
106 *logcorQ8 = lcs - lys; // log2(csum/sqrt(ysum)) | 106 *logcorQ8 = lcs - lys; // log2(csum/sqrt(ysum)) |
107 } else { | 107 } else { |
108 *logcorQ8 = oneQ8; // 1.00 | 108 *logcorQ8 = oneQ8; // 1.00 |
109 } | 109 } |
110 } else { | 110 } else { |
111 *logcorQ8 = 0; | 111 *logcorQ8 = 0; |
112 } | 112 } |
113 } | 113 } |
114 } | 114 } |
OLD | NEW |