| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
#ifndef MODULES_AUDIO_PROCESSING_AGC2_AGC2_COMMON_H_ |
| 12 |
#define MODULES_AUDIO_PROCESSING_AGC2_AGC2_COMMON_H_ |
| 13 |
|
| 14 |
namespace webrtc { |
| 15 |
|
| 16 |
constexpr float kMinFloatS16Value = -32768.0f; |
| 17 |
constexpr float kMaxFloatS16Value = 32767.0f; |
| 18 |
constexpr float kMaxAbsFloatS16Value = 32768.0f; |
| 19 |
|
| 20 |
|
| 21 |
constexpr float kMinLevelDbfs = -90.31f; |
| 22 |
|
| 23 |
constexpr int kFrameDurationMs = 10; |
| 24 |
constexpr int kSubFramesInFrame = 20; |
| 25 |
constexpr int kMaximalNumberOfSamplesPerChannel = 480; |
| 26 |
|
| 27 |
|
| 28 |
constexpr float kHeadroomDbfs = 1.0f; |
| 29 |
constexpr float kMaxGainDb = 30.0f; |
| 30 |
constexpr float kInitialAdaptiveDigitalGainDb = 8.0f; |
| 31 |
|
| 32 |
constexpr float kLimiterThresholdForAgcGainDbfs = -kHeadroomDbfs; |
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
constexpr float kVadConfidenceThreshold = 0.95f; |
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
constexpr float kLevelEstimatorTimeToConfidenceMs = 400; |
| 43 |
constexpr float kLevelEstimatorLeakFactor = |
| 44 |
1.0f - 1.0f / kLevelEstimatorTimeToConfidenceMs; |
| 45 |
|
| 46 |
|
| 47 |
constexpr int kDefaultVadRnnResetPeriodMs = 1500; |
| 48 |
static_assert(kDefaultVadRnnResetPeriodMs % kFrameDurationMs == 0, ""); |
| 49 |
constexpr int kDefaultLevelEstimatorAdjacentSpeechFramesThreshold = 12; |
| 50 |
|
| 51 |
|
| 52 |
constexpr float kSaturationProtectorInitialHeadroomDb = 20.0f; |
| 53 |
constexpr float kSaturationProtectorExtraHeadroomDb = 5.0f; |
| 54 |
constexpr int kSaturationProtectorBufferSize = 4; |
| 55 |
|
| 56 |
|
| 57 |
|
| 58 |
constexpr float kInitialSpeechLevelEstimateDbfs = |
| 59 |
-kSaturationProtectorExtraHeadroomDb - |
| 60 |
kSaturationProtectorInitialHeadroomDb - kInitialAdaptiveDigitalGainDb - |
| 61 |
kHeadroomDbfs; |
| 62 |
|
| 63 |
|
| 64 |
|
| 65 |
|
| 66 |
constexpr int kInterpolatedGainCurveKneePoints = 22; |
| 67 |
constexpr int kInterpolatedGainCurveBeyondKneePoints = 10; |
| 68 |
constexpr int kInterpolatedGainCurveTotalPoints = |
| 69 |
kInterpolatedGainCurveKneePoints + kInterpolatedGainCurveBeyondKneePoints; |
| 70 |
|
| 71 |
} |
| 72 |
|
| 73 |
#endif |