Commit 77feee68 authored by JÜRGEN Gerstacker's avatar JÜRGEN Gerstacker
Browse files

MR 2797 harmonize InitTnsConfiguration()

parent cf7f073c
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -106,10 +106,10 @@
#define FIX_2384_INIT_DEQUANT_COV                       /* FhG: basop issue 2384: only read initialized values from Cy_buf_e[k] in ivas_param_mc_dequantize_cov_fx() during renormalization */
#define FIX_2383_INIT_Q_A_ITF                           /* FhG: Initialize Q_A_itf, to avoid reading of uninitialized memory in case ITF is not triggered */
#define FIX_2382_COPY_AQ_IN_MCT                         /* FhG: basop issue 2382: 2nd instance of prevent copying uninitialized values from Aq_fx[][] to Aq_fx_32[][] in TCX */
#define FIX_2388_INITTNSCONFIGURATION                   /* FhG: issue 2388 : harmonizing InitTnsConfiguration() function */
#define FIX_2391_INIT_HQ_GENERIC_OFFSET                 /* FhG/Eri: basop issue 2391: make sure hq_generic_offset is initialized inside hq_hr_dec_fx() */
#define FIX_2397_COPY_AQ_MDCT_CORE_BFI                  /* FhG: prevent copying of uninit memory in MDCT stereo core if bfi is set */
#define HARMONIZE_TBE                                   /* VA: harmonize core-coder TBE function duplications */

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

/* #################### Start NON-BE switches ############################ */
+2 −0
Original line number Diff line number Diff line
@@ -3569,6 +3569,7 @@ Word32 DTFS_getEngy_band_wb_fx(
    Word16 lband,
    Word16 hband );
