Commit 9725ea31 authored by Michael Sturm's avatar Michael Sturm
Browse files

Unifies IGFDecSetMode function.

parent d5dc1427
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -8150,7 +8150,7 @@ void IGFDecSetMode(
    const Word16 defaultStopLine,          /* i  : default stop subband index          */
    const Word16 rf_mode                   /* i  : flag to signal the RF mode          */
);

#ifndef FIX_2346_DUPLICATED_IGF_FUNCTIONS
void IGFDecSetMode_ivas_fx(
    const IGF_DEC_INSTANCE_HANDLE hIGFDec, /* i  : instance handle of IGF Decoder */
    const Word32 total_brate,              /* i  : bitrate                        */
@@ -8160,7 +8160,7 @@ void IGFDecSetMode_ivas_fx(
    const Word16 defaultStopLine,          /* i  : default stop subband index     */
    const Word16 rf_mode                   /* i  : flag to signal the RF mode     */
);

#endif
#ifndef FIX_2346_DUPLICATED_IGF_FUNCTIONS
void IGFDecUpdateInfo(
    const IGF_DEC_INSTANCE_HANDLE hInstance, /**< in:     | instance handle of IGF Decoder */
+4 −0
Original line number Diff line number Diff line
@@ -313,7 +313,11 @@ void mode_switch_decoder_LPD_ivas_fx(
    IF( st->igf && ( ( st->idchan == 0 ) || EQ_16( st->element_mode, IVAS_CPE_MDCT ) ) )
    {
        /* switch IGF configuration */
#ifdef FIX_2346_DUPLICATED_IGF_FUNCTIONS
        IGFDecSetMode( st->hIGFDec, total_brate, bwidth, st->element_mode, -1, -1, st->rf_flag );
#else
        IGFDecSetMode_ivas_fx( st->hIGFDec, total_brate, bwidth, st->element_mode, -1, -1, st->rf_flag );
#endif
    }
    test();
    test();
+17 −1
Original line number Diff line number Diff line
@@ -4184,7 +4184,13 @@ void IGFDecSetMode(
        move16();

        test();
#ifdef FIX_2346_DUPLICATED_IGF_FUNCTIONS
        IF( ( LE_16( hPrivateData->igfInfo.bitRateIndex, IGF_BITRATE_FB_48000 ) && EQ_16( element_mode, EVS_MONO ) ) ||
            ( NE_16( hPrivateData->igfInfo.bitRateIndex, IGF_BITRATE_FB_96000 ) && NE_16( hPrivateData->igfInfo.bitRateIndex, IGF_BITRATE_FB_96000_CPE ) &&
              NE_16( hPrivateData->igfInfo.bitRateIndex, IGF_BITRATE_FB_128000 ) && NE_16( hPrivateData->igfInfo.bitRateIndex, IGF_BITRATE_FB_128000_CPE ) && GT_16( element_mode, EVS_MONO ) ) )
#else
        IF( ( LE_16( hPrivateData->igfInfo.bitRateIndex, IGF_BITRATE_SWB_48000 ) ) || ( LE_16( hPrivateData->igfInfo.bitRateIndex, IGF_BITRATE_FB_48000 ) ) )
#endif
        {
#ifdef FIX_2346_DUPLICATED_IGF_FUNCTIONS
            IGF_RefineGrid( &hPrivateData->igfInfo.grid[IGF_GRID_LB_NORM], element_mode );
@@ -4209,8 +4215,17 @@ void IGFDecSetMode(
        move16();
        fprintf( stderr, "IGFDecSetMode: initialization error!\n" );
    }
    IF( GT_16( element_mode, EVS_MONO ) )
    {
        hIGFDec->flag_sparse = &hIGFDec->flag_sparseBuf[0];
        hIGFDec->infoTCXNoise_ptr = &hIGFDec->infoTCXNoise_evs[0];
        hIGFDec->virtualSpec_fx = &hIGFDec->virtualSpec[0];
        hIGFDec->igfData.pSpecFlat = &hIGFDec->igfData.pSpecFlatBuf_fx[0];
        hIGFDec->igfData.igfInfo.nfSeed = &hIGFDec->igfData.igfInfo.nfSeedBuf[0];
    }

    return;
}
#ifndef FIX_2346_DUPLICATED_IGF_FUNCTIONS
void IGFDecSetMode_ivas_fx(
    const IGF_DEC_INSTANCE_HANDLE hIGFDec, /* i  : instance handle of IGF Decoder */
    const Word32 total_brate,              /* i  : bitrate                        */
@@ -4285,6 +4300,7 @@ void IGFDecSetMode_ivas_fx(
    hIGFDec->igfData.igfInfo.nfSeed = &hIGFDec->igfData.igfInfo.nfSeedBuf[0];
    return;
}
#endif
#ifndef FIX_2346_DUPLICATED_IGF_FUNCTIONS
/**********************************************************************/ /*
updates the start/stop frequency of IGF according to igfGridIdx
+4 −0
Original line number Diff line number Diff line
@@ -676,7 +676,11 @@ ivas_error mct_dec_reconfigure_fx(

                IF( st->igf )
                {
#ifdef FIX_2346_DUPLICATED_IGF_FUNCTIONS
                    IGFDecSetMode( st->hIGFDec, st_ivas->hCPE[cpe_id]->element_brate, st->bwidth, st->element_mode, -1, -1, st->rf_flag );
#else
                    IGFDecSetMode_ivas_fx( st->hIGFDec, st_ivas->hCPE[cpe_id]->element_brate, st->bwidth, st->element_mode, -1, -1, st->rf_flag );
#endif
                }
            }
        }