Loading lib_dec/TonalComponentDetection_fx.c +6 −3 Original line number Diff line number Diff line Loading @@ -97,8 +97,8 @@ void ivas_DetectTonalComponents_fx( lastMDCTSpect_exp = add( lastMDCTSpectrum_exp, scaleFactors_max_e ); } ELSE #endif { #endif FOR( Word16 i = 0; i < nSamples; i++ ) { pScaledMdctSpectrum[i] = L_shl( lastMDCTSpectrum[i], 16 ); /*15-lastMDCTSpectrum_exp+16 -> 31 - lastMDCTSpectrum_exp*/ Loading Loading @@ -151,7 +151,9 @@ void ivas_DetectTonalComponents_fx( /* Guard bit */ lastMDCTSpect_exp = add( lastMDCTSpect_exp, 1 ); scale_sig32( pScaledMdctSpectrum, nSamples, -1 ); /*q_pScaledMdctSpectrum - 1*/ #ifdef HARMONIZE_FUNC } #endif /* Find peak candidates in the last frame. */ findCandidates( nSamples, pScaledMdctSpectrum, lastMDCTSpect_exp, thresholdModification, floorPowerSpectrum ); Loading Loading @@ -771,6 +773,7 @@ static void findStrongestHarmonics( /* Use new F0, for which harmonics are most common in pHarmonicIndexes */ static void CorrectF0( #ifndef HARMONIZE_FUNC const Word16 /*short*/ *pHarmonicIndexes, /*I - Q0 */ const Word16 /*short*/ nHarmonics, /*I - Q0 */ Word16 /*short*/ *pF0 ) /*I/O - Q10 range: {0}, [4..18) */ Loading Loading @@ -916,8 +919,8 @@ static void CorrectF0( return; } #ifndef HARMONIZE_FUNC static void ivas_CorrectF0_fx( #endif const Word16 /*short*/ *pHarmonicIndexes, /*I - Q0 */ const Word16 /*short*/ nHarmonics, /*I - Q0 */ Word16 /*short*/ *pF0 ) /*I/O - Q10 range: {0}, [4..18) */ Loading Loading @@ -1070,7 +1073,7 @@ static void ivas_CorrectF0_fx( return; } #endif static void modifyThreshold( Word16 /*short*/ i, /*I - Q0 */ Loading lib_dec/tonalMDCTconcealment_fx.c +6 −2 Original line number Diff line number Diff line Loading @@ -881,8 +881,8 @@ static void ivas_CalcPowerSpecAndDetectTonalComponents_fx( #ifdef HARMONIZE_FUNC IF( element_mode != EVS_MONO ) #endif { #endif IF( LT_16( old_power_spectrum_q, power_spectrum_q ) ) { Scale_sig32( powerSpectrum, length, sub( old_power_spectrum_q, power_spectrum_q ) ); // Q(old_power_spectrum_q-power_spectrum_q) Loading @@ -894,7 +894,9 @@ static void ivas_CalcPowerSpecAndDetectTonalComponents_fx( } Scale_sig32( powerSpectrum, nSamples, -3 ); /*Adding guard bits*/ // Q(31 - powerSpectrum_exp )-3 powerSpectrum_exp = add( powerSpectrum_exp, 3 ); #ifdef HARMONIZE_FUNC } #endif FOR( i = hTonalMDCTConc->nSamplesCore; i < nSamples; i++ ) { Loading @@ -908,12 +910,14 @@ static void ivas_CalcPowerSpecAndDetectTonalComponents_fx( powerSpectrum_exp = sub( powerSpectrum_exp, hTonalMDCTConc->secondLastBlockData.gain_tcx_exp ); } ELSE #endif { #endif Word16 shift = Find_Max_Norm32( powerSpectrum, nSamples ); scale_sig32( powerSpectrum, nSamples, shift ); powerSpectrum_exp = sub( powerSpectrum_exp, shift ); #ifdef HARMONIZE_FUNC } #endif /* 16 bits are now enough for storing the power spectrum */ FOR( i = 0; i < nSamples; i++ ) Loading Loading
lib_dec/TonalComponentDetection_fx.c +6 −3 Original line number Diff line number Diff line Loading @@ -97,8 +97,8 @@ void ivas_DetectTonalComponents_fx( lastMDCTSpect_exp = add( lastMDCTSpectrum_exp, scaleFactors_max_e ); } ELSE #endif { #endif FOR( Word16 i = 0; i < nSamples; i++ ) { pScaledMdctSpectrum[i] = L_shl( lastMDCTSpectrum[i], 16 ); /*15-lastMDCTSpectrum_exp+16 -> 31 - lastMDCTSpectrum_exp*/ Loading Loading @@ -151,7 +151,9 @@ void ivas_DetectTonalComponents_fx( /* Guard bit */ lastMDCTSpect_exp = add( lastMDCTSpect_exp, 1 ); scale_sig32( pScaledMdctSpectrum, nSamples, -1 ); /*q_pScaledMdctSpectrum - 1*/ #ifdef HARMONIZE_FUNC } #endif /* Find peak candidates in the last frame. */ findCandidates( nSamples, pScaledMdctSpectrum, lastMDCTSpect_exp, thresholdModification, floorPowerSpectrum ); Loading Loading @@ -771,6 +773,7 @@ static void findStrongestHarmonics( /* Use new F0, for which harmonics are most common in pHarmonicIndexes */ static void CorrectF0( #ifndef HARMONIZE_FUNC const Word16 /*short*/ *pHarmonicIndexes, /*I - Q0 */ const Word16 /*short*/ nHarmonics, /*I - Q0 */ Word16 /*short*/ *pF0 ) /*I/O - Q10 range: {0}, [4..18) */ Loading Loading @@ -916,8 +919,8 @@ static void CorrectF0( return; } #ifndef HARMONIZE_FUNC static void ivas_CorrectF0_fx( #endif const Word16 /*short*/ *pHarmonicIndexes, /*I - Q0 */ const Word16 /*short*/ nHarmonics, /*I - Q0 */ Word16 /*short*/ *pF0 ) /*I/O - Q10 range: {0}, [4..18) */ Loading Loading @@ -1070,7 +1073,7 @@ static void ivas_CorrectF0_fx( return; } #endif static void modifyThreshold( Word16 /*short*/ i, /*I - Q0 */ Loading
lib_dec/tonalMDCTconcealment_fx.c +6 −2 Original line number Diff line number Diff line Loading @@ -881,8 +881,8 @@ static void ivas_CalcPowerSpecAndDetectTonalComponents_fx( #ifdef HARMONIZE_FUNC IF( element_mode != EVS_MONO ) #endif { #endif IF( LT_16( old_power_spectrum_q, power_spectrum_q ) ) { Scale_sig32( powerSpectrum, length, sub( old_power_spectrum_q, power_spectrum_q ) ); // Q(old_power_spectrum_q-power_spectrum_q) Loading @@ -894,7 +894,9 @@ static void ivas_CalcPowerSpecAndDetectTonalComponents_fx( } Scale_sig32( powerSpectrum, nSamples, -3 ); /*Adding guard bits*/ // Q(31 - powerSpectrum_exp )-3 powerSpectrum_exp = add( powerSpectrum_exp, 3 ); #ifdef HARMONIZE_FUNC } #endif FOR( i = hTonalMDCTConc->nSamplesCore; i < nSamples; i++ ) { Loading @@ -908,12 +910,14 @@ static void ivas_CalcPowerSpecAndDetectTonalComponents_fx( powerSpectrum_exp = sub( powerSpectrum_exp, hTonalMDCTConc->secondLastBlockData.gain_tcx_exp ); } ELSE #endif { #endif Word16 shift = Find_Max_Norm32( powerSpectrum, nSamples ); scale_sig32( powerSpectrum, nSamples, shift ); powerSpectrum_exp = sub( powerSpectrum_exp, shift ); #ifdef HARMONIZE_FUNC } #endif /* 16 bits are now enough for storing the power spectrum */ FOR( i = 0; i < nSamples; i++ ) Loading