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:
Hanna Silen
2021-06-02 17:13:24 +02:00
committed by WebRTC LUCI CQ
parent cbdbb8c166
commit a43953a518
2 changed files with 64 additions and 2 deletions

View File

@ -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;