NetEq: Make the fix for Opus DTX permanent

This change makes the fix for too long delays during Opus DTX periods
permanent. The fix has up until now been under an experiment, named
WebRTC-NetEqOpusDtxDelayFix.

Bug: webrtc:8488,chromium:780849
Change-Id: I006abb67f96d9d7880bf2215d7d6b52db6cbbfbc
Reviewed-on: https://webrtc-review.googlesource.com/44420
Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
Commit-Queue: Henrik Lundin <henrik.lundin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21786}
This commit is contained in:
Henrik Lundin
2018-01-26 17:32:56 +01:00
committed by Commit Bot
parent 70b820fefe
commit 4f2a4a12df
3 changed files with 4 additions and 22 deletions

View File

@ -103,9 +103,7 @@ NetEqImpl::NetEqImpl(const NetEq::Config& config,
playout_mode_(config.playout_mode),
enable_fast_accelerate_(config.enable_fast_accelerate),
nack_enabled_(false),
enable_muted_state_(config.enable_muted_state),
use_dtx_delay_fix_(
field_trial::IsEnabled("WebRTC-NetEqOpusDtxDelayFix")) {
enable_muted_state_(config.enable_muted_state) {
RTC_LOG(LS_INFO) << "NetEq config: " << config.ToString();
int fs = config.sample_rate_hz;
if (fs != 8000 && fs != 16000 && fs != 32000 && fs != 48000) {
@ -877,9 +875,8 @@ int NetEqImpl::GetAudioInternal(AudioFrame* audio_frame, bool* muted) {
// This is the criterion that we did decode some data through the speech
// decoder, and the operation resulted in comfort noise.
const bool codec_internal_sid_frame =
use_dtx_delay_fix_ ? (speech_type == AudioDecoder::kComfortNoise &&
start_num_packets > packet_list.size())
: (speech_type == AudioDecoder::kComfortNoise);
(speech_type == AudioDecoder::kComfortNoise &&
start_num_packets > packet_list.size());
if (sid_frame_available || codec_internal_sid_frame) {
// Start a new stopwatch since we are decoding a new CNG packet.

View File

@ -440,7 +440,6 @@ class NetEqImpl : public webrtc::NetEq {
std::unique_ptr<TickTimer::Stopwatch> generated_noise_stopwatch_
RTC_GUARDED_BY(crit_sect_);
std::vector<uint32_t> last_decoded_timestamps_ RTC_GUARDED_BY(crit_sect_);
const bool use_dtx_delay_fix_ RTC_GUARDED_BY(crit_sect_);
private:
RTC_DISALLOW_COPY_AND_ASSIGN(NetEqImpl);

View File

@ -529,20 +529,6 @@ TEST_F(NetEqDecodingTest, MAYBE_TestOpusBitExactness) {
FLAG_gen_ref);
}
// This test fixture is identical to NetEqDecodingTest, except that it enables
// the WebRTC-NetEqOpusDtxDelayFix field trial.
// TODO(bugs.webrtc.org/8488): When the field trial is over and the feature is
// default enabled, remove this fixture class and let the
// TestOpusDtxBitExactness test build directly on NetEqDecodingTest.
class NetEqDecodingTestWithOpusDtxFieldTrial : public NetEqDecodingTest {
public:
NetEqDecodingTestWithOpusDtxFieldTrial()
: override_field_trials_("WebRTC-NetEqOpusDtxDelayFix/Enabled/") {}
private:
test::ScopedFieldTrials override_field_trials_;
};
#if !defined(WEBRTC_IOS) && \
defined(WEBRTC_NETEQ_UNITTEST_BITEXACT) && \
defined(WEBRTC_CODEC_OPUS)
@ -550,7 +536,7 @@ class NetEqDecodingTestWithOpusDtxFieldTrial : public NetEqDecodingTest {
#else
#define MAYBE_TestOpusDtxBitExactness DISABLED_TestOpusDtxBitExactness
#endif
TEST_F(NetEqDecodingTestWithOpusDtxFieldTrial, MAYBE_TestOpusDtxBitExactness) {
TEST_F(NetEqDecodingTest, MAYBE_TestOpusDtxBitExactness) {
const std::string input_rtp_file =
webrtc::test::ResourcePath("audio_coding/neteq_opus_dtx", "rtp");