Commit f7ef6000 authored by Sandesh Venkatesh's avatar Sandesh Venkatesh
Browse files

Merge branch 'port-fix-1087-from-float' into 'ivas-float-update'

[Float ref update]port fix for float issue 1087

See merge request !875
parents 6432cc34 4bd3ae46
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -174,7 +174,7 @@
#define NONE_BE_FIX_BASOP_1044_OSBA_PRERENDER_MIX_GAINS /* DLB: adjust prerendering and mixing gain in OSBA encoder. This is fix to float codes*/
#define NONBE_1211_DTX_BR_SWITCHING                     /* VA: port float issue 1211: fix crash in MASA DTX bitrate switching */
#define NONBE_FIX_1189_GSC_IVAS_OMASA                   /* VA: Fix for issue 1189: Bitstream desynchornization due to reading/writing of the GSC_IVAS_mode parameter */

#define NONBE_FIX_1087_OOB_SBA_DTX_RS                   /* VA: issue 1087: Extend the length of the buffer for MCT decoding to avoid out-of-bound writing in SBA SID bitrate switching decoding */
/* #################### End FIXES switches ############################ */

#define BASOP_NOGLOB                                    /* Disable global symbols in BASOPs, Overflow/Carry in BASOPs disabled, additional BASOPs in case of Overflow */
+26 −0
Original line number Diff line number Diff line
@@ -83,6 +83,9 @@ ivas_error ivas_mct_dec(
    STnsData tnsData[MCT_MAX_BLOCKS][CPE_CHANNELS][NB_DIV];
    Decoder_State **sts;
    float synth[CPE_CHANNELS][L_FRAME_PLUS];
#ifdef NONBE_FIX_1087_OOB_SBA_DTX_RS
    float *p_output_orig[2];
#endif
    float output_lfe_ch[L_FRAME48k];
    int32_t ivas_total_brate;
    ivas_error error;
@@ -144,6 +147,18 @@ ivas_error ivas_mct_dec(
    /* MCT side bits decoder */
    ivas_mct_side_bits( hMCT, st_ivas->hCPE, nCPE, st_ivas->hCPE[0]->hCoreCoder[0], st_ivas->bfi, st_ivas->hCPE[0]->hCoreCoder[0]->bit_stream, ivas_total_brate, nb_bits_metadata );

#ifdef NONBE_FIX_1087_OOB_SBA_DTX_RS
    /* in case of switching from an SID frame (with ACELP core) to MCT, buffer of L_FRAME_PLUS samples is needed -> use synth[] as a temporary buffer */
    if ( st_ivas->hCPE[0]->hCoreCoder[0]->last_core == ACELP_CORE )
    {
        for ( n = 0; n < CPE_CHANNELS; n++ )
        {
            p_output_orig[n] = output[n];
            output[n] = synth[n];
        }
    }
#endif

    for ( cpe_id = 0; cpe_id < nCPE; cpe_id++ )
    {
        st_ivas->hCPE[cpe_id]->hCoreCoder[0]->BER_detect |= st_ivas->BER_detect;
@@ -228,6 +243,17 @@ ivas_error ivas_mct_dec(

        ivas_mdct_core_reconstruct( hCPE, x, synth, fUseTns[cpe_id], 1 );

#ifdef NONBE_FIX_1087_OOB_SBA_DTX_RS
        /* set pointers back */
        if ( cpe_id == 0 && st_ivas->hCPE[0]->hCoreCoder[0]->last_core == ACELP_CORE )
        {
            for ( n = 0; n < CPE_CHANNELS; n++ )
            {
                output[n] = p_output_orig[n];
            }
        }

#endif
        /*----------------------------------------------------------------*
         * CoreCoder Post-processing and updates
         *----------------------------------------------------------------*/