Commit 3b73c432 authored by reutelhuber's avatar reutelhuber
Browse files

amend fix to only trigger reconfig after NO_DATA frames if there was a bitrate...

amend fix to only trigger reconfig after NO_DATA frames if there was a bitrate switch in the meantime
parent dc068873
Loading
Loading
Loading
Loading
Loading

lib_enc/init_enc.c

100644 → 100755
+3 −0
Original line number Diff line number Diff line
@@ -100,6 +100,9 @@ ivas_error init_encoder(
    st->low_rate_mode = 0;
    st->ini_frame = 0;
    st->inactive_coder_type_flag = 0;
#ifdef NONBE_FIX_788_SBA_DTX_BR_SWITCHING
    st->sba_br_sw_while_no_data = 0;
#endif

    st->coder_type_raw = VOICED;
    st->last_coder_type_raw = st->coder_type_raw;
+10 −1
Original line number Diff line number Diff line
@@ -193,7 +193,11 @@ ivas_error pre_proc_front_ivas(
        st = hSCE->hCoreCoder[n];
        signal_in = hSCE->hCoreCoder[n]->input;
        element_mode = IVAS_SCE;
#ifdef NONBE_FIX_788_SBA_DTX_BR_SWITCHING
        last_element_brate = hSCE->last_element_brate;
#else
        last_element_brate = hSCE->element_brate; /*  hack - the past parameter is not really needed */
#endif
        hStereoClassif = NULL;
        lr_vad_enabled = 0;
    }
@@ -791,9 +795,14 @@ ivas_error pre_proc_front_ivas(
        if ( ( element_mode >= IVAS_CPE_DFT && element_brate >= IVAS_24k4 ) || ( element_mode == IVAS_SCE && element_brate >= SCE_SMC_THR ) )
        {
#ifdef NONBE_FIX_788_SBA_DTX_BR_SWITCHING
            if ( ivas_format == SBA_FORMAT && st->core_brate != FRAME_NO_DATA && st->last_core_brate == FRAME_NO_DATA )
            if ( ivas_format == SBA_FORMAT && st->core_brate != FRAME_NO_DATA && st->last_core_brate == FRAME_NO_DATA && st->sba_br_sw_while_no_data )
            {
                SetModeIndex( st, st->bits_frame_nominal * FRAMES_PER_SEC, element_mode, MCT_flag );
                st->sba_br_sw_while_no_data = 0;
            }
            else if ( ivas_format == SBA_FORMAT && st->core_brate == FRAME_NO_DATA && element_brate != last_element_brate )
            {
                st->sba_br_sw_while_no_data = 1;
            }
#endif

lib_enc/stat_enc.h

100644 → 100755
+4 −0
Original line number Diff line number Diff line
@@ -1556,6 +1556,10 @@ typedef struct enc_core_structure

    int16_t dtx_sce_sba; /* enable use of FD CNG with transform domain cores in SCE SBA */

#ifdef NONBE_FIX_788_SBA_DTX_BR_SWITCHING
    int16_t sba_br_sw_while_no_data; /* Indicator for SBA bitrate switch while in FRAME_NO_DATA mode */
#endif

} Encoder_State, *ENC_CORE_HANDLE;