Commit d4368978 authored by Jan Kiene's avatar Jan Kiene
Browse files

add new reconf call

parent 4c288405
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -152,7 +152,7 @@
#define FIX_155_HP20_ISSUE                              /* Issue 155: apply hp20 on all input channels instead of just 2 channels */
#define EFAP_FIX_POLY                                   /* Issue 167: fix bug in EFAP polygon selection */
#define SBA_HOA_HBR_IMPROV                              /* issue 91: Improvements to SBA high bitrate HOA3 coding */
#define FIX_TCX_DEC_RECONF_BF
#define FIX_TCX_DEC_RECONF_BFI

/* ################## End DEVELOPMENT switches ######################### */
/* clang-format on */
+27 −1
Original line number Diff line number Diff line
@@ -51,7 +51,11 @@
 * 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 is_mct, const int16_t last_element_mode );
#endif
@@ -130,7 +134,14 @@ 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
@@ -293,7 +304,11 @@ 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 )
@@ -817,6 +832,9 @@ 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             */
)
{
@@ -870,6 +888,14 @@ 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;

        /*for TCX 10 force last_core to be TCX since ACELP as previous core is forbidden*/
@@ -935,7 +961,7 @@ static void dec_prm_tcx(

#ifdef FIX_TCX_DEC_RECONF_BFI
static void stereo_tcx_dec_mode_switch_reconf(
    DecoderState *st,
    Decoder_State *st,
    const int16_t is_mct,
    const int16_t last_element_mode
)