Commit c4efb9f7 authored by Michael Sturm's avatar Michael Sturm
Browse files

Unifies IGFEncSetMode_fx function.

parent 2f8d643c
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -10161,6 +10161,7 @@ void SetModeIndex_ivas_fx(
    const Word16 MCT_flag           /* i  : hMCT handle allocated (1) or not (0)   Q0*/
);

#ifndef FIX_2346_DUPLICATED_IGF_FUNCTIONS
void IGFEncSetMode_ivas_fx(
    const IGF_ENC_INSTANCE_HANDLE hIGFEnc, /* i/o: instance handle of IGF Encoder */
    const Word32 total_brate,              /* i  : encoder total bitrate          */
@@ -10168,7 +10169,7 @@ void IGFEncSetMode_ivas_fx(
    const Word16 element_mode,             /* i  : IVAS element mode              */
    const Word16 rf_mode                   /* i  : flag to signal the RF mode     */
);

#endif
void init_tcx_cfg_ivas_fx(
    TCX_CONFIG_HANDLE hTcxCfg,
    const Word32 total_brate,
+4 −0
Original line number Diff line number Diff line
@@ -1060,7 +1060,11 @@ void init_coder_ace_plus_ivas_fx(
    test();
    IF( st->igf && st->hIGFEnc != NULL )
    {
#ifdef FIX_2346_DUPLICATED_IGF_FUNCTIONS
        IGFEncSetMode_fx( st->hIGFEnc, igf_brate, st->bwidth, st->element_mode, st->rf_mode );
#else
        IGFEncSetMode_ivas_fx( st->hIGFEnc, igf_brate, st->bwidth, st->element_mode, st->rf_mode );
#endif
    }
    ELSE IF( st->hIGFEnc != NULL )
    {
+35 −3
Original line number Diff line number Diff line
@@ -1445,7 +1445,7 @@ Word16 IGFEncWriteBitstream_fx(
    return hInstance->infoTotalBitsPerFrameWritten;
}


#ifndef FIX_2346_DUPLICATED_IGF_FUNCTIONS
/**********************************************************************/ /*
sets the IGF mode according to given bitrate
**************************************************************************/
@@ -1523,8 +1523,7 @@ void IGFEncSetMode_fx(

    return;
}


#endif
/*-------------------------------------------------------------------*
 * pack_bit()
 *
@@ -1780,11 +1779,19 @@ ivas_error IGF_Reconfig_fx(
        {
            return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for hIGFEnc\n" ) );
        }
#ifdef FIX_2346_DUPLICATED_IGF_FUNCTIONS
        IGFEncSetMode_fx( *hIGFEnc, brate, bwidth, element_mode, rf_mode );
#else
        IGFEncSetMode_ivas_fx( *hIGFEnc, brate, bwidth, element_mode, rf_mode );
#endif
    }
    ELSE IF( igf && reset )
    {
#ifdef FIX_2346_DUPLICATED_IGF_FUNCTIONS
        IGFEncSetMode_fx( *hIGFEnc, brate, bwidth, element_mode, rf_mode );
#else
        IGFEncSetMode_ivas_fx( *hIGFEnc, brate, bwidth, element_mode, rf_mode );
#endif
    }
    ELSE IF( !igf && *hIGFEnc != NULL )
    {
@@ -3955,7 +3962,11 @@ Word16 IGFEncWriteBitstream_ivas_fx(
 * sets the IGF mode according to given bitrate
 *-------------------------------------------------------------------*/

#ifdef FIX_2346_DUPLICATED_IGF_FUNCTIONS
void IGFEncSetMode_fx(
#else
void IGFEncSetMode_ivas_fx(
#endif
    const IGF_ENC_INSTANCE_HANDLE hIGFEnc, /* i/o: instance handle of IGF Encoder */
    const Word32 total_brate,              /* i  : encoder total bitrate          */
    const Word16 bwidth,                   /* i  : encoder audio bandwidth        */
@@ -3972,6 +3983,7 @@ void IGFEncSetMode_ivas_fx(
    set16_fx( hPrivateData->igfScfQuantized, 0, IGF_MAX_SFB );
    set16_fx( hPrivateData->igfCurrWhiteningLevel, 0, IGF_MAX_TILES );
    set16_fx( hPrivateData->igfPrevWhiteningLevel, 0, IGF_MAX_TILES );
#ifndef FIX_2346_DUPLICATED_IGF_FUNCTIONS
    set16_fx( hPrivateData->igfWhiteningHangoverCnt, 0, IGF_MAX_TILES );
    FOR( i = 0; i < IGF_MAX_TILES; i++ )
    {
@@ -3980,6 +3992,7 @@ void IGFEncSetMode_ivas_fx(

    hPrivateData->igfPastSFM_pos = 0;
    move16();
#endif

    FOR( i = 0; i < IGF_BITBUFSIZE / 8; i++ )
    {
@@ -3990,6 +4003,17 @@ void IGFEncSetMode_ivas_fx(
    move16();
    set32_fx( hPrivateData->prevSFM_FIR, 0, IGF_MAX_TILES );
    set16_fx( hPrivateData->prevSFM_IIR, 0, IGF_MAX_TILES );
#ifdef FIX_2346_DUPLICATED_IGF_FUNCTIONS
    /* IVAS specific settings */
    set16_fx( hPrivateData->igfWhiteningHangoverCnt, 0, IGF_MAX_TILES );
    FOR( i = 0; i < IGF_MAX_TILES; i++ )
    {
        set16_fx( hPrivateData->igfPastSFM_fx[i], -( ONE_IN_Q13 ), IGF_PAST_SFM_LEN );
    }

    hPrivateData->igfPastSFM_pos = 0;
    move16();
#endif
    set16_fx( hPrivateData->dampingFactorSmoothing, 2, IGF_MAX_SFB );
    set16_fx( hPrivateData->prevSFM_FIR_SFB_SB_fx, 0, IGF_MAX_SFB );
    set16_fx( hPrivateData->prevSFB_FIR_TB_e, 15, IGF_MAX_SFB );
@@ -4383,11 +4407,19 @@ ivas_error IGF_Reconfig(
        {
            return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for hIGFEnc\n" ) );
        }
#ifdef FIX_2346_DUPLICATED_IGF_FUNCTIONS
        IGFEncSetMode_fx( *hIGFEnc, brate, bwidth, element_mode, rf_mode );
#else
        IGFEncSetMode_ivas_fx( *hIGFEnc, brate, bwidth, element_mode, rf_mode );
#endif
    }
    ELSE IF( igf && reset )
    {
#ifdef FIX_2346_DUPLICATED_IGF_FUNCTIONS
        IGFEncSetMode_fx( *hIGFEnc, brate, bwidth, element_mode, rf_mode );
#else
        IGFEncSetMode_ivas_fx( *hIGFEnc, brate, bwidth, element_mode, rf_mode );
#endif
    }
    ELSE IF( !igf && *hIGFEnc != NULL )
    {