Commit 98a9dc6c authored by vaillancour's avatar vaillancour
Browse files

complementary fix for 1205 + debugging code

parent b2f433ff
Loading
Loading
Loading
Loading
Loading
+26 −1
Original line number Diff line number Diff line
@@ -215,7 +215,22 @@ void ivas_decision_matrix_enc(
    if ( st->core == TCX_20_CORE && st->total_brate < STEREO_TCX_MIN_RATE )
    {
        st->core = ACELP_CORE;
#ifdef NONBE_FIX_1205_TD_STEREO_MOD_CT
        /* For TD stereo at 16.4kbps (TD is not allowed at 13k2), we can't overwrite the coder_type here WHEN it is TRANSITION */
        /* as it has been used for TD bit allocation and must remained the same at the decoder side to ensure identical bit allocation */
        if ( st->idchan == 0 && !( element_brate <= IVAS_16k4 && st->coder_type == TRANSITION && st->element_mode == IVAS_CPE_TD ) )
        {   
            st->coder_type = AUDIO;
        }
#ifdef DEBUG_MODE_TD
        else
        {
            printf( "coder type not changed\n" );
        }
#endif
#else
        st->coder_type = AUDIO;
#endif
        st->sp_aud_decision2 = 0;

        if ( st->low_rate_mode )
@@ -371,7 +386,17 @@ void ivas_decision_matrix_enc(
    {
        st->inactive_coder_type_flag = 1; /* GSC */
    }

#ifdef DEBUG_MODE_TD
    if ( st->idchan == 0 && st->element_mode == IVAS_CPE_TD && st->core == ACELP_CORE && element_brate < IVAS_24k4 )
    {
        if ( (st->coder_type == TRANSITION && st->mod_ct_ST != TRANSITION ) || 
            ( st->coder_type != TRANSITION && st->mod_ct_ST == TRANSITION ) )
        {
            printf( "st->coder_type != st->mod_ct_ST !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n" );
            exit( -555 );
        }
    }
#endif
    return;
}

+3 −0
Original line number Diff line number Diff line
@@ -479,6 +479,9 @@ void tdm_configure_enc(
            mod_ct = AUDIO;
        }
    }
#endif
#ifdef DEBUG_MODE_TD
    sts[0]->mod_ct_ST = mod_ct;
#endif
    /* Correction of tdm_inst_ratio_idx in case of TC in the seecondary channel */
    if ( hStereoTD->flag_skip_DMX == 0 && hStereoTD->tdm_LRTD_flag == 1 && sts[1]->tc_cnt > 1 /*&& abs(hStereoTD->tdm_inst_ratio_idx-LRTD_STEREO_MID_IS_PRIM) > 5*/ )
+3 −1
Original line number Diff line number Diff line
@@ -1557,7 +1557,9 @@ typedef struct enc_core_structure
    int16_t dtx_sce_sba; /* enable use of FD CNG with transform domain cores in SCE SBA */

    int16_t sba_br_sw_while_no_data; /* Indicator for SBA bitrate switch while in FRAME_NO_DATA mode */

#ifdef DEBUG_MODE_TD
    short mod_ct_ST;       
#endif
} Encoder_State, *ENC_CORE_HANDLE;