Loading lib_com/cldfb.c +176 −1 Original line number Diff line number Diff line Loading @@ -60,6 +60,19 @@ static void cldfb_init_proto_and_twiddles( HANDLE_CLDFB_FILTER_BANK hs ); static void cldfb_init_proto_and_twiddles_enc_fx( HANDLE_CLDFB_FILTER_BANK hs ); static void GetEnergyCldfb_ivas_fx( Word32 *energyLookahead, /*!< o: Q(*sf_energyLookahead) | pointer to the result in the core look-ahead slot */ Word16 *sf_energyLookahead, /*!< o: pointer to the scalefactor of the result in the core look-ahead slot */ const Word16 numLookahead, /*!< i: Q0 the number of look-ahead time-slots */ Word16 **realValues, /*!< i: Q(sf_Values) | the real part of the CLDFB subsamples */ Word16 **imagValues, /*!< i: Q(sf_Values) | the imaginary part of the CLDFB subsamples */ Word16 sf_Values, /*!< i: scalefactor of the CLDFB subcamples - apply as a negated Exponent */ Word16 numberBands, /*!< i: Q0 | number of CLDFB bands */ Word16 numberCols, /*!< i: Q0 | number of CLDFB subsamples */ Word32 *energyHF, /*!< o: Q31 | pointer to HF energy */ Word16 *energyHF_Exp, /*!< o: pointer to exponent of HF energy */ Word32 *energyValuesSum, /*!< o: Q(2*sf_Values-4) | pointer to sum array of energy values, not initialized*/ Word16 *energyValuesSum_Exp, /*!< o: pointer to exponents of energyValuesSum, not initialized */ TEC_ENC_HANDLE hTecEnc ); /*-------------------------------------------------------------------* * cplxMult() Loading Loading @@ -1552,6 +1565,168 @@ void resampleCldfb_ivas_fx( return; } static void GetEnergyCldfb_ivas_fx( Word32 *energyLookahead, /*!< o: Q(*sf_energyLookahead) | pointer to the result in the core look-ahead slot */ Word16 *sf_energyLookahead, /*!< o: pointer to the scalefactor of the result in the core look-ahead slot */ const Word16 numLookahead, /*!< i: Q0 the number of look-ahead time-slots */ Word16 **realValues, /*!< i: Q(sf_Values) | the real part of the CLDFB subsamples */ Word16 **imagValues, /*!< i: Q(sf_Values) | the imaginary part of the CLDFB subsamples */ Word16 sf_Values, /*!< i: scalefactor of the CLDFB subcamples - apply as a negated Exponent */ Word16 numberBands, /*!< i: Q0 | number of CLDFB bands */ Word16 numberCols, /*!< i: Q0 | number of CLDFB subsamples */ Word32 *energyHF, /*!< o: Q31 | pointer to HF energy */ Word16 *energyHF_Exp, /*!< o: pointer to exponent of HF energy */ Word32 *energyValuesSum, /*!< o: Q(2*sf_Values-4) | pointer to sum array of energy values, not initialized*/ Word16 *energyValuesSum_Exp, /*!< o: pointer to exponents of energyValuesSum, not initialized */ TEC_ENC_HANDLE hTecEnc ) { Word16 j; Word16 k; Word16 s; Word16 sm; Word32 nrg; Word16 numberColsL; Word16 numberBandsM; Word16 numberBandsM20; Word32 energyValues[CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; Word16 energyValuesSumE[CLDFB_NO_CHANNELS_MAX]; // Word16 freqTable[2] = {20, 40}; #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; move32(); #endif FOR( k = 0; k < numberCols; k++ ) { FOR( j = 0; j < numberBands; j++ ) { nrg = L_mult0( realValues[k][j], realValues[k][j] ); // Q(2*sf_Values) nrg = L_mac0( nrg, imagValues[k][j], imagValues[k][j] ); // Q(2*sf_Values) energyValues[k][j] = nrg; move32(); } } IF( GE_16( numberBands, freqTable[1] ) && hTecEnc != NULL ) { Word32 *tempEnergyValuesArry[CLDFB_NO_COL_MAX]; Word16 ScaleX2; assert( numberCols == CLDFB_NO_COL_MAX ); FOR( j = 0; j < numberCols; j++ ) { tempEnergyValuesArry[j] = &energyValues[j][0]; } ScaleX2 = shl( sf_Values, 1 ); calcHiEnvLoBuff_Fix( numberCols, freqTable, 1, tempEnergyValuesArry, hTecEnc->loBuffer, hTecEnc->hiTempEnv, ScaleX2 ); } FOR( j = 0; j < numberBands; j++ ) { energyValuesSum[j] = 0; move32(); energyValuesSumE[j] = 31; move16(); FOR( k = 0; k < CLDFB_NO_COL_MAX; k++ ) { nrg = L_shr_r( energyValues[k][j], sub( energyValuesSumE[j], 31 ) ); // Q(2*sf_Values - (energyValuesSumE[j]-31)) IF( LT_32( L_sub( maxWord32, nrg ), energyValuesSum[j] ) ) { energyValuesSumE[j] = add( energyValuesSumE[j], 1 ); move16(); energyValuesSum[j] = L_shr_r( energyValuesSum[j], 1 ); move32(); nrg = L_shr_r( nrg, 1 ); } energyValuesSum[j] = L_add( energyValuesSum[j], nrg ); move32(); } test(); if ( j == 0 || GT_16( energyValuesSumE[j], *energyValuesSum_Exp ) ) { *energyValuesSum_Exp = energyValuesSumE[j]; move16(); } } FOR( j = 0; j < numberBands; j++ ) { energyValuesSum[j] = L_shr_r( energyValuesSum[j], sub( *energyValuesSum_Exp, energyValuesSumE[j] ) ); // Q(energyValuesSum_Exp - (2*sf_Values)) move32(); } *energyValuesSum_Exp = sub( *energyValuesSum_Exp, shl( sf_Values, 1 ) ); move16(); IF( GT_16( numberBands, 20 ) ) { numberBandsM = s_min( numberBands, 40 ); numberBandsM20 = sub( numberBandsM, 20 ); numberColsL = sub( numberCols, numLookahead ); /* sum up CLDFB energy above 8 kHz */ s = BASOP_util_norm_s_bands2shift( i_mult( numberColsL, numberBandsM20 ) ); s = sub( s, 4 ); nrg = 0; move32(); FOR( k = 0; k < numberColsL; k++ ) { FOR( j = 20; j < numberBandsM; j++ ) { nrg = L_add_o( nrg, L_shr_o( energyValues[k][j], s, &Overflow ), &Overflow ); } } s = sub( sub( shl( sf_Values, 1 ), 1 ), s ); sm = sub( s_min( s, *sf_energyLookahead ), 1 ); *energyHF = L_add( L_shr( nrg, limitScale32( sub( s, sm ) ) ), L_shr( *energyLookahead, sub( *sf_energyLookahead, sm ) ) ); // Q(31-(-nm)) move32(); *energyHF_Exp = negate( sm ); move16(); /* process look-ahead region */ s = BASOP_util_norm_s_bands2shift( i_mult( numLookahead, numberBandsM20 ) ); s = sub( s, 2 ); nrg = 0; move32(); FOR( k = numberColsL; k < numberCols; k++ ) { FOR( j = 20; j < numberBandsM; j++ ) { nrg = L_add_o( nrg, L_shr_o( energyValues[k][j], s, &Overflow ), &Overflow ); } } s = sub( shl( sf_Values, 1 ), s ); sm = sub( s_min( s, 44 ), 1 ); BASOP_SATURATE_WARNING_OFF_EVS /* nrg + 6.1e-5f => value 0x40000000, scale 44 */ *energyLookahead = L_add_sat( L_shr_sat( nrg, sub( s, sm ) ), L_shr_sat( 0x40000000, s_max( -31, s_min( 31, sub( 44, sm ) ) ) ) ); move32(); BASOP_SATURATE_WARNING_ON_EVS *sf_energyLookahead = sm; move16(); return; } *energyHF = 0x40000000; move32(); *energyHF_Exp = 17; move16(); } void analysisCldfbEncoder_ivas_fx( Encoder_State *st, /* i/o: encoder state structure */ Loading Loading @@ -1613,7 +1788,7 @@ void analysisCldfbEncoder_ivas_fx( AnalysisPostSpectrumScaling_Fx( st->cldfbAnaEnc, ppBuf_Real, ppBuf_Imag, ppBuf_Real16, ppBuf_Imag16, &enerScale.lb_scale16 ); GetEnergyCldfb( &st->energyCoreLookahead_Fx, &st->sf_energyCoreLookahead_Fx, 1, ppBuf_Real16, ppBuf_Imag16, enerScale.lb_scale16, st->cldfbAnaEnc->no_channels, st->cldfbAnaEnc->no_col, &st->currEnergyHF_fx, &st->currEnergyHF_e_fx, ppBuf_Ener, enerBuffSum_exp, st->hTECEnc ); GetEnergyCldfb_ivas_fx( &st->energyCoreLookahead_Fx, &st->sf_energyCoreLookahead_Fx, 1, ppBuf_Real16, ppBuf_Imag16, enerScale.lb_scale16, st->cldfbAnaEnc->no_channels, st->cldfbAnaEnc->no_col, &st->currEnergyHF_fx, &st->currEnergyHF_e_fx, ppBuf_Ener, enerBuffSum_exp, st->hTECEnc ); return; } Loading lib_com/ivas_fb_mixer_fx.c +48 −2 Original line number Diff line number Diff line Loading @@ -759,6 +759,12 @@ void ivas_fb_mixer_process_fx( pMdft_out_fx[0] = Mdft_out_0_fx; pMdft_out_fx[1] = Mdft_out_1_fx; #ifdef OPT_SBA_ENC_V1 Word16 total_guard_1 = find_guarded_bits_fx( num_bands ); Word16 total_guard_2 = find_guarded_bits_fx( shl( frame_len, 1 ) ); Word16 tmp_q = sub( sub( sub( add( 30, *q_mixer_mat_fx ), 31 ), total_guard_1 ), 31 ); Word16 len = shl( frame_len, 1 ); #endif FOR( ch = ( hFbMixer->fb_cfg->active_w_mixing == 0 ); ch < hFbMixer->fb_cfg->num_out_chans; ch++ ) { /* Run a loop of 2 to calculate current frame's filterbank output and prev frame's output */ Loading @@ -772,7 +778,12 @@ void ivas_fb_mixer_process_fx( { IF( in_out_mixer_map[ch][j] != 0 ) { #ifdef OPT_SBA_ENC_V1 Word16 res_q = add(tmp_q, hFbMixer->q_ppFilterbank_inFR[j]); Word16 q_check = s_min(q_pOut_fr_fx, res_q); Scale_sig32(pOut_fr_re_fx, frame_len, sub(q_check, q_pOut_fr_fx)); Scale_sig32(pOut_fr_im_fx, frame_len, sub(q_check, q_pOut_fr_fx)); #endif Word32 filterbank_mixer_bins_re_fx[L_FRAME48k]; Word32 filterbank_mixer_bins_im_fx[L_FRAME48k]; Word32 *pFb_inFR_re_fx = hFbMixer->ppFilterbank_inFR_re_fx[j]; // Q(hFbMixer->q_ppFilterbank_inFR_re_fx) Loading @@ -781,25 +792,39 @@ void ivas_fb_mixer_process_fx( set_zero_fx( filterbank_mixer_bins_re_fx, frame_len ); set_zero_fx( filterbank_mixer_bins_im_fx, frame_len ); #ifndef OPT_SBA_ENC_V1 Word16 total_guard = find_guarded_bits_fx( num_bands ); move16(); #endif FOR( i = 0; i < num_bands; i++ ) { Word16 start_offset = pFb->fb_consts.pFilterbank_bins_start_offset[i]; move16(); Word16 num_bins = pFb->fb_consts.pFilterbank_bins_per_band[i]; move16(); #ifndef OPT_SBA_ENC_V1 Word32 mixer_const_fx = hFbMixer->prior_mixer_fx[ch][j][i]; // Q(hFbMixer->q_prior_mixer_fx) move32(); #else Word32 mixer_const_fx = L_shr( hFbMixer->prior_mixer_fx[ch][j][i], total_guard_1 ); // Q(hFbMixer->q_prior_mixer_fx) - total_guard move32(); #endif pFilterbank_bin_to_band_re_fx = pFb->fb_consts.ppFilterbank_FRs_fx[0][i]; // Q30 pFilterbank_bin_to_band_im_fx = pFb->fb_consts.ppFilterbank_FRs_fx[1][i]; // Q30 FOR( k = start_offset; k < num_bins + start_offset; k++ ) { #ifndef OPT_SBA_ENC_V1 filterbank_mixer_bins_re_fx[k] = L_add_sat( filterbank_mixer_bins_re_fx[k], L_shr( Mpy_32_32( *pFilterbank_bin_to_band_re_fx, mixer_const_fx ), total_guard ) ); // Q30 + hFbMixer->q_prior_mixer_fx - 31 - total_guard move32(); filterbank_mixer_bins_im_fx[k] = L_add_sat( filterbank_mixer_bins_im_fx[k], L_shr( Mpy_32_32( *pFilterbank_bin_to_band_im_fx, mixer_const_fx ), total_guard ) ); // Q30 + hFbMixer->q_prior_mixer_fx - 31 - total_guard move32(); #else filterbank_mixer_bins_re_fx[k] = Madd_32_32( filterbank_mixer_bins_re_fx[k], *pFilterbank_bin_to_band_re_fx, mixer_const_fx ); // Q30 + hFbMixer->q_prior_mixer_fx - 31 - total_guard move32(); filterbank_mixer_bins_im_fx[k] = Madd_32_32( filterbank_mixer_bins_im_fx[k], *pFilterbank_bin_to_band_im_fx, mixer_const_fx ); // Q30 + hFbMixer->q_prior_mixer_fx - 31 - total_guard move32(); #endif /*filterbank_mixer_bins_im_fx q 30 */ /*mixer_const_fx q q_ppOut_pcm_fx */ pFilterbank_bin_to_band_re_fx++; Loading @@ -808,15 +833,19 @@ void ivas_fb_mixer_process_fx( hFbMixer->prior_mixer_fx[ch][j][i] = mixer_mat_fx[ch][j][i]; // Q(q_mixer_mat_fx) move32(); } #ifndef OPT_SBA_ENC_V1 Word16 res_q = 0; move16(); #endif FOR( k = 0; k < frame_len; k++ ) { Word32 temp_out_re_fx, temp_out_im_fx; ivas_cmult_fix( filterbank_mixer_bins_re_fx[k], filterbank_mixer_bins_im_fx[k], pFb_inFR_re_fx[k], pFb_inFR_im_fx[k], &temp_out_re_fx, &temp_out_im_fx ); res_q = sub( add( sub( sub( add( 30, *q_mixer_mat_fx ), 31 ), total_guard ), hFbMixer->q_ppFilterbank_inFR[j] ), 31 ); #ifndef OPT_SBA_ENC_V1 res_q = sub( add( sub( sub( add( 30, *q_mixer_mat_fx ), 31 ), total_guard_1 ), hFbMixer->q_ppFilterbank_inFR[j] ), 31 ); Word16 q_check = s_min( q_pOut_fr_fx, res_q ); IF( NE_16( q_check, q_pOut_fr_fx ) ) { Loading @@ -825,31 +854,48 @@ void ivas_fb_mixer_process_fx( pOut_fr_im_fx[k] = L_shr( pOut_fr_im_fx[k], sub( q_pOut_fr_fx, q_check ) ); // q_pOut_fr_fx -> q_check move32(); } #endif IF( NE_16( q_check, res_q ) ) { temp_out_re_fx = L_shr( temp_out_re_fx, sub( res_q, q_check ) ); // res_q -> q_check temp_out_im_fx = L_shr( temp_out_im_fx, sub( res_q, q_check ) ); // res_q -> q_check } #ifndef OPT_SBA_ENC_V1 res_q = q_check; move16(); #endif pOut_fr_re_fx[k] = L_add_sat( pOut_fr_re_fx[k], temp_out_re_fx ); // res_q move32(); pOut_fr_im_fx[k] = L_add_sat( pOut_fr_im_fx[k], temp_out_im_fx ); // res_q move32(); } #ifdef OPT_SBA_ENC_V1 q_pOut_fr_fx = q_check; #else q_pOut_fr_fx = res_q; move16(); #endif } } #ifndef OPT_SBA_ENC_V1 Word16 scale = sub( s_min( L_norm_arr( pOut_fr_re_fx, frame_len ), L_norm_arr( pOut_fr_im_fx, frame_len ) ), find_guarded_bits_fx( shl( frame_len, 1 ) ) ); #else Word16 scale = sub( s_min( L_norm_arr( pOut_fr_re_fx, frame_len ), L_norm_arr( pOut_fr_im_fx, frame_len ) ), total_guard_2 ); #endif scale_sig32( pOut_fr_re_fx, frame_len, scale ); scale_sig32( pOut_fr_im_fx, frame_len, scale ); ivas_imdft_fx( pOut_fr_re_fx, pOut_fr_im_fx, pMdft_out_fx[hist], frame_len ); q_pMdft_out_fx[hist] = add( q_pOut_fr_fx, scale ); move16(); } #ifdef OPT_SBA_ENC_V1 scale_sig32( pMdft_out_fx[0], len, sub( s_min( q_pMdft_out_fx[0], q_pMdft_out_fx[1] ), q_pMdft_out_fx[0] ) ); scale_sig32( pMdft_out_fx[1], len, sub( s_min( q_pMdft_out_fx[0], q_pMdft_out_fx[1] ), q_pMdft_out_fx[1] ) ); #else scale_sig32( pMdft_out_fx[0], shl( frame_len, 1 ), sub( s_min( q_pMdft_out_fx[0], q_pMdft_out_fx[1] ), q_pMdft_out_fx[0] ) ); scale_sig32( pMdft_out_fx[1], shl( frame_len, 1 ), sub( s_min( q_pMdft_out_fx[0], q_pMdft_out_fx[1] ), q_pMdft_out_fx[1] ) ); #endif ivas_fb_mixer_cross_fading_fx( hFbMixer, ppOut_pcm_fx, pMdft_out_fx[0], pMdft_out_fx[1], ch, frame_len, frame_len ); q_ppOut_pcm_fx[ch] = s_min( q_pMdft_out_fx[0], q_pMdft_out_fx[1] ); move16(); Loading lib_com/ivas_prot_fx.h +1 −1 Original line number Diff line number Diff line Loading @@ -3341,7 +3341,7 @@ void mctStereoIGF_enc_fx( Word32 powerSpec_fx[MCT_MAX_CHANNELS][L_FRAME48k], /* i/o: MDCT^2 + MDST^2 spectrum,or estimate */ Word16 q_powerSpec[MCT_MAX_CHANNELS], /* i : Q for powSpec_fx */ Word32 *powerSpecMsInv_fx[MCT_MAX_CHANNELS][NB_DIV], /* i : same as powerSpec_fx but for inverse spect.*/ Word16 q_powerSpecMsInv[MCT_MAX_CHANNELS], /* i : Q for powSpecMsInv_fx */ Word16 *q_powerSpecMsInv[MCT_MAX_CHANNELS][NB_DIV], /* i : Q for powSpecMsInv_fx */ Word32 *inv_spectrum_fx[MCT_MAX_CHANNELS][NB_DIV], /* i : inverse spectrum */ const Word16 sp_aud_decision0[MCT_MAX_CHANNELS] /* i : speech audio decision */ ); Loading lib_com/ivas_spar_com_fx.c +61 −14 Original line number Diff line number Diff line Loading @@ -1995,15 +1995,22 @@ static void ivas_calc_post_pred_per_band_enc_fx( Word16 *q_postpred_cov_re ) { Word16 i, j, k; #ifndef OPT_SBA_ENC_V1 Word32 dmx_mat_conj[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH]; Word32 temp_mat[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH]; Word16 temp_mat_q[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH]; #else Word16 temp_mat_e[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH]; Word16 q_postpred_cov_re_buf[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH]; Word16 temp; Word32 temp_add; #endif Word32 temp_mat[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH]; Word16 e_postpred_cov_re_buf[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH]; Word16 min_val; Word32 tmp_re; Word16 tmp_q; Word16 tmp_e; #ifndef OPT_SBA_ENC_V1 FOR( i = 0; i < num_ch; i++ ) { FOR( j = 0; j < num_ch; j++ ) Loading @@ -2013,25 +2020,40 @@ static void ivas_calc_post_pred_per_band_enc_fx( } } FOR( i = 0; i < num_ch; i++ ) { set32_fx( temp_mat[i], 0, num_ch ); set32_fx( postpred_cov_re[i], 0, num_ch ); } #endif #ifdef OPT_SBA_ENC_V1 min_val = MIN16B; move16(); temp = sub( 62, q_mixer_mat ); #else min_val = MAX16B; move16(); #endif /* num_ch x num_ch mult */ FOR( i = 0; i < num_ch; i++ ) { FOR( j = 0; j < num_ch; j++ ) { #ifndef OPT_SBA_ENC_V1 temp_mat[i][j] = 0; #else temp_add = 0; #endif move32(); temp_mat_e[i][j] = 0; move16(); FOR( k = 0; k < num_ch; k++ ) { #ifndef OPT_SBA_ENC_V1 tmp_re = Mpy_32_32( cov_real[i][k][band_idx], dmx_mat_conj[k][j] ); tmp_e = sub( 62, add( q_cov_real[i][k][band_idx], q_mixer_mat ) ); IF( tmp_re ) Loading @@ -2039,34 +2061,56 @@ static void ivas_calc_post_pred_per_band_enc_fx( temp_mat[i][j] = BASOP_Util_Add_Mant32Exp( temp_mat[i][j], temp_mat_e[i][j], tmp_re, tmp_e, &temp_mat_e[i][j] ); move32(); } #else tmp_re = Mpy_32_32( cov_real[i][k][band_idx], mixer_mat[j][k][band_idx] ); tmp_e = sub( temp, q_cov_real[i][k][band_idx] ); IF( tmp_re ) { temp_add = BASOP_Util_Add_Mant32Exp( temp_add, temp_mat_e[i][j], tmp_re, tmp_e, &temp_mat_e[i][j] ); } #endif } #ifdef OPT_SBA_ENC_V1 temp_mat[i][j] = temp_add; move32(); #endif } } tmp_e = sub( Q31, q_mixer_mat ); /* num_ch x num_ch mult */ FOR( i = 0; i < num_ch; i++ ) { FOR( j = i; j < num_ch; j++ ) { q_postpred_cov_re_buf[i][j] = *q_postpred_cov_re; #ifdef OPT_SBA_ENC_V1 temp_add = 0; move32(); #endif e_postpred_cov_re_buf[i][j] = sub( 31, *q_postpred_cov_re ); move16(); FOR( k = 0; k < num_ch; k++ ) { tmp_re = Mpy_32_32( mixer_mat[i][k][band_idx], temp_mat[k][j] ); tmp_q = sub( q_mixer_mat, temp_mat_e[k][j] ); tmp_q = add( tmp_e, temp_mat_e[k][j] ); IF( tmp_re ) { tmp_e = sub( 31, q_postpred_cov_re_buf[i][j] ); postpred_cov_re[i][j] = BASOP_Util_Add_Mant32Exp( postpred_cov_re[i][j], tmp_e, tmp_re, sub( Q31, tmp_q ), &tmp_e ); #ifndef OPT_SBA_ENC_V1 postpred_cov_re[i][j] = BASOP_Util_Add_Mant32Exp( postpred_cov_re[i][j], e_postpred_cov_re_buf[i][j], tmp_re, tmp_q, &e_postpred_cov_re_buf[i][j] ); move32(); q_postpred_cov_re_buf[i][j] = sub( 31, tmp_e ); move16(); #else temp_add = BASOP_Util_Add_Mant32Exp( temp_add, e_postpred_cov_re_buf[i][j], tmp_re, tmp_q, &e_postpred_cov_re_buf[i][j] ); #endif } } IF( postpred_cov_re[i][j] ) if ( temp_add ) { min_val = s_min( min_val, q_postpred_cov_re_buf[i][j] ); min_val = s_max( min_val, e_postpred_cov_re_buf[i][j] ); } #ifdef OPT_SBA_ENC_V1 postpred_cov_re[i][j] = temp_add; move32(); #endif } } Loading @@ -2077,7 +2121,7 @@ static void ivas_calc_post_pred_per_band_enc_fx( { IF( postpred_cov_re[i][j] ) { postpred_cov_re[i][j] = L_shl( postpred_cov_re[i][j], sub( min_val, q_postpred_cov_re_buf[i][j] ) ); postpred_cov_re[i][j] = L_shr( postpred_cov_re[i][j], sub( min_val, e_postpred_cov_re_buf[i][j] ) ); move32(); } } Loading @@ -2093,13 +2137,16 @@ static void ivas_calc_post_pred_per_band_enc_fx( } } if ( EQ_16( min_val, MAX16B ) ) IF( EQ_16( min_val, MIN16B ) ) { min_val = Q31; move16(); } *q_postpred_cov_re = min_val; ELSE { *q_postpred_cov_re = sub( Q31, min_val ); move16(); } return; } Loading lib_com/options.h +3 −0 Original line number Diff line number Diff line Loading @@ -74,6 +74,9 @@ #define FIX_1379_MASA_ANGLE_ROUND /* Note: each compile switch (FIX_1101_...) is independent from the other ones */ #define OPT_SBA_ENC_V1 #define OPT_BIN_RENDERER_V1 #define OPT_BIN_RENDERER_V2 #define OPT_STEREO_32KBPS_V1 /* Optimization made in stereo decoding path for 32kbps decoding */ #define OPT_AVOID_STATE_BUF_RESCALE /* Optimization made to avoid rescale of synth state buffer */ #define FIX_1310_SPEEDUP_ivas_dirac_dec_get_response_fx /*FhG: WMOPS tuning, nonbe*/ Loading Loading
lib_com/cldfb.c +176 −1 Original line number Diff line number Diff line Loading @@ -60,6 +60,19 @@ static void cldfb_init_proto_and_twiddles( HANDLE_CLDFB_FILTER_BANK hs ); static void cldfb_init_proto_and_twiddles_enc_fx( HANDLE_CLDFB_FILTER_BANK hs ); static void GetEnergyCldfb_ivas_fx( Word32 *energyLookahead, /*!< o: Q(*sf_energyLookahead) | pointer to the result in the core look-ahead slot */ Word16 *sf_energyLookahead, /*!< o: pointer to the scalefactor of the result in the core look-ahead slot */ const Word16 numLookahead, /*!< i: Q0 the number of look-ahead time-slots */ Word16 **realValues, /*!< i: Q(sf_Values) | the real part of the CLDFB subsamples */ Word16 **imagValues, /*!< i: Q(sf_Values) | the imaginary part of the CLDFB subsamples */ Word16 sf_Values, /*!< i: scalefactor of the CLDFB subcamples - apply as a negated Exponent */ Word16 numberBands, /*!< i: Q0 | number of CLDFB bands */ Word16 numberCols, /*!< i: Q0 | number of CLDFB subsamples */ Word32 *energyHF, /*!< o: Q31 | pointer to HF energy */ Word16 *energyHF_Exp, /*!< o: pointer to exponent of HF energy */ Word32 *energyValuesSum, /*!< o: Q(2*sf_Values-4) | pointer to sum array of energy values, not initialized*/ Word16 *energyValuesSum_Exp, /*!< o: pointer to exponents of energyValuesSum, not initialized */ TEC_ENC_HANDLE hTecEnc ); /*-------------------------------------------------------------------* * cplxMult() Loading Loading @@ -1552,6 +1565,168 @@ void resampleCldfb_ivas_fx( return; } static void GetEnergyCldfb_ivas_fx( Word32 *energyLookahead, /*!< o: Q(*sf_energyLookahead) | pointer to the result in the core look-ahead slot */ Word16 *sf_energyLookahead, /*!< o: pointer to the scalefactor of the result in the core look-ahead slot */ const Word16 numLookahead, /*!< i: Q0 the number of look-ahead time-slots */ Word16 **realValues, /*!< i: Q(sf_Values) | the real part of the CLDFB subsamples */ Word16 **imagValues, /*!< i: Q(sf_Values) | the imaginary part of the CLDFB subsamples */ Word16 sf_Values, /*!< i: scalefactor of the CLDFB subcamples - apply as a negated Exponent */ Word16 numberBands, /*!< i: Q0 | number of CLDFB bands */ Word16 numberCols, /*!< i: Q0 | number of CLDFB subsamples */ Word32 *energyHF, /*!< o: Q31 | pointer to HF energy */ Word16 *energyHF_Exp, /*!< o: pointer to exponent of HF energy */ Word32 *energyValuesSum, /*!< o: Q(2*sf_Values-4) | pointer to sum array of energy values, not initialized*/ Word16 *energyValuesSum_Exp, /*!< o: pointer to exponents of energyValuesSum, not initialized */ TEC_ENC_HANDLE hTecEnc ) { Word16 j; Word16 k; Word16 s; Word16 sm; Word32 nrg; Word16 numberColsL; Word16 numberBandsM; Word16 numberBandsM20; Word32 energyValues[CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; Word16 energyValuesSumE[CLDFB_NO_CHANNELS_MAX]; // Word16 freqTable[2] = {20, 40}; #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; move32(); #endif FOR( k = 0; k < numberCols; k++ ) { FOR( j = 0; j < numberBands; j++ ) { nrg = L_mult0( realValues[k][j], realValues[k][j] ); // Q(2*sf_Values) nrg = L_mac0( nrg, imagValues[k][j], imagValues[k][j] ); // Q(2*sf_Values) energyValues[k][j] = nrg; move32(); } } IF( GE_16( numberBands, freqTable[1] ) && hTecEnc != NULL ) { Word32 *tempEnergyValuesArry[CLDFB_NO_COL_MAX]; Word16 ScaleX2; assert( numberCols == CLDFB_NO_COL_MAX ); FOR( j = 0; j < numberCols; j++ ) { tempEnergyValuesArry[j] = &energyValues[j][0]; } ScaleX2 = shl( sf_Values, 1 ); calcHiEnvLoBuff_Fix( numberCols, freqTable, 1, tempEnergyValuesArry, hTecEnc->loBuffer, hTecEnc->hiTempEnv, ScaleX2 ); } FOR( j = 0; j < numberBands; j++ ) { energyValuesSum[j] = 0; move32(); energyValuesSumE[j] = 31; move16(); FOR( k = 0; k < CLDFB_NO_COL_MAX; k++ ) { nrg = L_shr_r( energyValues[k][j], sub( energyValuesSumE[j], 31 ) ); // Q(2*sf_Values - (energyValuesSumE[j]-31)) IF( LT_32( L_sub( maxWord32, nrg ), energyValuesSum[j] ) ) { energyValuesSumE[j] = add( energyValuesSumE[j], 1 ); move16(); energyValuesSum[j] = L_shr_r( energyValuesSum[j], 1 ); move32(); nrg = L_shr_r( nrg, 1 ); } energyValuesSum[j] = L_add( energyValuesSum[j], nrg ); move32(); } test(); if ( j == 0 || GT_16( energyValuesSumE[j], *energyValuesSum_Exp ) ) { *energyValuesSum_Exp = energyValuesSumE[j]; move16(); } } FOR( j = 0; j < numberBands; j++ ) { energyValuesSum[j] = L_shr_r( energyValuesSum[j], sub( *energyValuesSum_Exp, energyValuesSumE[j] ) ); // Q(energyValuesSum_Exp - (2*sf_Values)) move32(); } *energyValuesSum_Exp = sub( *energyValuesSum_Exp, shl( sf_Values, 1 ) ); move16(); IF( GT_16( numberBands, 20 ) ) { numberBandsM = s_min( numberBands, 40 ); numberBandsM20 = sub( numberBandsM, 20 ); numberColsL = sub( numberCols, numLookahead ); /* sum up CLDFB energy above 8 kHz */ s = BASOP_util_norm_s_bands2shift( i_mult( numberColsL, numberBandsM20 ) ); s = sub( s, 4 ); nrg = 0; move32(); FOR( k = 0; k < numberColsL; k++ ) { FOR( j = 20; j < numberBandsM; j++ ) { nrg = L_add_o( nrg, L_shr_o( energyValues[k][j], s, &Overflow ), &Overflow ); } } s = sub( sub( shl( sf_Values, 1 ), 1 ), s ); sm = sub( s_min( s, *sf_energyLookahead ), 1 ); *energyHF = L_add( L_shr( nrg, limitScale32( sub( s, sm ) ) ), L_shr( *energyLookahead, sub( *sf_energyLookahead, sm ) ) ); // Q(31-(-nm)) move32(); *energyHF_Exp = negate( sm ); move16(); /* process look-ahead region */ s = BASOP_util_norm_s_bands2shift( i_mult( numLookahead, numberBandsM20 ) ); s = sub( s, 2 ); nrg = 0; move32(); FOR( k = numberColsL; k < numberCols; k++ ) { FOR( j = 20; j < numberBandsM; j++ ) { nrg = L_add_o( nrg, L_shr_o( energyValues[k][j], s, &Overflow ), &Overflow ); } } s = sub( shl( sf_Values, 1 ), s ); sm = sub( s_min( s, 44 ), 1 ); BASOP_SATURATE_WARNING_OFF_EVS /* nrg + 6.1e-5f => value 0x40000000, scale 44 */ *energyLookahead = L_add_sat( L_shr_sat( nrg, sub( s, sm ) ), L_shr_sat( 0x40000000, s_max( -31, s_min( 31, sub( 44, sm ) ) ) ) ); move32(); BASOP_SATURATE_WARNING_ON_EVS *sf_energyLookahead = sm; move16(); return; } *energyHF = 0x40000000; move32(); *energyHF_Exp = 17; move16(); } void analysisCldfbEncoder_ivas_fx( Encoder_State *st, /* i/o: encoder state structure */ Loading Loading @@ -1613,7 +1788,7 @@ void analysisCldfbEncoder_ivas_fx( AnalysisPostSpectrumScaling_Fx( st->cldfbAnaEnc, ppBuf_Real, ppBuf_Imag, ppBuf_Real16, ppBuf_Imag16, &enerScale.lb_scale16 ); GetEnergyCldfb( &st->energyCoreLookahead_Fx, &st->sf_energyCoreLookahead_Fx, 1, ppBuf_Real16, ppBuf_Imag16, enerScale.lb_scale16, st->cldfbAnaEnc->no_channels, st->cldfbAnaEnc->no_col, &st->currEnergyHF_fx, &st->currEnergyHF_e_fx, ppBuf_Ener, enerBuffSum_exp, st->hTECEnc ); GetEnergyCldfb_ivas_fx( &st->energyCoreLookahead_Fx, &st->sf_energyCoreLookahead_Fx, 1, ppBuf_Real16, ppBuf_Imag16, enerScale.lb_scale16, st->cldfbAnaEnc->no_channels, st->cldfbAnaEnc->no_col, &st->currEnergyHF_fx, &st->currEnergyHF_e_fx, ppBuf_Ener, enerBuffSum_exp, st->hTECEnc ); return; } Loading
lib_com/ivas_fb_mixer_fx.c +48 −2 Original line number Diff line number Diff line Loading @@ -759,6 +759,12 @@ void ivas_fb_mixer_process_fx( pMdft_out_fx[0] = Mdft_out_0_fx; pMdft_out_fx[1] = Mdft_out_1_fx; #ifdef OPT_SBA_ENC_V1 Word16 total_guard_1 = find_guarded_bits_fx( num_bands ); Word16 total_guard_2 = find_guarded_bits_fx( shl( frame_len, 1 ) ); Word16 tmp_q = sub( sub( sub( add( 30, *q_mixer_mat_fx ), 31 ), total_guard_1 ), 31 ); Word16 len = shl( frame_len, 1 ); #endif FOR( ch = ( hFbMixer->fb_cfg->active_w_mixing == 0 ); ch < hFbMixer->fb_cfg->num_out_chans; ch++ ) { /* Run a loop of 2 to calculate current frame's filterbank output and prev frame's output */ Loading @@ -772,7 +778,12 @@ void ivas_fb_mixer_process_fx( { IF( in_out_mixer_map[ch][j] != 0 ) { #ifdef OPT_SBA_ENC_V1 Word16 res_q = add(tmp_q, hFbMixer->q_ppFilterbank_inFR[j]); Word16 q_check = s_min(q_pOut_fr_fx, res_q); Scale_sig32(pOut_fr_re_fx, frame_len, sub(q_check, q_pOut_fr_fx)); Scale_sig32(pOut_fr_im_fx, frame_len, sub(q_check, q_pOut_fr_fx)); #endif Word32 filterbank_mixer_bins_re_fx[L_FRAME48k]; Word32 filterbank_mixer_bins_im_fx[L_FRAME48k]; Word32 *pFb_inFR_re_fx = hFbMixer->ppFilterbank_inFR_re_fx[j]; // Q(hFbMixer->q_ppFilterbank_inFR_re_fx) Loading @@ -781,25 +792,39 @@ void ivas_fb_mixer_process_fx( set_zero_fx( filterbank_mixer_bins_re_fx, frame_len ); set_zero_fx( filterbank_mixer_bins_im_fx, frame_len ); #ifndef OPT_SBA_ENC_V1 Word16 total_guard = find_guarded_bits_fx( num_bands ); move16(); #endif FOR( i = 0; i < num_bands; i++ ) { Word16 start_offset = pFb->fb_consts.pFilterbank_bins_start_offset[i]; move16(); Word16 num_bins = pFb->fb_consts.pFilterbank_bins_per_band[i]; move16(); #ifndef OPT_SBA_ENC_V1 Word32 mixer_const_fx = hFbMixer->prior_mixer_fx[ch][j][i]; // Q(hFbMixer->q_prior_mixer_fx) move32(); #else Word32 mixer_const_fx = L_shr( hFbMixer->prior_mixer_fx[ch][j][i], total_guard_1 ); // Q(hFbMixer->q_prior_mixer_fx) - total_guard move32(); #endif pFilterbank_bin_to_band_re_fx = pFb->fb_consts.ppFilterbank_FRs_fx[0][i]; // Q30 pFilterbank_bin_to_band_im_fx = pFb->fb_consts.ppFilterbank_FRs_fx[1][i]; // Q30 FOR( k = start_offset; k < num_bins + start_offset; k++ ) { #ifndef OPT_SBA_ENC_V1 filterbank_mixer_bins_re_fx[k] = L_add_sat( filterbank_mixer_bins_re_fx[k], L_shr( Mpy_32_32( *pFilterbank_bin_to_band_re_fx, mixer_const_fx ), total_guard ) ); // Q30 + hFbMixer->q_prior_mixer_fx - 31 - total_guard move32(); filterbank_mixer_bins_im_fx[k] = L_add_sat( filterbank_mixer_bins_im_fx[k], L_shr( Mpy_32_32( *pFilterbank_bin_to_band_im_fx, mixer_const_fx ), total_guard ) ); // Q30 + hFbMixer->q_prior_mixer_fx - 31 - total_guard move32(); #else filterbank_mixer_bins_re_fx[k] = Madd_32_32( filterbank_mixer_bins_re_fx[k], *pFilterbank_bin_to_band_re_fx, mixer_const_fx ); // Q30 + hFbMixer->q_prior_mixer_fx - 31 - total_guard move32(); filterbank_mixer_bins_im_fx[k] = Madd_32_32( filterbank_mixer_bins_im_fx[k], *pFilterbank_bin_to_band_im_fx, mixer_const_fx ); // Q30 + hFbMixer->q_prior_mixer_fx - 31 - total_guard move32(); #endif /*filterbank_mixer_bins_im_fx q 30 */ /*mixer_const_fx q q_ppOut_pcm_fx */ pFilterbank_bin_to_band_re_fx++; Loading @@ -808,15 +833,19 @@ void ivas_fb_mixer_process_fx( hFbMixer->prior_mixer_fx[ch][j][i] = mixer_mat_fx[ch][j][i]; // Q(q_mixer_mat_fx) move32(); } #ifndef OPT_SBA_ENC_V1 Word16 res_q = 0; move16(); #endif FOR( k = 0; k < frame_len; k++ ) { Word32 temp_out_re_fx, temp_out_im_fx; ivas_cmult_fix( filterbank_mixer_bins_re_fx[k], filterbank_mixer_bins_im_fx[k], pFb_inFR_re_fx[k], pFb_inFR_im_fx[k], &temp_out_re_fx, &temp_out_im_fx ); res_q = sub( add( sub( sub( add( 30, *q_mixer_mat_fx ), 31 ), total_guard ), hFbMixer->q_ppFilterbank_inFR[j] ), 31 ); #ifndef OPT_SBA_ENC_V1 res_q = sub( add( sub( sub( add( 30, *q_mixer_mat_fx ), 31 ), total_guard_1 ), hFbMixer->q_ppFilterbank_inFR[j] ), 31 ); Word16 q_check = s_min( q_pOut_fr_fx, res_q ); IF( NE_16( q_check, q_pOut_fr_fx ) ) { Loading @@ -825,31 +854,48 @@ void ivas_fb_mixer_process_fx( pOut_fr_im_fx[k] = L_shr( pOut_fr_im_fx[k], sub( q_pOut_fr_fx, q_check ) ); // q_pOut_fr_fx -> q_check move32(); } #endif IF( NE_16( q_check, res_q ) ) { temp_out_re_fx = L_shr( temp_out_re_fx, sub( res_q, q_check ) ); // res_q -> q_check temp_out_im_fx = L_shr( temp_out_im_fx, sub( res_q, q_check ) ); // res_q -> q_check } #ifndef OPT_SBA_ENC_V1 res_q = q_check; move16(); #endif pOut_fr_re_fx[k] = L_add_sat( pOut_fr_re_fx[k], temp_out_re_fx ); // res_q move32(); pOut_fr_im_fx[k] = L_add_sat( pOut_fr_im_fx[k], temp_out_im_fx ); // res_q move32(); } #ifdef OPT_SBA_ENC_V1 q_pOut_fr_fx = q_check; #else q_pOut_fr_fx = res_q; move16(); #endif } } #ifndef OPT_SBA_ENC_V1 Word16 scale = sub( s_min( L_norm_arr( pOut_fr_re_fx, frame_len ), L_norm_arr( pOut_fr_im_fx, frame_len ) ), find_guarded_bits_fx( shl( frame_len, 1 ) ) ); #else Word16 scale = sub( s_min( L_norm_arr( pOut_fr_re_fx, frame_len ), L_norm_arr( pOut_fr_im_fx, frame_len ) ), total_guard_2 ); #endif scale_sig32( pOut_fr_re_fx, frame_len, scale ); scale_sig32( pOut_fr_im_fx, frame_len, scale ); ivas_imdft_fx( pOut_fr_re_fx, pOut_fr_im_fx, pMdft_out_fx[hist], frame_len ); q_pMdft_out_fx[hist] = add( q_pOut_fr_fx, scale ); move16(); } #ifdef OPT_SBA_ENC_V1 scale_sig32( pMdft_out_fx[0], len, sub( s_min( q_pMdft_out_fx[0], q_pMdft_out_fx[1] ), q_pMdft_out_fx[0] ) ); scale_sig32( pMdft_out_fx[1], len, sub( s_min( q_pMdft_out_fx[0], q_pMdft_out_fx[1] ), q_pMdft_out_fx[1] ) ); #else scale_sig32( pMdft_out_fx[0], shl( frame_len, 1 ), sub( s_min( q_pMdft_out_fx[0], q_pMdft_out_fx[1] ), q_pMdft_out_fx[0] ) ); scale_sig32( pMdft_out_fx[1], shl( frame_len, 1 ), sub( s_min( q_pMdft_out_fx[0], q_pMdft_out_fx[1] ), q_pMdft_out_fx[1] ) ); #endif ivas_fb_mixer_cross_fading_fx( hFbMixer, ppOut_pcm_fx, pMdft_out_fx[0], pMdft_out_fx[1], ch, frame_len, frame_len ); q_ppOut_pcm_fx[ch] = s_min( q_pMdft_out_fx[0], q_pMdft_out_fx[1] ); move16(); Loading
lib_com/ivas_prot_fx.h +1 −1 Original line number Diff line number Diff line Loading @@ -3341,7 +3341,7 @@ void mctStereoIGF_enc_fx( Word32 powerSpec_fx[MCT_MAX_CHANNELS][L_FRAME48k], /* i/o: MDCT^2 + MDST^2 spectrum,or estimate */ Word16 q_powerSpec[MCT_MAX_CHANNELS], /* i : Q for powSpec_fx */ Word32 *powerSpecMsInv_fx[MCT_MAX_CHANNELS][NB_DIV], /* i : same as powerSpec_fx but for inverse spect.*/ Word16 q_powerSpecMsInv[MCT_MAX_CHANNELS], /* i : Q for powSpecMsInv_fx */ Word16 *q_powerSpecMsInv[MCT_MAX_CHANNELS][NB_DIV], /* i : Q for powSpecMsInv_fx */ Word32 *inv_spectrum_fx[MCT_MAX_CHANNELS][NB_DIV], /* i : inverse spectrum */ const Word16 sp_aud_decision0[MCT_MAX_CHANNELS] /* i : speech audio decision */ ); Loading
lib_com/ivas_spar_com_fx.c +61 −14 Original line number Diff line number Diff line Loading @@ -1995,15 +1995,22 @@ static void ivas_calc_post_pred_per_band_enc_fx( Word16 *q_postpred_cov_re ) { Word16 i, j, k; #ifndef OPT_SBA_ENC_V1 Word32 dmx_mat_conj[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH]; Word32 temp_mat[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH]; Word16 temp_mat_q[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH]; #else Word16 temp_mat_e[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH]; Word16 q_postpred_cov_re_buf[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH]; Word16 temp; Word32 temp_add; #endif Word32 temp_mat[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH]; Word16 e_postpred_cov_re_buf[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH]; Word16 min_val; Word32 tmp_re; Word16 tmp_q; Word16 tmp_e; #ifndef OPT_SBA_ENC_V1 FOR( i = 0; i < num_ch; i++ ) { FOR( j = 0; j < num_ch; j++ ) Loading @@ -2013,25 +2020,40 @@ static void ivas_calc_post_pred_per_band_enc_fx( } } FOR( i = 0; i < num_ch; i++ ) { set32_fx( temp_mat[i], 0, num_ch ); set32_fx( postpred_cov_re[i], 0, num_ch ); } #endif #ifdef OPT_SBA_ENC_V1 min_val = MIN16B; move16(); temp = sub( 62, q_mixer_mat ); #else min_val = MAX16B; move16(); #endif /* num_ch x num_ch mult */ FOR( i = 0; i < num_ch; i++ ) { FOR( j = 0; j < num_ch; j++ ) { #ifndef OPT_SBA_ENC_V1 temp_mat[i][j] = 0; #else temp_add = 0; #endif move32(); temp_mat_e[i][j] = 0; move16(); FOR( k = 0; k < num_ch; k++ ) { #ifndef OPT_SBA_ENC_V1 tmp_re = Mpy_32_32( cov_real[i][k][band_idx], dmx_mat_conj[k][j] ); tmp_e = sub( 62, add( q_cov_real[i][k][band_idx], q_mixer_mat ) ); IF( tmp_re ) Loading @@ -2039,34 +2061,56 @@ static void ivas_calc_post_pred_per_band_enc_fx( temp_mat[i][j] = BASOP_Util_Add_Mant32Exp( temp_mat[i][j], temp_mat_e[i][j], tmp_re, tmp_e, &temp_mat_e[i][j] ); move32(); } #else tmp_re = Mpy_32_32( cov_real[i][k][band_idx], mixer_mat[j][k][band_idx] ); tmp_e = sub( temp, q_cov_real[i][k][band_idx] ); IF( tmp_re ) { temp_add = BASOP_Util_Add_Mant32Exp( temp_add, temp_mat_e[i][j], tmp_re, tmp_e, &temp_mat_e[i][j] ); } #endif } #ifdef OPT_SBA_ENC_V1 temp_mat[i][j] = temp_add; move32(); #endif } } tmp_e = sub( Q31, q_mixer_mat ); /* num_ch x num_ch mult */ FOR( i = 0; i < num_ch; i++ ) { FOR( j = i; j < num_ch; j++ ) { q_postpred_cov_re_buf[i][j] = *q_postpred_cov_re; #ifdef OPT_SBA_ENC_V1 temp_add = 0; move32(); #endif e_postpred_cov_re_buf[i][j] = sub( 31, *q_postpred_cov_re ); move16(); FOR( k = 0; k < num_ch; k++ ) { tmp_re = Mpy_32_32( mixer_mat[i][k][band_idx], temp_mat[k][j] ); tmp_q = sub( q_mixer_mat, temp_mat_e[k][j] ); tmp_q = add( tmp_e, temp_mat_e[k][j] ); IF( tmp_re ) { tmp_e = sub( 31, q_postpred_cov_re_buf[i][j] ); postpred_cov_re[i][j] = BASOP_Util_Add_Mant32Exp( postpred_cov_re[i][j], tmp_e, tmp_re, sub( Q31, tmp_q ), &tmp_e ); #ifndef OPT_SBA_ENC_V1 postpred_cov_re[i][j] = BASOP_Util_Add_Mant32Exp( postpred_cov_re[i][j], e_postpred_cov_re_buf[i][j], tmp_re, tmp_q, &e_postpred_cov_re_buf[i][j] ); move32(); q_postpred_cov_re_buf[i][j] = sub( 31, tmp_e ); move16(); #else temp_add = BASOP_Util_Add_Mant32Exp( temp_add, e_postpred_cov_re_buf[i][j], tmp_re, tmp_q, &e_postpred_cov_re_buf[i][j] ); #endif } } IF( postpred_cov_re[i][j] ) if ( temp_add ) { min_val = s_min( min_val, q_postpred_cov_re_buf[i][j] ); min_val = s_max( min_val, e_postpred_cov_re_buf[i][j] ); } #ifdef OPT_SBA_ENC_V1 postpred_cov_re[i][j] = temp_add; move32(); #endif } } Loading @@ -2077,7 +2121,7 @@ static void ivas_calc_post_pred_per_band_enc_fx( { IF( postpred_cov_re[i][j] ) { postpred_cov_re[i][j] = L_shl( postpred_cov_re[i][j], sub( min_val, q_postpred_cov_re_buf[i][j] ) ); postpred_cov_re[i][j] = L_shr( postpred_cov_re[i][j], sub( min_val, e_postpred_cov_re_buf[i][j] ) ); move32(); } } Loading @@ -2093,13 +2137,16 @@ static void ivas_calc_post_pred_per_band_enc_fx( } } if ( EQ_16( min_val, MAX16B ) ) IF( EQ_16( min_val, MIN16B ) ) { min_val = Q31; move16(); } *q_postpred_cov_re = min_val; ELSE { *q_postpred_cov_re = sub( Q31, min_val ); move16(); } return; } Loading
lib_com/options.h +3 −0 Original line number Diff line number Diff line Loading @@ -74,6 +74,9 @@ #define FIX_1379_MASA_ANGLE_ROUND /* Note: each compile switch (FIX_1101_...) is independent from the other ones */ #define OPT_SBA_ENC_V1 #define OPT_BIN_RENDERER_V1 #define OPT_BIN_RENDERER_V2 #define OPT_STEREO_32KBPS_V1 /* Optimization made in stereo decoding path for 32kbps decoding */ #define OPT_AVOID_STATE_BUF_RESCALE /* Optimization made to avoid rescale of synth state buffer */ #define FIX_1310_SPEEDUP_ivas_dirac_dec_get_response_fx /*FhG: WMOPS tuning, nonbe*/ Loading