Fix normalization of noise estimate in NoiseSuppressor
R=henrik.lundin@webrtc.org, peah@webrtc.org, turaj@webrtc.org Review URL: https://codereview.webrtc.org/1821443003 . Cr-Commit-Position: refs/heads/master@{#12201}
This commit is contained in:
@ -45,11 +45,14 @@ void WebRtcNsx_Process(NsxHandle* nsxInst,
|
||||
num_bands, outFrame);
|
||||
}
|
||||
|
||||
const uint32_t* WebRtcNsx_noise_estimate(const NsxHandle* nsxInst) {
|
||||
const uint32_t* WebRtcNsx_noise_estimate(const NsxHandle* nsxInst,
|
||||
int* q_noise) {
|
||||
*q_noise = 11;
|
||||
const NoiseSuppressionFixedC* self = (const NoiseSuppressionFixedC*)nsxInst;
|
||||
if (nsxInst == NULL || self->initFlag == 0) {
|
||||
return NULL;
|
||||
}
|
||||
*q_noise += self->prevQNoise;
|
||||
return self->prevNoiseU32;
|
||||
}
|
||||
|
||||
|
||||
@ -88,12 +88,16 @@ void WebRtcNsx_Process(NsxHandle* nsxInst,
|
||||
*
|
||||
* Input
|
||||
* - nsxInst : NSx instance. Needs to be initiated before call.
|
||||
* - q_noise : Q value of the noise estimate, which is the number of
|
||||
* bits that it needs to be right-shifted to be
|
||||
* normalized.
|
||||
*
|
||||
* Return value : Pointer to the noise estimate per frequency bin.
|
||||
* Returns NULL if the input is a NULL pointer or an
|
||||
* uninitialized instance.
|
||||
*/
|
||||
const uint32_t* WebRtcNsx_noise_estimate(const NsxHandle* nsxInst);
|
||||
const uint32_t* WebRtcNsx_noise_estimate(const NsxHandle* nsxInst,
|
||||
int* q_noise);
|
||||
|
||||
/* Returns the number of frequency bins, which is the length of the noise
|
||||
* estimate for example.
|
||||
|
||||
Reference in New Issue
Block a user