Commit e0ca9501 authored by vaillancour's avatar vaillancour
Browse files

Merge branch 'main' into basop-2410-harmonization-of-modif_fs

parents bfd0ecbb f4896dcb
Loading
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -997,8 +997,11 @@ void init_tcx_cfg_ivas_fx(

    IF( hTcxCfg->fIsTNSAllowed )
    {
#ifdef FIX_2388_INITTNSCONFIGURATION
        InitTnsConfigs_fx( bwidth, hTcxCfg->tcx_coded_lines, hTcxCfg->tnsConfig, infoIGFStopFreq, total_brate, element_mode, MCT_flag );
#else
        InitTnsConfigs_ivas_fx( bwidth, hTcxCfg->tcx_coded_lines, hTcxCfg->tnsConfig, infoIGFStopFreq, total_brate, element_mode, MCT_flag );

#endif
        SetAllowTnsOnWhite( hTcxCfg->tnsConfig, (Word8) EQ_16( element_mode, IVAS_CPE_MDCT ) );
    }

@@ -1253,7 +1256,11 @@ void init_tcx_cfg_fx(

    IF( hTcxCfg->fIsTNSAllowed )
    {
#ifdef FIX_2388_INITTNSCONFIGURATION
        InitTnsConfigs_fx( bwidth, hTcxCfg->tcx_coded_lines, hTcxCfg->tnsConfig, infoIGFStopFreq, total_brate, element_mode, MCT_flag );
#else
        InitTnsConfigs( bwidth, hTcxCfg->tcx_coded_lines, hTcxCfg->tnsConfig, infoIGFStopFreq, total_brate, element_mode, MCT_flag );
#endif

        SetAllowTnsOnWhite( hTcxCfg->tnsConfig, (Word8) EQ_16( element_mode, IVAS_CPE_MDCT ) );
    }
+1 −0
Original line number Diff line number Diff line
@@ -84,6 +84,7 @@
#define TMP_1342_WORKAROUND_DEC_FLUSH_BROKEN_IN_SR      /* FhG: Temporary workaround for incorrect implementation of decoder flush with split rendering */
#define NONBE_1122_KEEP_EVS_MODE_UNCHANGED              /* FhG: Disables fix for issue 1122 in EVS mode to keep BE tests green. This switch should be removed once the 1122 fix is added to EVS via a CR.  */
#define FIX_1904_HARM_GSC_ENC                           /* VA: #1904 Harmonization of EVS and IVAS GSC code */
#define FIX_2388_INITTNSCONFIGURATION                   /* FhG: issue 2388 : harmonizing InitTnsConfiguration() function */
#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 */
#define FIX_2405_HARM_SMC_INIT                          /* VA, basop 2405, harmonisation of SMC init */
+21 −8
Original line number Diff line number Diff line
@@ -3582,6 +3582,7 @@ Word32 DTFS_getEngy_band_wb_fx(
    Word16 lband,
    Word16 hband );
#ifndef FIX_2388_INITTNSCONFIGURATION
void InitTnsConfiguration(
    const Word16 bwidth,
    const Word16 frameLength,
@@ -3590,8 +3591,13 @@ void InitTnsConfiguration(
    const Word32 total_brate,
    const Word16 element_mode,
    const Word16 is_mct );
#endif
#ifdef FIX_2388_INITTNSCONFIGURATION
void InitTnsConfiguration_fx(
#else
void InitTnsConfiguration_ivas_fx(
#endif
    const Word16 bwidth,
    const Word16 frameLength,
    STnsConfig *pTnsConfig,
@@ -4236,6 +4242,7 @@ void tcx_noise_filling_with_shift(
    const Word16 element_mode /* i  : IVAS element mode   */
);
#ifndef FIX_2388_INITTNSCONFIGURATION
void InitTnsConfigs(
    const Word16 bwidth,
    const Word16 L_frame,
@@ -4244,8 +4251,14 @@ void InitTnsConfigs(
    const Word32 total_brate,
    const Word16 element_mode,
    const Word16 is_mct );
#endif
void InitTnsConfigs_ivas_fx(
#ifdef FIX_2388_INITTNSCONFIGURATION
void InitTnsConfigs_fx
#else
void InitTnsConfigs_ivas_fx
#endif
    (
        const Word16 bwidth,
        const Word16 L_frame,
        STnsConfig tnsConfig[2][2],
+25 −9
Original line number Diff line number Diff line
@@ -1973,6 +1973,7 @@ void tcx_noise_filling_with_shift(
 *--------------------------------------------------------------*/


#ifndef FIX_2388_INITTNSCONFIGURATION
void InitTnsConfigs(
    const Word16 bwidth,  /*Q0*/
    const Word16 L_frame, /*Q0*/
@@ -1989,8 +1990,14 @@ void InitTnsConfigs(
    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(
#ifdef FIX_2388_INITTNSCONFIGURATION
void InitTnsConfigs_fx
#else
void InitTnsConfigs_ivas_fx
#endif
    (
        const Word16 bwidth,  /*Q0*/
        const Word16 L_frame, /*Q0*/
        STnsConfig tnsConfig[2][2],
@@ -2001,10 +2008,19 @@ void InitTnsConfigs_ivas_fx(
{
    IF( GT_32( total_brate, ACELP_32k ) )
    {
#ifdef FIX_2388_INITTNSCONFIGURATION
        InitTnsConfiguration_fx( bwidth, shr( L_frame, 1 ), &tnsConfig[0][0], igfStopFreq, total_brate, element_mode, MCT_flag );
#else
        InitTnsConfiguration_ivas_fx( bwidth, shr( L_frame, 1 ), &tnsConfig[0][0], igfStopFreq, total_brate, element_mode, MCT_flag );
#endif
    }
#ifdef FIX_2388_INITTNSCONFIGURATION
    InitTnsConfiguration_fx( bwidth, L_frame, &tnsConfig[1][0], igfStopFreq, total_brate, element_mode, MCT_flag );
    InitTnsConfiguration_fx( bwidth, add( L_frame, shr( L_frame, 2 ) ), &tnsConfig[1][1], igfStopFreq, total_brate, element_mode, MCT_flag );
#else
    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 );
#endif
}

void SetTnsConfig(

lib_com/tns_base.c

100755 → 100644
+45 −14
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,8 +197,14 @@ void InitTnsConfiguration(
    }
    return; /*TNS_NO_ERROR;*/
}
#endif /* FIX_2388_INITTNSCONFIGURATION */

void InitTnsConfiguration_ivas_fx(
#ifdef FIX_2388_INITTNSCONFIGURATION
void InitTnsConfiguration_fx
#else
void InitTnsConfiguration_ivas_fx
#endif /* FIX_2388_INITTNSCONFIGURATION */
    (
        const Word16 bwidth,      /*Q0*/
        const Word16 frameLength, /*Q0*/
        STnsConfig *pTnsConfig,
@@ -235,7 +242,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 +254,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 +274,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 +293,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 +312,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;
            }
        }
Loading