Loading lib_com/ivas_dirac_com.c +9 −9 Original line number Diff line number Diff line Loading @@ -2100,6 +2100,7 @@ void calculate_hodirac_sector_parameters_fx( normI_fx = BASOP_Util_Add_Mant32Exp( tmp32, tmp_e, tmp_z, shl( *p_sec_I_vec_smth_z_exp, 1 ), &normI_exp ); normI_fx = Sqrt32( normI_fx, &normI_exp ); tmp32 = BASOP_Util_Add_Mant32Exp( tmp32, tmp_e, 0, 0, &tmp_e ); // normalising value of tmp32 tmp_xy_hypo = Sqrt32( tmp32, &tmp_e ); // sqrt(x^2 + y^2) tmp16 = BASOP_util_atan2( *p_sec_I_vec_smth_y_fx, *p_sec_I_vec_smth_x_fx, sub( *p_sec_I_vec_smth_y_exp, *p_sec_I_vec_smth_x_exp ) ); // Q13 Loading @@ -2124,9 +2125,8 @@ void calculate_hodirac_sector_parameters_fx( move32(); tmp_diff_exp = *p_diff_exp; move16(); // NOTE: here, assuming abs(tmp_diff) <= 1.0. --> Q30 tmp_diff_fx = L_shr( tmp_diff_fx, sub( 1, tmp_diff_exp ) ); tmp_diff_exp = 1; tmp_diff_fx = L_shr( tmp_diff_fx, sub( 2, tmp_diff_exp ) ); // Q29 tmp_diff_exp = 2; move16(); IF( tmp_diff_fx < 0 ) Loading @@ -2134,7 +2134,7 @@ void calculate_hodirac_sector_parameters_fx( *p_diff_fx = 0; move32(); } IF( GT_32( tmp_diff_fx, ( ONE_IN_Q30 / 2 ) ) ) IF( GT_32( tmp_diff_fx, ( ONE_IN_Q29 / 2 ) ) ) { IF( hDirAC->firstrun_sector_params ) { Loading @@ -2145,13 +2145,13 @@ void calculate_hodirac_sector_parameters_fx( } ELSE { *p_azi_fx = L_shl( L_add( Mpy_32_32( L_sub( ONE_IN_Q30, tmp_diff_fx ), *p_azi_fx ), Mpy_32_32( L_sub( tmp_diff_fx, ONE_IN_Q30 / 2 ), *p_azi_prev_fx ) ), 1 ); // Q30 + Q23 - 31 = Q22 *p_azi_fx = L_shl( L_add( Mpy_32_32( L_sub( ONE_IN_Q29, tmp_diff_fx ), *p_azi_fx ), Mpy_32_32( L_sub( tmp_diff_fx, ONE_IN_Q29 / 2 ), *p_azi_prev_fx ) ), 1 ); // Q29 + Q23 - 31 = Q21 move32(); *p_ele_fx = L_shl( L_add( Mpy_32_32( L_sub( ONE_IN_Q30, tmp_diff_fx ), *p_ele_fx ), Mpy_32_32( L_sub( tmp_diff_fx, ONE_IN_Q30 / 2 ), *p_ele_prev_fx ) ), 1 ); // Q30 + Q23 - 31 = Q22 *p_ele_fx = L_shl( L_add( Mpy_32_32( L_sub( ONE_IN_Q29, tmp_diff_fx ), *p_ele_fx ), Mpy_32_32( L_sub( tmp_diff_fx, ONE_IN_Q29 / 2 ), *p_ele_prev_fx ) ), 1 ); // Q29 + Q23 - 31 = Q21 move32(); *p_azi_fx = L_shl( *p_azi_fx, 1 ); // Q22 -> Q23; *p_azi_fx = L_shl( *p_azi_fx, 2 ); // Q21 -> Q23; move32(); *p_ele_fx = L_shl( *p_ele_fx, 1 ); // Q22 -> Q23; *p_ele_fx = L_shl( *p_ele_fx, 2 ); // Q21 -> Q23; move32(); } } Loading lib_dec/er_dec_tcx_fx.c +3 −2 Original line number Diff line number Diff line Loading @@ -2104,8 +2104,9 @@ void con_tcx_ivas_fx( move16(); /* create aliasing and windowing need for transition to TCX10/5 */ bufferCopyFx( syn + L_frame, hTcxDec->syn_Overl_TDACFB, shr( L_frame, 1 ), Q_syn, 0, -1, 0 ); hTcxDec->Q_syn_Overl_TDACFB = add( Q_syn, -1 ); // bufferCopyFx( syn + L_frame, hTcxDec->syn_Overl_TDACFB, shr( L_frame, 1 ), Q_syn, 0, -1, 0 ); Copy_Scale_sig( syn + L_frame, hTcxDec->syn_Overl_TDACFB, shr( L_frame, 1 ), sub( Q_syn, 1 ) ); hTcxDec->Q_syn_Overl_TDACFB = sub( Q_syn, 1 ); move16(); FOR( i = 0; i < W12; i++ ) Loading lib_dec/tonalMDCTconcealment_fx.c +4 −0 Original line number Diff line number Diff line Loading @@ -231,6 +231,10 @@ ivas_error TonalMDCTConceal_Init_ivas_fx( move16(); move16(); /* just the second half of the second last pcm output is needed */ #ifdef MSAN_FIX set16_fx( hTonalMDCTConc->timeDataBuffer, 0, ( 3 * L_FRAME_MAX ) / 2 ); #endif hTonalMDCTConc->secondLastPcmOut = &hTonalMDCTConc->timeDataBuffer[( 3 * L_FRAME_MAX ) / 2 - ( 3 * min( L_FRAME_MAX, nSamples ) / 2 )]; hTonalMDCTConc->lastPcmOut = &hTonalMDCTConc->timeDataBuffer[( 3 * L_FRAME_MAX ) / 2 - min( L_FRAME_MAX, nSamples )]; /* If the second last frame was lost, we reuse saved TonalComponentsInfo and don't update pcm buffers */ Loading lib_enc/core_switching_enc.c +5 −6 Original line number Diff line number Diff line Loading @@ -957,10 +957,6 @@ void core_switching_post_enc( #ifdef IVAS_FLOAT_FIXED InitSWBencBufferStates_fx( st->hBWE_TD, NULL ); swb_tbe_reset_fx( st->hBWE_TD->mem_csfilt_fx, st->hBWE_TD->mem_genSHBexc_filt_down_shb_fx, st->hBWE_TD->state_lpc_syn_fx, st->hBWE_TD->syn_overlap_fx, st->hBWE_TD->state_syn_shbexc_fx, &( st->hBWE_TD->tbe_demph_fx ), &( st->hBWE_TD->tbe_premph_fx ), st->hBWE_TD->mem_stp_swb_fx, &( st->hBWE_TD->gain_prec_swb_fx ) ); #ifdef IVAS_FLOAT_FIXED_CONVERSIONS /* To be removed later when the function is converted to fixed*/ InitSWBencBufferStates( st->hBWE_TD, NULL ); #endif #else InitSWBencBufferStates( st->hBWE_TD, NULL ); swb_tbe_reset( st->hBWE_TD->mem_csfilt, st->hBWE_TD->mem_genSHBexc_filt_down_shb, st->hBWE_TD->state_lpc_syn, st->hBWE_TD->syn_overlap, st->hBWE_TD->state_syn_shbexc, &( st->hBWE_TD->tbe_demph ), &( st->hBWE_TD->tbe_premph ), st->hBWE_TD->mem_stp_swb, &( st->hBWE_TD->gain_prec_swb ) ); Loading Loading @@ -1007,11 +1003,14 @@ void core_switching_post_enc( /* Interp_3_2 CNG buffers reset */ if ( st->extl == FB_TBE && ( ( st->last_extl != FB_TBE && st->last_core != TCX_20_CORE && st->last_core != TCX_10_CORE ) || st->L_frame != st->last_L_frame ) ) { set_f( st->hBWE_TD->fb_state_lpc_syn, 0, LPC_SHB_ORDER ); st->hBWE_TD->fb_tbe_demph = 0; #ifdef IVAS_FLOAT_FIXED set16_fx( st->hBWE_TD->fb_state_lpc_syn_fx, 0, LPC_SHB_ORDER ); st->hBWE_TD->fb_tbe_demph_fx = 0; move16(); fb_tbe_reset_enc_fx( st->hBWE_TD->elliptic_bpf_2_48k_mem_fx, &st->hBWE_TD->prev_fb_energy_fx, st->hBWE_TD->elliptic_bpf_2_48k_mem_fx_Q, &st->hBWE_TD->prev_fb_energy_fx_Q ); #else set_f( st->hBWE_TD->fb_state_lpc_syn, 0, LPC_SHB_ORDER ); st->hBWE_TD->fb_tbe_demph = 0; fb_tbe_reset_enc( st->hBWE_TD->elliptic_bpf_2_48k_mem, &st->hBWE_TD->prev_fb_energy ); #endif } Loading lib_enc/init_enc.c +6 −3 Original line number Diff line number Diff line Loading @@ -827,9 +827,13 @@ ivas_error init_encoder( InitSWBencBuffer( st->hBWE_TD ); #ifdef IVAS_FLOAT_FIXED InitSWBencBuffer_fx( st ); InitSWBencBuffer_ivas_fx( st ); #endif #ifndef IVAS_FLOAT_FIXED ResetSHBbuffer_Enc( st->hBWE_TD ); #else ResetSHBbuffer_Enc_fx( st ); #endif } else { Loading Loading @@ -1991,11 +1995,10 @@ ivas_error init_encoder_ivas_fx( return error; } InitSWBencBuffer_fx( st ); InitSWBencBuffer_ivas_fx( st ); ResetSHBbuffer_Enc_fx( st ); #if 1 InitSWBencBuffer( st->hBWE_TD ); ResetSHBbuffer_Enc( st->hBWE_TD ); #endif } ELSE Loading Loading
lib_com/ivas_dirac_com.c +9 −9 Original line number Diff line number Diff line Loading @@ -2100,6 +2100,7 @@ void calculate_hodirac_sector_parameters_fx( normI_fx = BASOP_Util_Add_Mant32Exp( tmp32, tmp_e, tmp_z, shl( *p_sec_I_vec_smth_z_exp, 1 ), &normI_exp ); normI_fx = Sqrt32( normI_fx, &normI_exp ); tmp32 = BASOP_Util_Add_Mant32Exp( tmp32, tmp_e, 0, 0, &tmp_e ); // normalising value of tmp32 tmp_xy_hypo = Sqrt32( tmp32, &tmp_e ); // sqrt(x^2 + y^2) tmp16 = BASOP_util_atan2( *p_sec_I_vec_smth_y_fx, *p_sec_I_vec_smth_x_fx, sub( *p_sec_I_vec_smth_y_exp, *p_sec_I_vec_smth_x_exp ) ); // Q13 Loading @@ -2124,9 +2125,8 @@ void calculate_hodirac_sector_parameters_fx( move32(); tmp_diff_exp = *p_diff_exp; move16(); // NOTE: here, assuming abs(tmp_diff) <= 1.0. --> Q30 tmp_diff_fx = L_shr( tmp_diff_fx, sub( 1, tmp_diff_exp ) ); tmp_diff_exp = 1; tmp_diff_fx = L_shr( tmp_diff_fx, sub( 2, tmp_diff_exp ) ); // Q29 tmp_diff_exp = 2; move16(); IF( tmp_diff_fx < 0 ) Loading @@ -2134,7 +2134,7 @@ void calculate_hodirac_sector_parameters_fx( *p_diff_fx = 0; move32(); } IF( GT_32( tmp_diff_fx, ( ONE_IN_Q30 / 2 ) ) ) IF( GT_32( tmp_diff_fx, ( ONE_IN_Q29 / 2 ) ) ) { IF( hDirAC->firstrun_sector_params ) { Loading @@ -2145,13 +2145,13 @@ void calculate_hodirac_sector_parameters_fx( } ELSE { *p_azi_fx = L_shl( L_add( Mpy_32_32( L_sub( ONE_IN_Q30, tmp_diff_fx ), *p_azi_fx ), Mpy_32_32( L_sub( tmp_diff_fx, ONE_IN_Q30 / 2 ), *p_azi_prev_fx ) ), 1 ); // Q30 + Q23 - 31 = Q22 *p_azi_fx = L_shl( L_add( Mpy_32_32( L_sub( ONE_IN_Q29, tmp_diff_fx ), *p_azi_fx ), Mpy_32_32( L_sub( tmp_diff_fx, ONE_IN_Q29 / 2 ), *p_azi_prev_fx ) ), 1 ); // Q29 + Q23 - 31 = Q21 move32(); *p_ele_fx = L_shl( L_add( Mpy_32_32( L_sub( ONE_IN_Q30, tmp_diff_fx ), *p_ele_fx ), Mpy_32_32( L_sub( tmp_diff_fx, ONE_IN_Q30 / 2 ), *p_ele_prev_fx ) ), 1 ); // Q30 + Q23 - 31 = Q22 *p_ele_fx = L_shl( L_add( Mpy_32_32( L_sub( ONE_IN_Q29, tmp_diff_fx ), *p_ele_fx ), Mpy_32_32( L_sub( tmp_diff_fx, ONE_IN_Q29 / 2 ), *p_ele_prev_fx ) ), 1 ); // Q29 + Q23 - 31 = Q21 move32(); *p_azi_fx = L_shl( *p_azi_fx, 1 ); // Q22 -> Q23; *p_azi_fx = L_shl( *p_azi_fx, 2 ); // Q21 -> Q23; move32(); *p_ele_fx = L_shl( *p_ele_fx, 1 ); // Q22 -> Q23; *p_ele_fx = L_shl( *p_ele_fx, 2 ); // Q21 -> Q23; move32(); } } Loading
lib_dec/er_dec_tcx_fx.c +3 −2 Original line number Diff line number Diff line Loading @@ -2104,8 +2104,9 @@ void con_tcx_ivas_fx( move16(); /* create aliasing and windowing need for transition to TCX10/5 */ bufferCopyFx( syn + L_frame, hTcxDec->syn_Overl_TDACFB, shr( L_frame, 1 ), Q_syn, 0, -1, 0 ); hTcxDec->Q_syn_Overl_TDACFB = add( Q_syn, -1 ); // bufferCopyFx( syn + L_frame, hTcxDec->syn_Overl_TDACFB, shr( L_frame, 1 ), Q_syn, 0, -1, 0 ); Copy_Scale_sig( syn + L_frame, hTcxDec->syn_Overl_TDACFB, shr( L_frame, 1 ), sub( Q_syn, 1 ) ); hTcxDec->Q_syn_Overl_TDACFB = sub( Q_syn, 1 ); move16(); FOR( i = 0; i < W12; i++ ) Loading
lib_dec/tonalMDCTconcealment_fx.c +4 −0 Original line number Diff line number Diff line Loading @@ -231,6 +231,10 @@ ivas_error TonalMDCTConceal_Init_ivas_fx( move16(); move16(); /* just the second half of the second last pcm output is needed */ #ifdef MSAN_FIX set16_fx( hTonalMDCTConc->timeDataBuffer, 0, ( 3 * L_FRAME_MAX ) / 2 ); #endif hTonalMDCTConc->secondLastPcmOut = &hTonalMDCTConc->timeDataBuffer[( 3 * L_FRAME_MAX ) / 2 - ( 3 * min( L_FRAME_MAX, nSamples ) / 2 )]; hTonalMDCTConc->lastPcmOut = &hTonalMDCTConc->timeDataBuffer[( 3 * L_FRAME_MAX ) / 2 - min( L_FRAME_MAX, nSamples )]; /* If the second last frame was lost, we reuse saved TonalComponentsInfo and don't update pcm buffers */ Loading
lib_enc/core_switching_enc.c +5 −6 Original line number Diff line number Diff line Loading @@ -957,10 +957,6 @@ void core_switching_post_enc( #ifdef IVAS_FLOAT_FIXED InitSWBencBufferStates_fx( st->hBWE_TD, NULL ); swb_tbe_reset_fx( st->hBWE_TD->mem_csfilt_fx, st->hBWE_TD->mem_genSHBexc_filt_down_shb_fx, st->hBWE_TD->state_lpc_syn_fx, st->hBWE_TD->syn_overlap_fx, st->hBWE_TD->state_syn_shbexc_fx, &( st->hBWE_TD->tbe_demph_fx ), &( st->hBWE_TD->tbe_premph_fx ), st->hBWE_TD->mem_stp_swb_fx, &( st->hBWE_TD->gain_prec_swb_fx ) ); #ifdef IVAS_FLOAT_FIXED_CONVERSIONS /* To be removed later when the function is converted to fixed*/ InitSWBencBufferStates( st->hBWE_TD, NULL ); #endif #else InitSWBencBufferStates( st->hBWE_TD, NULL ); swb_tbe_reset( st->hBWE_TD->mem_csfilt, st->hBWE_TD->mem_genSHBexc_filt_down_shb, st->hBWE_TD->state_lpc_syn, st->hBWE_TD->syn_overlap, st->hBWE_TD->state_syn_shbexc, &( st->hBWE_TD->tbe_demph ), &( st->hBWE_TD->tbe_premph ), st->hBWE_TD->mem_stp_swb, &( st->hBWE_TD->gain_prec_swb ) ); Loading Loading @@ -1007,11 +1003,14 @@ void core_switching_post_enc( /* Interp_3_2 CNG buffers reset */ if ( st->extl == FB_TBE && ( ( st->last_extl != FB_TBE && st->last_core != TCX_20_CORE && st->last_core != TCX_10_CORE ) || st->L_frame != st->last_L_frame ) ) { set_f( st->hBWE_TD->fb_state_lpc_syn, 0, LPC_SHB_ORDER ); st->hBWE_TD->fb_tbe_demph = 0; #ifdef IVAS_FLOAT_FIXED set16_fx( st->hBWE_TD->fb_state_lpc_syn_fx, 0, LPC_SHB_ORDER ); st->hBWE_TD->fb_tbe_demph_fx = 0; move16(); fb_tbe_reset_enc_fx( st->hBWE_TD->elliptic_bpf_2_48k_mem_fx, &st->hBWE_TD->prev_fb_energy_fx, st->hBWE_TD->elliptic_bpf_2_48k_mem_fx_Q, &st->hBWE_TD->prev_fb_energy_fx_Q ); #else set_f( st->hBWE_TD->fb_state_lpc_syn, 0, LPC_SHB_ORDER ); st->hBWE_TD->fb_tbe_demph = 0; fb_tbe_reset_enc( st->hBWE_TD->elliptic_bpf_2_48k_mem, &st->hBWE_TD->prev_fb_energy ); #endif } Loading
lib_enc/init_enc.c +6 −3 Original line number Diff line number Diff line Loading @@ -827,9 +827,13 @@ ivas_error init_encoder( InitSWBencBuffer( st->hBWE_TD ); #ifdef IVAS_FLOAT_FIXED InitSWBencBuffer_fx( st ); InitSWBencBuffer_ivas_fx( st ); #endif #ifndef IVAS_FLOAT_FIXED ResetSHBbuffer_Enc( st->hBWE_TD ); #else ResetSHBbuffer_Enc_fx( st ); #endif } else { Loading Loading @@ -1991,11 +1995,10 @@ ivas_error init_encoder_ivas_fx( return error; } InitSWBencBuffer_fx( st ); InitSWBencBuffer_ivas_fx( st ); ResetSHBbuffer_Enc_fx( st ); #if 1 InitSWBencBuffer( st->hBWE_TD ); ResetSHBbuffer_Enc( st->hBWE_TD ); #endif } ELSE Loading