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

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

Issue 2644123002: Adding full initial version of delay estimation functionality in echo canceller 3 (Closed)
Patch Set: Rebase Created 3 years, 10 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 | « webrtc/modules/audio_processing/BUILD.gn ('k') | webrtc/modules/audio_processing/aec3/block_processor.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_constants.h
diff --git a/webrtc/modules/audio_processing/aec3/aec3_constants.h b/webrtc/modules/audio_processing/aec3/aec3_constants.h
index 946e50c78636584ba4cd1da24c73185271a27887..054b0d8afd8fcf0086bac867c67f2aa1cef8dc42 100644
--- a/webrtc/modules/audio_processing/aec3/aec3_constants.h
+++ b/webrtc/modules/audio_processing/aec3/aec3_constants.h
@@ -34,6 +34,11 @@ constexpr int LowestBandRate(int sample_rate_hz) {
return sample_rate_hz == 8000 ? sample_rate_hz : 16000;
}
+constexpr bool ValidFullBandRate(int sample_rate_hz) {
+ return sample_rate_hz == 8000 || sample_rate_hz == 16000 ||
+ sample_rate_hz == 32000 || sample_rate_hz == 48000;
+}
+
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");
@@ -47,6 +52,17 @@ static_assert(16000 == LowestBandRate(32000),
static_assert(16000 == LowestBandRate(48000),
"Sample rate of band 0 for 48 kHz");
+static_assert(ValidFullBandRate(8000),
+ "Test that 8 kHz is a valid sample rate");
+static_assert(ValidFullBandRate(16000),
+ "Test that 16 kHz is a valid sample rate");
+static_assert(ValidFullBandRate(32000),
+ "Test that 32 kHz is a valid sample rate");
+static_assert(ValidFullBandRate(48000),
+ "Test that 48 kHz is a valid sample rate");
+static_assert(!ValidFullBandRate(8001),
+ "Test that 8001 Hz is not a valid sample rate");
+
} // namespace webrtc
#endif // WEBRTC_MODULES_AUDIO_PROCESSING_AEC3_AEC3_CONSTANTS_H_
« no previous file with comments | « webrtc/modules/audio_processing/BUILD.gn ('k') | webrtc/modules/audio_processing/aec3/block_processor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698