Index: webrtc/modules/audio_processing/aec3/aec3_common.h |
diff --git a/webrtc/modules/audio_processing/aec3/aec3_common.h b/webrtc/modules/audio_processing/aec3/aec3_common.h |
index f03a7e33d29f25370d39f621679b1cccdfa9f0c1..659a9b24a2f596ff8f99bebc8e3d1ca47f6dbd39 100644 |
--- a/webrtc/modules/audio_processing/aec3/aec3_common.h |
+++ b/webrtc/modules/audio_processing/aec3/aec3_common.h |
@@ -68,9 +68,15 @@ constexpr size_t kRenderTransferQueueSize = kMaxApiCallsJitterBlocks / 2; |
static_assert(2 * kRenderTransferQueueSize >= kMaxApiCallsJitterBlocks, |
"Requirement to ensure buffer overflow detection"); |
+// TODO(peah): Integrate this with how it is done inside audio_processing_impl. |
constexpr size_t NumBandsForRate(int sample_rate_hz) { |
+#ifdef WEBRTC_ARCH_ARM_FAMILY |
+ return std::min(2, static_cast<size_t>( |
hlundin-webrtc
2017/04/07 09:55:06
I think this would be more readable as
return sta
hlundin-webrtc
2017/04/07 09:56:35
My bad. How about
return static_cast<size_t>(sampl
peah-webrtc
2017/04/07 10:00:16
Awesome! Much better!
Done.
|
+ sample_rate_hz == 8000 ? 1 : sample_rate_hz / 16000)); |
+#else |
return static_cast<size_t>(sample_rate_hz == 8000 ? 1 |
: sample_rate_hz / 16000); |
+#endif |
} |
constexpr int LowestBandRate(int sample_rate_hz) { |
return sample_rate_hz == 8000 ? sample_rate_hz : 16000; |
@@ -87,7 +93,11 @@ 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"); |
+#ifdef WEBRTC_ARCH_ARM_FAMILY |
+static_assert(2 == NumBandsForRate(48000), "Number of bands for 48 kHz"); |
+#else |
static_assert(3 == NumBandsForRate(48000), "Number of bands for 48 kHz"); |
+#endif |
static_assert(8000 == LowestBandRate(8000), "Sample rate of band 0 for 8 kHz"); |
static_assert(16000 == LowestBandRate(16000), |