Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(823)

Unified Diff: webrtc/modules/audio_processing/ns/ns_core.c

Issue 1172163004: Reformat existing code. There should be no functional effects. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Resync Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/audio_processing/ns/ns_core.c
diff --git a/webrtc/modules/audio_processing/ns/ns_core.c b/webrtc/modules/audio_processing/ns/ns_core.c
index 1bd7af4adf78e33622247d60e3a6e7f2edb729e9..652f0fea00a3ff07443c9ca2ac70b6efa9885a0f 100644
--- a/webrtc/modules/audio_processing/ns/ns_core.c
+++ b/webrtc/modules/audio_processing/ns/ns_core.c
@@ -606,8 +606,8 @@ static void ComputeSpectralDifference(NoiseSuppressionC* self,
// Conservative smooth noise spectrum from pause frames.
avgPause += self->magnAvgPause[i];
}
- avgPause = avgPause / ((float)self->magnLen);
- avgMagn = avgMagn / ((float)self->magnLen);
+ avgPause /= self->magnLen;
+ avgMagn /= self->magnLen;
covMagnPause = 0.0;
varPause = 0.0;
@@ -619,9 +619,9 @@ static void ComputeSpectralDifference(NoiseSuppressionC* self,
(self->magnAvgPause[i] - avgPause) * (self->magnAvgPause[i] - avgPause);
varMagn += (magnIn[i] - avgMagn) * (magnIn[i] - avgMagn);
}
- covMagnPause = covMagnPause / ((float)self->magnLen);
- varPause = varPause / ((float)self->magnLen);
- varMagn = varMagn / ((float)self->magnLen);
+ covMagnPause /= self->magnLen;
+ varPause /= self->magnLen;
+ varMagn /= self->magnLen;
// Update of average magnitude spectrum.
self->featureData[6] += self->signalEnergy;
@@ -1099,7 +1099,7 @@ void WebRtcNs_AnalyzeCore(NoiseSuppressionC* self, const float* speechFrame) {
}
}
}
- signalEnergy = signalEnergy / ((float)self->magnLen);
+ signalEnergy /= self->magnLen;
self->signalEnergy = signalEnergy;
self->sumMagn = sumMagn;
@@ -1108,9 +1108,9 @@ void WebRtcNs_AnalyzeCore(NoiseSuppressionC* self, const float* speechFrame) {
// Compute simplified noise model during startup.
if (self->blockInd < END_STARTUP_SHORT) {
// Estimate White noise.
- self->whiteNoiseLevel += sumMagn / ((float)self->magnLen) * self->overdrive;
+ self->whiteNoiseLevel += sumMagn / self->magnLen * self->overdrive;
// Estimate Pink noise parameters.
- tmpFloat1 = sum_log_i_square * ((float)(self->magnLen - kStartBand));
+ tmpFloat1 = sum_log_i_square * (self->magnLen - kStartBand);
tmpFloat1 -= (sum_log_i * sum_log_i);
tmpFloat2 =
(sum_log_i_square * sum_log_magn - sum_log_i * sum_log_i_log_magn);
@@ -1121,7 +1121,7 @@ void WebRtcNs_AnalyzeCore(NoiseSuppressionC* self, const float* speechFrame) {
}
self->pinkNoiseNumerator += tmpFloat3;
tmpFloat2 = (sum_log_i * sum_log_magn);
- tmpFloat2 -= ((float)(self->magnLen - kStartBand)) * sum_log_i_log_magn;
+ tmpFloat2 -= (self->magnLen - kStartBand) * sum_log_i_log_magn;
tmpFloat3 = tmpFloat2 / tmpFloat1;
// Constrain the pink noise power to be in the interval [0, 1].
if (tmpFloat3 < 0.f) {

Powered by Google App Engine
This is Rietveld 408576698