Commit 15ba25a9 authored by vaillancour's avatar vaillancour
Browse files

First trial at harmonisation of the GSC

parent 24e8bdab
Loading
Loading
Loading
Loading
+20 −2
Original line number Original line Diff line number Diff line
@@ -285,6 +285,10 @@ void Ener_per_band_comp_fx(
    const Word16 Q_exc,         /* i  : frame length                      */
    const Word16 Q_exc,         /* i  : frame length                      */
    const Word16 Mband,         /* i  : Max band                          */
    const Word16 Mband,         /* i  : Max band                          */
    const Word16 Eflag          /* i  : flag of highest band              */
    const Word16 Eflag          /* i  : flag of highest band              */
#ifdef HARM_GSC_ENC_PART3
    , 
    const Word16 L_frame        /* i  : frame length                */
#endif
)
)
{
{
    const Word16 *pt_fx;
    const Word16 *pt_fx;
@@ -311,10 +315,23 @@ void Ener_per_band_comp_fx(
        move16();
        move16();
        pt_fx += 32;
        pt_fx += 32;
    }
    }

#ifdef HARM_GSC_ENC_PART3
    IF( EQ_16( L_frame, L_FRAME16k ) )
    {
        y_gain4_fx[j + 2] = Comp_band_log_ener( pt_fx, 32, Q_exc, -1 ); /*Q12*/
        move16();
#ifdef FIX_BUG_IN_IVAS_GSC
        pt_fx += 32;
        y_gain4_fx[j + 3] = Comp_band_log_ener( pt_fx, 32, Q_exc, -1 ); /*Q12*/
#else
        y_gain4_fx[j + 3] = Comp_band_log_ener( pt_fx, 64, Q_exc, -1 ); /*Q12*/
#endif
        move16();
    }
#endif
    return;
    return;
}
}

