Lines Matching refs:inst

296 static void UpdateNoiseEstimate(NsxInst_t* inst, int offset) {  in UpdateNoiseEstimate()  argument
304 tmp16 = WebRtcSpl_MaxValueW16(inst->noiseEstLogQuantile + offset, in UpdateNoiseEstimate()
305 inst->magnLen); in UpdateNoiseEstimate()
307 inst->qNoise = 14 - (int) WEBRTC_SPL_MUL_16_16_RSFT_WITH_ROUND( in UpdateNoiseEstimate()
309 for (i = 0; i < inst->magnLen; i++) { in UpdateNoiseEstimate()
313 inst->noiseEstLogQuantile[offset + i]); in UpdateNoiseEstimate()
317 tmp16 += (int16_t) inst->qNoise; //shift to get result in Q(qNoise) in UpdateNoiseEstimate()
323 inst->noiseEstQuantile[i] = WebRtcSpl_SatW32ToW16(tmp32no1); in UpdateNoiseEstimate()
328 static void NoiseEstimationC(NsxInst_t* inst, in NoiseEstimationC() argument
340 tabind = inst->stages - inst->normData; in NoiseEstimationC()
353 for (i = 0; i < inst->magnLen; i++) { in NoiseEstimationC()
373 offset = s * inst->magnLen; in NoiseEstimationC()
376 counter = inst->noiseEstCounter[s]; in NoiseEstimationC()
382 for (i = 0; i < inst->magnLen; i++) { in NoiseEstimationC()
384 if (inst->noiseEstDensity[offset + i] > 512) { in NoiseEstimationC()
386 int factor = WebRtcSpl_NormW16(inst->noiseEstDensity[offset + i]); in NoiseEstimationC()
390 if (inst->blockIndex < END_STARTUP_LONG) { in NoiseEstimationC()
399 if (lmagn[i] > inst->noiseEstLogQuantile[offset + i]) { in NoiseEstimationC()
403 inst->noiseEstLogQuantile[offset + i] += tmp16 / 4; in NoiseEstimationC()
408 inst->noiseEstLogQuantile[offset + i] -= tmp16no2; in NoiseEstimationC()
409 if (inst->noiseEstLogQuantile[offset + i] < logval) { in NoiseEstimationC()
412 inst->noiseEstLogQuantile[offset + i] = logval; in NoiseEstimationC()
417 if (WEBRTC_SPL_ABS_W16(lmagn[i] - inst->noiseEstLogQuantile[offset + i]) in NoiseEstimationC()
420 inst->noiseEstDensity[offset + i], countProd, 15); in NoiseEstimationC()
423 inst->noiseEstDensity[offset + i] = tmp16no1 + tmp16no2; in NoiseEstimationC()
428 inst->noiseEstCounter[s] = 0; in NoiseEstimationC()
429 if (inst->blockIndex >= END_STARTUP_LONG) { in NoiseEstimationC()
430 UpdateNoiseEstimate(inst, offset); in NoiseEstimationC()
433 inst->noiseEstCounter[s]++; in NoiseEstimationC()
438 if (inst->blockIndex < END_STARTUP_LONG) { in NoiseEstimationC()
439 UpdateNoiseEstimate(inst, offset); in NoiseEstimationC()
442 for (i = 0; i < inst->magnLen; i++) { in NoiseEstimationC()
443 noise[i] = (uint32_t)(inst->noiseEstQuantile[i]); // Q(qNoise) in NoiseEstimationC()
445 (*q_noise) = (int16_t)inst->qNoise; in NoiseEstimationC()
449 static void PrepareSpectrumC(NsxInst_t* inst, int16_t* freq_buf) { in PrepareSpectrumC() argument
452 for (i = 0; i < inst->magnLen; i++) { in PrepareSpectrumC()
453 inst->real[i] = (int16_t)WEBRTC_SPL_MUL_16_16_RSFT(inst->real[i], in PrepareSpectrumC()
454 (int16_t)(inst->noiseSupFilter[i]), 14); // Q(normData-stages) in PrepareSpectrumC()
455 inst->imag[i] = (int16_t)WEBRTC_SPL_MUL_16_16_RSFT(inst->imag[i], in PrepareSpectrumC()
456 (int16_t)(inst->noiseSupFilter[i]), 14); // Q(normData-stages) in PrepareSpectrumC()
459 freq_buf[0] = inst->real[0]; in PrepareSpectrumC()
460 freq_buf[1] = -inst->imag[0]; in PrepareSpectrumC()
461 for (i = 1, j = 2; i < inst->anaLen2; i += 1, j += 2) { in PrepareSpectrumC()
462 freq_buf[j] = inst->real[i]; in PrepareSpectrumC()
463 freq_buf[j + 1] = -inst->imag[i]; in PrepareSpectrumC()
465 freq_buf[inst->anaLen] = inst->real[inst->anaLen2]; in PrepareSpectrumC()
466 freq_buf[inst->anaLen + 1] = -inst->imag[inst->anaLen2]; in PrepareSpectrumC()
470 static void DenormalizeC(NsxInst_t* inst, int16_t* in, int factor) { in DenormalizeC() argument
473 for (i = 0; i < inst->anaLen; i += 1) { in DenormalizeC()
475 factor - inst->normData); in DenormalizeC()
476 inst->real[i] = WebRtcSpl_SatW32ToW16(tmp32); // Q0 in DenormalizeC()
482 static void SynthesisUpdateC(NsxInst_t* inst, in SynthesisUpdateC() argument
491 for (i = 0; i < inst->anaLen; i++) { in SynthesisUpdateC()
493 inst->window[i], inst->real[i], 14); // Q0, window in Q14 in SynthesisUpdateC()
497 inst->synthesisBuffer[i] = WebRtcSpl_AddSatW16(inst->synthesisBuffer[i], in SynthesisUpdateC()
502 for (i = 0; i < inst->blockLen10ms; i++) { in SynthesisUpdateC()
503 out_frame[i] = inst->synthesisBuffer[i]; // Q0 in SynthesisUpdateC()
507 WEBRTC_SPL_MEMCPY_W16(inst->synthesisBuffer, in SynthesisUpdateC()
508 inst->synthesisBuffer + inst->blockLen10ms, in SynthesisUpdateC()
509 inst->anaLen - inst->blockLen10ms); in SynthesisUpdateC()
510 WebRtcSpl_ZerosArrayW16(inst->synthesisBuffer in SynthesisUpdateC()
511 + inst->anaLen - inst->blockLen10ms, inst->blockLen10ms); in SynthesisUpdateC()
515 static void AnalysisUpdateC(NsxInst_t* inst, in AnalysisUpdateC() argument
521 WEBRTC_SPL_MEMCPY_W16(inst->analysisBuffer, in AnalysisUpdateC()
522 inst->analysisBuffer + inst->blockLen10ms, in AnalysisUpdateC()
523 inst->anaLen - inst->blockLen10ms); in AnalysisUpdateC()
524 WEBRTC_SPL_MEMCPY_W16(inst->analysisBuffer in AnalysisUpdateC()
525 + inst->anaLen - inst->blockLen10ms, new_speech, inst->blockLen10ms); in AnalysisUpdateC()
528 for (i = 0; i < inst->anaLen; i++) { in AnalysisUpdateC()
530 inst->window[i], inst->analysisBuffer[i], 14); // Q0 in AnalysisUpdateC()
535 static void NormalizeRealBufferC(NsxInst_t* inst, in NormalizeRealBufferC() argument
539 assert(inst->normData >= 0); in NormalizeRealBufferC()
540 for (i = 0; i < inst->anaLen; ++i) { in NormalizeRealBufferC()
541 out[i] = in[i] << inst->normData; // Q(normData) in NormalizeRealBufferC()
576 void WebRtcNsx_CalcParametricNoiseEstimate(NsxInst_t* inst, in WebRtcNsx_CalcParametricNoiseEstimate() argument
598 tmp32no1 += (inst->minNorm - inst->stages) << 11; in WebRtcNsx_CalcParametricNoiseEstimate()
617 *noise_estimate = (*noise_estimate_avg) * (uint32_t)(inst->blockIndex + 1); in WebRtcNsx_CalcParametricNoiseEstimate()
622 int32_t WebRtcNsx_InitCore(NsxInst_t* inst, uint32_t fs) { in WebRtcNsx_InitCore() argument
626 if (inst == NULL) { in WebRtcNsx_InitCore()
633 inst->fs = fs; in WebRtcNsx_InitCore()
639 inst->blockLen10ms = 80; in WebRtcNsx_InitCore()
640 inst->anaLen = 128; in WebRtcNsx_InitCore()
641 inst->stages = 7; in WebRtcNsx_InitCore()
642 inst->window = kBlocks80w128x; in WebRtcNsx_InitCore()
643 inst->thresholdLogLrt = 131072; //default threshold for LRT feature in WebRtcNsx_InitCore()
644 inst->maxLrt = 0x0040000; in WebRtcNsx_InitCore()
645 inst->minLrt = 52429; in WebRtcNsx_InitCore()
647 inst->blockLen10ms = 160; in WebRtcNsx_InitCore()
648 inst->anaLen = 256; in WebRtcNsx_InitCore()
649 inst->stages = 8; in WebRtcNsx_InitCore()
650 inst->window = kBlocks160w256x; in WebRtcNsx_InitCore()
651 inst->thresholdLogLrt = 212644; //default threshold for LRT feature in WebRtcNsx_InitCore()
652 inst->maxLrt = 0x0080000; in WebRtcNsx_InitCore()
653 inst->minLrt = 104858; in WebRtcNsx_InitCore()
655 inst->blockLen10ms = 160; in WebRtcNsx_InitCore()
656 inst->anaLen = 256; in WebRtcNsx_InitCore()
657 inst->stages = 8; in WebRtcNsx_InitCore()
658 inst->window = kBlocks160w256x; in WebRtcNsx_InitCore()
659 inst->thresholdLogLrt = 212644; //default threshold for LRT feature in WebRtcNsx_InitCore()
660 inst->maxLrt = 0x0080000; in WebRtcNsx_InitCore()
661 inst->minLrt = 104858; in WebRtcNsx_InitCore()
663 inst->anaLen2 = inst->anaLen / 2; in WebRtcNsx_InitCore()
664 inst->magnLen = inst->anaLen2 + 1; in WebRtcNsx_InitCore()
666 if (inst->real_fft != NULL) { in WebRtcNsx_InitCore()
667 WebRtcSpl_FreeRealFFT(inst->real_fft); in WebRtcNsx_InitCore()
669 inst->real_fft = WebRtcSpl_CreateRealFFT(inst->stages); in WebRtcNsx_InitCore()
670 if (inst->real_fft == NULL) { in WebRtcNsx_InitCore()
674 WebRtcSpl_ZerosArrayW16(inst->analysisBuffer, ANAL_BLOCKL_MAX); in WebRtcNsx_InitCore()
675 WebRtcSpl_ZerosArrayW16(inst->synthesisBuffer, ANAL_BLOCKL_MAX); in WebRtcNsx_InitCore()
678 WebRtcSpl_ZerosArrayW16(inst->dataBufHBFX, ANAL_BLOCKL_MAX); in WebRtcNsx_InitCore()
680 WebRtcSpl_ZerosArrayW16(inst->noiseEstQuantile, HALF_ANAL_BLOCKL); in WebRtcNsx_InitCore()
682 inst->noiseEstLogQuantile[i] = 2048; // Q8 in WebRtcNsx_InitCore()
683 inst->noiseEstDensity[i] = 153; // Q9 in WebRtcNsx_InitCore()
686 inst->noiseEstCounter[i] = (int16_t)(END_STARTUP_LONG * (i + 1)) / SIMULT; in WebRtcNsx_InitCore()
690 WebRtcSpl_MemSetW16((int16_t*)inst->noiseSupFilter, 16384, HALF_ANAL_BLOCKL); in WebRtcNsx_InitCore()
693 inst->aggrMode = 0; in WebRtcNsx_InitCore()
696 inst->priorNonSpeechProb = 8192; // Q14(0.5) prior probability for speech/noise in WebRtcNsx_InitCore()
698 inst->prevMagnU16[i] = 0; in WebRtcNsx_InitCore()
699 inst->prevNoiseU32[i] = 0; //previous noise-spectrum in WebRtcNsx_InitCore()
700 inst->logLrtTimeAvgW32[i] = 0; //smooth LR ratio in WebRtcNsx_InitCore()
701 inst->avgMagnPause[i] = 0; //conservative noise spectrum estimate in WebRtcNsx_InitCore()
702 inst->initMagnEst[i] = 0; //initial average magnitude spectrum in WebRtcNsx_InitCore()
706 inst->thresholdSpecDiff = 50; //threshold for difference feature: determined on-line in WebRtcNsx_InitCore()
707 inst->thresholdSpecFlat = 20480; //threshold for flatness: determined on-line in WebRtcNsx_InitCore()
708 inst->featureLogLrt = inst->thresholdLogLrt; //average LRT factor (= threshold) in WebRtcNsx_InitCore()
709 inst->featureSpecFlat = inst->thresholdSpecFlat; //spectral flatness (= threshold) in WebRtcNsx_InitCore()
710 inst->featureSpecDiff = inst->thresholdSpecDiff; //spectral difference (= threshold) in WebRtcNsx_InitCore()
711 inst->weightLogLrt = 6; //default weighting par for LRT feature in WebRtcNsx_InitCore()
712 inst->weightSpecFlat = 0; //default weighting par for spectral flatness feature in WebRtcNsx_InitCore()
713 inst->weightSpecDiff = 0; //default weighting par for spectral difference feature in WebRtcNsx_InitCore()
715 inst->curAvgMagnEnergy = 0; //window time-average of input magnitude spectrum in WebRtcNsx_InitCore()
716 inst->timeAvgMagnEnergy = 0; //normalization for spectral difference in WebRtcNsx_InitCore()
717 inst->timeAvgMagnEnergyTmp = 0; //normalization for spectral difference in WebRtcNsx_InitCore()
720 WebRtcSpl_ZerosArrayW16(inst->histLrt, HIST_PAR_EST); in WebRtcNsx_InitCore()
721 WebRtcSpl_ZerosArrayW16(inst->histSpecDiff, HIST_PAR_EST); in WebRtcNsx_InitCore()
722 WebRtcSpl_ZerosArrayW16(inst->histSpecFlat, HIST_PAR_EST); in WebRtcNsx_InitCore()
724 inst->blockIndex = -1; //frame counter in WebRtcNsx_InitCore()
727 inst->modelUpdate = (1 << STAT_UPDATES); //window for update in WebRtcNsx_InitCore()
728 inst->cntThresUpdate = 0; //counter feature thresholds updates in WebRtcNsx_InitCore()
730 inst->sumMagn = 0; in WebRtcNsx_InitCore()
731 inst->magnEnergy = 0; in WebRtcNsx_InitCore()
732 inst->prevQMagn = 0; in WebRtcNsx_InitCore()
733 inst->qNoise = 0; in WebRtcNsx_InitCore()
734 inst->prevQNoise = 0; in WebRtcNsx_InitCore()
736 inst->energyIn = 0; in WebRtcNsx_InitCore()
737 inst->scaleEnergyIn = 0; in WebRtcNsx_InitCore()
739 inst->whiteNoiseLevel = 0; in WebRtcNsx_InitCore()
740 inst->pinkNoiseNumerator = 0; in WebRtcNsx_InitCore()
741 inst->pinkNoiseExp = 0; in WebRtcNsx_InitCore()
742 inst->minNorm = 15; // Start with full scale in WebRtcNsx_InitCore()
743 inst->zeroInputSignal = 0; in WebRtcNsx_InitCore()
746 WebRtcNsx_set_policy_core(inst, 0); in WebRtcNsx_InitCore()
749 inst->infile = fopen("indebug.pcm", "wb"); in WebRtcNsx_InitCore()
750 inst->outfile = fopen("outdebug.pcm", "wb"); in WebRtcNsx_InitCore()
751 inst->file1 = fopen("file1.pcm", "wb"); in WebRtcNsx_InitCore()
752 inst->file2 = fopen("file2.pcm", "wb"); in WebRtcNsx_InitCore()
753 inst->file3 = fopen("file3.pcm", "wb"); in WebRtcNsx_InitCore()
754 inst->file4 = fopen("file4.pcm", "wb"); in WebRtcNsx_InitCore()
755 inst->file5 = fopen("file5.pcm", "wb"); in WebRtcNsx_InitCore()
779 inst->initFlag = 1; in WebRtcNsx_InitCore()
784 int WebRtcNsx_set_policy_core(NsxInst_t* inst, int mode) { in WebRtcNsx_set_policy_core() argument
790 inst->aggrMode = mode; in WebRtcNsx_set_policy_core()
792 inst->overdrive = 256; // Q8(1.0) in WebRtcNsx_set_policy_core()
793 inst->denoiseBound = 8192; // Q14(0.5) in WebRtcNsx_set_policy_core()
794 inst->gainMap = 0; // No gain compensation in WebRtcNsx_set_policy_core()
796 inst->overdrive = 256; // Q8(1.0) in WebRtcNsx_set_policy_core()
797 inst->denoiseBound = 4096; // Q14(0.25) in WebRtcNsx_set_policy_core()
798 inst->factor2Table = kFactor2Aggressiveness1; in WebRtcNsx_set_policy_core()
799 inst->gainMap = 1; in WebRtcNsx_set_policy_core()
801 inst->overdrive = 282; // ~= Q8(1.1) in WebRtcNsx_set_policy_core()
802 inst->denoiseBound = 2048; // Q14(0.125) in WebRtcNsx_set_policy_core()
803 inst->factor2Table = kFactor2Aggressiveness2; in WebRtcNsx_set_policy_core()
804 inst->gainMap = 1; in WebRtcNsx_set_policy_core()
806 inst->overdrive = 320; // Q8(1.25) in WebRtcNsx_set_policy_core()
807 inst->denoiseBound = 1475; // ~= Q14(0.09) in WebRtcNsx_set_policy_core()
808 inst->factor2Table = kFactor2Aggressiveness3; in WebRtcNsx_set_policy_core()
809 inst->gainMap = 1; in WebRtcNsx_set_policy_core()
819 void WebRtcNsx_FeatureParameterExtraction(NsxInst_t* inst, int flag) { in WebRtcNsx_FeatureParameterExtraction() argument
843 histIndex = (uint32_t)(inst->featureLogLrt); in WebRtcNsx_FeatureParameterExtraction()
845 inst->histLrt[histIndex]++; in WebRtcNsx_FeatureParameterExtraction()
849 histIndex = (inst->featureSpecFlat * 5) >> 8; in WebRtcNsx_FeatureParameterExtraction()
851 inst->histSpecFlat[histIndex]++; in WebRtcNsx_FeatureParameterExtraction()
855 if (inst->timeAvgMagnEnergy > 0) { in WebRtcNsx_FeatureParameterExtraction()
859 histIndex = ((inst->featureSpecDiff * 5) >> inst->stages) / in WebRtcNsx_FeatureParameterExtraction()
860 inst->timeAvgMagnEnergy; in WebRtcNsx_FeatureParameterExtraction()
863 inst->histSpecDiff[histIndex]++; in WebRtcNsx_FeatureParameterExtraction()
877 tmp32 = WEBRTC_SPL_MUL_16_16(inst->histLrt[i], j); in WebRtcNsx_FeatureParameterExtraction()
879 numHistLrt += inst->histLrt[i]; in WebRtcNsx_FeatureParameterExtraction()
885 tmp32 = WEBRTC_SPL_MUL_16_16(inst->histLrt[i], j); in WebRtcNsx_FeatureParameterExtraction()
897 inst->thresholdLogLrt = inst->maxLrt; in WebRtcNsx_FeatureParameterExtraction()
899 tmp32 = (int32_t)((tmpU32 << (9 + inst->stages)) / numHistLrt / in WebRtcNsx_FeatureParameterExtraction()
902 inst->thresholdLogLrt = WEBRTC_SPL_SAT(inst->maxLrt, in WebRtcNsx_FeatureParameterExtraction()
904 inst->minLrt); in WebRtcNsx_FeatureParameterExtraction()
922 if (inst->histSpecFlat[i] > maxPeak1) { in WebRtcNsx_FeatureParameterExtraction()
928 maxPeak1 = inst->histSpecFlat[i]; in WebRtcNsx_FeatureParameterExtraction()
929 weightPeak1SpecFlat = inst->histSpecFlat[i]; in WebRtcNsx_FeatureParameterExtraction()
931 } else if (inst->histSpecFlat[i] > maxPeak2) { in WebRtcNsx_FeatureParameterExtraction()
933 maxPeak2 = inst->histSpecFlat[i]; in WebRtcNsx_FeatureParameterExtraction()
934 weightPeak2SpecFlat = inst->histSpecFlat[i]; in WebRtcNsx_FeatureParameterExtraction()
953 inst->thresholdSpecFlat = WEBRTC_SPL_SAT(MAX_FLAT_Q10, FACTOR_2_FLAT_Q10 in WebRtcNsx_FeatureParameterExtraction()
968 if (inst->histSpecDiff[i] > maxPeak1) { in WebRtcNsx_FeatureParameterExtraction()
974 maxPeak1 = inst->histSpecDiff[i]; in WebRtcNsx_FeatureParameterExtraction()
975 weightPeak1SpecDiff = inst->histSpecDiff[i]; in WebRtcNsx_FeatureParameterExtraction()
977 } else if (inst->histSpecDiff[i] > maxPeak2) { in WebRtcNsx_FeatureParameterExtraction()
979 maxPeak2 = inst->histSpecDiff[i]; in WebRtcNsx_FeatureParameterExtraction()
980 weightPeak2SpecDiff = inst->histSpecDiff[i]; in WebRtcNsx_FeatureParameterExtraction()
992 inst->thresholdSpecDiff = WEBRTC_SPL_SAT(MAX_DIFF, FACTOR_1_LRT_DIFF in WebRtcNsx_FeatureParameterExtraction()
1004 inst->weightLogLrt = featureSum; in WebRtcNsx_FeatureParameterExtraction()
1005 inst->weightSpecFlat = useFeatureSpecFlat * featureSum; in WebRtcNsx_FeatureParameterExtraction()
1006 inst->weightSpecDiff = useFeatureSpecDiff * featureSum; in WebRtcNsx_FeatureParameterExtraction()
1009 WebRtcSpl_ZerosArrayW16(inst->histLrt, HIST_PAR_EST); in WebRtcNsx_FeatureParameterExtraction()
1010 WebRtcSpl_ZerosArrayW16(inst->histSpecDiff, HIST_PAR_EST); in WebRtcNsx_FeatureParameterExtraction()
1011 WebRtcSpl_ZerosArrayW16(inst->histSpecFlat, HIST_PAR_EST); in WebRtcNsx_FeatureParameterExtraction()
1019 void WebRtcNsx_ComputeSpectralFlatness(NsxInst_t* inst, uint16_t* magn) { in WebRtcNsx_ComputeSpectralFlatness() argument
1032 avgSpectralFlatnessDen = inst->sumMagn - (uint32_t)magn[0]; // Q(normData-stages) in WebRtcNsx_ComputeSpectralFlatness()
1038 for (i = 1; i < inst->magnLen; i++) { in WebRtcNsx_ComputeSpectralFlatness()
1051 tmpU32 = WEBRTC_SPL_UMUL_32_16(inst->featureSpecFlat, SPECT_FLAT_TAVG_Q14); // Q24 in WebRtcNsx_ComputeSpectralFlatness()
1052 inst->featureSpecFlat -= tmpU32 >> 14; // Q10 in WebRtcNsx_ComputeSpectralFlatness()
1063 logCurSpectralFlatness += ((int32_t)(inst->stages - 1) << (inst->stages + 7)); // Q(8+stages-1) in WebRtcNsx_ComputeSpectralFlatness()
1064 logCurSpectralFlatness -= (tmp32 << (inst->stages - 1)); in WebRtcNsx_ComputeSpectralFlatness()
1065 logCurSpectralFlatness <<= (10 - inst->stages); // Q17 in WebRtcNsx_ComputeSpectralFlatness()
1076 tmp32 = currentSpectralFlatness - (int32_t)inst->featureSpecFlat; // Q10 in WebRtcNsx_ComputeSpectralFlatness()
1078 inst->featureSpecFlat += tmp32 >> 14; // Q10 in WebRtcNsx_ComputeSpectralFlatness()
1087 void WebRtcNsx_ComputeSpectralDifference(NsxInst_t* inst, uint16_t* magnIn) { in WebRtcNsx_ComputeSpectralDifference() argument
1104 minPause = inst->avgMagnPause[0]; // Q(prevQMagn) in WebRtcNsx_ComputeSpectralDifference()
1106 for (i = 0; i < inst->magnLen; i++) { in WebRtcNsx_ComputeSpectralDifference()
1108 avgPauseFX += inst->avgMagnPause[i]; // in Q(prevQMagn) in WebRtcNsx_ComputeSpectralDifference()
1109 maxPause = WEBRTC_SPL_MAX(maxPause, inst->avgMagnPause[i]); in WebRtcNsx_ComputeSpectralDifference()
1110 minPause = WEBRTC_SPL_MIN(minPause, inst->avgMagnPause[i]); in WebRtcNsx_ComputeSpectralDifference()
1113 avgPauseFX >>= inst->stages - 1; in WebRtcNsx_ComputeSpectralDifference()
1114 avgMagnFX = inst->sumMagn >> (inst->stages - 1); in WebRtcNsx_ComputeSpectralDifference()
1118 nShifts = WEBRTC_SPL_MAX(0, 10 + inst->stages - WebRtcSpl_NormW32(tmp32no1)); in WebRtcNsx_ComputeSpectralDifference()
1123 for (i = 0; i < inst->magnLen; i++) { in WebRtcNsx_ComputeSpectralDifference()
1126 tmp32no2 = inst->avgMagnPause[i] - avgPauseFX; in WebRtcNsx_ComputeSpectralDifference()
1134 inst->curAvgMagnEnergy += in WebRtcNsx_ComputeSpectralDifference()
1135 inst->magnEnergy >> (2 * inst->normData + inst->stages - 1); in WebRtcNsx_ComputeSpectralDifference()
1166 tmpU32no1 = avgDiffNormMagnUFX >> (2 * inst->normData); in WebRtcNsx_ComputeSpectralDifference()
1167 if (inst->featureSpecDiff > tmpU32no1) { in WebRtcNsx_ComputeSpectralDifference()
1168 tmpU32no2 = WEBRTC_SPL_UMUL_32_16(inst->featureSpecDiff - tmpU32no1, in WebRtcNsx_ComputeSpectralDifference()
1170 inst->featureSpecDiff -= tmpU32no2 >> 8; // Q(-2*stages) in WebRtcNsx_ComputeSpectralDifference()
1172 tmpU32no2 = WEBRTC_SPL_UMUL_32_16(tmpU32no1 - inst->featureSpecDiff, in WebRtcNsx_ComputeSpectralDifference()
1174 inst->featureSpecDiff += tmpU32no2 >> 8; // Q(-2*stages) in WebRtcNsx_ComputeSpectralDifference()
1179 void WebRtcNsx_DataAnalysis(NsxInst_t* inst, short* speechFrame, uint16_t* magnU16) { in WebRtcNsx_DataAnalysis() argument
1212 WebRtcNsx_AnalysisUpdate(inst, winData, speechFrame); in WebRtcNsx_DataAnalysis()
1215 inst->energyIn = WebRtcSpl_Energy(winData, (int)inst->anaLen, &(inst->scaleEnergyIn)); in WebRtcNsx_DataAnalysis()
1218 inst->zeroInputSignal = 0; in WebRtcNsx_DataAnalysis()
1220 maxWinData = WebRtcSpl_MaxAbsValueW16(winData, inst->anaLen); in WebRtcNsx_DataAnalysis()
1221 inst->normData = WebRtcSpl_NormW16(maxWinData); in WebRtcNsx_DataAnalysis()
1224 inst->zeroInputSignal = 1; in WebRtcNsx_DataAnalysis()
1229 net_norm = inst->stages - inst->normData; in WebRtcNsx_DataAnalysis()
1231 right_shifts_in_magnU16 = inst->normData - inst->minNorm; in WebRtcNsx_DataAnalysis()
1233 inst->minNorm -= right_shifts_in_initMagnEst; in WebRtcNsx_DataAnalysis()
1237 WebRtcNsx_NormalizeRealBuffer(inst, winData, realImag); in WebRtcNsx_DataAnalysis()
1240 WebRtcSpl_RealForwardFFT(inst->real_fft, realImag, winData); in WebRtcNsx_DataAnalysis()
1242 inst->imag[0] = 0; // Q(normData-stages) in WebRtcNsx_DataAnalysis()
1243 inst->imag[inst->anaLen2] = 0; in WebRtcNsx_DataAnalysis()
1244 inst->real[0] = winData[0]; // Q(normData-stages) in WebRtcNsx_DataAnalysis()
1245 inst->real[inst->anaLen2] = winData[inst->anaLen]; in WebRtcNsx_DataAnalysis()
1247 inst->magnEnergy = (uint32_t)WEBRTC_SPL_MUL_16_16(inst->real[0], inst->real[0]); in WebRtcNsx_DataAnalysis()
1248 inst->magnEnergy += (uint32_t)WEBRTC_SPL_MUL_16_16(inst->real[inst->anaLen2], in WebRtcNsx_DataAnalysis()
1249 inst->real[inst->anaLen2]); in WebRtcNsx_DataAnalysis()
1250 magnU16[0] = (uint16_t)WEBRTC_SPL_ABS_W16(inst->real[0]); // Q(normData-stages) in WebRtcNsx_DataAnalysis()
1251 magnU16[inst->anaLen2] = (uint16_t)WEBRTC_SPL_ABS_W16(inst->real[inst->anaLen2]); in WebRtcNsx_DataAnalysis()
1252 inst->sumMagn = (uint32_t)magnU16[0]; // Q(normData-stages) in WebRtcNsx_DataAnalysis()
1253 inst->sumMagn += (uint32_t)magnU16[inst->anaLen2]; in WebRtcNsx_DataAnalysis()
1255 if (inst->blockIndex >= END_STARTUP_SHORT) { in WebRtcNsx_DataAnalysis()
1256 for (i = 1, j = 2; i < inst->anaLen2; i += 1, j += 2) { in WebRtcNsx_DataAnalysis()
1257 inst->real[i] = winData[j]; in WebRtcNsx_DataAnalysis()
1258 inst->imag[i] = -winData[j + 1]; in WebRtcNsx_DataAnalysis()
1263 inst->magnEnergy += tmpU32no1; // Q(2*(normData-stages)) in WebRtcNsx_DataAnalysis()
1266 inst->sumMagn += (uint32_t)magnU16[i]; // Q(normData-stages) in WebRtcNsx_DataAnalysis()
1274 inst->initMagnEst[0] >>= right_shifts_in_initMagnEst; in WebRtcNsx_DataAnalysis()
1275 inst->initMagnEst[inst->anaLen2] >>= right_shifts_in_initMagnEst; in WebRtcNsx_DataAnalysis()
1278 inst->initMagnEst[0] += magnU16[0] >> right_shifts_in_magnU16; in WebRtcNsx_DataAnalysis()
1279 inst->initMagnEst[inst->anaLen2] += in WebRtcNsx_DataAnalysis()
1280 magnU16[inst->anaLen2] >> right_shifts_in_magnU16; in WebRtcNsx_DataAnalysis()
1283 if (magnU16[inst->anaLen2]) { in WebRtcNsx_DataAnalysis()
1285 zeros = WebRtcSpl_NormU32((uint32_t)magnU16[inst->anaLen2]); in WebRtcNsx_DataAnalysis()
1286 frac = (int16_t)((((uint32_t)magnU16[inst->anaLen2] << zeros) & in WebRtcNsx_DataAnalysis()
1295 sum_log_i_log_magn = (WEBRTC_SPL_MUL_16_16(kLogIndex[inst->anaLen2], log2) >> 3); in WebRtcNsx_DataAnalysis()
1297 for (i = 1, j = 2; i < inst->anaLen2; i += 1, j += 2) { in WebRtcNsx_DataAnalysis()
1298 inst->real[i] = winData[j]; in WebRtcNsx_DataAnalysis()
1299 inst->imag[i] = -winData[j + 1]; in WebRtcNsx_DataAnalysis()
1304 inst->magnEnergy += tmpU32no1; // Q(2*(normData-stages)) in WebRtcNsx_DataAnalysis()
1307 inst->sumMagn += (uint32_t)magnU16[i]; // Q(normData-stages) in WebRtcNsx_DataAnalysis()
1310 inst->initMagnEst[i] >>= right_shifts_in_initMagnEst; in WebRtcNsx_DataAnalysis()
1313 inst->initMagnEst[i] += magnU16[i] >> right_shifts_in_magnU16; in WebRtcNsx_DataAnalysis()
1340 inst->whiteNoiseLevel >>= right_shifts_in_initMagnEst; in WebRtcNsx_DataAnalysis()
1343 tmpU32no1 = WEBRTC_SPL_UMUL_32_16(inst->sumMagn, inst->overdrive); in WebRtcNsx_DataAnalysis()
1344 tmpU32no1 >>= inst->stages + 8; in WebRtcNsx_DataAnalysis()
1351 inst->whiteNoiseLevel += tmpU32no1; // Q(minNorm-stages) in WebRtcNsx_DataAnalysis()
1361 if (inst->fs == 8000) { in WebRtcNsx_DataAnalysis()
1368 (inst->magnLen - kStartBand), kSumSquareLogIndex[65], 2); in WebRtcNsx_DataAnalysis()
1400 inst->pinkNoiseNumerator += tmp_2_w32; // Q11 in WebRtcNsx_DataAnalysis()
1405 tmp_1_w32 *= inst->magnLen - kStartBand; in WebRtcNsx_DataAnalysis()
1411 inst->pinkNoiseExp += WEBRTC_SPL_SAT(16384, tmp_1_w32, 0); // Q14 in WebRtcNsx_DataAnalysis()
1416 void WebRtcNsx_DataSynthesis(NsxInst_t* inst, short* outFrame) { in WebRtcNsx_DataSynthesis() argument
1434 if (inst->zeroInputSignal) { in WebRtcNsx_DataSynthesis()
1437 for (i = 0; i < inst->blockLen10ms; i++) { in WebRtcNsx_DataSynthesis()
1438 outFrame[i] = inst->synthesisBuffer[i]; // Q0 in WebRtcNsx_DataSynthesis()
1441 WEBRTC_SPL_MEMCPY_W16(inst->synthesisBuffer, in WebRtcNsx_DataSynthesis()
1442 inst->synthesisBuffer + inst->blockLen10ms, in WebRtcNsx_DataSynthesis()
1443 inst->anaLen - inst->blockLen10ms); in WebRtcNsx_DataSynthesis()
1444 WebRtcSpl_ZerosArrayW16(inst->synthesisBuffer + inst->anaLen - inst->blockLen10ms, in WebRtcNsx_DataSynthesis()
1445 inst->blockLen10ms); in WebRtcNsx_DataSynthesis()
1450 WebRtcNsx_PrepareSpectrum(inst, realImag); in WebRtcNsx_DataSynthesis()
1453 outCIFFT = WebRtcSpl_RealInverseFFT(inst->real_fft, realImag, rfft_out); in WebRtcNsx_DataSynthesis()
1455 WebRtcNsx_Denormalize(inst, rfft_out, outCIFFT); in WebRtcNsx_DataSynthesis()
1459 if (inst->gainMap == 1 && in WebRtcNsx_DataSynthesis()
1460 inst->blockIndex > END_STARTUP_LONG && in WebRtcNsx_DataSynthesis()
1461 inst->energyIn > 0) { in WebRtcNsx_DataSynthesis()
1462 …energyOut = WebRtcSpl_Energy(inst->real, (int)inst->anaLen, &scaleEnergyOut); // Q(-scaleEnergyOut) in WebRtcNsx_DataSynthesis()
1465 - inst->scaleEnergyIn); in WebRtcNsx_DataSynthesis()
1470 inst->energyIn >>= 8 + scaleEnergyOut - inst->scaleEnergyIn; in WebRtcNsx_DataSynthesis()
1473 assert(inst->energyIn > 0); in WebRtcNsx_DataSynthesis()
1474 energyRatio = (energyOut + inst->energyIn / 2) / inst->energyIn; // Q8 in WebRtcNsx_DataSynthesis()
1481 gainFactor2 = inst->factor2Table[energyRatio]; // Q8 in WebRtcNsx_DataSynthesis()
1486 tmp16no1 = (int16_t)WEBRTC_SPL_MUL_16_16_RSFT(16384 - inst->priorNonSpeechProb, in WebRtcNsx_DataSynthesis()
1488 tmp16no2 = (int16_t)WEBRTC_SPL_MUL_16_16_RSFT(inst->priorNonSpeechProb, in WebRtcNsx_DataSynthesis()
1494 WebRtcNsx_SynthesisUpdate(inst, outFrame, gainFactor); in WebRtcNsx_DataSynthesis()
1497 int WebRtcNsx_ProcessCore(NsxInst_t* inst, short* speechFrame, short* speechFrameHB, in WebRtcNsx_ProcessCore() argument
1537 assert(inst->anaLen > 0); in WebRtcNsx_ProcessCore()
1538 assert(inst->anaLen2 > 0); in WebRtcNsx_ProcessCore()
1539 assert(inst->anaLen % 16 == 0); in WebRtcNsx_ProcessCore()
1540 assert(inst->anaLen2 % 8 == 0); in WebRtcNsx_ProcessCore()
1541 assert(inst->blockLen10ms > 0); in WebRtcNsx_ProcessCore()
1542 assert(inst->blockLen10ms % 16 == 0); in WebRtcNsx_ProcessCore()
1543 assert(inst->magnLen == inst->anaLen2 + 1); in WebRtcNsx_ProcessCore()
1547 inst->blockLen10ms, inst->infile) != inst->blockLen10ms) { in WebRtcNsx_ProcessCore()
1553 if (inst->initFlag != 1) { in WebRtcNsx_ProcessCore()
1557 if ((inst->fs == 32000) && (speechFrameHB == NULL)) { in WebRtcNsx_ProcessCore()
1562 WebRtcNsx_DataAnalysis(inst, speechFrame, magnU16); in WebRtcNsx_ProcessCore()
1564 if (inst->zeroInputSignal) { in WebRtcNsx_ProcessCore()
1565 WebRtcNsx_DataSynthesis(inst, outFrame); in WebRtcNsx_ProcessCore()
1567 if (inst->fs == 32000) { in WebRtcNsx_ProcessCore()
1570 WEBRTC_SPL_MEMCPY_W16(inst->dataBufHBFX, inst->dataBufHBFX + inst->blockLen10ms, in WebRtcNsx_ProcessCore()
1571 inst->anaLen - inst->blockLen10ms); in WebRtcNsx_ProcessCore()
1572 WEBRTC_SPL_MEMCPY_W16(inst->dataBufHBFX + inst->anaLen - inst->blockLen10ms, in WebRtcNsx_ProcessCore()
1573 speechFrameHB, inst->blockLen10ms); in WebRtcNsx_ProcessCore()
1574 for (i = 0; i < inst->blockLen10ms; i++) { in WebRtcNsx_ProcessCore()
1575 outFrameHB[i] = inst->dataBufHBFX[i]; // Q0 in WebRtcNsx_ProcessCore()
1582 inst->blockIndex++; in WebRtcNsx_ProcessCore()
1586 qMagn = inst->normData - inst->stages; in WebRtcNsx_ProcessCore()
1589 WebRtcNsx_ComputeSpectralFlatness(inst, magnU16); in WebRtcNsx_ProcessCore()
1592 WebRtcNsx_NoiseEstimation(inst, magnU16, noiseU32, &qNoise); in WebRtcNsx_ProcessCore()
1595 for (i = 0; i < inst->magnLen; i++) { in WebRtcNsx_ProcessCore()
1596 prevNoiseU16[i] = (uint16_t)(inst->prevNoiseU32[i] >> 11); // Q(prevQNoise) in WebRtcNsx_ProcessCore()
1599 if (inst->blockIndex < END_STARTUP_SHORT) { in WebRtcNsx_ProcessCore()
1601 q_domain_to_use = WEBRTC_SPL_MIN((int)qNoise, inst->minNorm - inst->stages); in WebRtcNsx_ProcessCore()
1605 if (inst->pinkNoiseExp) { in WebRtcNsx_ProcessCore()
1606 pink_noise_exp_avg = (int16_t)WebRtcSpl_DivW32W16(inst->pinkNoiseExp, in WebRtcNsx_ProcessCore()
1607 … (int16_t)(inst->blockIndex + 1)); // Q14 in WebRtcNsx_ProcessCore()
1608 pink_noise_num_avg = WebRtcSpl_DivW32W16(inst->pinkNoiseNumerator, in WebRtcNsx_ProcessCore()
1609 (int16_t)(inst->blockIndex + 1)); // Q11 in WebRtcNsx_ProcessCore()
1610 WebRtcNsx_CalcParametricNoiseEstimate(inst, in WebRtcNsx_ProcessCore()
1618 noise_estimate = inst->whiteNoiseLevel; // Q(minNorm-stages) in WebRtcNsx_ProcessCore()
1619 noise_estimate_avg = noise_estimate / (inst->blockIndex + 1); // Q(minNorm-stages) in WebRtcNsx_ProcessCore()
1621 for (i = 0; i < inst->magnLen; i++) { in WebRtcNsx_ProcessCore()
1623 if ((inst->pinkNoiseExp) && (i >= kStartBand)) { in WebRtcNsx_ProcessCore()
1628 WebRtcNsx_CalcParametricNoiseEstimate(inst, in WebRtcNsx_ProcessCore()
1636 noiseSupFilterTmp[i] = inst->denoiseBound; in WebRtcNsx_ProcessCore()
1637 if (inst->initMagnEst[i]) { in WebRtcNsx_ProcessCore()
1640 tmpU32no1 = WEBRTC_SPL_UMUL_32_16(noise_estimate, inst->overdrive); in WebRtcNsx_ProcessCore()
1641 numerator = inst->initMagnEst[i] << 8; in WebRtcNsx_ProcessCore()
1655 tmpU32no1 = inst->initMagnEst[i] >> (6 - nShifts); in WebRtcNsx_ProcessCore()
1663 (uint32_t)(inst->denoiseBound)); // Q14 in WebRtcNsx_ProcessCore()
1677 (inst->minNorm - inst->stages - q_domain_to_use); in WebRtcNsx_ProcessCore()
1686 tmpU32no1 *= inst->blockIndex; in WebRtcNsx_ProcessCore()
1687 tmpU32no2 *= (END_STARTUP_SHORT - inst->blockIndex); in WebRtcNsx_ProcessCore()
1698 if (inst->blockIndex < END_STARTUP_LONG) { in WebRtcNsx_ProcessCore()
1700 inst->timeAvgMagnEnergyTmp += in WebRtcNsx_ProcessCore()
1701 inst->magnEnergy >> (2 * inst->normData + inst->stages - 1); in WebRtcNsx_ProcessCore()
1702 inst->timeAvgMagnEnergy = WebRtcSpl_DivU32U16(inst->timeAvgMagnEnergyTmp, in WebRtcNsx_ProcessCore()
1703 inst->blockIndex + 1); in WebRtcNsx_ProcessCore()
1712 nShifts = 5 - inst->prevQMagn + inst->prevQNoise; in WebRtcNsx_ProcessCore()
1713 for (i = 0; i < inst->magnLen; i++) { in WebRtcNsx_ProcessCore()
1752 nearMagnEst = inst->prevMagnU16[i] * inst->noiseSupFilter[i]; in WebRtcNsx_ProcessCore()
1754 tmpU32no2 = inst->prevNoiseU32[i] >> nShifts; // Q(prevQMagn+6) in WebRtcNsx_ProcessCore()
1776 WebRtcNsx_ComputeSpectralDifference(inst, magnU16); in WebRtcNsx_ProcessCore()
1780 inst->cntThresUpdate++; in WebRtcNsx_ProcessCore()
1781 flag = (int)(inst->cntThresUpdate == inst->modelUpdate); in WebRtcNsx_ProcessCore()
1783 WebRtcNsx_FeatureParameterExtraction(inst, flag); in WebRtcNsx_ProcessCore()
1786 inst->cntThresUpdate = 0; // Reset counter in WebRtcNsx_ProcessCore()
1791 inst->curAvgMagnEnergy >>= STAT_UPDATES; in WebRtcNsx_ProcessCore()
1793 tmpU32no1 = (inst->curAvgMagnEnergy + inst->timeAvgMagnEnergy + 1) >> 1; //Q(-2*stages) in WebRtcNsx_ProcessCore()
1795 if ((tmpU32no1 != inst->timeAvgMagnEnergy) && (inst->featureSpecDiff) && in WebRtcNsx_ProcessCore()
1796 (inst->timeAvgMagnEnergy > 0)) { in WebRtcNsx_ProcessCore()
1803 tmpU32no2 = inst->featureSpecDiff; in WebRtcNsx_ProcessCore()
1809 tmpU32no3 /= inst->timeAvgMagnEnergy; in WebRtcNsx_ProcessCore()
1811 inst->featureSpecDiff = 0x007FFFFF; in WebRtcNsx_ProcessCore()
1813 inst->featureSpecDiff = WEBRTC_SPL_MIN(0x007FFFFF, in WebRtcNsx_ProcessCore()
1818 inst->timeAvgMagnEnergy = tmpU32no1; // Q(-2*stages) in WebRtcNsx_ProcessCore()
1819 inst->curAvgMagnEnergy = 0; in WebRtcNsx_ProcessCore()
1823 WebRtcNsx_SpeechNoiseProb(inst, nonSpeechProbFinal, priorLocSnr, postLocSnr); in WebRtcNsx_ProcessCore()
1829 postShifts = inst->prevQNoise - qMagn; in WebRtcNsx_ProcessCore()
1830 nShifts = inst->prevQMagn - qMagn; in WebRtcNsx_ProcessCore()
1831 for (i = 0; i < inst->magnLen; i++) { in WebRtcNsx_ProcessCore()
1848 noiseUpdateU32 = inst->prevNoiseU32[i]; // Q(prevQNoise+11) in WebRtcNsx_ProcessCore()
1893 tmpU32no1 = inst->prevNoiseU32[i] + tmpU32no2; // Q(prevQNoise+11) in WebRtcNsx_ProcessCore()
1895 tmpU32no1 = inst->prevNoiseU32[i] - tmpU32no2; // Q(prevQNoise+11) in WebRtcNsx_ProcessCore()
1912 tmp32no2 = WEBRTC_SPL_SHIFT_W32(inst->avgMagnPause[i], -nShifts); in WebRtcNsx_ProcessCore()
1920 tmp32no1 = ((int32_t)magnU16[i] << nShifts) - inst->avgMagnPause[i]; in WebRtcNsx_ProcessCore()
1926 inst->avgMagnPause[i] = tmp32no2; in WebRtcNsx_ProcessCore()
1930 qNoise = inst->prevQNoise + norm32no1 - 5; in WebRtcNsx_ProcessCore()
1934 nShifts = inst->prevQNoise + 11 - qMagn; in WebRtcNsx_ProcessCore()
1935 for (i = 0; i < inst->magnLen; i++) { in WebRtcNsx_ProcessCore()
1984 tmpU32no1 = inst->overdrive + ((priorSnr + 8192) >> 14); // Q8 in WebRtcNsx_ProcessCore()
1985 assert(inst->overdrive > 0); in WebRtcNsx_ProcessCore()
1987inst->noiseSupFilter[i] = WEBRTC_SPL_SAT(16384, tmpU16no1, inst->denoiseBound); // 16384 = Q14(1.0… in WebRtcNsx_ProcessCore()
1990 if (inst->blockIndex < END_STARTUP_SHORT) { in WebRtcNsx_ProcessCore()
1992 tmpU32no1 = inst->noiseSupFilter[i] * inst->blockIndex; in WebRtcNsx_ProcessCore()
1994 (END_STARTUP_SHORT - inst->blockIndex); in WebRtcNsx_ProcessCore()
1996 inst->noiseSupFilter[i] = (uint16_t)WebRtcSpl_DivU32U16(tmpU32no1, in WebRtcNsx_ProcessCore()
2003 inst->prevQNoise = qNoise; in WebRtcNsx_ProcessCore()
2004 inst->prevQMagn = qMagn; in WebRtcNsx_ProcessCore()
2006 for (i = 0; i < inst->magnLen; i++) { in WebRtcNsx_ProcessCore()
2007 inst->prevNoiseU32[i] = noiseU32[i] << (norm32no1 - 5); // Q(qNoise+11) in WebRtcNsx_ProcessCore()
2008 inst->prevMagnU16[i] = magnU16[i]; // Q(qMagn) in WebRtcNsx_ProcessCore()
2011 for (i = 0; i < inst->magnLen; i++) { in WebRtcNsx_ProcessCore()
2012 inst->prevNoiseU32[i] = noiseU32[i] >> (5 - norm32no1); // Q(qNoise+11) in WebRtcNsx_ProcessCore()
2013 inst->prevMagnU16[i] = magnU16[i]; // Q(qMagn) in WebRtcNsx_ProcessCore()
2017 WebRtcNsx_DataSynthesis(inst, outFrame); in WebRtcNsx_ProcessCore()
2020 inst->blockLen10ms, inst->outfile) != inst->blockLen10ms) { in WebRtcNsx_ProcessCore()
2027 if (inst->fs == 32000) { in WebRtcNsx_ProcessCore()
2030 …WEBRTC_SPL_MEMCPY_W16(inst->dataBufHBFX, inst->dataBufHBFX + inst->blockLen10ms, inst->anaLen - in… in WebRtcNsx_ProcessCore()
2031 …WEBRTC_SPL_MEMCPY_W16(inst->dataBufHBFX + inst->anaLen - inst->blockLen10ms, speechFrameHB, inst->… in WebRtcNsx_ProcessCore()
2040 for (i = inst->anaLen2 - (inst->anaLen2 >> 2); i < inst->anaLen2; i++) { in WebRtcNsx_ProcessCore()
2042 tmpU32no1 += (uint32_t)(inst->noiseSupFilter[i]); // Q14 in WebRtcNsx_ProcessCore()
2044 assert(inst->stages >= 7); in WebRtcNsx_ProcessCore()
2045 avgProbSpeechHB = (4096 - (tmpU16no1 >> (inst->stages - 7))); // Q12 in WebRtcNsx_ProcessCore()
2046 avgFilterGainHB = (int16_t)(tmpU32no1 >> (inst->stages - 3)); // Q14 in WebRtcNsx_ProcessCore()
2085 = WEBRTC_SPL_SAT(16384, gainTimeDomainHB, (int16_t)(inst->denoiseBound)); // 16384 = Q14(1.0) in WebRtcNsx_ProcessCore()
2089 for (i = 0; i < inst->blockLen10ms; i++) { in WebRtcNsx_ProcessCore()
2091 = (int16_t)WEBRTC_SPL_MUL_16_16_RSFT(gainTimeDomainHB, inst->dataBufHBFX[i], 14); // Q0 in WebRtcNsx_ProcessCore()