Skip to content
......@@ -462,7 +462,6 @@ void CNG_enc_fx(
IF( hTdCngEnc->burst_ho_cnt > 0 )
{
/**allow_cn_step |= ( hTdCngEnc->ho_ener_hist_fx[hTdCngEnc->ho_hist_ptr] > 4 * hTdCngEnc->lp_ener_fx ); */
#if 1
/*allow_cn_step |= (hDtxEnc->first_CNG || st->element_mode == EVS_MONO) && (hTdCngEnc->ho_ener_hist[hTdCngEnc->ho_hist_ptr] > lp_ener_thr_scale * hTdCngEnc->lp_ener);*/
/* (hTdCngEnc->ho_ener_hist[hTdCngEnc->ho_hist_ptr] > lp_ener_thr_scale * hTdCngEnc->lp_ener); */
L_tmp1 = L_shr( hTdCngEnc->ho_ener_hist_fx[hTdCngEnc->ho_hist_ptr], 2 );
......@@ -471,10 +470,6 @@ void CNG_enc_fx(
L_tmp1 = L_add( L_tmp1, L_shr( hTdCngEnc->lp_ener_fx, 8 ) );
}
L_tmp1 = L_sub( L_tmp1, hTdCngEnc->lp_ener_fx );
#else
L_tmp1 = L_shr( hTdCngEnc->ho_ener_hist_fx[hTdCngEnc->ho_hist_ptr], 2 );
L_tmp1 = L_sub( L_tmp1, hTdCngEnc->lp_ener_fx );
#endif
test();
test();
IF( ( hDtxEnc->first_CNG > 0 || st_fx->element_mode == EVS_MONO ) && L_tmp1 > 0 )
......
This diff is collapsed.
......@@ -53,15 +53,7 @@ void init_coder_ace_plus_fx(
/* Bitrate */
st->tcxonly = (Word8) getTcxonly(
#ifdef IVAS_CODE_SWITCHING
st->element_mode,
#endif
st->total_brate
#ifdef IVAS_CODE_SWITCHING
,
MCT_flag, st->is_ism_format
#endif
);
st->total_brate );
move16();
/* Core Sampling Rate */
......
......@@ -49,11 +49,7 @@ void core_coder_mode_switch_fx(
switchWB = 1; /*force init when coming from MODE1*/
}
#ifdef IVAS_CODE_SWITCHING
tcxonly_tmp = getTcxonly( st->element_mode, st->total_brate, MCT_flag, st->is_ism_format );
#else
tcxonly_tmp = getTcxonly( st->total_brate );
#endif
if ( NE_16( tcxonly_tmp, st->tcxonly ) )
{
......@@ -71,11 +67,7 @@ void core_coder_mode_switch_fx(
move32();
st->L_frame = extract_l( Mult_32_16( st->sr_core, 0x0290 ) );
assert( st->L_frame == st->sr_core / 50 );
#ifdef IVAS_CODE_SWITCHING
st->tcxonly = getTcxonly( st->element_mode, st->total_brate, MCT_flag, st->is_ism_format );
#else
st->tcxonly = (Word8) getTcxonly( st->total_brate );
#endif
/* st->bits_frame_nominal = (int)( (float)st->L_frame/(float)st->fscale ) * (float)FSCALE_DENOM/128.0f * (float)st->bitrate/100.0f + 0.49f ; */
/* st->bits_frame_nominal = extract_l(L_shr(Mpy_32_16_1( L_shl(st->bitrate,8), mult_r(div_s(st->fscale, shl(st->L_frame,4)), FL2WORD16(FSCALE_DENOM/12800.f))), 6)); */
tmp32 = L_shl( st->total_brate, 1 ); /* (float)st->L_frame/(float)st->fscale * (float)FSCALE_DENOM/128.0f * (float)st->bitrate */
......@@ -118,9 +110,6 @@ void core_coder_mode_switch_fx(
IF( st->hTcxCfg->fIsTNSAllowed != 0 )
{
InitTnsConfigs( st->bwidth, st->hTcxCfg->tcx_coded_lines, st->hTcxCfg->tnsConfig, st->hIGFEnc->infoStopFrequency, st->total_brate, st->element_mode, MCT_flag );
#ifdef IVAS_CODE
SetAllowTnsOnWhite( st->hTcxCfg->tnsConfig, EQ_16( st->element_mode, IVAS_CPE_MDCT ) );
#endif
}
st->narrowBand = 0;
......
......@@ -48,20 +48,6 @@ void core_encode_update_fx( Encoder_State *st )
if ( hTcxEnc != NULL )
{
Copy( hTcxEnc->buf_speech_ltp + st->L_frame, hTcxEnc->buf_speech_ltp, n );
#ifdef IVAS_CODE
IF( NE_16( st->element_mode, IVAS_CPE_MDCT ) )
{
st->hTcxEnc->kernel_switch_corr_past = 0.f;
st->hTcxEnc->kernel_type[0] = MDCT_IV;
st->hTcxEnc->kernel_symmetry_past = 0;
st->hTcxEnc->enc_ste_pre_corr_past = 0;
move16();
move16();
move16();
move16();
}
#endif
}
/* Update previous mode */
......
......@@ -250,13 +250,8 @@ void enc_pit_exc_fx(
*----------------------------------------------------------------*/
Copy( &res[i_subfr], &exc[i_subfr], L_subfr ); /* Q_new */
/* condition on target (compared to float) has been put outside the loop */
#if 1 // ndef BUG_FIX
find_targets_fx( speech, hLPDmem->mem_syn, i_subfr, &hLPDmem->mem_w0, p_Aq,
res, L_subfr, p_Aw, st_fx->preemph_fac, xn, cn, h1 );
#else
find_targets_fx( speech, hGSCEnc->mem_syn_tmp_fx, i_subfr, &hLPDmem->mem_w0, p_Aq, /*_DIFF_FLOAT_FIX_ --> Here I think mem_syn_tmp_fx should be used */
res, L_subfr, p_Aw, st_fx->preemph_fac, xn, cn, h1 );
#endif
Copy_Scale_sig( h1, h2, L_subfr, -2 ); /* Q13 */
Scale_sig( h1, L_subfr, add( 1, shift ) ); /* set h1[] in Q14 with scaling for convolution */
......
......@@ -545,7 +545,7 @@ Word16 encod_tran_ivas_fx(
Copy( &res_fx[i_subfr], &exc_fx[i_subfr], L_SUBFR ); /* Q_new */
find_targets_ivas_fx( speech_fx, hLPDmem->mem_syn, i_subfr, &hLPDmem->mem_w0, p_Aq,
find_targets_ivas_new_fx( speech_fx, hLPDmem->mem_syn, i_subfr, &hLPDmem->mem_w0, p_Aq,
res_fx, L_SUBFR, p_Aw, st_fx->preemph_fac, xn, cn, h1 );
q_h1 = sub( 14, norm_s( h1[0] ) );
......@@ -555,6 +555,7 @@ Word16 encod_tran_ivas_fx(
#else
Scale_sig( h1, L_SUBFR, sub( 13, q_h1 ) );
#endif
/* scaling of xn[] to limit dynamic at 12 bits */
Scale_sig( xn, L_SUBFR, shift );
......
......@@ -169,18 +169,6 @@ ivas_error evs_enc_fx(
{
updt_IO_switch_enc_fx( st, input_frame );
set16_fx( hBWE_TD->old_speech_shb_fx, 0, L_LOOK_16k + L_SUBFR16k );
#if defined IVAS_CODE
PMT( "find scaling factor for prev_enr_EnvSHBres, prev_pow_exc16kWhtnd and prev_mix_factor " )
set16_fx( st->hBWE_TD->old_speech_shb, 0, L_LOOK_16k + L_SUBFR16k );
set16_fx( st->hBWE_TD->mem_shb_res, 0, MAX_LEN_MA_FILTER );
set16_fx( st->hBWE_TD->old_EnvSHBres, 0, L_FRAME4k );
st->hBWE_TD->old_mean_EnvSHBres = 0;
st->hBWE_TD->prev_enr_EnvSHBres = 1.0f;
st->hBWE_TD->prev_shb_env_tilt = 0;
st->hBWE_TD->prev_pow_exc16kWhtnd = 1.0f;
st->hBWE_TD->prev_mix_factor = 1.0f;
st->hBWE_TD->prev_Env_error = 0;
#endif
cldfb_reset_memory( st->cldfbAnaEnc );
cldfb_reset_memory( st->cldfbSynTd );
}
......@@ -466,16 +454,6 @@ ivas_error evs_enc_fx(
{
set16_fx( hBWE_TD->old_speech_shb_fx, 0, L_LOOK_16k + L_SUBFR16k );
set16_fx( shb_speech, 0, L_FRAME16k );
#if defined IVAS_CODE
set_f( st->hBWE_TD->mem_shb_res, 0.0f, MAX_LEN_MA_FILTER );
set_f( st->hBWE_TD->old_EnvSHBres, 0.0f, L_FRAME4k );
st->hBWE_TD->old_mean_EnvSHBres = 0.0f;
st->hBWE_TD->prev_enr_EnvSHBres = 1.0f;
st->hBWE_TD->prev_shb_env_tilt = 0.0f;
st->hBWE_TD->prev_pow_exc16kWhtnd = 1.0f;
st->hBWE_TD->prev_mix_factor = 1.0f;
st->hBWE_TD->prev_Env_error = 0.0f;
#endif
}
/* SWB TBE encoder */
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -249,20 +249,6 @@ void hq_hr_enc_fx(
move16();
/* Prepare synthesis for LB generation in case of switch to ACELP */
#ifdef ADD_IVAS_HQ_CODE
IF( NE_16( hqswb_clas, HQ_HVQ ) )
{
apply_envelope_enc( t_audio_q, ynrm, num_sfm, sfm_start, sfm_end );
}
IF( is_transient )
{
de_interleave_spectrum( t_audio_q, length );
}
Copy32( t_audio_q, t_audio, length );
#endif
return;
}
......
This diff is collapsed.
This diff is collapsed.
......@@ -1425,7 +1425,7 @@ ivas_error pre_proc_front_ivas_fx(
* TC frame selection
*-----------------------------------------------------------------*/
st->clas = signal_clas_fx( st, inp_12k8_fx, ee_fx, *relE_fx, L_look, tdm_SM_last_clas ); /* Q0 */
st->clas = signal_clas_ivas_fx( st, inp_12k8_fx, ee_fx, *relE_fx, L_look, tdm_SM_last_clas ); /* Q0 */
move16();
select_TC_fx( MODE1, st->tc_cnt, &st->coder_type, st->localVAD );
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -167,6 +167,8 @@ ivas_error ivas_ism_enc_fx(
*-----------------------------------------------------------------*/
Word16 Q_min = s_min( q_data, add( st->q_inp32, L_norm_arr( st->input32_fx - input_frame, input_frame ) ) );
scale_sig32( st->input32_fx - input_frame, input_frame, sub( Q_min, st->q_inp32 ) );
st->q_old_inp32 = Q_min;
move16();
Copy_Scale_sig32( data[sce_id], st->input32_fx, input_frame, sub( Q_min, q_data ) ); // Q(Q_min)
st->q_inp32 = Q_min;
move16();
......@@ -474,7 +476,9 @@ ivas_error ivas_ism_enc_fx(
Copy( st->input_fx, st->old_input_signal_fx, input_frame ); /* st->q_inp */
st->q_old_inp = st->q_inp;
move16();
Copy32( st->input32_fx, st->input32_fx - input_frame, input_frame ); /* st->q_inp32 */
Copy32( st->input32_fx, st->old_input_signal32_fx, input_frame ); /* st->q_inp32 */
st->q_old_inp32 = st->q_inp32;
move16();
hSCE->last_element_brate = hSCE->element_brate; /* Q0 */
move32();
......
......@@ -484,6 +484,9 @@ ivas_error ivas_mct_enc_fx(
Copy( hCPE->hCoreCoder[n]->input_fx, hCPE->hCoreCoder[n]->old_input_signal_fx, input_frame );
hCPE->hCoreCoder[n]->q_old_inp = hCPE->hCoreCoder[n]->q_inp;
move16();
Copy32( hCPE->hCoreCoder[n]->input32_fx, hCPE->hCoreCoder[n]->old_input_signal32_fx, input_frame );
hCPE->hCoreCoder[n]->q_old_inp32 = hCPE->hCoreCoder[n]->q_inp32;
move16();
/* common encoder updates */
updt_enc_common_ivas_fx( hCPE->hCoreCoder[n], Q_new_out[cpe_id][n] );
......