Commit 41a897bd authored by Jouni Paulus's avatar Jouni Paulus
Browse files

fix ACELP problems with extreme OMASA items. switch: CR_FIX_694_OMASA_ACELP

parent 10ad856f
Loading
Loading
Loading
Loading
Loading
+7 −0
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 CR_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 CR_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 CR_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 −0
Original line number Diff line number Diff line
@@ -172,6 +172,7 @@
#define CR_FIX_586_BPF_DFT_MEM                          /* FhG: issue 586: set input memory of DFT analysis of BPF signal to zero for HQ core to fix issue with PLC and bitrate switching */
#define CR_FIX_ISM_DTX_INFINITE_CNG_ON_TRAILING_SILENCE /* FhG: fix for cng in ISM DTX on sudden silence periods */
#define CR_FIX_698_SBA_MSAN                             /* Dlb: issue 698: Uninitialized memory read in SBA init */
#define CR_FIX_694_OMASA_ACELP                          /* Nokia: Issue #694: OMASA crash in ACELP with extreme item */

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