#ifndef FIX_2388_INITTNSCONFIGURATION
void InitTnsConfiguration(
    const Word16 bwidth,
    const Word16 frameLength,
@@ -3577,6 +3578,7 @@ void InitTnsConfiguration(
    const Word32 total_brate,
    const Word16 element_mode,
    const Word16 is_mct );
#endif
void InitTnsConfiguration_ivas_fx(
    const Word16 bwidth,
+10 −1
Original line number Diff line number Diff line
@@ -1969,7 +1969,7 @@ void tcx_noise_filling_with_shift(


/*---------------------------------------------------------------
 * InitTnsConfigs()
 * ()
 *--------------------------------------------------------------*/


@@ -1984,10 +1984,19 @@ void InitTnsConfigs(
{
    IF( GT_32( total_brate, ACELP_32k ) )
    {
#ifdef FIX_2388_INITTNSCONFIGURATION
        InitTnsConfiguration_ivas_fx( bwidth, shr( L_frame, 1 ), &tnsConfig[0][0], igfStopFreq, total_brate, element_mode, MCT_flag );
#else
        InitTnsConfiguration( bwidth, shr( L_frame, 1 ), &tnsConfig[0][0], igfStopFreq, total_brate, element_mode, MCT_flag );
#endif
    }
#ifdef FIX_2388_INITTNSCONFIGURATION
    InitTnsConfiguration_ivas_fx( bwidth, L_frame, &tnsConfig[1][0], igfStopFreq, total_brate, element_mode, MCT_flag );
    InitTnsConfiguration_ivas_fx( bwidth, add( L_frame, shr( L_frame, 2 ) ), &tnsConfig[1][1], igfStopFreq, total_brate, element_mode, MCT_flag );
#else
    InitTnsConfiguration( bwidth, L_frame, &tnsConfig[1][0], igfStopFreq, total_brate, element_mode, MCT_flag );
    InitTnsConfiguration( bwidth, add( L_frame, shr( L_frame, 2 ) ), &tnsConfig[1][1], igfStopFreq, total_brate, element_mode, MCT_flag );
#endif
}

void InitTnsConfigs_ivas_fx(
+26 −0
Original line number Diff line number Diff line
@@ -72,6 +72,7 @@ static void ITF_GetFilterParameters_fx( Word32 rxx[], const Word16 maxOrder, Wor
/*      Interface functions     */
/********************************/

#ifndef FIX_2388_INITTNSCONFIGURATION
/** Init TNS configuration.
 * Fills STnsConfig structure with sensible content.
 * @param nSampleRate Sampling rate of the input.
@@ -196,6 +197,7 @@ void InitTnsConfiguration(
    }
    return; /*TNS_NO_ERROR;*/
}
#endif /* FIX_2388_INITTNSCONFIGURATION */

void InitTnsConfiguration_ivas_fx(
    const Word16 bwidth,      /*Q0*/
@@ -235,7 +237,11 @@ void InitTnsConfiguration_ivas_fx(
    IF( LE_32( total_brate, ACELP_32k ) )
    {
        move16();
#ifdef FIX_2388_INITTNSCONFIGURATION
        pTnsConfig->nMaxFilters = (UWord8) ( sizeof( tnsParametersIGF32kHz_LowBR ) / sizeof( tnsParametersIGF32kHz_LowBR[0] ) ); /*Q0*/
#else
        pTnsConfig->nMaxFilters = (UWord8) idiv1616( sizeof( tnsParametersIGF32kHz_LowBR ), sizeof( tnsParametersIGF32kHz_LowBR[0] ) ); /*Q0*/
#endif
        pTnsConfig->pTnsParameters = tnsParametersIGF32kHz_LowBR;
    }
    ELSE
@@ -243,7 +249,11 @@ void InitTnsConfiguration_ivas_fx(
        test();
        IF( GT_32( nSampleRate, 32000 ) && EQ_32( nSampleRate, L_mult0( 100, frameLength ) ) )
        {
#ifdef FIX_2388_INITTNSCONFIGURATION
            pTnsConfig->nMaxFilters = (UWord8) ( sizeof( tnsParameters48kHz_grouped ) / sizeof( tnsParameters48kHz_grouped[0] ) ); /*Q0*/
#else
            pTnsConfig->nMaxFilters = (UWord8) idiv1616( sizeof( tnsParameters48kHz_grouped ), sizeof( tnsParameters48kHz_grouped[0] ) ); /*Q0*/
#endif
            move16();
            pTnsConfig->pTnsParameters = tnsParameters48kHz_grouped;
        }
@@ -259,7 +269,11 @@ void InitTnsConfiguration_ivas_fx(
            test();
            IF( GT_16( element_mode, IVAS_SCE ) && GE_32( total_brate, L_tmp ) )
            {
#ifdef FIX_2388_INITTNSCONFIGURATION
                pTnsConfig->nMaxFilters = (UWord8) ( sizeof( tnsParameters32kHz_Stereo ) / sizeof( tnsParameters32kHz_Stereo[0] ) ); /*Q0*/
#else
                pTnsConfig->nMaxFilters = (UWord8) idiv1616( sizeof( tnsParameters32kHz_Stereo ), sizeof( tnsParameters32kHz_Stereo[0] ) ); /*Q0*/
#endif
                move16();
                IF( EQ_32( nSampleRate, L_mult0( 100, frameLength ) ) ) /* sub-frame length is <= 10 ms */
                {
@@ -274,7 +288,11 @@ void InitTnsConfiguration_ivas_fx(
            {

                move16();
#ifdef FIX_2388_INITTNSCONFIGURATION
                pTnsConfig->nMaxFilters = (UWord8) ( sizeof( tnsParameters32kHz ) / sizeof( tnsParameters32kHz[0] ) ); /*Q0*/
#else
                pTnsConfig->nMaxFilters = (UWord8) idiv1616( sizeof( tnsParameters32kHz ), sizeof( tnsParameters32kHz[0] ) ); /*Q0*/
#endif

                pTnsConfig->pTnsParameters = tnsParameters32kHz;

@@ -289,13 +307,21 @@ void InitTnsConfiguration_ivas_fx(
            IF( EQ_32( nSampleRate, L_mult0( 100, frameLength ) ) ) /* sub-frame length is <= 10 ms */
            {
                move16();
#ifdef FIX_2388_INITTNSCONFIGURATION
                pTnsConfig->nMaxFilters = (UWord8) ( sizeof( tnsParameters16kHz_grouped ) / sizeof( tnsParameters16kHz_grouped[0] ) ); /*Q0*/
#else
                pTnsConfig->nMaxFilters = (UWord8) idiv1616( sizeof( tnsParameters16kHz_grouped ), sizeof( tnsParameters16kHz_grouped[0] ) ); /*Q0*/
#endif
                pTnsConfig->pTnsParameters = tnsParameters16kHz_grouped;
            }
            ELSE
            {
                move16();
#ifdef FIX_2388_INITTNSCONFIGURATION
                pTnsConfig->nMaxFilters = (UWord8) ( sizeof( tnsParameters16kHz ) / sizeof( tnsParameters16kHz[0] ) ); /*Q0*/
#else
                pTnsConfig->nMaxFilters = (UWord8) idiv1616( sizeof( tnsParameters16kHz ), sizeof( tnsParameters16kHz[0] ) ); /*Q0*/
#endif
                pTnsConfig->pTnsParameters = tnsParameters16kHz;
            }
        }