From 0f109beb3830e1dd690dcf13fcfbcd5327af24f6 Mon Sep 17 00:00:00 2001 From: soren Date: Mon, 24 Apr 2017 00:22:05 -0700 Subject: [PATCH] Fixing check for when overlap-add is not 1 ms BUG=chromium:710812 Review-Url: https://codereview.webrtc.org/2814363002 Cr-Commit-Position: refs/heads/master@{#17835} --- webrtc/modules/audio_coding/neteq/normal.cc | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/webrtc/modules/audio_coding/neteq/normal.cc b/webrtc/modules/audio_coding/neteq/normal.cc index 1a7bc68033..7442df1384 100644 --- a/webrtc/modules/audio_coding/neteq/normal.cc +++ b/webrtc/modules/audio_coding/neteq/normal.cc @@ -145,11 +145,8 @@ int Normal::Process(const int16_t* input, ((1 << 14) - win_up_Q14) * expanded[channel_ix][i] + (1 << 13)) >> 14; } - if (fs_hz_ == 48000) { - RTC_DCHECK_EQ(win_up_Q14, (1 << 14) - 16); - } else { - RTC_DCHECK_EQ(win_up_Q14, 1 << 14); - } + RTC_DCHECK_GT(win_up_Q14, + (1 << 14) - 32); // Worst case rouding is a length of 34 } } else if (last_mode == kModeRfc3389Cng) { RTC_DCHECK_EQ(output->Channels(), 1); // Not adapted for multi-channel yet. @@ -187,11 +184,8 @@ int Normal::Process(const int16_t* input, ((1 << 14) - win_up_Q14) * cng_output[i] + (1 << 13)) >> 14; } - if (fs_hz_ == 48000) { - RTC_DCHECK_EQ(win_up_Q14, (1 << 14) - 16); - } else { - RTC_DCHECK_EQ(win_up_Q14, 1 << 14); - } + RTC_DCHECK_GT(win_up_Q14, + (1 << 14) - 32); // Worst case rouding is a length of 34 } else if (external_mute_factor_array[0] < 16384) { // Previous was neither of Expand, FadeToBGN or RFC3389_CNG, but we are // still ramping up from previous muting.