//#ifndef HARM_GSC_ENC_PART3
void Ener_per_band_comp_ivas_fx(
void Ener_per_band_comp_ivas_fx(
    const Word16 exc_diff_fx[], /* i  : target signal                     Q_exc_diff     */
    const Word16 exc_diff_fx[], /* i  : target signal                     Q_exc_diff     */
    Word16 y_gain4_fx[],        /* o  : Energy per band to quantize       Q12            */
    Word16 y_gain4_fx[],        /* o  : Energy per band to quantize       Q12            */
@@ -360,6 +377,7 @@ void Ener_per_band_comp_ivas_fx(


    return;
    return;
}
}
//#endif      HARM_GSC_ENC_PART3




/*-------------------------------------------------------------------*
/*-------------------------------------------------------------------*
+8 −1
Original line number Original line Diff line number Diff line
@@ -801,12 +801,19 @@ void highband_exc_dct_in_fx(
    test();
    test();
    IF( EQ_32( core_brate, ACELP_8k00 ) && NE_16( bwidth, NB ) )
    IF( EQ_32( core_brate, ACELP_8k00 ) && NE_16( bwidth, NB ) )
    {
    {
#ifdef HARM_GSC_ENC_PART3
        Ener_per_band_comp_fx( exc_diffQ, Ener_per_bd_yQ, Qexc_diffQ, add( last_bin, 1 ), 0, L_frame );
#else
        Ener_per_band_comp_fx( exc_diffQ, Ener_per_bd_yQ, Qexc_diffQ, add( last_bin, 1 ), 0 );
        Ener_per_band_comp_fx( exc_diffQ, Ener_per_bd_yQ, Qexc_diffQ, add( last_bin, 1 ), 0 );
#endif
    }
    }
    ELSE
    ELSE
    {
    {
#ifdef HARM_GSC_ENC_PART3
        Ener_per_band_comp_fx( exc_diffQ, Ener_per_bd_yQ, Qexc_diffQ, MBANDS_GN, 1, L_frame );
#else
        Ener_per_band_comp_fx( exc_diffQ, Ener_per_bd_yQ, Qexc_diffQ, MBANDS_GN, 1 );
        Ener_per_band_comp_fx( exc_diffQ, Ener_per_bd_yQ, Qexc_diffQ, MBANDS_GN, 1 );

#endif
        IF( LT_16( nb_subfr, 4 ) && LT_16( L_frame, L_FRAME16k ) )
        IF( LT_16( nb_subfr, 4 ) && LT_16( L_frame, L_FRAME16k ) )
        {
        {
            FOR( i = L_FRAME - 16; i < L_FRAME; i++ )
            FOR( i = L_FRAME - 16; i < L_FRAME; i++ )
+7 −2
Original line number Original line Diff line number Diff line
@@ -87,7 +87,11 @@
#define FIX_1435_MOVE_STEREO_PANNING                    /* VA: issue 1435: do the EVS stereo panning in the renderer */
#define FIX_1435_MOVE_STEREO_PANNING                    /* VA: issue 1435: do the EVS stereo panning in the renderer */
#define FIX_BASOP_2201_HARMONIZE_HRTF_FILE_READER_CREND /* OR : Fix issue basop 2201 hrtf_file_reader crend differs between basop ivas-main and ivas-float-update */
#define FIX_BASOP_2201_HARMONIZE_HRTF_FILE_READER_CREND /* OR : Fix issue basop 2201 hrtf_file_reader crend differs between basop ivas-main and ivas-float-update */
#define FIX_2245_INIT_FD_CNG_EVS                        /* Dolby/VA: Issue 2245: initialize FD CNG with EVS-type of init function */
#define FIX_2245_INIT_FD_CNG_EVS                        /* Dolby/VA: Issue 2245: initialize FD CNG with EVS-type of init function */

#define HARM_GSC_ENC                                    /* VA: Harmonization of EVS and IVAS GSC code */
#define HARM_GSC_ENC_PART2
#define HARM_GSC_ENC_PART3
#define HARM_GSC_ENC_PART4
#define BE_COMPL_RED
/* #################### End BE switches ################################## */
/* #################### End BE switches ################################## */


/* #################### Start NON-BE switches ############################ */
/* #################### Start NON-BE switches ############################ */
@@ -97,7 +101,8 @@
#define FIX_2015_PREMPH_SAT_ALT_PART2                   /* VA: Add missing scaling factor to be passed to AVQ_cod() */
#define FIX_2015_PREMPH_SAT_ALT_PART2                   /* VA: Add missing scaling factor to be passed to AVQ_cod() */
#define FIX_2253_CORRECT_GSC_MINIMUM_PIT_SEARCH         /* VA: Fix Issue 2253 where the encoder and decoder could get out of sync */
#define FIX_2253_CORRECT_GSC_MINIMUM_PIT_SEARCH         /* VA: Fix Issue 2253 where the encoder and decoder could get out of sync */
#define NONBE_FIX_1967_SBA_DECODER_MONO_OUT_BIG_DIFFERENCES /* Dolby: Fix basop issue 1967 */
#define NONBE_FIX_1967_SBA_DECODER_MONO_OUT_BIG_DIFFERENCES /* Dolby: Fix basop issue 1967 */

//#define FIX_EVS_LR_PG_BUG                               /* VA: EVS bug on how the lowrate pitch gain is compared to threshold, not used in IVAS */
//#define FIX_BUG_IN_IVAS_GSC
/* ##################### End NON-BE switches ########################### */
/* ##################### End NON-BE switches ########################### */


/* ################## End MAINTENANCE switches ######################### */
/* ################## End MAINTENANCE switches ######################### */
+5 −0
Original line number Original line Diff line number Diff line
@@ -58,9 +58,14 @@ void pred_lt4_ivas_fx(
            FOR( i = 0; i < nb_coef; i++ )
            FOR( i = 0; i < nb_coef; i++ )
            {
            {
                /*s += (*x1--) * (*c1) + (*x2++) * (*c2);*/
                /*s += (*x1--) * (*c1) + (*x2++) * (*c2);*/
#ifdef BE_COMPL_RED
                s64 = W_mac_32_32( s64, L_deposit_l( *x1-- ), ( *c1 ) ); /* Q_exc + Q32 */
                s64 = W_mac_32_32( s64, L_deposit_l( *x1-- ), ( *c1 ) ); /* Q_exc + Q32 */
                s64 = W_mac_32_32( s64, L_deposit_l( *x2++ ), ( *c2 ) ); /* Q_exc + Q32 */
                s64 = W_mac_32_32( s64, L_deposit_l( *x2++ ), ( *c2 ) ); /* Q_exc + Q32 */
#else
                s64 = W_mac_32_16( s64, ( *c1 ), *x1-- ); /* Q_exc + Q32 */
                s64 = W_mac_32_16( s64, ( *c2 ), *x2++ ); /* Q_exc + Q32 */


#endif
                c1 += up_sample;
                c1 += up_sample;
                c2 += up_sample;
                c2 += up_sample;
            }
            }
+6 −1
Original line number Original line Diff line number Diff line
@@ -1758,7 +1758,12 @@ void Ener_per_band_comp_fx(
    Word16 y_gain4[],        /* o  : Energy per band to quantize     Q12            */
    Word16 y_gain4[],        /* o  : Energy per band to quantize     Q12            */
    const Word16 Q_exc_diff,
    const Word16 Q_exc_diff,
    const Word16 Mband, /* i  : Max band                          */
    const Word16 Mband, /* i  : Max band                          */
    const Word16 Eflag );
    const Word16 Eflag 
#ifdef HARM_GSC_ENC_PART3
    , 
    const Word16 L_frame        /* i  : frame length                */
#endif 
);
void Ener_per_band_comp_ivas_fx(
void Ener_per_band_comp_ivas_fx(
    const Word16 exc_diff_fx[], /* i  : target signal                    Q_exc_diff     */
    const Word16 exc_diff_fx[], /* i  : target signal                    Q_exc_diff     */
Loading