Delete expired and unused field trial WebRTC-Audio-OpusPlcUsePrevDecodedSamples
Bug: b/143582588, webrtc:42221607 Change-Id: I49f477ab785801c8ef7143ab8b8654dd7379dfbd Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/359560 Commit-Queue: Danil Chapovalov <danilchap@webrtc.org> Reviewed-by: Jakob Ivarsson <jakobi@webrtc.org> Cr-Commit-Position: refs/heads/main@{#42783}
This commit is contained in:
parent
eb26634e6a
commit
759f8d80f0
@ -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)
|
||||
|
||||
@ -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) {
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user