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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 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 static __inline int32_t WebRtcSpl_SatW64ToW32(int64_t x) { |
| 67 int32_t x32 = (int32_t)x; |
| 68 return x32 == x ? x32 : x < 0 ? INT32_MIN : INT32_MAX; |
| 69 } |
| 70 |
66 #ifdef WEBRTC_ARCH_ARM_V7 | 71 #ifdef WEBRTC_ARCH_ARM_V7 |
67 #include "webrtc/common_audio/signal_processing/include/spl_inl_armv7.h" | 72 #include "webrtc/common_audio/signal_processing/include/spl_inl_armv7.h" |
68 #else | 73 #else |
69 | 74 |
70 #if defined(MIPS32_LE) | 75 #if defined(MIPS32_LE) |
71 #include "webrtc/common_audio/signal_processing/include/spl_inl_mips.h" | 76 #include "webrtc/common_audio/signal_processing/include/spl_inl_mips.h" |
72 #endif | 77 #endif |
73 | 78 |
74 #if !defined(MIPS_DSP_R1_LE) | 79 #if !defined(MIPS_DSP_R1_LE) |
75 static __inline int16_t WebRtcSpl_SatW32ToW16(int32_t value32) { | 80 static __inline int16_t WebRtcSpl_SatW32ToW16(int32_t value32) { |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 } | 150 } |
146 | 151 |
147 static __inline int32_t WebRtc_MulAccumW16(int16_t a, int16_t b, int32_t c) { | 152 static __inline int32_t WebRtc_MulAccumW16(int16_t a, int16_t b, int32_t c) { |
148 return (a * b + c); | 153 return (a * b + c); |
149 } | 154 } |
150 #endif // #if !defined(MIPS32_LE) | 155 #endif // #if !defined(MIPS32_LE) |
151 | 156 |
152 #endif // WEBRTC_ARCH_ARM_V7 | 157 #endif // WEBRTC_ARCH_ARM_V7 |
153 | 158 |
154 #endif // WEBRTC_COMMON_AUDIO_SIGNAL_PROCESSING_INCLUDE_SPL_INL_H_ | 159 #endif // WEBRTC_COMMON_AUDIO_SIGNAL_PROCESSING_INCLUDE_SPL_INL_H_ |
OLD | NEW |