Commit 6c38d924 authored by vasilache's avatar vasilache
Browse files

Merge branch '694-omasa-crash-for-extreme-sample' into 'main'

Resolve #694 "OMASA crash for extreme sample"

See merge request !989
parents a54a59b1 42519e8f
Loading
Loading
Loading
Loading
Loading
+14 −7
Original line number Diff line number Diff line
@@ -476,6 +476,10 @@ static ivas_error acelp_FCB_allocator(
        }

        /* try to increase the FCB of the first subframe in cases when the next step is lower than the current step */
#ifdef NONBE_FIX_694_OMASA_ACELP
        if ( fixed_cdk_index[sfr] < ACELP_FIXED_CDK_NB - 1 )
        {
#endif
            step = fcb_table( fixed_cdk_index[sfr] + 1, L_subfr ) - fcb_table( fixed_cdk_index[sfr], L_subfr );
            if ( *nBits >= step && cdbk >= 0 )
            {
@@ -489,6 +493,9 @@ static ivas_error acelp_FCB_allocator(
                    *nBits -= step;
                }
            }
#ifdef NONBE_FIX_694_OMASA_ACELP
        }
#endif
    }
    /* TRANSITION coding: allocate highest FCBQ bit-budget to the subframe with the glottal-shape codebook */
    if ( tc_subfr >= L_SUBFR )
+11 −0
Original line number Diff line number Diff line
@@ -308,7 +308,18 @@ void tdm_bit_alloc(
    {
        *total_brate_sec = min( *total_brate_sec, element_brate_wo_meta - ( 5900 + BWE_brate ) );

#ifdef NONBE_FIX_694_OMASA_ACELP
        if ( coder_type == INACTIVE )
        {
            *total_brate_sec = max( *total_brate_sec, tdm_bit_allc_tbl[0][0] ); /* sanity check to ensure the secondary channel always gets the minimal bitrate it needs */
        }
        else
        {
            *total_brate_sec = max( *total_brate_sec, 3500 ); /* sanity check to ensure the secondary channel always gets the minimal bitrate it needs */
        }
#else
        *total_brate_sec = max( *total_brate_sec, tdm_bit_allc_tbl[idx][coder_type] ); /* sanity check to ensure the secondary channel always gets the minimal bitrate it needs */
#endif
    }

    /* Secondary channel bitrate adjusment                                                      */
+1 −1
Original line number Diff line number Diff line
@@ -167,7 +167,7 @@
#define NONBE_FIX_736_FOA_BR_SWITCH                           /* FhG/Dlb : Issue 736: FOA bitrate switching decoding crashes in in ivas_spar_to_dirac */
#define NONBE_FIX_746_NONDIEGETIC_MD                          /* Eri: Issue 746: The non-diegetic panning flag affects the encoder bitstream even if extended metadata is not enabled. Crashes the decoder.*/
#define NONBE_FIX_729_ASAN_2ISM_ACELP                         /* VA: issue 729: fix ASAN ACELP errors with 2 ISM coding using LTV */

#define NONBE_FIX_694_OMASA_ACELP                             /* Nokia: Issue #694: OMASA crash in ACELP with extreme item */

/* ##################### End NON-BE switches ############################# */