Bump to WebRTC M120 release
Some API deprecation -- ExperimentalAgc and ExperimentalNs are gone. We're continuing to carry iSAC even though it's gone upstream, but maybe we'll want to drop that soon.
This commit is contained in:
@ -35,16 +35,12 @@ int16_t MapSetting(GainControl::Mode mode) {
|
||||
case GainControl::kFixedDigital:
|
||||
return kAgcModeFixedDigital;
|
||||
}
|
||||
RTC_NOTREACHED();
|
||||
RTC_DCHECK_NOTREACHED();
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Checks whether the legacy digital gain application should be used.
|
||||
bool UseLegacyDigitalGainApplier() {
|
||||
return field_trial::IsEnabled("WebRTC-UseLegacyDigitalGainApplier");
|
||||
}
|
||||
|
||||
// Floating point variant of WebRtcAgc_Process.
|
||||
// Applies the sub-frame `gains` to all the bands in `out` and clamps the output
|
||||
// in the signed 16 bit range.
|
||||
void ApplyDigitalGain(const int32_t gains[11],
|
||||
size_t num_bands,
|
||||
float* const* out) {
|
||||
@ -97,7 +93,6 @@ int GainControlImpl::instance_counter_ = 0;
|
||||
|
||||
GainControlImpl::GainControlImpl()
|
||||
: data_dumper_(new ApmDataDumper(instance_counter_)),
|
||||
use_legacy_gain_applier_(UseLegacyDigitalGainApplier()),
|
||||
mode_(kAdaptiveAnalog),
|
||||
minimum_capture_level_(0),
|
||||
maximum_capture_level_(255),
|
||||
@ -236,26 +231,9 @@ int GainControlImpl::ProcessCaptureAudio(AudioBuffer* audio,
|
||||
}
|
||||
}
|
||||
|
||||
if (use_legacy_gain_applier_) {
|
||||
for (size_t ch = 0; ch < mono_agcs_.size(); ++ch) {
|
||||
int16_t split_band_data[AudioBuffer::kMaxNumBands]
|
||||
[AudioBuffer::kMaxSplitFrameLength];
|
||||
int16_t* split_bands[AudioBuffer::kMaxNumBands] = {
|
||||
split_band_data[0], split_band_data[1], split_band_data[2]};
|
||||
audio->ExportSplitChannelData(ch, split_bands);
|
||||
|
||||
int err_process = WebRtcAgc_Process(
|
||||
mono_agcs_[ch]->state, mono_agcs_[index_to_apply]->gains, split_bands,
|
||||
audio->num_bands(), split_bands);
|
||||
RTC_DCHECK_EQ(err_process, 0);
|
||||
|
||||
audio->ImportSplitChannelData(ch, split_bands);
|
||||
}
|
||||
} else {
|
||||
for (size_t ch = 0; ch < mono_agcs_.size(); ++ch) {
|
||||
ApplyDigitalGain(mono_agcs_[index_to_apply]->gains, audio->num_bands(),
|
||||
audio->split_bands(ch));
|
||||
}
|
||||
for (size_t ch = 0; ch < mono_agcs_.size(); ++ch) {
|
||||
ApplyDigitalGain(mono_agcs_[index_to_apply]->gains, audio->num_bands(),
|
||||
audio->split_bands(ch));
|
||||
}
|
||||
|
||||
RTC_DCHECK_LT(0ul, *num_proc_channels_);
|
||||
@ -277,7 +255,6 @@ int GainControlImpl::ProcessCaptureAudio(AudioBuffer* audio,
|
||||
return AudioProcessing::kNoError;
|
||||
}
|
||||
|
||||
|
||||
// TODO(ajm): ensure this is called under kAdaptiveAnalog.
|
||||
int GainControlImpl::set_stream_analog_level(int level) {
|
||||
data_dumper_->DumpRaw("gain_control_set_stream_analog_level", 1, &level);
|
||||
@ -309,7 +286,6 @@ int GainControlImpl::set_mode(Mode mode) {
|
||||
return AudioProcessing::kNoError;
|
||||
}
|
||||
|
||||
|
||||
int GainControlImpl::set_analog_level_limits(int minimum, int maximum) {
|
||||
if (minimum < 0 || maximum > 65535 || maximum < minimum) {
|
||||
return AudioProcessing::kBadParameterError;
|
||||
@ -324,7 +300,6 @@ int GainControlImpl::set_analog_level_limits(int minimum, int maximum) {
|
||||
return AudioProcessing::kNoError;
|
||||
}
|
||||
|
||||
|
||||
int GainControlImpl::set_target_level_dbfs(int level) {
|
||||
if (level > 31 || level < 0) {
|
||||
return AudioProcessing::kBadParameterError;
|
||||
|
Reference in New Issue
Block a user