Commit 5e9fb905 authored by Jan Kiene's avatar Jan Kiene
Browse files

fix noisy_speech_detection for MDCT-Stereo

parent 4040d977
Loading
Loading
Loading
Loading
Loading
+11 −4
Original line number Diff line number Diff line
@@ -643,18 +643,25 @@ static void run_min_stats(
#endif
                }
            }
#ifndef NONBE_FIX_1204_MDCT_STEREO_NOISE_EST_SCALING

#ifdef NONBE_FIX_1204_MDCT_STEREO_NOISE_EST_SCALING
            noisy_speech_detection( st->hFdCngDec, st->VAD && st->m_frame_type == ACTIVE_FRAME, NULL );
#else
            noisy_speech_detection( st->hFdCngDec, st->VAD && st->m_frame_type == ACTIVE_FRAME, power_spec );
#endif

            st->hFdCngDec->hFdCngCom->likelihood_noisy_speech = 0.99f * st->hFdCngDec->hFdCngCom->likelihood_noisy_speech + 0.01f * (float) st->hFdCngDec->hFdCngCom->flag_noisy_speech;

            st->lp_noise = st->hFdCngDec->lp_noise;
#endif
        }

#ifdef NONBE_FIX_1204_MDCT_STEREO_NOISE_EST_SCALING
        if ( st->core == TCX_20_CORE )
        {
            noisy_speech_detection( st->hFdCngDec, save_VAD[ch] && st->m_frame_type == ACTIVE_FRAME, x[ch][0] );
            st->hFdCngDec->hFdCngCom->likelihood_noisy_speech = 0.99f * st->hFdCngDec->hFdCngCom->likelihood_noisy_speech + 0.01f * (float) st->hFdCngDec->hFdCngCom->flag_noisy_speech;
            st->lp_noise = st->hFdCngDec->lp_noise;
        }
#endif

        if ( will_estimate_noise_on_channel[0] || will_estimate_noise_on_channel[1] || st->bfi )
        {
            ApplyFdCng( NULL, st->bfi ? NULL : power_spec, NULL, NULL, st, st->bfi, 0 );