Commit 412325ac authored by Michael Sturm's avatar Michael Sturm
Browse files

Unifies IGFDecUpdateInfo function.

parent 562d2fca
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -8160,16 +8160,27 @@ void IGFDecSetMode_ivas_fx(
    const Word16 rf_mode                   /* i  : flag to signal the RF mode     */
);

#ifndef FIX_2346_DUPLICATED_IGF_FUNCTIONS
void IGFDecUpdateInfo(
    const IGF_DEC_INSTANCE_HANDLE hInstance, /**< in:     | instance handle of IGF Decoder */
    const Word16 igfGridIdx                  /**< in:     | IGF grid index                 */
);
#endif

#ifdef FIX_2346_DUPLICATED_IGF_FUNCTIONS
void IGFDecUpdateInfo(
    const IGF_DEC_INSTANCE_HANDLE hIGFDec, /* i/o: instance handle of IGF Decoder */
    const Word16 subFrameIdx,              /* i  : index of subframe              */
    const Word16 igfGridIdx,               /* i  : IGF grid index                 */
    const Word16 element_mode              /* i  : IVAS element mode type         */
);
#else
void IGFDecUpdateInfo_ivas_fx(
    const IGF_DEC_INSTANCE_HANDLE hIGFDec, /* i/o: instance handle of IGF Decoder      */
    const Word16 subFrameIdx,              /* i  : subframe index                      */
    const Word16 igfGridIdx                /* i  : IGF grid index                      */
);
#endif

