Commit 252d3788 authored by Sandesh Venkatesh's avatar Sandesh Venkatesh
Browse files

Merge branch '3gpp_issue_807_fix' into 'main'

[3GPP-Issue #807] Fixes LTV Encoding crash issue observed for MASA DTX bitrate switching case

See merge request !477
parents c084b0b1 0b3e8504
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -79,6 +79,7 @@
#define NON_BE_1055_RESET_LP_MEMORIES                   /* VA: issue 1055: Correctly reset LP filter MA and AR memories in bitrate switching */
#define NON_BE_FIX_1137_GSC_IVAS_FXFLT_DECODING         /* VA: Add fix point bit allocation for special GSC mode such that float and fixed point have the same final bit allocation */
#define NONBE_FIX_1132_THRESHOLD_POW_IN_SWB_TBE         /* VA: issue 1132: prevent division by extremely low energy value in SWB TBE */
#define NON_BE_FIX_807_MASA_DTX_BRSW                     /* Nokia: adds fix to check existence of DTX encoder for secondary channel in TD mode */

/* #################### End FIXES switches ############################ */

+4 −0
Original line number Diff line number Diff line
@@ -232,7 +232,11 @@ ivas_error acelp_core_dec(
        st->hGSCDec->Last_frame_ener = (float) MAX_32;
    }

#ifdef NON_BE_FIX_807_MASA_DTX_BRSW
    if ( st->hFdCngDec != NULL && ( st->element_mode == IVAS_CPE_DFT || st->element_mode == IVAS_CPE_TD ) && ( st->last_core_brate == SID_2k40 || st->last_core_brate == FRAME_NO_DATA ) )
#else
    if ( ( st->element_mode == IVAS_CPE_DFT || st->element_mode == IVAS_CPE_TD ) && ( st->last_core_brate == SID_2k40 || st->last_core_brate == FRAME_NO_DATA ) )
#endif
    {
        set_zero( st->hFdCngDec->hFdCngCom->olapBufferSynth2_flt, FFTLEN );
        set_zero( hStereoCng->olapBufferSynth22, FFTLEN );
+4 −0
Original line number Diff line number Diff line
@@ -264,7 +264,11 @@ ivas_error acelp_core_dec_fx(
        move32();
    }
#ifdef IVAS_CODE
#ifdef NON_BE_FIX_807_MASA_DTX_BRSW
    if ( st->hFdCngDec != NULL && ( st->element_mode == IVAS_CPE_DFT || st->element_mode == IVAS_CPE_TD ) && ( st->last_core_brate == SID_2k40 || st->last_core_brate == FRAME_NO_DATA ) )
#else
    if ( ( st->element_mode == IVAS_CPE_DFT || st->element_mode == IVAS_CPE_TD ) && ( st->last_core_brate == SID_2k40 || st->last_core_brate == FRAME_NO_DATA ) )
#endif
    {
        set_zero( st->hFdCngDec->hFdCngCom->olapBufferSynth2, FFTLEN );
        set_zero( hStereoCng->olapBufferSynth22, FFTLEN );
+5 −0
Original line number Diff line number Diff line
@@ -284,7 +284,12 @@ ivas_error acelp_core_dec_ivas_fx(
    test();
    test();
    test();
#ifdef NON_BE_FIX_807_MASA_DTX_BRSW
    test();
    IF( st->hFdCngDec != NULL && ( EQ_16( st->element_mode, IVAS_CPE_DFT ) || EQ_16( st->element_mode, IVAS_CPE_TD ) ) && ( EQ_32( st->last_core_brate, SID_2k40 ) || st->last_core_brate == FRAME_NO_DATA ) )
#else
    IF( ( EQ_16( st->element_mode, IVAS_CPE_DFT ) || EQ_16( st->element_mode, IVAS_CPE_TD ) ) && ( EQ_32( st->last_core_brate, SID_2k40 ) || st->last_core_brate == FRAME_NO_DATA ) )
#endif
    {
        set16_fx( st->hFdCngDec->hFdCngCom->olapBufferSynth2, 0, FFTLEN );
        set16_fx( hStereoCng->olapBufferSynth22_fx, 0, FFTLEN );
+20 −0
Original line number Diff line number Diff line
@@ -414,7 +414,11 @@ ivas_error acelp_core_enc(
         * After inactive period, use the most up-to-date ISPs
         *-----------------------------------------------------------------*/

#ifdef NON_BE_FIX_807_MASA_DTX_BRSW
        if (st->hDtxEnc != NULL && (st->last_core_brate == FRAME_NO_DATA || st->last_core_brate == SID_2k40))
#else
        if ( st->last_core_brate == FRAME_NO_DATA || st->last_core_brate == SID_2k40 )
#endif
        {
            mvr2r( st->hDtxEnc->lspCNG, st->lsp_old, M );
            lsp2lsf( st->hDtxEnc->lspCNG, st->lsf_old, M, int_fs );
@@ -748,7 +752,11 @@ ivas_error acelp_core_enc(
#if 0
        floatToFixed_arr(st->lsp_old, st->lsp_old_fx, 15, M);

#ifdef NON_BE_FIX_807_MASA_DTX_BRSW
        IF (st->hDtxEnc != NULL && (st->last_core_brate == FRAME_NO_DATA || EQ_32(st->last_core_brate, SID_2k40)))
#else
        IF(EQ_32(st->last_core_brate, FRAME_NO_DATA) || EQ_32(st->last_core_brate, SID_2k40))
#endif
        {
          Copy(st->hDtxEnc->lspCNG_fx, st->lsp_old_fx, M);
          lsp2lsf_fx(st->hDtxEnc->lspCNG_fx, st->lsf_old_fx, M, int_fs);
@@ -756,8 +764,12 @@ ivas_error acelp_core_enc(
        for (int i = 0; i < M; i++) {
          st->lsf_old[i] = st->lsf_old_fx[i] / 2.56;
        }
#else
#ifdef NON_BE_FIX_807_MASA_DTX_BRSW
        if (st->hDtxEnc != NULL && (st->last_core_brate == FRAME_NO_DATA || st->last_core_brate == SID_2k40))
#else
        if ( st->last_core_brate == FRAME_NO_DATA || st->last_core_brate == SID_2k40 )
#endif
        {
            mvr2r( st->hDtxEnc->lspCNG, st->lsp_old, M );
            lsp2lsf( st->hDtxEnc->lspCNG, st->lsf_old, M, int_fs );
@@ -1164,7 +1176,11 @@ ivas_error acelp_core_enc(
         * After inactive period, use the most up-to-date ISPs
         *-----------------------------------------------------------------*/

#ifdef NON_BE_FIX_807_MASA_DTX_BRSW
        if ( st->hDtxEnc != NULL && ( st->last_core_brate == FRAME_NO_DATA || st->last_core_brate == SID_2k40 ) )
#else
        if ( st->last_core_brate == FRAME_NO_DATA || st->last_core_brate == SID_2k40 )
#endif
        {
            mvr2r( st->hDtxEnc->lspCNG, st->lsp_old, M );
            lsp2lsf( st->hDtxEnc->lspCNG, st->lsf_old, M, int_fs );
@@ -1838,7 +1854,11 @@ ivas_error acelp_core_enc(
         * After inactive period, use the most up-to-date ISPs
         *-----------------------------------------------------------------*/

#ifdef NON_BE_FIX_807_MASA_DTX_BRSW
        if ( st->hDtxEnc != NULL && ( st->last_core_brate == FRAME_NO_DATA || st->last_core_brate == SID_2k40 ) )
#else
        if ( st->last_core_brate == FRAME_NO_DATA || st->last_core_brate == SID_2k40 )
#endif
        {
            mvr2r( st->hDtxEnc->lspCNG, st->lsp_old, M );
            lsp2lsf( st->hDtxEnc->lspCNG, st->lsf_old, M, int_fs );
Loading