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 |
(...skipping 28 matching lines...) Expand all Loading... |
39 // Don't call this directly except in tests! | 39 // Don't call this directly except in tests! |
40 static __inline int WebRtcSpl_CountLeadingZeros64_NotBuiltin(uint64_t n) { | 40 static __inline int WebRtcSpl_CountLeadingZeros64_NotBuiltin(uint64_t n) { |
41 const int leading_zeros = n >> 32 == 0 ? 32 : 0; | 41 const int leading_zeros = n >> 32 == 0 ? 32 : 0; |
42 return leading_zeros + WebRtcSpl_CountLeadingZeros32_NotBuiltin( | 42 return leading_zeros + WebRtcSpl_CountLeadingZeros32_NotBuiltin( |
43 (uint32_t)(n >> (32 - leading_zeros))); | 43 (uint32_t)(n >> (32 - leading_zeros))); |
44 } | 44 } |
45 | 45 |
46 // Returns the number of leading zero bits in the argument. | 46 // Returns the number of leading zero bits in the argument. |
47 static __inline int WebRtcSpl_CountLeadingZeros32(uint32_t n) { | 47 static __inline int WebRtcSpl_CountLeadingZeros32(uint32_t n) { |
48 #ifdef __GNUC__ | 48 #ifdef __GNUC__ |
49 COMPILE_ASSERT(sizeof(unsigned int) == sizeof(uint32_t)); | 49 RTC_COMPILE_ASSERT(sizeof(unsigned int) == sizeof(uint32_t)); |
50 return n == 0 ? 32 : __builtin_clz(n); | 50 return n == 0 ? 32 : __builtin_clz(n); |
51 #else | 51 #else |
52 return WebRtcSpl_CountLeadingZeros32_NotBuiltin(n); | 52 return WebRtcSpl_CountLeadingZeros32_NotBuiltin(n); |
53 #endif | 53 #endif |
54 } | 54 } |
55 | 55 |
56 // Returns the number of leading zero bits in the argument. | 56 // Returns the number of leading zero bits in the argument. |
57 static __inline int WebRtcSpl_CountLeadingZeros64(uint64_t n) { | 57 static __inline int WebRtcSpl_CountLeadingZeros64(uint64_t n) { |
58 #ifdef __GNUC__ | 58 #ifdef __GNUC__ |
59 COMPILE_ASSERT(sizeof(unsigned long long) == sizeof(uint64_t)); // NOLINT | 59 RTC_COMPILE_ASSERT(sizeof(unsigned long long) == sizeof(uint64_t)); // NOLINT |
60 return n == 0 ? 64 : __builtin_clzll(n); | 60 return n == 0 ? 64 : __builtin_clzll(n); |
61 #else | 61 #else |
62 return WebRtcSpl_CountLeadingZeros64_NotBuiltin(n); | 62 return WebRtcSpl_CountLeadingZeros64_NotBuiltin(n); |
63 #endif | 63 #endif |
64 } | 64 } |
65 | 65 |
66 #ifdef WEBRTC_ARCH_ARM_V7 | 66 #ifdef WEBRTC_ARCH_ARM_V7 |
67 #include "webrtc/common_audio/signal_processing/include/spl_inl_armv7.h" | 67 #include "webrtc/common_audio/signal_processing/include/spl_inl_armv7.h" |
68 #else | 68 #else |
69 | 69 |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 } | 145 } |
146 | 146 |
147 static __inline int32_t WebRtc_MulAccumW16(int16_t a, int16_t b, int32_t c) { | 147 static __inline int32_t WebRtc_MulAccumW16(int16_t a, int16_t b, int32_t c) { |
148 return (a * b + c); | 148 return (a * b + c); |
149 } | 149 } |
150 #endif // #if !defined(MIPS32_LE) | 150 #endif // #if !defined(MIPS32_LE) |
151 | 151 |
152 #endif // WEBRTC_ARCH_ARM_V7 | 152 #endif // WEBRTC_ARCH_ARM_V7 |
153 | 153 |
154 #endif // WEBRTC_COMMON_AUDIO_SIGNAL_PROCESSING_INCLUDE_SPL_INL_H_ | 154 #endif // WEBRTC_COMMON_AUDIO_SIGNAL_PROCESSING_INCLUDE_SPL_INL_H_ |
OLD | NEW |