void IGFDecCopyLPCFlatSpectrum(
    const IGF_DEC_INSTANCE_HANDLE hInstance, /**< in:     | instance handle of IGF Decoder     */
+44 −0
Original line number Diff line number Diff line
@@ -219,7 +219,11 @@ void decoder_tcx_fx(
    test();
    IF( ( EQ_16( L_frame, shr( st->L_frame, 1 ) ) ) && ( st->tcxonly ) )
    {
#ifdef FIX_2346_DUPLICATED_IGF_FUNCTIONS
        IGFDecUpdateInfo( st->hIGFDec, frame_cnt, IGF_GRID_LB_SHORT, st->element_mode );
#else
        IGFDecUpdateInfo( st->hIGFDec, IGF_GRID_LB_SHORT );
#endif
    }
    ELSE
    {
@@ -227,11 +231,19 @@ void decoder_tcx_fx(
        test();
        IF( ( EQ_16( st->last_core, ACELP_CORE ) ) || ( left_rect && st->bfi ) )
        {
#ifdef FIX_2346_DUPLICATED_IGF_FUNCTIONS
            IGFDecUpdateInfo( st->hIGFDec, frame_cnt, IGF_GRID_LB_TRAN, st->element_mode );
#else
            IGFDecUpdateInfo( st->hIGFDec, IGF_GRID_LB_TRAN );
#endif
        }
        ELSE
        {
#ifdef FIX_2346_DUPLICATED_IGF_FUNCTIONS
            IGFDecUpdateInfo( st->hIGFDec, frame_cnt, IGF_GRID_LB_NORM, st->element_mode );
#else
            IGFDecUpdateInfo( st->hIGFDec, IGF_GRID_LB_NORM );
#endif
        }
    }

@@ -3735,7 +3747,11 @@ void init_tcx_info_fx(
        test();
        IF( EQ_16( *L_frame, shr( st->L_frame, 1 ) ) && ( st->tcxonly ) )
        {
#ifdef FIX_2346_DUPLICATED_IGF_FUNCTIONS
            IGFDecUpdateInfo( st->hIGFDec, frame_cnt, IGF_GRID_LB_SHORT, st->element_mode );
#else
            IGFDecUpdateInfo_ivas_fx( st->hIGFDec, frame_cnt, IGF_GRID_LB_SHORT );
#endif
        }
        ELSE
        {
@@ -3743,11 +3759,19 @@ void init_tcx_info_fx(
            test();
            IF( st->last_core == ACELP_CORE || ( *left_rect && st->bfi ) )
            {
#ifdef FIX_2346_DUPLICATED_IGF_FUNCTIONS
                IGFDecUpdateInfo( st->hIGFDec, frame_cnt, IGF_GRID_LB_TRAN, st->element_mode );
#else
                IGFDecUpdateInfo_ivas_fx( st->hIGFDec, frame_cnt, IGF_GRID_LB_TRAN );
#endif
            }
            ELSE
            {
#ifdef FIX_2346_DUPLICATED_IGF_FUNCTIONS
                IGFDecUpdateInfo( st->hIGFDec, frame_cnt, IGF_GRID_LB_NORM, st->element_mode );
#else
                IGFDecUpdateInfo_ivas_fx( st->hIGFDec, frame_cnt, IGF_GRID_LB_NORM );
#endif
            }
        }
    }
@@ -3794,7 +3818,11 @@ void decoder_tcx_IGF_mono_fx(
        }
    }

#ifdef FIX_2346_DUPLICATED_IGF_FUNCTIONS
    IGFDecUpdateInfo( st->hIGFDec, frame_cnt, igfGridIdx, st->element_mode );
#else
    IGFDecUpdateInfo_ivas_fx( st->hIGFDec, frame_cnt, igfGridIdx );
#endif

    IF( st->igf )
    {
@@ -3900,7 +3928,11 @@ void decoder_tcx_IGF_stereo_fx(
            move16();
        }
    }
#ifdef FIX_2346_DUPLICATED_IGF_FUNCTIONS
    IGFDecUpdateInfo( sts[0]->hIGFDec, k, igfGridIdx, sts[0]->element_mode );
#else
    IGFDecUpdateInfo_ivas_fx( sts[0]->hIGFDec, k, igfGridIdx );
#endif

    test();
    IF( EQ_16( L_frame, shr( sts[1]->L_frame, 1 ) ) && ( sts[1]->tcxonly ) )
@@ -3922,7 +3954,11 @@ void decoder_tcx_IGF_stereo_fx(
            move16();
        }
    }
#ifdef FIX_2346_DUPLICATED_IGF_FUNCTIONS
    IGFDecUpdateInfo( sts[1]->hIGFDec, k, igfGridIdx, sts[1]->element_mode );
#else
    IGFDecUpdateInfo_ivas_fx( sts[1]->hIGFDec, k, igfGridIdx );
#endif


    IF( sts[0]->igf )
@@ -5047,9 +5083,17 @@ void decoder_tcx_noisefilling_fx(
    {
        IGFDecCopyLPCFlatSpectrum_fx( st->hIGFDec, x, *x_e, IGF_GRID_LB_SHORT );
        /* also replace flat spectrum for the second TCX10 sub frame */
#ifdef FIX_2346_DUPLICATED_IGF_FUNCTIONS
        IGFDecUpdateInfo( st->hIGFDec, 1, IGF_GRID_LB_SHORT, st->element_mode );
#else
        IGFDecUpdateInfo_ivas_fx( st->hIGFDec, 1, IGF_GRID_LB_SHORT );
#endif
        IGFDecCopyLPCFlatSpectrum_fx( st->hIGFDec, x, *x_e, IGF_GRID_LB_SHORT );
#ifdef FIX_2346_DUPLICATED_IGF_FUNCTIONS
        IGFDecUpdateInfo( st->hIGFDec, 0, IGF_GRID_LB_SHORT, st->element_mode );
#else
        IGFDecUpdateInfo_ivas_fx( st->hIGFDec, 0, IGF_GRID_LB_SHORT );
#endif
        Copy( st->hIGFDec->igfData.igf_curr_subframe[0][0], st->hIGFDec->igfData.igf_curr_subframe[1][0], IGF_MAX_SFB );
    }
    ELSE IF( bfi && st->igf && ( frame_cnt == 0 ) && ( EQ_16( L_frameTCX, shr( hTcxDec->L_frameTCX, 1 ) ) ) )
+32 −8
Original line number Diff line number Diff line
@@ -4092,6 +4092,7 @@ void IGFDecSetMode_ivas_fx(
    hIGFDec->igfData.igfInfo.nfSeed = &hIGFDec->igfData.igfInfo.nfSeedBuf[0];
    return;
}
#ifndef FIX_2346_DUPLICATED_IGF_FUNCTIONS
/**********************************************************************/ /*
updates the start/stop frequency of IGF according to igfGridIdx
**************************************************************************/
@@ -4117,7 +4118,22 @@ void IGFDecUpdateInfo( const IGF_DEC_INSTANCE_HANDLE hInstance, /**< in
        move16();
    }
}
#endif

#ifdef FIX_2346_DUPLICATED_IGF_FUNCTIONS
/*-------------------------------------------------------------------*
 * IGFDecUpdateInfo()
 *
 * updates the start/stop frequency of IGF according to igfGridIdx
 *-------------------------------------------------------------------*/

void IGFDecUpdateInfo(
    const IGF_DEC_INSTANCE_HANDLE hIGFDec, /* i/o: instance handle of IGF Decoder */
    const Word16 subFrameIdx,              /* i  : index of subframe              */
    const Word16 igfGridIdx,               /* i  : IGF grid index                 */
    const Word16 element_mode              /* i  : IVAS element mode type         */
)
#else
/*-------------------------------------------------------------------*
 * IGFDecUpdateInfo_ivas_fx()
 *
@@ -4129,10 +4145,15 @@ void IGFDecUpdateInfo_ivas_fx(
    const Word16 subFrameIdx,              /* i  : index of subframe              */
    const Word16 igfGridIdx                /* i  : IGF grid index                 */
)
#endif
{
    IGF_DEC_PRIVATE_DATA_HANDLE hPrivateData;
    H_IGF_GRID hGrid;

#ifdef FIX_2346_DUPLICATED_IGF_FUNCTIONS
    IF( GT_16( element_mode, EVS_MONO ) )
    {
#endif
        hIGFDec->flag_sparse = &hIGFDec->flag_sparseBuf[0];
        hIGFDec->infoTCXNoise_ptr = &hIGFDec->infoTCXNoise_evs[0];

@@ -4145,6 +4166,9 @@ void IGFDecUpdateInfo_ivas_fx(
        {
            IGFDecRestoreTCX10SubFrameData_fx( hIGFDec, subFrameIdx );
        }
#ifdef FIX_2346_DUPLICATED_IGF_FUNCTIONS
    }
#endif

    hPrivateData = &hIGFDec->igfData;
    IF( hIGFDec->isIGFActive )