Skip to content

Commit

Permalink
Enable AudioProcessing48kHzSupport by default
Browse files Browse the repository at this point in the history
Because of the Finch experiment, this will not affect Chrome's behaviour at all.
The SNRs in AudioProcessingTest.Formats were only increased to the next multiple of 5.

BUG=webrtc:3146
R=andrew@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/43359004

Cr-Commit-Position: refs/heads/master@{#9263}
  • Loading branch information
Alejandro Luebs committed May 22, 2015
1 parent 3548dd2 commit 4774874
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 64 deletions.
Binary file modified data/audio_processing/output_data_float.pb
Binary file not shown.
Binary file modified data/audio_processing/output_data_mac.pb
Binary file not shown.
2 changes: 1 addition & 1 deletion webrtc/modules/audio_processing/include/audio_processing.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ struct Beamforming {
// constructor. It will have no impact if used with
// AudioProcessing::SetExtraOptions().
struct AudioProcessing48kHzSupport {
AudioProcessing48kHzSupport() : enabled(false) {}
AudioProcessing48kHzSupport() : enabled(true) {}
explicit AudioProcessing48kHzSupport(bool enabled) : enabled(enabled) {}
bool enabled;
};
Expand Down
129 changes: 66 additions & 63 deletions webrtc/modules/audio_processing/test/audio_processing_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,14 @@ bool write_ref_data = false;
const int kChannels[] = {1, 2};
const size_t kChannelsSize = sizeof(kChannels) / sizeof(*kChannels);

const int kSampleRates[] = {8000, 16000, 32000};
const int kSampleRates[] = {8000, 16000, 32000, 48000};
const size_t kSampleRatesSize = sizeof(kSampleRates) / sizeof(*kSampleRates);

#if defined(WEBRTC_AUDIOPROC_FIXED_PROFILE)
// AECM doesn't support super-wb.
const int kProcessSampleRates[] = {8000, 16000};
#elif defined(WEBRTC_AUDIOPROC_FLOAT_PROFILE)
const int kProcessSampleRates[] = {8000, 16000, 32000};
const int kProcessSampleRates[] = {8000, 16000, 32000, 48000};
#endif
const size_t kProcessSampleRatesSize = sizeof(kProcessSampleRates) /
sizeof(*kProcessSampleRates);
Expand Down Expand Up @@ -816,7 +816,7 @@ TEST_F(ApmTest, SampleRatesInt) {
SetContainerFormat(10000, 2, frame_, &float_cb_);
EXPECT_EQ(apm_->kBadSampleRateError, ProcessStreamChooser(kIntFormat));
// Testing valid sample rates
int fs[] = {8000, 16000, 32000};
int fs[] = {8000, 16000, 32000, 48000};
for (size_t i = 0; i < sizeof(fs) / sizeof(*fs); i++) {
SetContainerFormat(fs[i], 2, frame_, &float_cb_);
EXPECT_NOERR(ProcessStreamChooser(kIntFormat));
Expand Down Expand Up @@ -1914,7 +1914,7 @@ TEST_F(ApmTest, FloatAndIntInterfacesGiveSimilarResults) {
fapm->echo_cancellation()->stream_has_echo());
EXPECT_NEAR(apm_->noise_suppression()->speech_probability(),
fapm->noise_suppression()->speech_probability(),
0.0005);
0.01);

// Reset in case of downmixing.
frame_->num_channels_ = test->num_input_channels();
Expand Down Expand Up @@ -2256,7 +2256,7 @@ class AudioProcessingTest

static void SetUpTestCase() {
// Create all needed output reference files.
const int kNativeRates[] = {8000, 16000, 32000};
const int kNativeRates[] = {8000, 16000, 32000, 48000};
const size_t kNativeRatesSize =
sizeof(kNativeRates) / sizeof(*kNativeRates);
const int kNumChannels[] = {1, 2};
Expand Down Expand Up @@ -2401,7 +2401,10 @@ TEST_P(AudioProcessingTest, Formats) {
"out");
int min_ref_rate = std::min(input_rate_, output_rate_);
int ref_rate;
if (min_ref_rate > 16000) {

if (min_ref_rate > 32000) {
ref_rate = 48000;
} else if (min_ref_rate > 16000) {
ref_rate = 32000;
} else if (min_ref_rate > 8000) {
ref_rate = 16000;
Expand Down Expand Up @@ -2510,44 +2513,44 @@ TEST_P(AudioProcessingTest, Formats) {
#if defined(WEBRTC_AUDIOPROC_FLOAT_PROFILE)
INSTANTIATE_TEST_CASE_P(
CommonFormats, AudioProcessingTest, testing::Values(
std::tr1::make_tuple(48000, 48000, 48000, 20),
std::tr1::make_tuple(48000, 48000, 32000, 20),
std::tr1::make_tuple(48000, 48000, 16000, 20),
std::tr1::make_tuple(48000, 44100, 48000, 15),
std::tr1::make_tuple(48000, 44100, 32000, 15),
std::tr1::make_tuple(48000, 44100, 16000, 15),
std::tr1::make_tuple(48000, 32000, 48000, 20),
std::tr1::make_tuple(48000, 32000, 32000, 20),
std::tr1::make_tuple(48000, 32000, 16000, 20),
std::tr1::make_tuple(48000, 16000, 48000, 20),
std::tr1::make_tuple(48000, 16000, 32000, 20),
std::tr1::make_tuple(48000, 16000, 16000, 20),

std::tr1::make_tuple(44100, 48000, 48000, 20),
std::tr1::make_tuple(44100, 48000, 32000, 20),
std::tr1::make_tuple(44100, 48000, 16000, 20),
std::tr1::make_tuple(44100, 44100, 48000, 15),
std::tr1::make_tuple(44100, 44100, 32000, 15),
std::tr1::make_tuple(44100, 44100, 16000, 15),
std::tr1::make_tuple(44100, 32000, 48000, 20),
std::tr1::make_tuple(44100, 32000, 32000, 20),
std::tr1::make_tuple(44100, 32000, 16000, 20),
std::tr1::make_tuple(44100, 16000, 48000, 20),
std::tr1::make_tuple(44100, 16000, 32000, 20),
std::tr1::make_tuple(44100, 16000, 16000, 20),

std::tr1::make_tuple(32000, 48000, 48000, 25),
std::tr1::make_tuple(32000, 48000, 32000, 25),
std::tr1::make_tuple(32000, 48000, 16000, 25),
std::tr1::make_tuple(48000, 48000, 48000, 0),
std::tr1::make_tuple(48000, 48000, 32000, 40),
std::tr1::make_tuple(48000, 48000, 16000, 40),
std::tr1::make_tuple(48000, 44100, 48000, 20),
std::tr1::make_tuple(48000, 44100, 32000, 20),
std::tr1::make_tuple(48000, 44100, 16000, 20),
std::tr1::make_tuple(48000, 32000, 48000, 30),
std::tr1::make_tuple(48000, 32000, 32000, 30),
std::tr1::make_tuple(48000, 32000, 16000, 30),
std::tr1::make_tuple(48000, 16000, 48000, 25),
std::tr1::make_tuple(48000, 16000, 32000, 25),
std::tr1::make_tuple(48000, 16000, 16000, 25),

std::tr1::make_tuple(44100, 48000, 48000, 30),
std::tr1::make_tuple(44100, 48000, 32000, 30),
std::tr1::make_tuple(44100, 48000, 16000, 30),
std::tr1::make_tuple(44100, 44100, 48000, 20),
std::tr1::make_tuple(44100, 44100, 32000, 20),
std::tr1::make_tuple(44100, 44100, 16000, 20),
std::tr1::make_tuple(44100, 32000, 48000, 30),
std::tr1::make_tuple(44100, 32000, 32000, 30),
std::tr1::make_tuple(44100, 32000, 16000, 30),
std::tr1::make_tuple(44100, 16000, 48000, 25),
std::tr1::make_tuple(44100, 16000, 32000, 25),
std::tr1::make_tuple(44100, 16000, 16000, 25),

std::tr1::make_tuple(32000, 48000, 48000, 30),
std::tr1::make_tuple(32000, 48000, 32000, 35),
std::tr1::make_tuple(32000, 48000, 16000, 30),
std::tr1::make_tuple(32000, 44100, 48000, 20),
std::tr1::make_tuple(32000, 44100, 32000, 20),
std::tr1::make_tuple(32000, 44100, 16000, 20),
std::tr1::make_tuple(32000, 32000, 48000, 30),
std::tr1::make_tuple(32000, 32000, 48000, 40),
std::tr1::make_tuple(32000, 32000, 32000, 0),
std::tr1::make_tuple(32000, 32000, 16000, 30),
std::tr1::make_tuple(32000, 16000, 48000, 20),
std::tr1::make_tuple(32000, 16000, 32000, 20),
std::tr1::make_tuple(32000, 16000, 16000, 20),
std::tr1::make_tuple(32000, 32000, 16000, 40),
std::tr1::make_tuple(32000, 16000, 48000, 25),
std::tr1::make_tuple(32000, 16000, 32000, 25),
std::tr1::make_tuple(32000, 16000, 16000, 25),

std::tr1::make_tuple(16000, 48000, 48000, 25),
std::tr1::make_tuple(16000, 48000, 32000, 25),
Expand All @@ -2558,8 +2561,8 @@ INSTANTIATE_TEST_CASE_P(
std::tr1::make_tuple(16000, 32000, 48000, 25),
std::tr1::make_tuple(16000, 32000, 32000, 25),
std::tr1::make_tuple(16000, 32000, 16000, 25),
std::tr1::make_tuple(16000, 16000, 48000, 30),
std::tr1::make_tuple(16000, 16000, 32000, 30),
std::tr1::make_tuple(16000, 16000, 48000, 40),
std::tr1::make_tuple(16000, 16000, 32000, 50),
std::tr1::make_tuple(16000, 16000, 16000, 0)));

#elif defined(WEBRTC_AUDIOPROC_FIXED_PROFILE)
Expand All @@ -2578,31 +2581,31 @@ INSTANTIATE_TEST_CASE_P(
std::tr1::make_tuple(48000, 16000, 32000, 20),
std::tr1::make_tuple(48000, 16000, 16000, 20),

std::tr1::make_tuple(44100, 48000, 48000, 19),
std::tr1::make_tuple(44100, 48000, 32000, 19),
std::tr1::make_tuple(44100, 48000, 16000, 19),
std::tr1::make_tuple(44100, 48000, 48000, 20),
std::tr1::make_tuple(44100, 48000, 32000, 20),
std::tr1::make_tuple(44100, 48000, 16000, 20),
std::tr1::make_tuple(44100, 44100, 48000, 15),
std::tr1::make_tuple(44100, 44100, 32000, 15),
std::tr1::make_tuple(44100, 44100, 16000, 15),
std::tr1::make_tuple(44100, 32000, 48000, 19),
std::tr1::make_tuple(44100, 32000, 32000, 19),
std::tr1::make_tuple(44100, 32000, 16000, 19),
std::tr1::make_tuple(44100, 16000, 48000, 19),
std::tr1::make_tuple(44100, 16000, 32000, 19),
std::tr1::make_tuple(44100, 16000, 16000, 19),

std::tr1::make_tuple(32000, 48000, 48000, 19),
std::tr1::make_tuple(32000, 48000, 32000, 19),
std::tr1::make_tuple(32000, 48000, 16000, 19),
std::tr1::make_tuple(44100, 32000, 48000, 20),
std::tr1::make_tuple(44100, 32000, 32000, 20),
std::tr1::make_tuple(44100, 32000, 16000, 20),
std::tr1::make_tuple(44100, 16000, 48000, 20),
std::tr1::make_tuple(44100, 16000, 32000, 20),
std::tr1::make_tuple(44100, 16000, 16000, 20),

std::tr1::make_tuple(32000, 48000, 48000, 20),
std::tr1::make_tuple(32000, 48000, 32000, 20),
std::tr1::make_tuple(32000, 48000, 16000, 20),
std::tr1::make_tuple(32000, 44100, 48000, 15),
std::tr1::make_tuple(32000, 44100, 32000, 15),
std::tr1::make_tuple(32000, 44100, 16000, 15),
std::tr1::make_tuple(32000, 32000, 48000, 19),
std::tr1::make_tuple(32000, 32000, 32000, 19),
std::tr1::make_tuple(32000, 32000, 16000, 19),
std::tr1::make_tuple(32000, 16000, 48000, 19),
std::tr1::make_tuple(32000, 16000, 32000, 19),
std::tr1::make_tuple(32000, 16000, 16000, 19),
std::tr1::make_tuple(32000, 32000, 48000, 20),
std::tr1::make_tuple(32000, 32000, 32000, 20),
std::tr1::make_tuple(32000, 32000, 16000, 20),
std::tr1::make_tuple(32000, 16000, 48000, 20),
std::tr1::make_tuple(32000, 16000, 32000, 20),
std::tr1::make_tuple(32000, 16000, 16000, 20),

std::tr1::make_tuple(16000, 48000, 48000, 25),
std::tr1::make_tuple(16000, 48000, 32000, 25),
Expand All @@ -2613,8 +2616,8 @@ INSTANTIATE_TEST_CASE_P(
std::tr1::make_tuple(16000, 32000, 48000, 25),
std::tr1::make_tuple(16000, 32000, 32000, 25),
std::tr1::make_tuple(16000, 32000, 16000, 25),
std::tr1::make_tuple(16000, 16000, 48000, 30),
std::tr1::make_tuple(16000, 16000, 32000, 30),
std::tr1::make_tuple(16000, 16000, 48000, 35),
std::tr1::make_tuple(16000, 16000, 32000, 40),
std::tr1::make_tuple(16000, 16000, 16000, 0)));
#endif

Expand Down

0 comments on commit 4774874

Please sign in to comment.