Commit 103a056f authored by Vidhya V P's avatar Vidhya V P
Browse files

Fix for the issue# 501

parent 4de9d026
Loading
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -206,6 +206,8 @@
#define FIX_468_16KHZ_PUPMIX                            /* Dlb: Fix issue 468 for Param Upmix at 16kHz sampling rate */
#define FIX_499_DFT_STEREO_PLC                          /* Eri: Fix for issue 499: Wrong past memory addressed for computing energy of DFT stereo residual ECU frame  */
#define FIX_489_COV_SMOOTHING                           /* Dlb: Fix covariance smoothing for ParamUpmix */
#define FIX_501_TABLE_IDX_INIT                          /* Dlb: Fix for the issue 501 */

#define FIX_485_STATIC_BUFFERS                          /* FhG: move static buffers in DirAC parameter estimator to the DirAC struct */
#define FIX_I503_ASAN_ERROR_IND_LIST                    /* VA: fix issue #503: address sanitizer error with IND_LIST_DYN */
#define FIX_473_JITTER_NONDIEGETIC_PANNING              /* FhG,Orange: add missing non-diegetic panning to JITTER */
+30 −0
Original line number Diff line number Diff line
@@ -736,7 +736,37 @@ static void ivas_spar_dec_MD(
                ivas_spar_md_dec_init( hSpar->hMdDec, hDecoderConfig, num_channels, sba_order );
            }
        }
#ifdef FIX_501_TABLE_IDX_INIT
        else if ( st_ivas->ini_frame == 0 )
        {
            if ( st_ivas->sid_format == SID_SBA_2TC )
            {
                table_idx = ivas_get_spar_table_idx( IVAS_48k, sba_order, SPAR_CONFIG_BW, NULL, NULL );
            }
            else
            {
                table_idx = ivas_get_spar_table_idx( IVAS_24k4, sba_order, SPAR_CONFIG_BW, NULL, NULL );
            }

            hSpar->hMdDec->table_idx = table_idx;
            if ( hSpar->hMdDec->spar_hoa_md_flag )
            {
                hSpar->hMdDec->spar_md.num_bands = IVAS_MAX_NUM_BANDS;
            }
            else
            {
                hSpar->hMdDec->spar_md.num_bands = min( SPAR_DIRAC_SPLIT_START_BAND, IVAS_MAX_NUM_BANDS );
            }

            if ( hSpar->hMdDec->table_idx != table_idx )
            {
                hSpar->hMdDec->table_idx = table_idx;
                hSpar->hTdDecorr->ducking_flag = ivas_spar_br_table_consts[table_idx].td_ducking;

                ivas_spar_md_dec_init( hSpar->hMdDec, hDecoderConfig, num_channels, sba_order );
            }
        }
#endif
        /*---------------------------------------------------------------------*
         * Decode MD
         *---------------------------------------------------------------------*/
+23 −5
Original line number Diff line number Diff line
@@ -84,9 +84,11 @@ static ivas_error ivas_spar_set_dec_config( ivas_spar_md_dec_state_t *hMdDec, co
static void ivas_parse_parameter_bitstream_dtx( ivas_spar_md_t *pSpar_md, Decoder_State *st, const int16_t bw, const int16_t num_bands, int16_t *num_dmx_per_band, int16_t *num_dec_per_band );

static ivas_error ivas_deindex_real_index( const int16_t *index, const int16_t q_levels, const float min_value, const float max_value, float *quant, const int16_t num_ch_dim2 );

#ifdef FIX_501_TABLE_IDX_INIT
static void ivas_spar_dec_parse_md_bs( ivas_spar_md_dec_state_t *hMdDec, Decoder_State *st, int16_t *nB, int16_t *bands_bw, int16_t *dtx_vad, const int32_t ivas_total_brate, const int16_t use_planar_coeff, const int16_t sba_inactive_mode, const int32_t last_active_brate );
#else
static void ivas_spar_dec_parse_md_bs( ivas_spar_md_dec_state_t *hMdDec, Decoder_State *st, int16_t *nB, int16_t *bands_bw, int16_t *dtx_vad, const int32_t ivas_total_brate, const int16_t use_planar_coeff, const int16_t sba_inactive_mode );

#endif

/*-------------------------------------------------------------------------
 * ivas_spar_md_dec_matrix_open()
@@ -672,7 +674,12 @@ void ivas_spar_md_dec_process(


    ivas_spar_dec_parse_md_bs( hMdDec, st0, &nB, &bw, &dtx_vad, st_ivas->hDecoderConfig->ivas_total_brate,
                               ivas_spar_br_table_consts[hMdDec->table_idx].usePlanarCoeff, st_ivas->hQMetaData->sba_inactive_mode );
                               ivas_spar_br_table_consts[hMdDec->table_idx].usePlanarCoeff, st_ivas->hQMetaData->sba_inactive_mode
#ifdef FIX_501_TABLE_IDX_INIT
                               ,
                               st_ivas->last_active_ivas_total_brate
#endif
    );

#if 0
    {
@@ -1708,7 +1715,12 @@ static void ivas_spar_dec_parse_md_bs(
    int16_t *dtx_vad,
    const int32_t ivas_total_brate,
    const int16_t use_planar_coeff,
    const int16_t sba_inactive_mode )
    const int16_t sba_inactive_mode
#ifdef FIX_501_TABLE_IDX_INIT
    ,
    const int32_t last_active_brate
#endif
)
{
    int16_t i, j, k, num_bands;
    int16_t ii, jj, ndec, ndm, b, idx;
@@ -1812,7 +1824,13 @@ static void ivas_spar_dec_parse_md_bs(

        *nB = num_bands;
        *bands_bw = 1;

#ifdef FIX_501_TABLE_IDX_INIT
        if ( ( ivas_total_brate < IVAS_24k4 ) && ( last_active_brate < IVAS_24k4 ) )
        {
            *bands_bw = 2;
            *nB = num_bands / *bands_bw;
        }
#endif
        return;
    }