Loading lib_com/options.h +0 −1 Original line number Diff line number Diff line Loading @@ -161,7 +161,6 @@ #define FIX_279_CODE_COVERAGE /* Dlb : issue 279 , clean up unused function */ #define FIX_549_PARAM_ISM_BIN_GAIN /* FhG: Issue 549 : fix too quiet binaural output in ParamISM */ #define FIX_618_STEREO_SW_DIV_BY_ZERO /* VA: fix issue 618 - UBSAN: division-by-zero in stereo bitrate switching */ #define FIX_625_IDX_OOB /* FhG: Fix index out-of-bounds UBSAN error (issue 625) */ Loading lib_dec/ivas_spar_md_dec.c +0 −111 Original line number Diff line number Diff line Loading @@ -69,19 +69,12 @@ static void ivas_get_spar_matrices( ivas_spar_md_dec_state_t *hMdDec, const int1 #endif ); #ifndef FIX_279_CODE_COVERAGE static void ivas_decode_arith_bs( ivas_spar_md_dec_state_t *hMdDec, Decoder_State *st, const uint16_t qsi, const int16_t nB, const int16_t bands_bw, int16_t *pDo_diff, const int16_t freq_diff, const int16_t strat, const int32_t ivas_total_brate ); #else static void ivas_decode_arith_bs( ivas_spar_md_dec_state_t *hMdDec, Decoder_State *st, const uint16_t qsi, const int16_t nB, const int16_t bands_bw, int16_t *pDo_diff, const int16_t strat, const int32_t ivas_total_brate ); #endif static void ivas_decode_huffman_bs( ivas_spar_md_dec_state_t *hMdDec, Decoder_State *st, const uint16_t qsi, const int16_t nB, const int16_t bands_bw ); static void ivas_fill_band_coeffs_idx( ivas_band_coeffs_ind_t *pBands_idx, const int16_t nB, int16_t *pSymbol_re, ivas_cell_dim_t *pCell_dims, ivas_coeffs_type_t coeff_type ); #ifndef FIX_279_CODE_COVERAGE static void ivas_get_band_idx_from_differential( ivas_spar_md_t *pSpar_md, const int16_t q_levels[2], const int16_t one_sided, const int16_t nB, const ivas_coeffs_type_t coeff_type ); #endif static void ivas_mat_col_rearrange( float in_re[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH], const int16_t order[IVAS_SPAR_MAX_CH], const int16_t i_ts, float ***mixer_mat, const int16_t bands, const int16_t num_ch ); static void ivas_spar_dec_compute_ramp_down_post_matrix( ivas_spar_md_dec_state_t *hMdDec, const int16_t num_bands, const int16_t bfi, const int16_t num_md_sub_frames ); Loading Loading @@ -1527,11 +1520,7 @@ static void ivas_spar_dec_parse_md_bs( int16_t ii, jj, ndec, ndm, b, idx; uint16_t qsi; ivas_quant_strat_t qs; #ifndef FIX_279_CODE_COVERAGE int16_t strat, freq_diff, no_ec; #else int16_t strat, no_ec; #endif int16_t do_diff[IVAS_MAX_NUM_BANDS]; float quant[IVAS_SPAR_MAX_C_COEFF]; int16_t do_repeat[IVAS_MAX_NUM_BANDS]; Loading Loading @@ -1647,9 +1636,6 @@ static void ivas_spar_dec_parse_md_bs( strat = get_next_indice( st0, 3 ); #ifndef FIX_279_CODE_COVERAGE freq_diff = 0; #endif no_ec = 0; if ( strat < 2 ) Loading Loading @@ -1705,9 +1691,6 @@ static void ivas_spar_dec_parse_md_bs( if ( no_ec == 0 ) { ivas_decode_arith_bs( hMdDec, st0, qsi, *nB, *bands_bw, do_diff, #ifndef FIX_279_CODE_COVERAGE freq_diff, #endif strat, ivas_total_brate ); } else Loading Loading @@ -1784,9 +1767,6 @@ static void ivas_decode_arith_bs( const int16_t nB, const int16_t bands_bw, int16_t *pDo_diff, #ifndef FIX_279_CODE_COVERAGE const int16_t freq_diff, #endif const int16_t strat, const int32_t ivas_total_brate ) { Loading Loading @@ -1923,100 +1903,9 @@ static void ivas_decode_arith_bs( ivas_fill_band_coeffs_idx( hMdDec->spar_md.band_coeffs_idx, nB, symbol_arr_re, decx_cell_dims, DECX_COEFF ); #ifndef FIX_279_CODE_COVERAGE if ( freq_diff == 1 ) { ivas_get_band_idx_from_differential( &hMdDec->spar_md, hMdDec->spar_md_cfg.quant_strat->PR.q_levels, 0, nB, PRED_COEFF ); ivas_get_band_idx_from_differential( &hMdDec->spar_md, hMdDec->spar_md_cfg.quant_strat->C.q_levels, 0, nB, DRCT_COEFF ); ivas_get_band_idx_from_differential( &hMdDec->spar_md, hMdDec->spar_md_cfg.quant_strat->P_r.q_levels, 1, nB, DECD_COEFF ); ivas_get_band_idx_from_differential( &hMdDec->spar_md, hMdDec->spar_md_cfg.quant_strat->P_c.q_levels, 0, nB, DECX_COEFF ); } #endif return; } #ifndef FIX_279_CODE_COVERAGE /*-----------------------------------------------------------------------------------------* * Function ivas_get_band_idx_from_differential() * * *-----------------------------------------------------------------------------------------*/ static void ivas_get_band_idx_from_differential( ivas_spar_md_t *pSpar_md, const int16_t q_levels[2], const int16_t one_sided, const int16_t nB, const ivas_coeffs_type_t coeff_type ) { int16_t i, k; int16_t min_val, max_val; int16_t index[FOA_CHANNELS - 1]; int16_t band_idx[IVAS_MAX_NUM_BANDS][FOA_CHANNELS - 1]; int16_t *ptr_idx = NULL; for ( i = 0; i < nB; i++ ) { switch ( coeff_type ) { case PRED_COEFF: ptr_idx = pSpar_md->band_coeffs_idx[i].pred_index_re; break; case DRCT_COEFF: ptr_idx = pSpar_md->band_coeffs_idx[i].drct_index_re; break; case DECD_COEFF: ptr_idx = pSpar_md->band_coeffs_idx[i].decd_index_re; break; default: assert( !"unsupported config!" ); } if ( one_sided ) { min_val = 0; max_val = q_levels[0] - 1; } else { min_val = (int16_t) -floor( q_levels[0] / 2.0f ); max_val = (int16_t) floor( q_levels[0] / 2.0f ); } if ( i == 0 ) { for ( k = 0; k < FOA_CHANNELS - 1; k++ ) { index[k] = ptr_idx[k]; } } else { for ( k = 0; k < FOA_CHANNELS - 1; k++ ) { index[k] = ptr_idx[k] + band_idx[i][k]; } } for ( k = 0; k < FOA_CHANNELS - 1; k++ ) { if ( index[k] < min_val ) { index[k] = max_val - min_val + index[k] + 1; } if ( index[k] > max_val ) { index[k] = max_val + index[k] - min_val - 1; } band_idx[i][k] = index[k]; } } return; } #endif /*-----------------------------------------------------------------------------------------* * Function ivas_fill_band_coeffs_idx() * Loading Loading
lib_com/options.h +0 −1 Original line number Diff line number Diff line Loading @@ -161,7 +161,6 @@ #define FIX_279_CODE_COVERAGE /* Dlb : issue 279 , clean up unused function */ #define FIX_549_PARAM_ISM_BIN_GAIN /* FhG: Issue 549 : fix too quiet binaural output in ParamISM */ #define FIX_618_STEREO_SW_DIV_BY_ZERO /* VA: fix issue 618 - UBSAN: division-by-zero in stereo bitrate switching */ #define FIX_625_IDX_OOB /* FhG: Fix index out-of-bounds UBSAN error (issue 625) */ Loading
lib_dec/ivas_spar_md_dec.c +0 −111 Original line number Diff line number Diff line Loading @@ -69,19 +69,12 @@ static void ivas_get_spar_matrices( ivas_spar_md_dec_state_t *hMdDec, const int1 #endif ); #ifndef FIX_279_CODE_COVERAGE static void ivas_decode_arith_bs( ivas_spar_md_dec_state_t *hMdDec, Decoder_State *st, const uint16_t qsi, const int16_t nB, const int16_t bands_bw, int16_t *pDo_diff, const int16_t freq_diff, const int16_t strat, const int32_t ivas_total_brate ); #else static void ivas_decode_arith_bs( ivas_spar_md_dec_state_t *hMdDec, Decoder_State *st, const uint16_t qsi, const int16_t nB, const int16_t bands_bw, int16_t *pDo_diff, const int16_t strat, const int32_t ivas_total_brate ); #endif static void ivas_decode_huffman_bs( ivas_spar_md_dec_state_t *hMdDec, Decoder_State *st, const uint16_t qsi, const int16_t nB, const int16_t bands_bw ); static void ivas_fill_band_coeffs_idx( ivas_band_coeffs_ind_t *pBands_idx, const int16_t nB, int16_t *pSymbol_re, ivas_cell_dim_t *pCell_dims, ivas_coeffs_type_t coeff_type ); #ifndef FIX_279_CODE_COVERAGE static void ivas_get_band_idx_from_differential( ivas_spar_md_t *pSpar_md, const int16_t q_levels[2], const int16_t one_sided, const int16_t nB, const ivas_coeffs_type_t coeff_type ); #endif static void ivas_mat_col_rearrange( float in_re[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH], const int16_t order[IVAS_SPAR_MAX_CH], const int16_t i_ts, float ***mixer_mat, const int16_t bands, const int16_t num_ch ); static void ivas_spar_dec_compute_ramp_down_post_matrix( ivas_spar_md_dec_state_t *hMdDec, const int16_t num_bands, const int16_t bfi, const int16_t num_md_sub_frames ); Loading Loading @@ -1527,11 +1520,7 @@ static void ivas_spar_dec_parse_md_bs( int16_t ii, jj, ndec, ndm, b, idx; uint16_t qsi; ivas_quant_strat_t qs; #ifndef FIX_279_CODE_COVERAGE int16_t strat, freq_diff, no_ec; #else int16_t strat, no_ec; #endif int16_t do_diff[IVAS_MAX_NUM_BANDS]; float quant[IVAS_SPAR_MAX_C_COEFF]; int16_t do_repeat[IVAS_MAX_NUM_BANDS]; Loading Loading @@ -1647,9 +1636,6 @@ static void ivas_spar_dec_parse_md_bs( strat = get_next_indice( st0, 3 ); #ifndef FIX_279_CODE_COVERAGE freq_diff = 0; #endif no_ec = 0; if ( strat < 2 ) Loading Loading @@ -1705,9 +1691,6 @@ static void ivas_spar_dec_parse_md_bs( if ( no_ec == 0 ) { ivas_decode_arith_bs( hMdDec, st0, qsi, *nB, *bands_bw, do_diff, #ifndef FIX_279_CODE_COVERAGE freq_diff, #endif strat, ivas_total_brate ); } else Loading Loading @@ -1784,9 +1767,6 @@ static void ivas_decode_arith_bs( const int16_t nB, const int16_t bands_bw, int16_t *pDo_diff, #ifndef FIX_279_CODE_COVERAGE const int16_t freq_diff, #endif const int16_t strat, const int32_t ivas_total_brate ) { Loading Loading @@ -1923,100 +1903,9 @@ static void ivas_decode_arith_bs( ivas_fill_band_coeffs_idx( hMdDec->spar_md.band_coeffs_idx, nB, symbol_arr_re, decx_cell_dims, DECX_COEFF ); #ifndef FIX_279_CODE_COVERAGE if ( freq_diff == 1 ) { ivas_get_band_idx_from_differential( &hMdDec->spar_md, hMdDec->spar_md_cfg.quant_strat->PR.q_levels, 0, nB, PRED_COEFF ); ivas_get_band_idx_from_differential( &hMdDec->spar_md, hMdDec->spar_md_cfg.quant_strat->C.q_levels, 0, nB, DRCT_COEFF ); ivas_get_band_idx_from_differential( &hMdDec->spar_md, hMdDec->spar_md_cfg.quant_strat->P_r.q_levels, 1, nB, DECD_COEFF ); ivas_get_band_idx_from_differential( &hMdDec->spar_md, hMdDec->spar_md_cfg.quant_strat->P_c.q_levels, 0, nB, DECX_COEFF ); } #endif return; } #ifndef FIX_279_CODE_COVERAGE /*-----------------------------------------------------------------------------------------* * Function ivas_get_band_idx_from_differential() * * *-----------------------------------------------------------------------------------------*/ static void ivas_get_band_idx_from_differential( ivas_spar_md_t *pSpar_md, const int16_t q_levels[2], const int16_t one_sided, const int16_t nB, const ivas_coeffs_type_t coeff_type ) { int16_t i, k; int16_t min_val, max_val; int16_t index[FOA_CHANNELS - 1]; int16_t band_idx[IVAS_MAX_NUM_BANDS][FOA_CHANNELS - 1]; int16_t *ptr_idx = NULL; for ( i = 0; i < nB; i++ ) { switch ( coeff_type ) { case PRED_COEFF: ptr_idx = pSpar_md->band_coeffs_idx[i].pred_index_re; break; case DRCT_COEFF: ptr_idx = pSpar_md->band_coeffs_idx[i].drct_index_re; break; case DECD_COEFF: ptr_idx = pSpar_md->band_coeffs_idx[i].decd_index_re; break; default: assert( !"unsupported config!" ); } if ( one_sided ) { min_val = 0; max_val = q_levels[0] - 1; } else { min_val = (int16_t) -floor( q_levels[0] / 2.0f ); max_val = (int16_t) floor( q_levels[0] / 2.0f ); } if ( i == 0 ) { for ( k = 0; k < FOA_CHANNELS - 1; k++ ) { index[k] = ptr_idx[k]; } } else { for ( k = 0; k < FOA_CHANNELS - 1; k++ ) { index[k] = ptr_idx[k] + band_idx[i][k]; } } for ( k = 0; k < FOA_CHANNELS - 1; k++ ) { if ( index[k] < min_val ) { index[k] = max_val - min_val + index[k] + 1; } if ( index[k] > max_val ) { index[k] = max_val + index[k] - min_val - 1; } band_idx[i][k] = index[k]; } } return; } #endif /*-----------------------------------------------------------------------------------------* * Function ivas_fill_band_coeffs_idx() * Loading