diff --git a/experiments/field_trials.py b/experiments/field_trials.py index 5a95331ef8..be0f62db22 100755 --- a/experiments/field_trials.py +++ b/experiments/field_trials.py @@ -475,9 +475,6 @@ POLICY_EXEMPT_FIELD_TRIALS: FrozenSet[FieldTrial] = frozenset([ FieldTrial('WebRTC-Audio-OpusBitrateMultipliers', 42221139, date(2024, 4, 1)), - FieldTrial('WebRTC-Audio-OpusPlcUsePrevDecodedSamples', - 143582588, - date(2024, 4, 1)), FieldTrial('WebRTC-Audio-Red-For-Opus', 42221750, date(2024, 4, 1)), @@ -878,7 +875,7 @@ POLICY_EXEMPT_FIELD_TRIALS: FrozenSet[FieldTrial] = frozenset([ ]) # yapf: disable POLICY_EXEMPT_FIELD_TRIALS_DIGEST: str = \ - '95050aa4a628b16d1220b3674b543c035c24cb6c' + 'e750429cb042c02921a227fa18291f2cea23ea3b' REGISTERED_FIELD_TRIALS: FrozenSet[FieldTrial] = ACTIVE_FIELD_TRIALS.union( POLICY_EXEMPT_FIELD_TRIALS) diff --git a/modules/audio_coding/BUILD.gn b/modules/audio_coding/BUILD.gn index 78c0417da9..a93d434c8e 100644 --- a/modules/audio_coding/BUILD.gn +++ b/modules/audio_coding/BUILD.gn @@ -545,7 +545,6 @@ rtc_library("webrtc_opus_wrapper") { "../../api:array_view", "../../rtc_base:checks", "../../rtc_base:ignore_wundef", - "../../system_wrappers:field_trial", ] if (rtc_build_opus) { diff --git a/modules/audio_coding/codecs/opus/opus_inst.h b/modules/audio_coding/codecs/opus/opus_inst.h index 34bb7710e5..ddf4396256 100644 --- a/modules/audio_coding/codecs/opus/opus_inst.h +++ b/modules/audio_coding/codecs/opus/opus_inst.h @@ -31,8 +31,6 @@ struct WebRtcOpusEncInst { struct WebRtcOpusDecInst { OpusDecoder* decoder; OpusMSDecoder* multistream_decoder; - int prev_decoded_samples; - bool plc_use_prev_decoded_samples; size_t channels; int in_dtx_mode; int sample_rate_hz; diff --git a/modules/audio_coding/codecs/opus/opus_interface.cc b/modules/audio_coding/codecs/opus/opus_interface.cc index e5ca678120..1257f25c7c 100644 --- a/modules/audio_coding/codecs/opus/opus_interface.cc +++ b/modules/audio_coding/codecs/opus/opus_interface.cc @@ -15,7 +15,6 @@ #include "api/array_view.h" #include "rtc_base/checks.h" -#include "system_wrappers/include/field_trial.h" enum { #if WEBRTC_OPUS_SUPPORT_120MS_PTIME @@ -35,9 +34,6 @@ enum { kWebRtcOpusPlcFrameSizeMs = 10, }; -constexpr char kPlcUsePrevDecodedSamplesFieldTrial[] = - "WebRTC-Audio-OpusPlcUsePrevDecodedSamples"; - static int FrameSizePerChannel(int frame_size_ms, int sample_rate_hz) { RTC_DCHECK_GT(frame_size_ms, 0); RTC_DCHECK_EQ(frame_size_ms % 10, 0); @@ -51,11 +47,6 @@ static int MaxFrameSizePerChannel(int sample_rate_hz) { return FrameSizePerChannel(kWebRtcOpusMaxDecodeFrameSizeMs, sample_rate_hz); } -// Default sample count per channel. -static int DefaultFrameSizePerChannel(int sample_rate_hz) { - return FrameSizePerChannel(20, sample_rate_hz); -} - int16_t WebRtcOpus_EncoderCreate(OpusEncInst** inst, size_t channels, int32_t application, @@ -394,12 +385,6 @@ int16_t WebRtcOpus_DecoderCreate(OpusDecInst** inst, // Creation of memory all ok. state->channels = channels; state->sample_rate_hz = sample_rate_hz; - state->plc_use_prev_decoded_samples = - webrtc::field_trial::IsEnabled(kPlcUsePrevDecodedSamplesFieldTrial); - if (state->plc_use_prev_decoded_samples) { - state->prev_decoded_samples = - DefaultFrameSizePerChannel(state->sample_rate_hz); - } state->in_dtx_mode = 0; *inst = state; return 0; @@ -438,12 +423,6 @@ int16_t WebRtcOpus_MultistreamDecoderCreate( // Creation of memory all ok. state->channels = channels; state->sample_rate_hz = 48000; - state->plc_use_prev_decoded_samples = - webrtc::field_trial::IsEnabled(kPlcUsePrevDecodedSamplesFieldTrial); - if (state->plc_use_prev_decoded_samples) { - state->prev_decoded_samples = - DefaultFrameSizePerChannel(state->sample_rate_hz); - } state->in_dtx_mode = 0; *inst = state; return 0; @@ -542,17 +521,6 @@ static int DecodePlc(OpusDecInst* inst, int16_t* decoded) { int plc_samples = FrameSizePerChannel(kWebRtcOpusPlcFrameSizeMs, inst->sample_rate_hz); - if (inst->plc_use_prev_decoded_samples) { - /* The number of samples we ask for is `number_of_lost_frames` times - * `prev_decoded_samples_`. Limit the number of samples to maximum - * `MaxFrameSizePerChannel()`. */ - plc_samples = inst->prev_decoded_samples; - const int max_samples_per_channel = - MaxFrameSizePerChannel(inst->sample_rate_hz); - plc_samples = plc_samples <= max_samples_per_channel - ? plc_samples - : max_samples_per_channel; - } decoded_samples = DecodeNative(inst, NULL, 0, plc_samples, decoded, &audio_type, 0); if (decoded_samples < 0) { @@ -581,11 +549,6 @@ int WebRtcOpus_Decode(OpusDecInst* inst, return -1; } - if (inst->plc_use_prev_decoded_samples) { - /* Update decoded sample memory, to be used by the PLC in case of losses. */ - inst->prev_decoded_samples = decoded_samples; - } - return decoded_samples; } @@ -639,16 +602,6 @@ int WebRtcOpus_DurationEst(OpusDecInst* inst, } int WebRtcOpus_PlcDuration(OpusDecInst* inst) { - if (inst->plc_use_prev_decoded_samples) { - /* The number of samples we ask for is `number_of_lost_frames` times - * `prev_decoded_samples_`. Limit the number of samples to maximum - * `MaxFrameSizePerChannel()`. */ - const int plc_samples = inst->prev_decoded_samples; - const int max_samples_per_channel = - MaxFrameSizePerChannel(inst->sample_rate_hz); - return plc_samples <= max_samples_per_channel ? plc_samples - : max_samples_per_channel; - } return FrameSizePerChannel(kWebRtcOpusPlcFrameSizeMs, inst->sample_rate_hz); }