Chromium Code Reviews| Index: webrtc/modules/audio_processing/aec3/aec3_common.h |
| diff --git a/webrtc/modules/audio_processing/aec3/aec3_constants.h b/webrtc/modules/audio_processing/aec3/aec3_common.h |
| similarity index 80% |
| rename from webrtc/modules/audio_processing/aec3/aec3_constants.h |
| rename to webrtc/modules/audio_processing/aec3/aec3_common.h |
| index 054b0d8afd8fcf0086bac867c67f2aa1cef8dc42..17a64e85bcd2c8aabf363a553d907be4731b6ac0 100644 |
| --- a/webrtc/modules/audio_processing/aec3/aec3_constants.h |
| +++ b/webrtc/modules/audio_processing/aec3/aec3_common.h |
| @@ -8,15 +8,27 @@ |
| * be found in the AUTHORS file in the root of the source tree. |
| */ |
| -#ifndef WEBRTC_MODULES_AUDIO_PROCESSING_AEC3_AEC3_CONSTANTS_H_ |
| -#define WEBRTC_MODULES_AUDIO_PROCESSING_AEC3_AEC3_CONSTANTS_H_ |
| +#ifndef WEBRTC_MODULES_AUDIO_PROCESSING_AEC3_AEC3_COMMON_H_ |
| +#define WEBRTC_MODULES_AUDIO_PROCESSING_AEC3_AEC3_COMMON_H_ |
| #include <stddef.h> |
| +#include "webrtc/typedefs.h" |
| namespace webrtc { |
| +#ifdef _MSC_VER /* visual c++ */ |
| +#define ALIGN16_BEG __declspec(align(16)) |
| +#define ALIGN16_END |
| +#else /* gcc or icc */ |
| +#define ALIGN16_BEG |
| +#define ALIGN16_END __attribute__((aligned(16))) |
| +#endif |
| + |
| +enum class Aec3Optimization { kNone, kSse2, kNeon }; |
|
hlundin-webrtc
2017/02/22 15:24:05
kNeon is not used yet, right? I suggest you remove
peah-webrtc
2017/02/22 23:51:36
Done.
|
| + |
| constexpr size_t kFftLengthBy2 = 64; |
| constexpr size_t kFftLengthBy2Plus1 = kFftLengthBy2 + 1; |
| +constexpr size_t kFftLengthBy2Minus1 = kFftLengthBy2 - 1; |
| constexpr size_t kFftLength = 2 * kFftLengthBy2; |
| constexpr size_t kMaxNumBands = 3; |
| @@ -39,6 +51,9 @@ constexpr bool ValidFullBandRate(int sample_rate_hz) { |
| sample_rate_hz == 32000 || sample_rate_hz == 48000; |
| } |
| +// Detects what kind of optimizations to use for the code. |
| +Aec3Optimization DetectOptimization(); |
| + |
| static_assert(1 == NumBandsForRate(8000), "Number of bands for 8 kHz"); |
| static_assert(1 == NumBandsForRate(16000), "Number of bands for 16 kHz"); |
| static_assert(2 == NumBandsForRate(32000), "Number of bands for 32 kHz"); |
| @@ -65,4 +80,4 @@ static_assert(!ValidFullBandRate(8001), |
| } // namespace webrtc |
| -#endif // WEBRTC_MODULES_AUDIO_PROCESSING_AEC3_AEC3_CONSTANTS_H_ |
| +#endif // WEBRTC_MODULES_AUDIO_PROCESSING_AEC3_AEC3_COMMON_H_ |