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 |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 *logcorQ8 = 0; | 50 *logcorQ8 = 0; |
51 } | 51 } |
52 | 52 |
53 | 53 |
54 for (k = 1; k < PITCH_LAG_SPAN2; k++) { | 54 for (k = 1; k < PITCH_LAG_SPAN2; k++) { |
55 inptr = &in[k]; | 55 inptr = &in[k]; |
56 ysum32 -= in[k - 1] * in[k - 1] >> scaling; | 56 ysum32 -= in[k - 1] * in[k - 1] >> scaling; |
57 ysum32 += in[PITCH_CORR_LEN2 + k - 1] * in[PITCH_CORR_LEN2 + k - 1] >> | 57 ysum32 += in[PITCH_CORR_LEN2 + k - 1] * in[PITCH_CORR_LEN2 + k - 1] >> |
58 scaling; | 58 scaling; |
59 | 59 |
60 // TODO(zhongwei.yao): Move this function into a separate NEON code file so | |
61 // that WEBRTC_DETECT_NEON could take advantage of it. | |
62 #ifdef WEBRTC_HAS_NEON | 60 #ifdef WEBRTC_HAS_NEON |
63 { | 61 { |
64 int32_t vbuff[4]; | 62 int32_t vbuff[4]; |
65 int32x4_t int_32x4_sum = vmovq_n_s32(0); | 63 int32x4_t int_32x4_sum = vmovq_n_s32(0); |
66 // Can't shift a Neon register to right with a non-constant shift value. | 64 // Can't shift a Neon register to right with a non-constant shift value. |
67 int32x4_t int_32x4_scale = vdupq_n_s32(-scaling); | 65 int32x4_t int_32x4_scale = vdupq_n_s32(-scaling); |
68 // Assert a codition used in loop unrolling at compile-time. | 66 // Assert a codition used in loop unrolling at compile-time. |
69 COMPILE_ASSERT(PITCH_CORR_LEN2 %4 == 0); | 67 COMPILE_ASSERT(PITCH_CORR_LEN2 %4 == 0); |
70 | 68 |
71 for (n = 0; n < PITCH_CORR_LEN2; n += 4) { | 69 for (n = 0; n < PITCH_CORR_LEN2; n += 4) { |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 if (lcs > (lys + oneQ8)) { // csum/sqrt(ysum) > 2 | 103 if (lcs > (lys + oneQ8)) { // csum/sqrt(ysum) > 2 |
106 *logcorQ8 = lcs - lys; // log2(csum/sqrt(ysum)) | 104 *logcorQ8 = lcs - lys; // log2(csum/sqrt(ysum)) |
107 } else { | 105 } else { |
108 *logcorQ8 = oneQ8; // 1.00 | 106 *logcorQ8 = oneQ8; // 1.00 |
109 } | 107 } |
110 } else { | 108 } else { |
111 *logcorQ8 = 0; | 109 *logcorQ8 = 0; |
112 } | 110 } |
113 } | 111 } |
114 } | 112 } |
OLD | NEW |