Loading lib_com/arith_coder_fx.c +1 −1 Original line number Diff line number Diff line Loading @@ -260,7 +260,7 @@ void tcx_arith_scale_envelope( b_e = add(b_e, mean_e); /* scale = (-b + (float)sqrt(b*b - 4.0f*a*0.035f)) / (2.0f * a); */ tmp = round_fx(BASOP_Util_Add_Mant32Exp(L_mult(b, b), shl(b_e, 1), Mpy_32_16_1(a, -4588/*-4.0f*0.035f Q15*/), a_e, &tmp2)); tmp = round_fx_o(BASOP_Util_Add_Mant32Exp(L_mult(b, b), shl(b_e, 1), Mpy_32_16_1(a, -4588/*-4.0f*0.035f Q15*/), a_e, &tmp2), &Overflow); IF( tmp <= 0 ) { Loading lib_com/fd_cng_com.c +3 −1 Original line number Diff line number Diff line Loading @@ -88,7 +88,8 @@ ivas_error createFdCngCom_flt( void initFdCngCom_flt( HANDLE_FD_CNG_COM hFdCngCom, /* i/o: FD_CNG structure containing all buffers and variables */ const float scale ) const float scale ) { #ifndef IVAS_FLOAT_FIXED /* Calculate FFT scaling factor */ Loading @@ -102,6 +103,7 @@ void initFdCngCom_flt( /* Initialize the comfort noise generation */ set_f( hFdCngCom->fftBuffer_flt, 0.0f, FFTLEN ); #endif UNUSED_PARAM(scale); set_f( hFdCngCom->cngNoiseLevel_flt, 0.0f, FFTCLDFBLEN ); set_f( hFdCngCom->olapBufferSynth2_flt, 0.0f, FFTLEN ); Loading lib_com/float_to_fix_ops.c +24 −5 Original line number Diff line number Diff line Loading @@ -844,11 +844,21 @@ void fixed_to_float_stereo_tcx_core_dec( //st->hTcxDec->syn_Overl_TDACFB_float[p] = (float) st->hTcxDec->syn_Overl_TDACFB[p] * 2 * (float) pow( 2, st->Q_syn ); //st->hTcxDec->syn_Overl_TDAC_float[p] = (float) st->hTcxDec->syn_Overl_TDAC[p] * 2 * (float) pow( 2, st->Q_syn ); } if (st->hHQ_core->Q_old_wtda >= 0) { for ( int p = 0; p < st->L_frame; p++ ) { st->hHQ_core->old_outLB[p] = (float) st->hHQ_core->old_out_LB_fx[p] / ( 1u << st->hHQ_core->Q_old_wtda ); st->hHQ_core->old_out[p] = (float) st->hHQ_core->old_out_fx[p] / ( 1u << st->hHQ_core->Q_old_wtda ); } } else{ for ( int p = 0; p < st->L_frame; p++ ) { st->hHQ_core->old_outLB[p] = (float) st->hHQ_core->old_out_LB_fx[p] * ( 1u << (-st->hHQ_core->Q_old_wtda) ); st->hHQ_core->old_out[p] = (float) st->hHQ_core->old_out_fx[p] * ( 1u << (-st->hHQ_core->Q_old_wtda) ); } } //for ( int p = 0; p < st->L_frame; p++ ) //{ // st->hTcxDec->old_excFB[p] = (float) ( st->hTcxDec->old_excFB_fx[p] ) / ( 1u << st->Q_exc ); Loading Loading @@ -903,10 +913,19 @@ void fixed_to_float_stereo_tcx_core_dec( //{ // st->hFdCngDec->hFdCngCom->fftBuffer_flt[p] = ( (float) st->hFdCngDec->hFdCngCom->fftBuffer[p] / ( 1u << ( 31 - st->hFdCngDec->hFdCngCom->fftBuffer_exp ) ) ); //} if(( 31 - st->hFdCngDec->hFdCngCom->cngNoiseLevelExp ) >= 0) { for ( int p = 0; p < ( st->hFdCngDec->hFdCngCom->stopFFTbin - st->hFdCngDec->hFdCngCom->startBand ); p++ ) { st->hFdCngDec->hFdCngCom->cngNoiseLevel_flt[p] = ( (float) st->hFdCngDec->hFdCngCom->cngNoiseLevel[p] / ( 1u << ( 31 - st->hFdCngDec->hFdCngCom->cngNoiseLevelExp ) ) ); } } else{ for ( int p = 0; p < ( st->hFdCngDec->hFdCngCom->stopFFTbin - st->hFdCngDec->hFdCngCom->startBand ); p++ ) { st->hFdCngDec->hFdCngCom->cngNoiseLevel_flt[p] = ( (float) st->hFdCngDec->hFdCngCom->cngNoiseLevel[p] * ( 1u << ( st->hFdCngDec->hFdCngCom->cngNoiseLevelExp - 31) ) ); } } for ( int p = 0; p < ( st->hFdCngDec->hFdCngCom->stopFFTbin - st->hFdCngDec->hFdCngCom->startBand ); p++ ) { //st->hFdCngDec->bandNoiseShape_float[p] = ( (float) st->hFdCngDec->bandNoiseShape[p] / ( 1u << ( 31 - st->hFdCngDec->bandNoiseShape_exp ) ) ); Loading lib_com/prot.h +3 −1 Original line number Diff line number Diff line Loading @@ -8796,7 +8796,9 @@ void deleteFdCngCom_flt( void initFdCngCom_flt( HANDLE_FD_CNG_COM hFdCngCom, /* i/o: FD_CNG structure containing all buffers and variables */ const float scale ); const float scale ); void initPartitions_flt( const int16_t *part_in, Loading lib_com/swb_bwe_com_fx.c +2 −2 Original line number Diff line number Diff line Loading @@ -1057,8 +1057,8 @@ void WB_BWE_decoding_fx( energy = L_deposit_l(0); FOR(n_freq = swb_bwe_subband[n_band]; n_freq < swb_bwe_subband[n_band + L]; n_freq++) { L_tmp = L_mult(WB_signal[n_freq],WB_signal[n_freq]); /*Q31 */ energy = L_add(energy,L_shr(L_tmp,6)); /*Q25 */ L_tmp = L_mult0(WB_signal[n_freq],WB_signal[n_freq]); /*Q30 */ energy = L_add(energy,L_shr(L_tmp,5)); /*Q25 */ } tmp = sub(swb_bwe_subband[n_band + L] , swb_bwe_subband[n_band]); Loading Loading
lib_com/arith_coder_fx.c +1 −1 Original line number Diff line number Diff line Loading @@ -260,7 +260,7 @@ void tcx_arith_scale_envelope( b_e = add(b_e, mean_e); /* scale = (-b + (float)sqrt(b*b - 4.0f*a*0.035f)) / (2.0f * a); */ tmp = round_fx(BASOP_Util_Add_Mant32Exp(L_mult(b, b), shl(b_e, 1), Mpy_32_16_1(a, -4588/*-4.0f*0.035f Q15*/), a_e, &tmp2)); tmp = round_fx_o(BASOP_Util_Add_Mant32Exp(L_mult(b, b), shl(b_e, 1), Mpy_32_16_1(a, -4588/*-4.0f*0.035f Q15*/), a_e, &tmp2), &Overflow); IF( tmp <= 0 ) { Loading
lib_com/fd_cng_com.c +3 −1 Original line number Diff line number Diff line Loading @@ -88,7 +88,8 @@ ivas_error createFdCngCom_flt( void initFdCngCom_flt( HANDLE_FD_CNG_COM hFdCngCom, /* i/o: FD_CNG structure containing all buffers and variables */ const float scale ) const float scale ) { #ifndef IVAS_FLOAT_FIXED /* Calculate FFT scaling factor */ Loading @@ -102,6 +103,7 @@ void initFdCngCom_flt( /* Initialize the comfort noise generation */ set_f( hFdCngCom->fftBuffer_flt, 0.0f, FFTLEN ); #endif UNUSED_PARAM(scale); set_f( hFdCngCom->cngNoiseLevel_flt, 0.0f, FFTCLDFBLEN ); set_f( hFdCngCom->olapBufferSynth2_flt, 0.0f, FFTLEN ); Loading
lib_com/float_to_fix_ops.c +24 −5 Original line number Diff line number Diff line Loading @@ -844,11 +844,21 @@ void fixed_to_float_stereo_tcx_core_dec( //st->hTcxDec->syn_Overl_TDACFB_float[p] = (float) st->hTcxDec->syn_Overl_TDACFB[p] * 2 * (float) pow( 2, st->Q_syn ); //st->hTcxDec->syn_Overl_TDAC_float[p] = (float) st->hTcxDec->syn_Overl_TDAC[p] * 2 * (float) pow( 2, st->Q_syn ); } if (st->hHQ_core->Q_old_wtda >= 0) { for ( int p = 0; p < st->L_frame; p++ ) { st->hHQ_core->old_outLB[p] = (float) st->hHQ_core->old_out_LB_fx[p] / ( 1u << st->hHQ_core->Q_old_wtda ); st->hHQ_core->old_out[p] = (float) st->hHQ_core->old_out_fx[p] / ( 1u << st->hHQ_core->Q_old_wtda ); } } else{ for ( int p = 0; p < st->L_frame; p++ ) { st->hHQ_core->old_outLB[p] = (float) st->hHQ_core->old_out_LB_fx[p] * ( 1u << (-st->hHQ_core->Q_old_wtda) ); st->hHQ_core->old_out[p] = (float) st->hHQ_core->old_out_fx[p] * ( 1u << (-st->hHQ_core->Q_old_wtda) ); } } //for ( int p = 0; p < st->L_frame; p++ ) //{ // st->hTcxDec->old_excFB[p] = (float) ( st->hTcxDec->old_excFB_fx[p] ) / ( 1u << st->Q_exc ); Loading Loading @@ -903,10 +913,19 @@ void fixed_to_float_stereo_tcx_core_dec( //{ // st->hFdCngDec->hFdCngCom->fftBuffer_flt[p] = ( (float) st->hFdCngDec->hFdCngCom->fftBuffer[p] / ( 1u << ( 31 - st->hFdCngDec->hFdCngCom->fftBuffer_exp ) ) ); //} if(( 31 - st->hFdCngDec->hFdCngCom->cngNoiseLevelExp ) >= 0) { for ( int p = 0; p < ( st->hFdCngDec->hFdCngCom->stopFFTbin - st->hFdCngDec->hFdCngCom->startBand ); p++ ) { st->hFdCngDec->hFdCngCom->cngNoiseLevel_flt[p] = ( (float) st->hFdCngDec->hFdCngCom->cngNoiseLevel[p] / ( 1u << ( 31 - st->hFdCngDec->hFdCngCom->cngNoiseLevelExp ) ) ); } } else{ for ( int p = 0; p < ( st->hFdCngDec->hFdCngCom->stopFFTbin - st->hFdCngDec->hFdCngCom->startBand ); p++ ) { st->hFdCngDec->hFdCngCom->cngNoiseLevel_flt[p] = ( (float) st->hFdCngDec->hFdCngCom->cngNoiseLevel[p] * ( 1u << ( st->hFdCngDec->hFdCngCom->cngNoiseLevelExp - 31) ) ); } } for ( int p = 0; p < ( st->hFdCngDec->hFdCngCom->stopFFTbin - st->hFdCngDec->hFdCngCom->startBand ); p++ ) { //st->hFdCngDec->bandNoiseShape_float[p] = ( (float) st->hFdCngDec->bandNoiseShape[p] / ( 1u << ( 31 - st->hFdCngDec->bandNoiseShape_exp ) ) ); Loading
lib_com/prot.h +3 −1 Original line number Diff line number Diff line Loading @@ -8796,7 +8796,9 @@ void deleteFdCngCom_flt( void initFdCngCom_flt( HANDLE_FD_CNG_COM hFdCngCom, /* i/o: FD_CNG structure containing all buffers and variables */ const float scale ); const float scale ); void initPartitions_flt( const int16_t *part_in, Loading
lib_com/swb_bwe_com_fx.c +2 −2 Original line number Diff line number Diff line Loading @@ -1057,8 +1057,8 @@ void WB_BWE_decoding_fx( energy = L_deposit_l(0); FOR(n_freq = swb_bwe_subband[n_band]; n_freq < swb_bwe_subband[n_band + L]; n_freq++) { L_tmp = L_mult(WB_signal[n_freq],WB_signal[n_freq]); /*Q31 */ energy = L_add(energy,L_shr(L_tmp,6)); /*Q25 */ L_tmp = L_mult0(WB_signal[n_freq],WB_signal[n_freq]); /*Q30 */ energy = L_add(energy,L_shr(L_tmp,5)); /*Q25 */ } tmp = sub(swb_bwe_subband[n_band + L] , swb_bwe_subband[n_band]); Loading