Add ClippingPredictor config in AudioProcessing config
Bug: webrtc:12774 Change-Id: Id8cdb6b5499a22cbca40d424cf936f81c1e7d8d7 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/221104 Reviewed-by: Minyue Li <minyue@webrtc.org> Commit-Queue: Hanna Silen <silen@webrtc.org> Cr-Commit-Position: refs/heads/master@{#34204}
This commit is contained in:
committed by
WebRTC LUCI CQ
parent
cbdbb8c166
commit
a43953a518
@ -81,7 +81,19 @@ bool Agc1Config::operator==(const Agc1Config& rhs) const {
|
||||
analog_lhs.clipped_level_step == analog_rhs.clipped_level_step &&
|
||||
analog_lhs.clipped_ratio_threshold ==
|
||||
analog_rhs.clipped_ratio_threshold &&
|
||||
analog_lhs.clipped_wait_frames == analog_rhs.clipped_wait_frames;
|
||||
analog_lhs.clipped_wait_frames == analog_rhs.clipped_wait_frames &&
|
||||
analog_lhs.clipping_predictor.mode ==
|
||||
analog_rhs.clipping_predictor.mode &&
|
||||
analog_lhs.clipping_predictor.window_length ==
|
||||
analog_rhs.clipping_predictor.window_length &&
|
||||
analog_lhs.clipping_predictor.reference_window_length ==
|
||||
analog_rhs.clipping_predictor.reference_window_length &&
|
||||
analog_lhs.clipping_predictor.reference_window_delay ==
|
||||
analog_rhs.clipping_predictor.reference_window_delay &&
|
||||
analog_lhs.clipping_predictor.clipping_threshold ==
|
||||
analog_rhs.clipping_predictor.clipping_threshold &&
|
||||
analog_lhs.clipping_predictor.crest_factor_margin ==
|
||||
analog_rhs.clipping_predictor.crest_factor_margin;
|
||||
}
|
||||
|
||||
bool Agc2Config::AdaptiveDigital::operator==(
|
||||
@ -167,7 +179,26 @@ std::string AudioProcessing::Config::ToString() const {
|
||||
<< gain_controller1.analog_gain_controller.clipped_ratio_threshold
|
||||
<< ", clipped_wait_frames: "
|
||||
<< gain_controller1.analog_gain_controller.clipped_wait_frames
|
||||
<< " }}, gain_controller2: { enabled: " << gain_controller2.enabled
|
||||
<< ", clipping_predictor: { enabled: "
|
||||
<< gain_controller1.analog_gain_controller.clipping_predictor.enabled
|
||||
<< ", mode: "
|
||||
<< gain_controller1.analog_gain_controller.clipping_predictor.mode
|
||||
<< ", window_length: "
|
||||
<< gain_controller1.analog_gain_controller.clipping_predictor
|
||||
.window_length
|
||||
<< ", reference_window_length: "
|
||||
<< gain_controller1.analog_gain_controller.clipping_predictor
|
||||
.reference_window_length
|
||||
<< ", reference_window_delay: "
|
||||
<< gain_controller1.analog_gain_controller.clipping_predictor
|
||||
.reference_window_delay
|
||||
<< ", clipping_threshold: "
|
||||
<< gain_controller1.analog_gain_controller.clipping_predictor
|
||||
.clipping_threshold
|
||||
<< ", crest_factor_margin: "
|
||||
<< gain_controller1.analog_gain_controller.clipping_predictor
|
||||
.crest_factor_margin
|
||||
<< " }}}, gain_controller2: { enabled: " << gain_controller2.enabled
|
||||
<< ", fixed_digital: { gain_db: "
|
||||
<< gain_controller2.fixed_digital.gain_db
|
||||
<< " }, adaptive_digital: { enabled: "
|
||||
|
||||
@ -343,6 +343,37 @@ class RTC_EXPORT AudioProcessing : public rtc::RefCountInterface {
|
||||
// Time in frames to wait after a clipping event before checking again.
|
||||
// Limited to values higher than 0.
|
||||
int clipped_wait_frames = 300;
|
||||
|
||||
// Enables clipping prediction functionality.
|
||||
struct ClippingPredictor {
|
||||
bool enabled = false;
|
||||
enum Mode {
|
||||
// Sets clipping prediction for clipping event prediction with fixed
|
||||
// step estimation.
|
||||
kClippingEventPrediction,
|
||||
// Sets clipping prediction for clipped peak estimation with
|
||||
// adaptive step estimation.
|
||||
kAdaptiveStepClippingPeakPrediction,
|
||||
// Sets clipping prediction for clipped peak estimation with fixed
|
||||
// step estimation.
|
||||
kFixedStepClippingPeakPrediction,
|
||||
};
|
||||
Mode mode = kClippingEventPrediction;
|
||||
// Number of frames in the sliding analysis window. Limited to values
|
||||
// higher than zero.
|
||||
int window_length = 5;
|
||||
// Number of frames in the sliding reference window. Limited to values
|
||||
// higher than zero.
|
||||
int reference_window_length = 5;
|
||||
// Number of frames the reference window is delayed. Limited to values
|
||||
// zero and higher. An additional requirement:
|
||||
// |window_length < reference_window_length + reference_window_delay|.
|
||||
int reference_window_delay = 5;
|
||||
// Clipping predictor ste estimation threshold (dB).
|
||||
float clipping_threshold = -1.0f;
|
||||
// Crest factor drop threshold (dB).
|
||||
float crest_factor_margin = 3.0f;
|
||||
} clipping_predictor;
|
||||
} analog_gain_controller;
|
||||
} gain_controller1;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user