Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(112)

Unified Diff: webrtc/modules/audio_processing/aec3/aec3_common.h

Issue 2800033003: Fixing sample-rate dependent band-split filter issues in AEC3 (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | webrtc/modules/audio_processing/audio_processing_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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),
« no previous file with comments | « no previous file | webrtc/modules/audio_processing/audio_processing_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698