AgcManagerDirect: Remove clipping_predictor_evaluator_
Remove the evaluation of clipping prediction. The result is not used. Bug: webrtc:7494 Change-Id: I18d2c1f50ed675a9653d518095f69ed263a34041 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/278361 Reviewed-by: Alessio Bazzica <alessiob@webrtc.org> Commit-Queue: Hanna Silen <silen@webrtc.org> Cr-Commit-Position: refs/heads/main@{#38320}
This commit is contained in:

committed by
WebRTC LUCI CQ

parent
cfc3eb1a92
commit
3609a5aeb6
@ -35,7 +35,6 @@ rtc_library("agc") {
|
|||||||
"../../../system_wrappers:field_trial",
|
"../../../system_wrappers:field_trial",
|
||||||
"../../../system_wrappers:metrics",
|
"../../../system_wrappers:metrics",
|
||||||
"../agc2:clipping_predictor",
|
"../agc2:clipping_predictor",
|
||||||
"../agc2:clipping_predictor_evaluator",
|
|
||||||
"../agc2:gain_map",
|
"../agc2:gain_map",
|
||||||
"../vad",
|
"../vad",
|
||||||
]
|
]
|
||||||
|
@ -49,10 +49,6 @@ constexpr int kMaxResidualGainChange = 15;
|
|||||||
// restrictions from clipping events.
|
// restrictions from clipping events.
|
||||||
constexpr int kSurplusCompressionGain = 6;
|
constexpr int kSurplusCompressionGain = 6;
|
||||||
|
|
||||||
// History size for the clipping predictor evaluator (unit: number of 10 ms
|
|
||||||
// frames).
|
|
||||||
constexpr int kClippingPredictorEvaluatorHistorySize = 500;
|
|
||||||
|
|
||||||
// Target speech level (dBFs) and speech probability threshold used to compute
|
// Target speech level (dBFs) and speech probability threshold used to compute
|
||||||
// the RMS error override in `GetSpeechLevelErrorDb()`. These are only used for
|
// the RMS error override in `GetSpeechLevelErrorDb()`. These are only used for
|
||||||
// computing the error override and they are not passed to `agc_`.
|
// computing the error override and they are not passed to `agc_`.
|
||||||
@ -506,7 +502,6 @@ AgcManagerDirect::AgcManagerDirect(int num_capture_channels,
|
|||||||
use_clipping_predictor_step_(
|
use_clipping_predictor_step_(
|
||||||
!!clipping_predictor_ &&
|
!!clipping_predictor_ &&
|
||||||
analog_config.clipping_predictor.use_predicted_step),
|
analog_config.clipping_predictor.use_predicted_step),
|
||||||
clipping_predictor_evaluator_(kClippingPredictorEvaluatorHistorySize),
|
|
||||||
clipping_rate_log_(0.0f),
|
clipping_rate_log_(0.0f),
|
||||||
clipping_rate_log_counter_(0) {
|
clipping_rate_log_counter_(0) {
|
||||||
RTC_LOG(LS_INFO) << "[agc] analog controller enabled: "
|
RTC_LOG(LS_INFO) << "[agc] analog controller enabled: "
|
||||||
@ -546,7 +541,6 @@ void AgcManagerDirect::Initialize() {
|
|||||||
capture_output_used_ = true;
|
capture_output_used_ = true;
|
||||||
|
|
||||||
AggregateChannelLevels();
|
AggregateChannelLevels();
|
||||||
clipping_predictor_evaluator_.Reset();
|
|
||||||
clipping_rate_log_ = 0.0f;
|
clipping_rate_log_ = 0.0f;
|
||||||
clipping_rate_log_counter_ = 0;
|
clipping_rate_log_counter_ = 0;
|
||||||
}
|
}
|
||||||
@ -625,14 +619,6 @@ void AgcManagerDirect::AnalyzePreProcess(const AudioBuffer& audio_buffer) {
|
|||||||
clipping_predicted = true;
|
clipping_predicted = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Clipping prediction evaluation.
|
|
||||||
// `clipping_detected` is not used to evaluate the clipping predictor
|
|
||||||
// since for this purpose a single clipping sample counts as clipping.
|
|
||||||
const bool one_or_more_clipped_samples =
|
|
||||||
clipped_ratio >= (1.0f / samples_per_channel);
|
|
||||||
// TODO(webrtc:7494): Remove the evaluator, the result is not used.
|
|
||||||
clipping_predictor_evaluator_.Observe(
|
|
||||||
/*clipping_detected=*/one_or_more_clipped_samples, clipping_predicted);
|
|
||||||
}
|
}
|
||||||
if (clipping_detected) {
|
if (clipping_detected) {
|
||||||
RTC_DLOG(LS_INFO) << "[agc] Clipping detected. clipped_ratio="
|
RTC_DLOG(LS_INFO) << "[agc] Clipping detected. clipped_ratio="
|
||||||
@ -654,7 +640,6 @@ void AgcManagerDirect::AnalyzePreProcess(const AudioBuffer& audio_buffer) {
|
|||||||
frames_since_clipped_ = 0;
|
frames_since_clipped_ = 0;
|
||||||
if (!!clipping_predictor_) {
|
if (!!clipping_predictor_) {
|
||||||
clipping_predictor_->Reset();
|
clipping_predictor_->Reset();
|
||||||
clipping_predictor_evaluator_.RemoveExpectations();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
AggregateChannelLevels();
|
AggregateChannelLevels();
|
||||||
|
@ -18,7 +18,6 @@
|
|||||||
#include "api/array_view.h"
|
#include "api/array_view.h"
|
||||||
#include "modules/audio_processing/agc/agc.h"
|
#include "modules/audio_processing/agc/agc.h"
|
||||||
#include "modules/audio_processing/agc2/clipping_predictor.h"
|
#include "modules/audio_processing/agc2/clipping_predictor.h"
|
||||||
#include "modules/audio_processing/agc2/clipping_predictor_evaluator.h"
|
|
||||||
#include "modules/audio_processing/audio_buffer.h"
|
#include "modules/audio_processing/audio_buffer.h"
|
||||||
#include "modules/audio_processing/include/audio_processing.h"
|
#include "modules/audio_processing/include/audio_processing.h"
|
||||||
#include "modules/audio_processing/logging/apm_data_dumper.h"
|
#include "modules/audio_processing/logging/apm_data_dumper.h"
|
||||||
@ -182,7 +181,6 @@ class AgcManagerDirect final {
|
|||||||
|
|
||||||
const std::unique_ptr<ClippingPredictor> clipping_predictor_;
|
const std::unique_ptr<ClippingPredictor> clipping_predictor_;
|
||||||
const bool use_clipping_predictor_step_;
|
const bool use_clipping_predictor_step_;
|
||||||
ClippingPredictorEvaluator clipping_predictor_evaluator_;
|
|
||||||
float clipping_rate_log_;
|
float clipping_rate_log_;
|
||||||
int clipping_rate_log_counter_;
|
int clipping_rate_log_counter_;
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user