Commit e0258465 authored by vaclav's avatar vaclav
Browse files

step 3 (StableHighPitchDetect_fx)

parent 5c654a7b
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -124,8 +124,7 @@
#define REMOVE_UNUSED_CODE_IVAS_DEC                     /* VA: remove unused code in ivas_jbm_dec_tc_fx() */
#define FIX_2294_CLANG_18_WARNINGS_ENC                  /* VA: Fix some encoder clang-18 warnings, desc. in 2294 */
#define REMOVE_CAM_FROM_IVAS                            /* VA: basop issue 210: remove obsoelte CAM code from IVAS */
#define HARM_DTX                                        /* VA: basop issue 2339: Remove duplicated code in the core-coder DTX  */
#define HARM_PREPROC
#define HARM_PREPROC                                    /* VA: basop issue 2339: Remove duplicated code in the core-coder DTX  */

/* #################### End BE switches ################################## */

+1 −1
Original line number Diff line number Diff line
@@ -336,7 +336,7 @@ void amr_wb_enc_fx(
        move16();
    }

#ifdef HARM_DTX
#ifdef HARM_PREPROC
    dtx_fx( st, -1, -1, vad_flag_dtx, inp, Q_new );
#else
    dtx_fx( st, vad_flag_dtx, inp, Q_new );
+3 −3
Original line number Diff line number Diff line
@@ -63,7 +63,7 @@ static void update_SID_cnt_fx( DTX_ENC_HANDLE hDtxEnc, const Word32 core_brate,
/* _ None                                                                           */
/*==================================================================================*/

#ifdef HARM_DTX
#ifdef HARM_PREPROC
void dtx_fx(
#else
void dtx_ivas_fx(
@@ -611,7 +611,7 @@ void dtx_ivas_fx(
    return;
}

#ifndef HARM_DTX
#ifndef HARM_PREPROC
/*==================================================================================*/
/* FUNCTION : dtx_fx()                                                              */
/*----------------------------------------------------------------------------------*/
@@ -1517,7 +1517,7 @@ void td_cng_enc_init_fx(
    const Word16 Opt_DTX_ON,     /* i  : flag indicating DTX operation       Q0*/
    const Word16 max_bwidth      /* i  : maximum encoded bandwidth           Q0*/
)
#ifndef HARM_DTX
#ifndef HARM_PREPROC
{

    hTdCngEnc->cng_seed = RANDOM_INITSEED;
+1 −1
Original line number Diff line number Diff line
@@ -686,7 +686,7 @@ ivas_error init_encoder_fx(
            return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for DTX/TD CNG\n" ) );
        }

#ifdef HARM_DTX
#ifdef HARM_PREPROC
        td_cng_enc_init_fx( st->hTdCngEnc, st->Opt_DTX_ON, st->max_bwidth );
#else
        IF( st->element_mode == EVS_MONO )
+7 −3
Original line number Diff line number Diff line
@@ -773,7 +773,6 @@ ivas_error pre_proc_front_ivas_fx(
        *vad_flag_dtx = *vad_flag_dtx || st->vad_flag; /* Q0 */
        move16();


        /* Determine hangover flag status based on LR localVAD and downmix localVAD */
        test();
        test();
@@ -830,7 +829,6 @@ ivas_error pre_proc_front_ivas_fx(
        set_bw_fx( element_mode, element_brate, st, MODE1 );
    }


    /* set the BW of the TD secondary channel in LRTD mode same as BW of the primary channel (only at higher bitrates) */
    test();
    test();
@@ -938,7 +936,7 @@ ivas_error pre_proc_front_ivas_fx(
        move16();
    }

#ifdef HARM_DTX
#ifdef HARM_PREPROC
    dtx_fx( st, last_ivas_total_brate, ivas_total_brate, *vad_flag_dtx, inp_12k8_fx, *Q_new );
#else
    dtx_ivas_fx( st, last_ivas_total_brate, ivas_total_brate, *vad_flag_dtx, inp_12k8_fx, *Q_new );
@@ -1134,6 +1132,7 @@ ivas_error pre_proc_front_ivas_fx(

    pitch_ol_ivas_fx( st->pitch, st->voicing_fx, &st->old_pitch, &st->old_corr_fx, corr_shift_fx, &st->old_thres_fx,
                      &st->delta_pit, st->old_wsp2_fx, wsp_fx, st->mem_decim2_fx, *relE_fx, st->clas, st->input_bwidth, st->Opt_SC_VBR, Q_wsp );

    /* Updates for adaptive lag window memory */
    st->old_pitch_la = st->pitch[2]; /* Q0 */
    move16();
@@ -1147,8 +1146,13 @@ ivas_error pre_proc_front_ivas_fx(
    move16();

    Copy_Scale_sig_32_16( st->Bin_E_fx, st->lgBin_E_fx, L_FFT / 2, sub( Q7, st->q_Bin_E ) ); /* Q7 */

    /* Detection of very short stable pitch period */
#ifdef HARM_PREPROC
    StableHighPitchDetect_fx( element_mode, &flag_spitch, st->pitch, st->voicing_fx, wsp_fx, st->localVAD, &st->voicing_sm_fx, &st->voicing0_sm_fx, &st->LF_EnergyRatio_sm_fx, &st->predecision_flag, &st->diff_sm_fx, &st->energy_sm_fx, *q_old_wsp, st->lgBin_E_fx );
#else
    StableHighPitchDetect_ivas_fx( &flag_spitch, st->pitch, st->voicing_fx, wsp_fx, st->localVAD, &st->voicing_sm_fx, &st->voicing0_sm_fx, &st->LF_EnergyRatio_sm_fx, &st->predecision_flag, &st->diff_sm_fx, &st->energy_sm_fx, *q_old_wsp, st->lgBin_E_fx );
#endif

    /* 1/4 pitch precision improvement */
    IF( LE_32( element_brate, IVAS_32k ) )
Loading