Loading lib_dec/ivas_corecoder_dec_reconfig.c +0 −13 Original line number Diff line number Diff line Loading @@ -64,10 +64,6 @@ ivas_error ivas_corecoder_dec_reconfig( MC_MODE last_mc_mode; DECODER_CONFIG_HANDLE hDecoderConfig; ivas_error error; #ifdef NONBE_FIX_862_UBSAN_SPAR_DEC_BR_SW_PLC int16_t prev_bfi; Decoder_State *st0; #endif /*-----------------------------------------------------------------* * Initialization Loading Loading @@ -145,10 +141,6 @@ ivas_error ivas_corecoder_dec_reconfig( } else { #ifdef NONBE_FIX_862_UBSAN_SPAR_DEC_BR_SW_PLC st0 = ( nSCE_old > 0 ) ? st_ivas->hSCE[0]->hCoreCoder[0] : st_ivas->hCPE[0]->hCoreCoder[0]; prev_bfi = st0->prev_bfi; #endif nSCE_existing = min( nSCE_old, st_ivas->nSCE ); nCPE_existing = min( nCPE_old, st_ivas->nCPE ); Loading Loading @@ -301,11 +293,6 @@ ivas_error ivas_corecoder_dec_reconfig( st_ivas->hCPE[0]->hCoreCoder[n]->mct_chan_mode = MCT_CHAN_MODE_REGULAR; } } #ifdef NONBE_FIX_862_UBSAN_SPAR_DEC_BR_SW_PLC st0 = ( st_ivas->nSCE > 0 ) ? st_ivas->hSCE[0]->hCoreCoder[0] : st_ivas->hCPE[0]->hCoreCoder[0]; st0->prev_bfi = prev_bfi; #endif } /* create dummy CPE element for DFT stereo-like upmix */ Loading lib_dec/ivas_spar_md_dec.c +131 −9 Original line number Diff line number Diff line Loading @@ -82,7 +82,12 @@ static void ivas_parse_parameter_bitstream_dtx( ivas_spar_md_t *pSpar_md, Decode 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 ); 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 sba_inactive_mode, const int32_t last_active_brate ); 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 sba_inactive_mode #ifndef NONBE_FIX_862_UBSAN_SPAR_DEC_BR_SW_PLC , const int32_t last_active_brate #endif ); /*------------------------------------------------------------------------- Loading @@ -103,6 +108,12 @@ ivas_error ivas_spar_md_dec_matrix_open( { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for band_coeffs in SPAR MD" ); } #ifdef NONBE_FIX_862_UBSAN_SPAR_DEC_BR_SW_PLC if ( ( hMdDec->band_coeffs_prev = (ivas_band_coeffs_t *) malloc( IVAS_MAX_NUM_BANDS * sizeof( ivas_band_coeffs_t ) ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for band_coeffs in SPAR MD" ); } #endif if ( ( hMdDec->mixer_mat = (float ***) malloc( num_channels * sizeof( float ** ) ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for SPAR MD matrix" ); Loading Loading @@ -365,6 +376,13 @@ void ivas_spar_md_dec_matrix_close( free( hMdDecoder->spar_md.band_coeffs ); hMdDecoder->spar_md.band_coeffs = NULL; } #ifdef NONBE_FIX_862_UBSAN_SPAR_DEC_BR_SW_PLC if ( hMdDecoder->band_coeffs_prev != NULL ) { free( hMdDecoder->band_coeffs_prev ); hMdDecoder->band_coeffs_prev = NULL; } #endif if ( hMdDecoder->mixer_mat != NULL ) { Loading Loading @@ -543,11 +561,17 @@ ivas_error ivas_spar_md_dec_init( /* initialize PLC state */ set_s( hMdDec->valid_bands, 0, IVAS_MAX_NUM_BANDS ); set_s( hMdDec->base_band_age, 0, IVAS_MAX_NUM_BANDS ); #ifdef NONBE_FIX_862_UBSAN_SPAR_DEC_BR_SW_PLC set_s( hMdDec->base_band_coeffs_age, 0, IVAS_MAX_NUM_BANDS ); #endif hMdDec->spar_plc_num_lost_frames = 0; hMdDec->spar_plc_enable_fadeout_flag = 1; hMdDec->dtx_md_smoothing_cntr = 1; ivas_clear_band_coeffs( hMdDec->spar_md.band_coeffs, IVAS_MAX_NUM_BANDS ); #ifdef NONBE_FIX_862_UBSAN_SPAR_DEC_BR_SW_PLC ivas_clear_band_coeffs( hMdDec->band_coeffs_prev, IVAS_MAX_NUM_BANDS ); #endif ivas_clear_band_coeff_idx( hMdDec->spar_md.band_coeffs_idx, IVAS_MAX_NUM_BANDS ); ivas_clear_band_coeff_idx( hMdDec->spar_md_prev.band_coeffs_idx, IVAS_MAX_NUM_BANDS ); ivas_clear_band_coeff_idx( hMdDec->spar_md_prev.band_coeffs_idx_mapped, IVAS_MAX_NUM_BANDS ); Loading @@ -571,6 +595,9 @@ ivas_error ivas_spar_md_dec_init( set_zero( hMdDec->mixer_mat_prev2[i][j], IVAS_MAX_NUM_BANDS ); } } #ifdef NONBE_FIX_862_UBSAN_SPAR_DEC_BR_SW_PLC hMdDec->first_valid_frame = 0; #endif return IVAS_ERR_OK; } Loading Loading @@ -752,7 +779,17 @@ 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 ); st_ivas->hQMetaData->sba_inactive_mode #ifndef NONBE_FIX_862_UBSAN_SPAR_DEC_BR_SW_PLC , st_ivas->last_active_ivas_total_brate #endif ); #ifdef NONBE_FIX_862_UBSAN_SPAR_DEC_BR_SW_PLC assert( nB == hMdDec->spar_md.num_bands ); assert( bw == 1 ); #endif ivas_dec_mono_sba_handling( st_ivas ); Loading @@ -763,11 +800,13 @@ void ivas_spar_md_dec_process( } /* set correct number of bands*/ #ifndef NONBE_FIX_862_UBSAN_SPAR_DEC_BR_SW_PLC nB = IVAS_MAX_NUM_BANDS; if ( bw == IVAS_RED_BAND_FACT ) { nB = nB >> 1; } #endif #ifdef DEBUG_LBR_SBA /* Dumping SPAR Coefficients */ char f_name[100]; Loading Loading @@ -840,6 +879,7 @@ void ivas_spar_md_dec_process( fprintf( fid, "%.6f\n", hMdDec->mixer_mat[1][0][band] ); } #endif #ifndef NONBE_FIX_862_UBSAN_SPAR_DEC_BR_SW_PLC if ( bw == IVAS_RED_BAND_FACT ) { nB = nB << 1; Loading @@ -849,9 +889,10 @@ void ivas_spar_md_dec_process( { hMdDec->valid_bands[b] = 1; } #endif ivas_spar_md_fill_invalid_bands( &hMdDec->spar_coeffs, &hMdDec->spar_coeffs_prev, &hMdDec->valid_bands[0], &hMdDec->base_band_age[0], num_bands_out, num_md_chs, num_md_sub_frames ); hMdDec->dtx_md_smoothing_cntr = 1; return; Loading Loading @@ -1461,6 +1502,49 @@ void ivas_spar_dec_gen_umx_mat( return; } #ifdef NONBE_FIX_862_UBSAN_SPAR_DEC_BR_SW_PLC static void ivas_spar_md_band_upmix( ivas_band_coeffs_t *band_coeffs, int16_t *nB, int16_t *bands_bw, int16_t *valid_bands, int16_t bw_final, int16_t ndec, int16_t ndm ) { int16_t i, ii, jj, b, idx, bw_fact; bw_fact = *bands_bw / bw_final; for ( i = *nB - 1; i >= 0; i-- ) { for ( b = bw_fact - 1; b >= 0; b-- ) { idx = i * bw_fact + b; for ( ii = 0; ii < ndec + ndm - 1; ii++ ) { band_coeffs[idx].pred_re[ii] = band_coeffs[i].pred_re[ii]; } for ( ii = 0; ii < ndec; ii++ ) { for ( jj = 0; jj < ndm - 1; jj++ ) { band_coeffs[idx].C_re[ii][jj] = band_coeffs[i].C_re[ii][jj]; } } for ( jj = 0; jj < ndec; jj++ ) { band_coeffs[idx].P_re[jj] = band_coeffs[i].P_re[jj]; } valid_bands[idx] = valid_bands[i]; } } *nB = ( *nB ) * ( *bands_bw ) / bw_final; *bands_bw = bw_final; return; } #endif /*-----------------------------------------------------------------------------------------* * Function ivas_spar_dec_parse_md_bs() Loading @@ -1475,19 +1559,29 @@ static void ivas_spar_dec_parse_md_bs( int16_t *bands_bw, int16_t *dtx_vad, const int32_t ivas_total_brate, const int16_t sba_inactive_mode, const int32_t last_active_brate ) const int16_t sba_inactive_mode #ifndef NONBE_FIX_862_UBSAN_SPAR_DEC_BR_SW_PLC , const int32_t last_active_brate #endif ) { int16_t i, j, k, num_bands; #ifndef NONBE_FIX_862_UBSAN_SPAR_DEC_BR_SW_PLC int16_t ii, jj, ndec, ndm, b, idx; #else int16_t ii, jj, ndec, ndm; #endif uint16_t qsi; ivas_quant_strat_t qs; int16_t strat, no_ec; int16_t do_diff[IVAS_MAX_NUM_BANDS]; float quant[IVAS_SPAR_MAX_C_COEFF]; int16_t do_repeat[IVAS_MAX_NUM_BANDS]; #ifndef NONBE_FIX_862_UBSAN_SPAR_DEC_BR_SW_PLC int16_t bw_final, bw_fact; int32_t active_brate; #endif *dtx_vad = 1; *bands_bw = 1; qsi = 0; Loading Loading @@ -1559,6 +1653,19 @@ static void ivas_spar_dec_parse_md_bs( ivas_parse_parameter_bitstream_dtx( &hMdDec->spar_md, st0, *bands_bw, *nB, hMdDec->spar_md_cfg.num_dmx_chans_per_band, hMdDec->spar_md_cfg.num_decorr_per_band ); #ifdef NONBE_FIX_862_UBSAN_SPAR_DEC_BR_SW_PLC ndec = hMdDec->spar_md_cfg.num_decorr_per_band[0]; ndm = hMdDec->spar_md_cfg.num_dmx_chans_per_band[0]; ivas_spar_md_band_upmix( hMdDec->spar_md.band_coeffs, nB, bands_bw, hMdDec->valid_bands, 1, ndec, ndm ); #else active_brate = ( ivas_total_brate > IVAS_SID_5k2 ) ? ivas_total_brate : last_active_brate; if ( active_brate >= IVAS_24k4 ) Loading Loading @@ -1593,7 +1700,7 @@ static void ivas_spar_dec_parse_md_bs( *bands_bw = bw_final; *nB = num_bands / bw_final; #endif return; } Loading Loading @@ -1646,7 +1753,7 @@ static void ivas_spar_dec_parse_md_bs( do_repeat[i] = 0; } #ifdef NONBE_FIX_862_UBSAN_SPAR_DEC_BR_SW_PLC if ( st0->prev_bfi == 0 ) if ( hMdDec->spar_md_cfg.prev_quant_idx >= 0 ) { #endif ivas_map_prior_coeffs_quant( &hMdDec->spar_md_prev, &hMdDec->spar_md_cfg, qsi, *nB ); Loading Loading @@ -1712,13 +1819,30 @@ static void ivas_spar_dec_parse_md_bs( { hMdDec->spar_md_prev.band_coeffs_idx[i].decd_index_re[j] = hMdDec->spar_md.band_coeffs_idx[i].decd_index_re[j]; } #ifndef NONBE_FIX_862_UBSAN_SPAR_DEC_BR_SW_PLC hMdDec->valid_bands[*bands_bw * i] |= ( do_diff[i] == 0 && do_repeat[i] == 0 ) ? 1 : 0; for ( j = 1; j < *bands_bw; j++ ) { hMdDec->valid_bands[*bands_bw * i + j] = hMdDec->valid_bands[*bands_bw * i]; } #else hMdDec->valid_bands[i] |= ( do_diff[i] == 0 && do_repeat[i] == 0 ) ? 1 : 0; #endif } #ifdef NONBE_FIX_862_UBSAN_SPAR_DEC_BR_SW_PLC ndec = hMdDec->spar_md_cfg.num_decorr_per_band[0]; ndm = hMdDec->spar_md_cfg.num_dmx_chans_per_band[0]; ivas_spar_md_band_upmix( hMdDec->spar_md.band_coeffs, nB, bands_bw, hMdDec->valid_bands, 1, ndec, ndm ); #endif return; } Loading Loading @@ -1997,7 +2121,6 @@ static void ivas_decode_huffman_bs( * Fill invalid bands in interpolation/extrapolation of valid bands * when PLC is to be done with partial time differential coding *-----------------------------------------------------------------------------------------*/ static void ivas_spar_md_fill_invalid_bands( ivas_spar_dec_matrices_t *pSpar_coeffs, ivas_spar_dec_matrices_t *pSpar_coeffs_prev, Loading Loading @@ -2111,7 +2234,6 @@ static void ivas_spar_md_fill_invalid_bands( return; } /*-----------------------------------------------------------------------------------------* * Function ivas_spar_dec_compute_ramp_down_post_matrix() * Loading lib_dec/ivas_stat_dec.h +5 −1 Original line number Diff line number Diff line Loading @@ -603,7 +603,11 @@ typedef struct ivas_spar_md_dec_state_t float smooth_buf[IVAS_MAX_NUM_BANDS][2 * SBA_DIRAC_NRG_SMOOTH_LONG + 1]; float smooth_fac[IVAS_MAX_NUM_BANDS]; float mixer_mat_prev2[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH][IVAS_MAX_NUM_BANDS]; #ifdef NONBE_FIX_862_UBSAN_SPAR_DEC_BR_SW_PLC int16_t first_valid_frame; ivas_band_coeffs_t *band_coeffs_prev; int16_t base_band_coeffs_age[IVAS_MAX_NUM_BANDS]; #endif } ivas_spar_md_dec_state_t; Loading Loading
lib_dec/ivas_corecoder_dec_reconfig.c +0 −13 Original line number Diff line number Diff line Loading @@ -64,10 +64,6 @@ ivas_error ivas_corecoder_dec_reconfig( MC_MODE last_mc_mode; DECODER_CONFIG_HANDLE hDecoderConfig; ivas_error error; #ifdef NONBE_FIX_862_UBSAN_SPAR_DEC_BR_SW_PLC int16_t prev_bfi; Decoder_State *st0; #endif /*-----------------------------------------------------------------* * Initialization Loading Loading @@ -145,10 +141,6 @@ ivas_error ivas_corecoder_dec_reconfig( } else { #ifdef NONBE_FIX_862_UBSAN_SPAR_DEC_BR_SW_PLC st0 = ( nSCE_old > 0 ) ? st_ivas->hSCE[0]->hCoreCoder[0] : st_ivas->hCPE[0]->hCoreCoder[0]; prev_bfi = st0->prev_bfi; #endif nSCE_existing = min( nSCE_old, st_ivas->nSCE ); nCPE_existing = min( nCPE_old, st_ivas->nCPE ); Loading Loading @@ -301,11 +293,6 @@ ivas_error ivas_corecoder_dec_reconfig( st_ivas->hCPE[0]->hCoreCoder[n]->mct_chan_mode = MCT_CHAN_MODE_REGULAR; } } #ifdef NONBE_FIX_862_UBSAN_SPAR_DEC_BR_SW_PLC st0 = ( st_ivas->nSCE > 0 ) ? st_ivas->hSCE[0]->hCoreCoder[0] : st_ivas->hCPE[0]->hCoreCoder[0]; st0->prev_bfi = prev_bfi; #endif } /* create dummy CPE element for DFT stereo-like upmix */ Loading
lib_dec/ivas_spar_md_dec.c +131 −9 Original line number Diff line number Diff line Loading @@ -82,7 +82,12 @@ static void ivas_parse_parameter_bitstream_dtx( ivas_spar_md_t *pSpar_md, Decode 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 ); 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 sba_inactive_mode, const int32_t last_active_brate ); 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 sba_inactive_mode #ifndef NONBE_FIX_862_UBSAN_SPAR_DEC_BR_SW_PLC , const int32_t last_active_brate #endif ); /*------------------------------------------------------------------------- Loading @@ -103,6 +108,12 @@ ivas_error ivas_spar_md_dec_matrix_open( { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for band_coeffs in SPAR MD" ); } #ifdef NONBE_FIX_862_UBSAN_SPAR_DEC_BR_SW_PLC if ( ( hMdDec->band_coeffs_prev = (ivas_band_coeffs_t *) malloc( IVAS_MAX_NUM_BANDS * sizeof( ivas_band_coeffs_t ) ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for band_coeffs in SPAR MD" ); } #endif if ( ( hMdDec->mixer_mat = (float ***) malloc( num_channels * sizeof( float ** ) ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for SPAR MD matrix" ); Loading Loading @@ -365,6 +376,13 @@ void ivas_spar_md_dec_matrix_close( free( hMdDecoder->spar_md.band_coeffs ); hMdDecoder->spar_md.band_coeffs = NULL; } #ifdef NONBE_FIX_862_UBSAN_SPAR_DEC_BR_SW_PLC if ( hMdDecoder->band_coeffs_prev != NULL ) { free( hMdDecoder->band_coeffs_prev ); hMdDecoder->band_coeffs_prev = NULL; } #endif if ( hMdDecoder->mixer_mat != NULL ) { Loading Loading @@ -543,11 +561,17 @@ ivas_error ivas_spar_md_dec_init( /* initialize PLC state */ set_s( hMdDec->valid_bands, 0, IVAS_MAX_NUM_BANDS ); set_s( hMdDec->base_band_age, 0, IVAS_MAX_NUM_BANDS ); #ifdef NONBE_FIX_862_UBSAN_SPAR_DEC_BR_SW_PLC set_s( hMdDec->base_band_coeffs_age, 0, IVAS_MAX_NUM_BANDS ); #endif hMdDec->spar_plc_num_lost_frames = 0; hMdDec->spar_plc_enable_fadeout_flag = 1; hMdDec->dtx_md_smoothing_cntr = 1; ivas_clear_band_coeffs( hMdDec->spar_md.band_coeffs, IVAS_MAX_NUM_BANDS ); #ifdef NONBE_FIX_862_UBSAN_SPAR_DEC_BR_SW_PLC ivas_clear_band_coeffs( hMdDec->band_coeffs_prev, IVAS_MAX_NUM_BANDS ); #endif ivas_clear_band_coeff_idx( hMdDec->spar_md.band_coeffs_idx, IVAS_MAX_NUM_BANDS ); ivas_clear_band_coeff_idx( hMdDec->spar_md_prev.band_coeffs_idx, IVAS_MAX_NUM_BANDS ); ivas_clear_band_coeff_idx( hMdDec->spar_md_prev.band_coeffs_idx_mapped, IVAS_MAX_NUM_BANDS ); Loading @@ -571,6 +595,9 @@ ivas_error ivas_spar_md_dec_init( set_zero( hMdDec->mixer_mat_prev2[i][j], IVAS_MAX_NUM_BANDS ); } } #ifdef NONBE_FIX_862_UBSAN_SPAR_DEC_BR_SW_PLC hMdDec->first_valid_frame = 0; #endif return IVAS_ERR_OK; } Loading Loading @@ -752,7 +779,17 @@ 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 ); st_ivas->hQMetaData->sba_inactive_mode #ifndef NONBE_FIX_862_UBSAN_SPAR_DEC_BR_SW_PLC , st_ivas->last_active_ivas_total_brate #endif ); #ifdef NONBE_FIX_862_UBSAN_SPAR_DEC_BR_SW_PLC assert( nB == hMdDec->spar_md.num_bands ); assert( bw == 1 ); #endif ivas_dec_mono_sba_handling( st_ivas ); Loading @@ -763,11 +800,13 @@ void ivas_spar_md_dec_process( } /* set correct number of bands*/ #ifndef NONBE_FIX_862_UBSAN_SPAR_DEC_BR_SW_PLC nB = IVAS_MAX_NUM_BANDS; if ( bw == IVAS_RED_BAND_FACT ) { nB = nB >> 1; } #endif #ifdef DEBUG_LBR_SBA /* Dumping SPAR Coefficients */ char f_name[100]; Loading Loading @@ -840,6 +879,7 @@ void ivas_spar_md_dec_process( fprintf( fid, "%.6f\n", hMdDec->mixer_mat[1][0][band] ); } #endif #ifndef NONBE_FIX_862_UBSAN_SPAR_DEC_BR_SW_PLC if ( bw == IVAS_RED_BAND_FACT ) { nB = nB << 1; Loading @@ -849,9 +889,10 @@ void ivas_spar_md_dec_process( { hMdDec->valid_bands[b] = 1; } #endif ivas_spar_md_fill_invalid_bands( &hMdDec->spar_coeffs, &hMdDec->spar_coeffs_prev, &hMdDec->valid_bands[0], &hMdDec->base_band_age[0], num_bands_out, num_md_chs, num_md_sub_frames ); hMdDec->dtx_md_smoothing_cntr = 1; return; Loading Loading @@ -1461,6 +1502,49 @@ void ivas_spar_dec_gen_umx_mat( return; } #ifdef NONBE_FIX_862_UBSAN_SPAR_DEC_BR_SW_PLC static void ivas_spar_md_band_upmix( ivas_band_coeffs_t *band_coeffs, int16_t *nB, int16_t *bands_bw, int16_t *valid_bands, int16_t bw_final, int16_t ndec, int16_t ndm ) { int16_t i, ii, jj, b, idx, bw_fact; bw_fact = *bands_bw / bw_final; for ( i = *nB - 1; i >= 0; i-- ) { for ( b = bw_fact - 1; b >= 0; b-- ) { idx = i * bw_fact + b; for ( ii = 0; ii < ndec + ndm - 1; ii++ ) { band_coeffs[idx].pred_re[ii] = band_coeffs[i].pred_re[ii]; } for ( ii = 0; ii < ndec; ii++ ) { for ( jj = 0; jj < ndm - 1; jj++ ) { band_coeffs[idx].C_re[ii][jj] = band_coeffs[i].C_re[ii][jj]; } } for ( jj = 0; jj < ndec; jj++ ) { band_coeffs[idx].P_re[jj] = band_coeffs[i].P_re[jj]; } valid_bands[idx] = valid_bands[i]; } } *nB = ( *nB ) * ( *bands_bw ) / bw_final; *bands_bw = bw_final; return; } #endif /*-----------------------------------------------------------------------------------------* * Function ivas_spar_dec_parse_md_bs() Loading @@ -1475,19 +1559,29 @@ static void ivas_spar_dec_parse_md_bs( int16_t *bands_bw, int16_t *dtx_vad, const int32_t ivas_total_brate, const int16_t sba_inactive_mode, const int32_t last_active_brate ) const int16_t sba_inactive_mode #ifndef NONBE_FIX_862_UBSAN_SPAR_DEC_BR_SW_PLC , const int32_t last_active_brate #endif ) { int16_t i, j, k, num_bands; #ifndef NONBE_FIX_862_UBSAN_SPAR_DEC_BR_SW_PLC int16_t ii, jj, ndec, ndm, b, idx; #else int16_t ii, jj, ndec, ndm; #endif uint16_t qsi; ivas_quant_strat_t qs; int16_t strat, no_ec; int16_t do_diff[IVAS_MAX_NUM_BANDS]; float quant[IVAS_SPAR_MAX_C_COEFF]; int16_t do_repeat[IVAS_MAX_NUM_BANDS]; #ifndef NONBE_FIX_862_UBSAN_SPAR_DEC_BR_SW_PLC int16_t bw_final, bw_fact; int32_t active_brate; #endif *dtx_vad = 1; *bands_bw = 1; qsi = 0; Loading Loading @@ -1559,6 +1653,19 @@ static void ivas_spar_dec_parse_md_bs( ivas_parse_parameter_bitstream_dtx( &hMdDec->spar_md, st0, *bands_bw, *nB, hMdDec->spar_md_cfg.num_dmx_chans_per_band, hMdDec->spar_md_cfg.num_decorr_per_band ); #ifdef NONBE_FIX_862_UBSAN_SPAR_DEC_BR_SW_PLC ndec = hMdDec->spar_md_cfg.num_decorr_per_band[0]; ndm = hMdDec->spar_md_cfg.num_dmx_chans_per_band[0]; ivas_spar_md_band_upmix( hMdDec->spar_md.band_coeffs, nB, bands_bw, hMdDec->valid_bands, 1, ndec, ndm ); #else active_brate = ( ivas_total_brate > IVAS_SID_5k2 ) ? ivas_total_brate : last_active_brate; if ( active_brate >= IVAS_24k4 ) Loading Loading @@ -1593,7 +1700,7 @@ static void ivas_spar_dec_parse_md_bs( *bands_bw = bw_final; *nB = num_bands / bw_final; #endif return; } Loading Loading @@ -1646,7 +1753,7 @@ static void ivas_spar_dec_parse_md_bs( do_repeat[i] = 0; } #ifdef NONBE_FIX_862_UBSAN_SPAR_DEC_BR_SW_PLC if ( st0->prev_bfi == 0 ) if ( hMdDec->spar_md_cfg.prev_quant_idx >= 0 ) { #endif ivas_map_prior_coeffs_quant( &hMdDec->spar_md_prev, &hMdDec->spar_md_cfg, qsi, *nB ); Loading Loading @@ -1712,13 +1819,30 @@ static void ivas_spar_dec_parse_md_bs( { hMdDec->spar_md_prev.band_coeffs_idx[i].decd_index_re[j] = hMdDec->spar_md.band_coeffs_idx[i].decd_index_re[j]; } #ifndef NONBE_FIX_862_UBSAN_SPAR_DEC_BR_SW_PLC hMdDec->valid_bands[*bands_bw * i] |= ( do_diff[i] == 0 && do_repeat[i] == 0 ) ? 1 : 0; for ( j = 1; j < *bands_bw; j++ ) { hMdDec->valid_bands[*bands_bw * i + j] = hMdDec->valid_bands[*bands_bw * i]; } #else hMdDec->valid_bands[i] |= ( do_diff[i] == 0 && do_repeat[i] == 0 ) ? 1 : 0; #endif } #ifdef NONBE_FIX_862_UBSAN_SPAR_DEC_BR_SW_PLC ndec = hMdDec->spar_md_cfg.num_decorr_per_band[0]; ndm = hMdDec->spar_md_cfg.num_dmx_chans_per_band[0]; ivas_spar_md_band_upmix( hMdDec->spar_md.band_coeffs, nB, bands_bw, hMdDec->valid_bands, 1, ndec, ndm ); #endif return; } Loading Loading @@ -1997,7 +2121,6 @@ static void ivas_decode_huffman_bs( * Fill invalid bands in interpolation/extrapolation of valid bands * when PLC is to be done with partial time differential coding *-----------------------------------------------------------------------------------------*/ static void ivas_spar_md_fill_invalid_bands( ivas_spar_dec_matrices_t *pSpar_coeffs, ivas_spar_dec_matrices_t *pSpar_coeffs_prev, Loading Loading @@ -2111,7 +2234,6 @@ static void ivas_spar_md_fill_invalid_bands( return; } /*-----------------------------------------------------------------------------------------* * Function ivas_spar_dec_compute_ramp_down_post_matrix() * Loading
lib_dec/ivas_stat_dec.h +5 −1 Original line number Diff line number Diff line Loading @@ -603,7 +603,11 @@ typedef struct ivas_spar_md_dec_state_t float smooth_buf[IVAS_MAX_NUM_BANDS][2 * SBA_DIRAC_NRG_SMOOTH_LONG + 1]; float smooth_fac[IVAS_MAX_NUM_BANDS]; float mixer_mat_prev2[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH][IVAS_MAX_NUM_BANDS]; #ifdef NONBE_FIX_862_UBSAN_SPAR_DEC_BR_SW_PLC int16_t first_valid_frame; ivas_band_coeffs_t *band_coeffs_prev; int16_t base_band_coeffs_age[IVAS_MAX_NUM_BANDS]; #endif } ivas_spar_md_dec_state_t; Loading