Commit 61b05a1c authored by multrus's avatar multrus
Browse files

[cleanup] accept NONBE_FIX_698_SBA_MSAN

parent 70f2e0f6
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -4549,10 +4549,6 @@ void ivas_spar_update_md_hist(

int16_t ivas_spar_chk_zero_coefs(
    Decoder_Struct *st_ivas                                    /* i/o: IVAS decoder handle                     */
#ifndef NONBE_FIX_698_SBA_MSAN
    ,
    const int16_t sba_order                                     /* i  : Ambisonic (SBA) order                   */
#endif
);

void ivas_spar_smooth_md_dtx(
+0 −1
Original line number Diff line number Diff line
@@ -175,7 +175,6 @@
/* all switches in this category should start with "NONBE_" */


#define NONBE_FIX_698_SBA_MSAN                                /* Dlb: issue 698: Uninitialized memory read in SBA init */
#define NONBE_FIX_694_OMASA_ACELP                             /* Nokia: Issue #694: OMASA crash in ACELP with extreme item */
#define NONBE_FIX_770_PLANAR_SBA_JBM                          /* FhG  : Issue #770: Crash in planar FOA decoding with JBM caused by uninitialized value */
#define NONBE_FIX_760_COHERENCE_MASA                          /* Nokia: Issue 760: fixes decoder crash for some cases when all energy ratios are 1 */
+0 −41
Original line number Diff line number Diff line
@@ -644,10 +644,6 @@ static ivas_error ivas_spar_set_dec_config(

static void ivas_dec_mono_sba_handling(
    Decoder_Struct *st_ivas /* i/o: IVAS decoder handle                                 */
#ifndef NONBE_FIX_698_SBA_MSAN
    ,
    const int16_t sba_order /* i  : Ambisonic (SBA) order                              */
#endif
)
{
    int16_t mono_flag, b, block;
@@ -672,11 +668,7 @@ static void ivas_dec_mono_sba_handling(
    }

/* Combine the SPAR prediction coefs flag with the azimuth, elevation and energy ratio flag.*/
#ifdef NONBE_FIX_698_SBA_MSAN
    mono_flag = mono_flag && ivas_spar_chk_zero_coefs( st_ivas );
#else
    mono_flag = mono_flag && ivas_spar_chk_zero_coefs( st_ivas, sba_order );
#endif

    if ( mono_flag )
    {
@@ -762,11 +754,7 @@ void ivas_spar_md_dec_process(
    ivas_spar_dec_parse_md_bs( hMdDec, st0, &nB, &bw, &dtx_vad, st_ivas->hDecoderConfig->ivas_total_brate,
                               st_ivas->hQMetaData->sba_inactive_mode, st_ivas->last_active_ivas_total_brate );

#ifdef NONBE_FIX_698_SBA_MSAN
    ivas_dec_mono_sba_handling( st_ivas );
#else
    ivas_dec_mono_sba_handling( st_ivas, sba_order );
#endif

    /* SPAR to DirAC conversion */
    if ( hMdDec->spar_hoa_dirac2spar_md_flag == 1 )
@@ -878,18 +866,9 @@ void ivas_spar_md_dec_process(

int16_t ivas_spar_chk_zero_coefs(
    Decoder_Struct *st_ivas /* i/o: IVAS decoder handle        */
#ifndef NONBE_FIX_698_SBA_MSAN
    ,
    const int16_t sba_order /* i  : Ambisonic (SBA) order      */
#endif
)
{
#ifdef NONBE_FIX_698_SBA_MSAN
    int16_t j, k, b;
#else
    int16_t j, k, b, i_ts;
    int16_t num_md_sub_frames;
#endif
    ivas_spar_md_dec_state_t *hMdDec;
    int16_t mono = 1;
    int16_t ndec, ndm;
@@ -898,20 +877,11 @@ int16_t ivas_spar_chk_zero_coefs(
    ndec = hMdDec->spar_md_cfg.num_decorr_per_band[0];
    ndm = hMdDec->spar_md_cfg.num_dmx_chans_per_band[0];

#ifndef NONBE_FIX_698_SBA_MSAN
    num_md_sub_frames = ivas_get_spar_dec_md_num_subframes( sba_order, st_ivas->hDecoderConfig->ivas_total_brate, st_ivas->last_active_ivas_total_brate );
    for ( i_ts = 0; i_ts < num_md_sub_frames; i_ts++ )
    {
#endif
        for ( b = 0; b < min( hMdDec->spar_md.num_bands, SPAR_DIRAC_SPLIT_START_BAND ); b++ )
        {
            for ( j = 0; j < ndm + ndec - 1; j++ )
            {
#ifdef NONBE_FIX_698_SBA_MSAN
                if ( hMdDec->spar_md.band_coeffs[b].pred_re[j] != 0.0f )
#else
            if ( hMdDec->spar_md.band_coeffs[b + i_ts * IVAS_MAX_NUM_BANDS].pred_re[j] != 0.0f )
#endif
                {
                    mono = 0;
                }
@@ -920,11 +890,7 @@ int16_t ivas_spar_chk_zero_coefs(
            {
                for ( k = 0; k < ndm - 1; k++ )
                {
#ifdef NONBE_FIX_698_SBA_MSAN
                    if ( hMdDec->spar_md.band_coeffs[b].C_re[j][k] != 0.0f )
#else
                if ( hMdDec->spar_md.band_coeffs[b + i_ts * IVAS_MAX_NUM_BANDS].C_re[j][k] != 0.0f )
#endif
                    {
                        mono = 0;
                    }
@@ -932,19 +898,12 @@ int16_t ivas_spar_chk_zero_coefs(
            }
            for ( j = 0; j < ndec; j++ )
            {
#ifdef NONBE_FIX_698_SBA_MSAN
                if ( hMdDec->spar_md.band_coeffs[b].P_re[j] != 0.0f )
#else
            if ( hMdDec->spar_md.band_coeffs[b + i_ts * IVAS_MAX_NUM_BANDS].P_re[j] != 0.0f )
#endif
                {
                    mono = 0;
                }
            }
        }
#ifndef NONBE_FIX_698_SBA_MSAN
    }
#endif

    return mono;
}