Commit 9c449287 authored by multrus's avatar multrus
Browse files

[cleanup] accept FIX_TCX_DEC_RECONF_BFI

parent 9f266e4d
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -145,7 +145,6 @@
/*#define FIX_I4_OL_PITCH*/                             /* fix open-loop pitch used for EVS core switching */
#define FIX_I1_113                                      /* under review : MCT bit distribution optimization for SBA high bitrates*/
#define PRINT_SBA_ORDER                                 /* Issue 179: print-out also the SBA order of IVAS SBA format to stdout */
#define FIX_TCX_DEC_RECONF_BFI
#define FIX_SBA_DTX_DECODE_ERROR                        /* Issue 176: SBA decoder error with DTX at 80kbps SWB, Issue 21: SBA front-VAD threshold (203) */
#define FIX_124_DONT_ALLOC_PLCINFO_IN_IVAS              /* Issue 124: do not allocate unused plc struct in IVAS modes which is only used in EVS mono */
/*#define FIX_MCT_PLC_RECOVERY*/                            /* Issue 184: scale the old synthesis part correctly in the first good frame after lost frames in MCT modes - to be activated after previous switch is merged */
+0 −49
Original line number Diff line number Diff line
@@ -51,14 +51,8 @@
 * Local prototypes
 *-------------------------------------------------------------*/

#ifdef FIX_TCX_DEC_RECONF_BFI
static void dec_prm_tcx( Decoder_State *st, int16_t param[], int16_t param_lpc[], int16_t *total_nbbits, const int16_t last_element_mode, int16_t *bitsRead );
#else
static void dec_prm_tcx( Decoder_State *st, int16_t param[], int16_t param_lpc[], int16_t *total_nbbits, int16_t *bitsRead );
#endif
#ifdef FIX_TCX_DEC_RECONF_BFI
static void stereo_tcx_dec_mode_switch_reconf( Decoder_State *st, const int16_t MCT_flag, const int16_t last_element_mode );
#endif


/*-------------------------------------------------------------*
@@ -73,9 +67,6 @@ void stereo_tcx_init_dec(
    const int16_t last_element_mode /* i  : element mode of previous frame      */
)
{
#ifndef FIX_TCX_DEC_RECONF_BFI
    int16_t frame_size_index;
#endif
    TCX_LTP_DEC_HANDLE hTcxLtpDec = st->hTcxLtpDec;
    TCX_DEC_HANDLE hTcxDec = st->hTcxDec;

@@ -134,43 +125,13 @@ void stereo_tcx_init_dec(
        }
    }

#ifdef FIX_TCX_DEC_RECONF_BFI
    if ( ( st->bits_frame_nominal != st->last_bits_frame_nominal ) ||
         ( st->bwidth != st->last_bwidth ) ||
         ( st->last_core != TCX_20_CORE && st->last_core != TCX_10_CORE && !( st->prev_bfi == 1 && st->last_core == ACELP_CORE && st->last_con_tcx == 1 ) ) ||
         ( st->idchan == 1 && st->element_mode == IVAS_CPE_MDCT && last_element_mode != IVAS_CPE_MDCT ) )
#else
    if ( ( st->bits_frame_nominal != st->last_bits_frame_nominal ) || ( st->bwidth != st->last_bwidth ) || ( st->last_core != TCX_20_CORE && st->last_core != TCX_10_CORE && !( st->prev_bfi == 1 && st->last_core == ACELP_CORE && st->last_con_tcx == 1 ) ) || ( st->idchan == 1 && st->element_mode == IVAS_CPE_MDCT && last_element_mode != IVAS_CPE_MDCT ) )
#endif
    {
        /*re-initialization*/
#ifdef FIX_TCX_DEC_RECONF_BFI
        stereo_tcx_dec_mode_switch_reconf( st, MCT_flag, last_element_mode );
#else
        st->rate_switching_init = 1;

        /* Identify frame type - TCX Reconfiguration */
        for ( frame_size_index = 0; frame_size_index < FRAME_SIZE_NB; frame_size_index++ )
        {
            if ( frame_size_index < FRAME_SIZE_NB - 1 )
            {
                if ( ( FrameSizeConfig[frame_size_index].frame_bits <= st->bits_frame_nominal ) && ( FrameSizeConfig[frame_size_index + 1].frame_bits > st->bits_frame_nominal ) )
                {
                    break;
                }
            }
            else
            {
                if ( FrameSizeConfig[frame_size_index].frame_bits <= st->bits_frame_nominal )
                {
                    break;
                }
            }
        }

        /* Reconfigure Core */
        mode_switch_decoder_LPD( st, st->bwidth, st->bits_frame_nominal * FRAMES_PER_SEC, st->last_bits_frame_nominal * FRAMES_PER_SEC, frame_size_index, MCT_flag, last_element_mode );
#endif
    }

    return;
@@ -304,11 +265,7 @@ void stereo_tcx_core_dec(
        tcx_current_overlap_mode = st->hTcxCfg->tcx_curr_overlap_mode;
#endif

#ifdef FIX_TCX_DEC_RECONF_BFI
        dec_prm_tcx( st, param, param_lpc, &total_nbbits, last_element_mode, &bitsRead );
#else
        dec_prm_tcx( st, param, param_lpc, &total_nbbits, &bitsRead );
#endif

#ifdef FIX_IVAS_337 /*IVAS-337 consider BER */
        if ( !st->rate_switching_init && st->BER_detect )
@@ -832,9 +789,7 @@ static void dec_prm_tcx(
    int16_t param[],       /* o  : decoded parameters              */
    int16_t param_lpc[],   /* o  : LPC parameters                  */
    int16_t *total_nbbits, /* i/o: number of bits / decoded bits   */
#ifdef FIX_TCX_DEC_RECONF_BFI
    const int16_t last_element_mode,
#endif
    int16_t *bitsRead /* o  : number of read bits             */
)
{
@@ -888,13 +843,11 @@ static void dec_prm_tcx(
            st->prev_bfi = 1;
        }

#ifdef FIX_TCX_DEC_RECONF_BFI
        /* possible need for reconfiguration can only be decided correctly once last_core_from_bs has been decoded */
        if ( ( st->last_core != st->last_core_from_bs ) && ( st->last_core_from_bs != TCX_20_CORE && st->last_core_from_bs != TCX_10_CORE && !( st->prev_bfi == 1 && st->last_core_from_bs == ACELP_CORE && st->last_con_tcx == 1 ) ) )
        {
            stereo_tcx_dec_mode_switch_reconf( st, 0, last_element_mode );
        }
#endif

        st->last_core = st->last_core_from_bs;

@@ -959,7 +912,6 @@ static void dec_prm_tcx(
    return;
}

#ifdef FIX_TCX_DEC_RECONF_BFI
static void stereo_tcx_dec_mode_switch_reconf(
    Decoder_State *st,
    const int16_t MCT_flag,
@@ -991,4 +943,3 @@ static void stereo_tcx_dec_mode_switch_reconf(
    /* Reconfigure Core */
    mode_switch_decoder_LPD( st, st->bwidth, st->bits_frame_nominal * FRAMES_PER_SEC, st->last_bits_frame_nominal * FRAMES_PER_SEC, frame_size_index, MCT_flag, last_element_mode );
}
#endif