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

Merge branch...

Merge branch '288-assertion-in-range-coder-decoding-for-stereo-24-4kbps-with-frame-errors' into 'main'

[non-Be]Set TNS flag in every frame for Unified Stereo TCX coding to prevent encoder/decoder mismatch in case of unlucky frame errors.

See merge request !383
parents d495e421 f43fe077
Loading
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -156,8 +156,9 @@
#define FIX_293_EXT_RENDERER_CLI                        /* FhG: Fix bugs in external renderer CLI */
#define FIX_268                                         /* Issue 268: Add low cost dry-run of memory analysis */
#define LOW_RATE_TRANS_FIX                              /* Eri: Fix for critical item during transitions */

#define FIX_197_CREND_INTERFACE 
#define SET_TNS_FLAG_IN_EVERY_FRAME                     /* FhG: issue 288 - mismatch between encoder and decoder wrt TNS usage in unified stereo  with frameloss */

/* ################## End DEVELOPMENT switches ######################### */
/* clang-format on */
#endif
+7 −0
Original line number Diff line number Diff line
@@ -670,6 +670,13 @@ void open_decoder_LPD(
    st->last_tns_active = 0;
    st->second_last_tns_active = 0;
    st->second_last_core = -1;
#ifdef SET_TNS_FLAG_IN_EVERY_FRAME
    /* TODO: also apply for MCT modes, once issue #24 is solved */
    if ( st->hTcxCfg != NULL && !MCT_flag && st->element_mode != EVS_MONO )
    {
        st->hTcxCfg->fIsTNSAllowed = getTnsAllowed( is_init ? total_brate : st->bits_frame_nominal * FRAMES_PER_SEC, st->igf, st->element_mode, st->mct_chan_mode );
    }
#endif
    if ( hTcxDec != NULL )
    {
        hTcxDec->tcxltp_second_last_pitch = st->old_fpitch;
+7 −0
Original line number Diff line number Diff line
@@ -96,6 +96,13 @@ void stereo_tcx_init_dec(
    st->hTcxCfg->resq = getResq( st->bits_frame_nominal * FRAMES_PER_SEC );
    hTcxDec->tcx_lpc_shaped_ari = getTcxLpcShapedAri( st->bits_frame_nominal * FRAMES_PER_SEC, st->rf_flag, st->element_mode );
    st->igf = getIgfPresent( st->element_mode, st->bits_frame_nominal * FRAMES_PER_SEC, st->bwidth, st->rf_flag, st->mct_chan_mode );
#ifdef SET_TNS_FLAG_IN_EVERY_FRAME
    /* TODO: also apply for MCT modes, once issue #24 is solved */
    if ( !MCT_flag && st->element_mode != EVS_MONO )
    {
        st->hTcxCfg->fIsTNSAllowed = getTnsAllowed( st->bits_frame_nominal * FRAMES_PER_SEC, st->igf, st->element_mode, st->mct_chan_mode );
    }
#endif
    if ( hTcxLtpDec != NULL )
    {
        hTcxLtpDec->tcxltp = getTcxLtp( st->sr_core );
+6 −0
Original line number Diff line number Diff line
@@ -100,6 +100,12 @@ void stereo_tcx_init_enc(
    st->hTcxCfg->resq = getResq( st->bits_frame_nominal * FRAMES_PER_SEC );
    st->hTcxEnc->tcx_lpc_shaped_ari = getTcxLpcShapedAri( st->bits_frame_nominal * FRAMES_PER_SEC, st->rf_mode, st->element_mode );
    st->igf = getIgfPresent( st->element_mode, st->bits_frame_nominal * FRAMES_PER_SEC, st->bwidth, st->rf_mode, st->mct_chan_mode );
#ifdef SET_TNS_FLAG_IN_EVERY_FRAME
    if ( st->element_mode != EVS_MONO )
    {
        st->hTcxCfg->fIsTNSAllowed = getTnsAllowed( st->bits_frame_nominal * FRAMES_PER_SEC, st->igf, st->element_mode, st->mct_chan_mode );
    }
#endif

    st->core_brate = st->total_brate;

+1 −1
Original line number Diff line number Diff line
@@ -41,7 +41,7 @@
../IVAS_dec -fec 5 8 bit testv/stv8c_13k20_8-8_DTX20_FEC5.tst

// Codec A at 32 kbps, 32kHz in, 8kHz out, random FEC at 6%
../IVAS_cod 32000 32 scripts/testv/stv32c.pcm bit
../IVAS_cod 32000 32 testv/stv32c.pcm bit
../IVAS_dec -fec testv/FEC_6pct2.bin 8 bit stv32c_32k_32-8_FEC6.tst