Loading lib_enc/core_enc_init.c +7 −4 Original line number Diff line number Diff line Loading @@ -853,8 +853,10 @@ static void init_sig_buffers( #ifndef IVAS_FLOAT_FIXED // Need to remove after cleanup of old_inp_12k8 mvr2r( st->old_inp_12k8, st->buf_speech_enc_pe_flt + st->L_frame - L_INP_MEM, L_INP_MEM ); #else Word16 tmp; f2me_buf_16( st->old_inp_12k8, st->buf_speech_enc_pe + st->L_frame - L_INP_MEM, &tmp, L_INP_MEM ); Word16 tmp = st->exp_old_inp_12k8; move16(); Copy( st->old_inp_12k8_fx, st->buf_speech_enc_pe + st->L_frame - L_INP_MEM, L_INP_MEM ); /* SCaling to common exponent*/ Scale_sig( st->buf_speech_enc_pe + st->L_frame - L_INP_MEM, L_INP_MEM, sub( tmp, s_max( tmp, st->exp_buf_speech_enc_pe ) ) ); Scale_sig( st->buf_speech_enc_pe, st->L_frame - L_INP_MEM, sub( st->exp_buf_speech_enc_pe, s_max( tmp, st->exp_buf_speech_enc_pe ) ) ); Loading @@ -870,8 +872,9 @@ static void init_sig_buffers( #ifndef IVAS_FLOAT_FIXED // Need to remove after cleanup of old_inp_12k8 mvr2r( st->old_inp_16k, st->buf_speech_enc_pe_flt + st->L_frame - L_INP_MEM, L_INP_MEM ); #else Word16 tmp; f2me_buf_16( st->old_inp_12k8, st->buf_speech_enc_pe + st->L_frame - L_INP_MEM, &tmp, L_INP_MEM ); Word16 tmp = st->exp_old_inp_12k8; move16(); Copy( st->old_inp_12k8_fx, st->buf_speech_enc_pe + st->L_frame - L_INP_MEM, L_INP_MEM ); /* SCaling to common exponent*/ Scale_sig( st->buf_speech_enc_pe + st->L_frame - L_INP_MEM, L_INP_MEM, sub( tmp, s_max( tmp, st->exp_buf_speech_enc_pe ) ) ); Scale_sig( st->buf_speech_enc_pe, st->L_frame - L_INP_MEM, sub( st->exp_buf_speech_enc_pe, s_max( tmp, st->exp_buf_speech_enc_pe ) ) ); Loading lib_enc/core_enc_switch.c +8 −6 Original line number Diff line number Diff line Loading @@ -197,7 +197,6 @@ void core_coder_mode_switch_ivas_fx( { st->igf = getIgfPresent_fx( st->element_mode, st->total_brate, st->bwidth, st->rf_mode ); move16(); #ifdef IVAS_FLOAT_FIXED_CONVERSIONS IF( hTcxEnc != NULL ) { hTcxEnc->L_frameTCX = extract_l( Mult_32_16( st->input_Fs, 0x0290 ) ); /* 0x0290 is 1/FRAMES_PER_SEC in Q15*/ Loading @@ -205,11 +204,14 @@ void core_coder_mode_switch_ivas_fx( } st->currEnergyHF_fx = 0; move32(); /* Initialize Signal Buffers */ f2me_buf_16( st->old_inp_12k8, st->old_inp_12k8_fx, &st->exp_old_inp_12k8, L_INP_MEM ); f2me_buf_16( st->old_inp_16k, st->old_inp_16k_fx, &st->exp_old_inp_16k, L_INP_MEM ); #endif Word16 shift = getScaleFactor16( st->old_inp_16k_fx, L_INP_MEM ); Scale_sig( st->old_inp_16k_fx, L_INP_MEM, shift ); st->exp_old_inp_16k = sub( st->exp_old_inp_16k, shift ); move16(); shift = getScaleFactor16( st->old_inp_12k8_fx, L_INP_MEM ); Scale_sig( st->old_inp_12k8_fx, L_INP_MEM, shift ); st->exp_old_inp_12k8 = sub( st->exp_old_inp_12k8, shift ); move16(); init_coder_ace_plus_ivas_fx( st, last_total_brate, MCT_flag ); IF( st->hLPDmem != NULL ) { Loading lib_enc/fd_cng_enc.c +20 −11 Original line number Diff line number Diff line Loading @@ -701,9 +701,18 @@ void FdCng_encodeSID_ivas_fx( move32(); FOR( i = 0; i < N; i++ ) { v_fx[i] = Mpy_32_32( 1342177280, BASOP_Util_Log10( L_add_sat( E_fx[i], L_shr( 214748 /* 1e-4f in Q31*/, hFdCngEnc->msNoiseEst_fx_exp ) ), hFdCngEnc->msNoiseEst_fx_exp ) ); // Q21 = 27+25-31 IF( E_fx[i] == 0 ) { /* 10 * log(1e-4) = 10 * (-4) = -40 */ v_fx[i] = -41943040; // -40.0 in Q20 move32(); } ELSE { v_fx[i] = Mpy_32_32( 671088640 /*10 in Q26*/, BASOP_Util_Log10( E_fx[i], hFdCngEnc->msNoiseEst_fx_exp ) ); // Q20 = 26+25-31 move32(); e_fx = L_add( e_fx, v_fx[i] ); // Q21 } e_fx = L_add( e_fx, v_fx[i] ); // Q20 } /* Normalize MSVQ input */ Loading @@ -711,19 +720,19 @@ void FdCng_encodeSID_ivas_fx( move32(); FOR( i = N_GAIN_MIN; i < N_GAIN_MAX; i++ ) { gain_fx = L_add( gain_fx, v_fx[i] ); // Q21 gain_fx = L_add( gain_fx, v_fx[i] ); // Q20 } /*gain /= (float) ( N_GAIN_MAX - N_GAIN_MIN );*/ gain_fx = Mpy_32_32( gain_fx, 165191050 /* 1/13 in Q31*/ ); // Q21 gain_fx = Mpy_32_32( gain_fx, 165191050 /* 1/13 in Q31*/ ); // Q20 FOR( i = 0; i < N; i++ ) { v_fx[i] = L_sub( v_fx[i], gain_fx ); // Q21 v_fx[i] = L_sub( v_fx[i], gain_fx ); // Q20 move32(); } v_e = 10; // Q21 v_e = 11; // Q20 move16(); /* MSVQ encoder */ Loading @@ -740,12 +749,12 @@ void FdCng_encodeSID_ivas_fx( /* truncated DCT21 analysis */ create_IDCT_N_Matrix_fx( invTrfMatrix_fx, N, FDCNG_VQ_DCT_MAXTRUNC, sizeof( tmpRAM_fx ) / ( sizeof( Word32 ) ) ); // Q31 dctT2_N_apply_matrix_fx( v_fx /*Q21*/, dct_target_fx, FDCNG_VQ_DCT_MAXTRUNC, N, invTrfMatrix_fx, FDCNG_VQ_DCT_MAXTRUNC, DCT_T2_21_XX ); // Q21 dctT2_N_apply_matrix_fx( v_fx /*Q20*/, dct_target_fx, FDCNG_VQ_DCT_MAXTRUNC, N, invTrfMatrix_fx, FDCNG_VQ_DCT_MAXTRUNC, DCT_T2_21_XX ); // Q20 /* truncated IDCT21 extension to 24 bands */ extend_dctN_input_fx( v_fx, dct_target_fx, N, tot_sig_ext_fx, FDCNG_VQ_MAX_LEN, invTrfMatrix_fx, FDCNG_VQ_DCT_MAXTRUNC, IDCT_T2_XX_21 ); // Q21 extend_dctN_input_fx( v_fx, dct_target_fx, N, tot_sig_ext_fx, FDCNG_VQ_MAX_LEN, invTrfMatrix_fx, FDCNG_VQ_DCT_MAXTRUNC, IDCT_T2_XX_21 ); // Q20 Copy32( tot_sig_ext_fx, v_fx, FDCNG_VQ_MAX_LEN ); /* write extended result as input to VQ stage #1 */ // Q21 Copy32( tot_sig_ext_fx, v_fx, FDCNG_VQ_MAX_LEN ); /* write extended result as input to VQ stage #1 */ // Q20 } create_IDCT_N_Matrix_fx( invTrfMatrix_fx, FDCNG_VQ_MAX_LEN, FDCNG_VQ_DCT_MAXTRUNC, sizeof( tmpRAM_fx ) / ( sizeof( Word32 ) ) ); // Q31 Loading Loading @@ -773,7 +782,7 @@ void FdCng_encodeSID_ivas_fx( gain_fx = L_add( gain_fx, v_fx[i] ); // Q = 31 - v_e } e_fx = L_shl( e_fx, sub( 10, v_e ) ); // Q = 31 - v_e e_fx = L_shl( e_fx, sub( 11, v_e ) ); // Q = 31 - v_e gain_fx = Mpy_32_16_1( L_sub( e_fx, gain_fx ), div_s( 1, N ) ); // Q = 31 - v_e gain_fx = L_shl( gain_fx, sub( v_e, 8 ) ); // Q23 Loading lib_enc/init_enc.c +21 −13 Original line number Diff line number Diff line Loading @@ -446,9 +446,8 @@ ivas_error init_encoder( st->Bin_E_old = st->hSignalBuf->Bin_E_old; st->mem_decim = st->hSignalBuf->mem_decim_flt; st->mem_decim16k = st->hSignalBuf->mem_decim16k_flt; #endif st->old_inp_12k8 = st->hSignalBuf->old_inp_12k8_flt; st->old_inp_16k = st->hSignalBuf->old_inp_16k_flt; #endif #ifdef IVAS_FLOAT_FIXED st->mem_decim_fx = st->hSignalBuf->mem_decim_fx; st->mem_decim16k_fx = st->hSignalBuf->mem_decim16k_fx; Loading @@ -456,6 +455,7 @@ ivas_error init_encoder( st->old_inp_16k_fx = st->hSignalBuf->old_inp_16k_fx; #endif #ifndef IVAS_FLOAT_FIXED st->old_inp_16k = st->hSignalBuf->old_inp_16k_flt; st->buf_synth_flt = st->hSignalBuf->buf_synth_flt; st->buf_speech_enc_flt = st->hSignalBuf->buf_speech_enc_flt; st->buf_wspeech_enc_flt = st->hSignalBuf->buf_wspeech_enc_flt; Loading @@ -479,12 +479,13 @@ ivas_error init_encoder( set_f( st->Bin_E_old, 0, L_FFT / 2 ); set_f( st->mem_decim, 0, 2 * L_FILT_MAX ); set_f( st->mem_decim16k, 0, 2 * L_FILT_MAX ); #endif set_f( st->old_inp_12k8, 0, L_INP_MEM ); set_f( st->old_inp_16k, 0, L_INP_MEM ); set_f( st->old_inp_12k8, 0, L_INP_MEM ); #endif #ifdef IVAS_FLOAT_FIXED set16_fx( st->old_inp_12k8_fx, 0, L_INP_MEM ); set16_fx( st->old_inp_16k_fx, 0, L_INP_MEM ); st->exp_old_inp_16k = 0; st->input_buff_fx = st->hSignalBuf->input_buff; st->input_buff32_fx = st->hSignalBuf->input_buff32; set32_fx( st->hSignalBuf->input_buff32, 0, L_FRAME48k + L_FRAME48k + NS2SA( 48000, DELAY_FIR_RESAMPL_NS ) ); Loading Loading @@ -533,9 +534,9 @@ ivas_error init_encoder( st->mem_decim_fx = NULL; st->mem_decim16k_fx = NULL; #endif #ifndef IVAS_FLOAT_FIXED st->old_inp_12k8 = NULL; st->old_inp_16k = NULL; #ifndef IVAS_FLOAT_FIXED st->buf_synth_flt = NULL; st->buf_speech_enc_flt = NULL; st->buf_speech_enc = NULL; Loading Loading @@ -1629,6 +1630,10 @@ ivas_error init_encoder_ivas_fx( set16_fx( st->mem_decim16k_fx, 0, shl( L_FILT_MAX, 1 ) ); set16_fx( st->old_inp_12k8_fx, 0, L_INP_MEM ); set16_fx( st->old_inp_16k_fx, 0, L_INP_MEM ); st->exp_old_inp_16k = 0; st->exp_old_inp_12k8 = 0; move16(); move16(); st->input_buff_fx = st->hSignalBuf->input_buff; st->input_buff32_fx = st->hSignalBuf->input_buff32; Loading @@ -1655,16 +1660,14 @@ ivas_error init_encoder_ivas_fx( st->input_fx = st->input_buff_fx + frame_length; } #if 1 // TODO: To be removed later st->old_inp_12k8 = st->hSignalBuf->old_inp_12k8_flt; st->old_inp_16k = st->hSignalBuf->old_inp_16k_flt; #ifndef IVAS_FLOAT_FIXED st->old_inp_12k8 = st->hSignalBuf->old_inp_12k8_flt; st->buf_synth_flt = st->hSignalBuf->buf_synth_flt; st->buf_speech_enc_flt = st->hSignalBuf->buf_speech_enc_flt; st->buf_wspeech_enc_flt = st->hSignalBuf->buf_wspeech_enc_flt; #endif set_f( st->old_inp_12k8, 0, L_INP_MEM ); set_f( st->old_inp_16k, 0, L_INP_MEM ); #ifndef IVAS_FLOAT_FIXED set_f( st->old_inp_12k8, 0, L_INP_MEM ); set_f( st->hSignalBuf->buf_speech_enc_flt, 0, L_PAST_MAX_32k + L_FRAME32k + L_NEXT_MAX_32k ); set_f( st->hSignalBuf->buf_wspeech_enc_flt, 0, L_FRAME16k + L_SUBFR + L_FRAME16k + L_NEXT_MAX_16k + 320 ); #endif Loading @@ -1684,9 +1687,9 @@ ivas_error init_encoder_ivas_fx( st->buf_wspeech_enc = NULL; st->input_buff_fx = NULL; #if 1 #ifndef IVAS_FLOAT_FIXED st->old_inp_12k8 = NULL; st->old_inp_16k = NULL; #ifndef IVAS_FLOAT_FIXED st->buf_synth_flt = NULL; st->buf_speech_enc_flt = NULL; st->buf_wspeech_enc_flt = NULL; Loading Loading @@ -2328,9 +2331,14 @@ ivas_error init_encoder_ivas_fx( #endif /* Initialize Signal Buffers */ f2me_buf_16( st->old_inp_12k8, st->old_inp_12k8_fx, &st->exp_old_inp_12k8, L_INP_MEM ); f2me_buf_16( st->old_inp_16k, st->old_inp_16k_fx, &st->exp_old_inp_16k, L_INP_MEM ); Word16 shift = getScaleFactor16( st->old_inp_16k_fx, L_INP_MEM ); Scale_sig( st->old_inp_16k_fx, L_INP_MEM, shift ); st->exp_old_inp_16k = sub( st->exp_old_inp_16k, shift ); move16(); shift = getScaleFactor16( st->old_inp_12k8_fx, L_INP_MEM ); Scale_sig( st->old_inp_12k8_fx, L_INP_MEM, shift ); st->exp_old_inp_12k8 = sub( st->exp_old_inp_12k8, shift ); move16(); /* Initialize ACELP */ #endif init_coder_ace_plus_ivas_fx( st, st->last_total_brate, 0 ); Loading lib_enc/ivas_core_pre_proc.c +8 −7 Original line number Diff line number Diff line Loading @@ -542,8 +542,14 @@ ivas_error pre_proc_ivas( Word16 Q_old_inp_16k = -1; Word16 Q_r[2] = { 0 }; inp_16k_fx = old_inp_16k_fx + L_INP_MEM - L_look; f2me_buf_16( st->old_inp_12k8, st->old_inp_12k8_fx, &st->exp_old_inp_12k8, 240 ); floatToFixed_arr16( st->old_inp_16k, st->old_inp_16k_fx, Q_old_inp_16k, L_INP_MEM ); Word16 shift = getScaleFactor16( st->old_inp_12k8_fx, 240 ); Scale_sig( st->old_inp_12k8_fx, 240, shift ); st->exp_old_inp_12k8 = sub( st->exp_old_inp_12k8, shift ); move16(); Scale_sig( st->old_inp_16k_fx, L_INP_MEM, sub( Q_old_inp_16k, sub( Q15, Q_old_inp_16k ) ) ); st->exp_old_inp_16k = sub( Q15, Q_old_inp_16k ); if ( st->hBWE_FD != NULL ) { Scale_sig( st->hBWE_FD->L_old_wtda_swb_fx, L_FRAME48k, sub( -1, st->Q_old_wtda ) ); Loading Loading @@ -621,11 +627,6 @@ ivas_error pre_proc_ivas( st->exp_buf_speech_enc_pe = sub( Q15, *Q_new - 1 ); move16(); #ifdef IVAS_FLOAT_FIXED_CONVERSIONS // No need to do fixed to float for signal_in_fx fixedToFloat_arr( st->old_inp_16k_fx, st->old_inp_16k, *Q_new - 1, L_INP_MEM ); #endif /* set the pointer of the current frame for the ACELP core */ IF( EQ_16( st->L_frame, L_FRAME ) ) { Loading Loading
lib_enc/core_enc_init.c +7 −4 Original line number Diff line number Diff line Loading @@ -853,8 +853,10 @@ static void init_sig_buffers( #ifndef IVAS_FLOAT_FIXED // Need to remove after cleanup of old_inp_12k8 mvr2r( st->old_inp_12k8, st->buf_speech_enc_pe_flt + st->L_frame - L_INP_MEM, L_INP_MEM ); #else Word16 tmp; f2me_buf_16( st->old_inp_12k8, st->buf_speech_enc_pe + st->L_frame - L_INP_MEM, &tmp, L_INP_MEM ); Word16 tmp = st->exp_old_inp_12k8; move16(); Copy( st->old_inp_12k8_fx, st->buf_speech_enc_pe + st->L_frame - L_INP_MEM, L_INP_MEM ); /* SCaling to common exponent*/ Scale_sig( st->buf_speech_enc_pe + st->L_frame - L_INP_MEM, L_INP_MEM, sub( tmp, s_max( tmp, st->exp_buf_speech_enc_pe ) ) ); Scale_sig( st->buf_speech_enc_pe, st->L_frame - L_INP_MEM, sub( st->exp_buf_speech_enc_pe, s_max( tmp, st->exp_buf_speech_enc_pe ) ) ); Loading @@ -870,8 +872,9 @@ static void init_sig_buffers( #ifndef IVAS_FLOAT_FIXED // Need to remove after cleanup of old_inp_12k8 mvr2r( st->old_inp_16k, st->buf_speech_enc_pe_flt + st->L_frame - L_INP_MEM, L_INP_MEM ); #else Word16 tmp; f2me_buf_16( st->old_inp_12k8, st->buf_speech_enc_pe + st->L_frame - L_INP_MEM, &tmp, L_INP_MEM ); Word16 tmp = st->exp_old_inp_12k8; move16(); Copy( st->old_inp_12k8_fx, st->buf_speech_enc_pe + st->L_frame - L_INP_MEM, L_INP_MEM ); /* SCaling to common exponent*/ Scale_sig( st->buf_speech_enc_pe + st->L_frame - L_INP_MEM, L_INP_MEM, sub( tmp, s_max( tmp, st->exp_buf_speech_enc_pe ) ) ); Scale_sig( st->buf_speech_enc_pe, st->L_frame - L_INP_MEM, sub( st->exp_buf_speech_enc_pe, s_max( tmp, st->exp_buf_speech_enc_pe ) ) ); Loading
lib_enc/core_enc_switch.c +8 −6 Original line number Diff line number Diff line Loading @@ -197,7 +197,6 @@ void core_coder_mode_switch_ivas_fx( { st->igf = getIgfPresent_fx( st->element_mode, st->total_brate, st->bwidth, st->rf_mode ); move16(); #ifdef IVAS_FLOAT_FIXED_CONVERSIONS IF( hTcxEnc != NULL ) { hTcxEnc->L_frameTCX = extract_l( Mult_32_16( st->input_Fs, 0x0290 ) ); /* 0x0290 is 1/FRAMES_PER_SEC in Q15*/ Loading @@ -205,11 +204,14 @@ void core_coder_mode_switch_ivas_fx( } st->currEnergyHF_fx = 0; move32(); /* Initialize Signal Buffers */ f2me_buf_16( st->old_inp_12k8, st->old_inp_12k8_fx, &st->exp_old_inp_12k8, L_INP_MEM ); f2me_buf_16( st->old_inp_16k, st->old_inp_16k_fx, &st->exp_old_inp_16k, L_INP_MEM ); #endif Word16 shift = getScaleFactor16( st->old_inp_16k_fx, L_INP_MEM ); Scale_sig( st->old_inp_16k_fx, L_INP_MEM, shift ); st->exp_old_inp_16k = sub( st->exp_old_inp_16k, shift ); move16(); shift = getScaleFactor16( st->old_inp_12k8_fx, L_INP_MEM ); Scale_sig( st->old_inp_12k8_fx, L_INP_MEM, shift ); st->exp_old_inp_12k8 = sub( st->exp_old_inp_12k8, shift ); move16(); init_coder_ace_plus_ivas_fx( st, last_total_brate, MCT_flag ); IF( st->hLPDmem != NULL ) { Loading
lib_enc/fd_cng_enc.c +20 −11 Original line number Diff line number Diff line Loading @@ -701,9 +701,18 @@ void FdCng_encodeSID_ivas_fx( move32(); FOR( i = 0; i < N; i++ ) { v_fx[i] = Mpy_32_32( 1342177280, BASOP_Util_Log10( L_add_sat( E_fx[i], L_shr( 214748 /* 1e-4f in Q31*/, hFdCngEnc->msNoiseEst_fx_exp ) ), hFdCngEnc->msNoiseEst_fx_exp ) ); // Q21 = 27+25-31 IF( E_fx[i] == 0 ) { /* 10 * log(1e-4) = 10 * (-4) = -40 */ v_fx[i] = -41943040; // -40.0 in Q20 move32(); } ELSE { v_fx[i] = Mpy_32_32( 671088640 /*10 in Q26*/, BASOP_Util_Log10( E_fx[i], hFdCngEnc->msNoiseEst_fx_exp ) ); // Q20 = 26+25-31 move32(); e_fx = L_add( e_fx, v_fx[i] ); // Q21 } e_fx = L_add( e_fx, v_fx[i] ); // Q20 } /* Normalize MSVQ input */ Loading @@ -711,19 +720,19 @@ void FdCng_encodeSID_ivas_fx( move32(); FOR( i = N_GAIN_MIN; i < N_GAIN_MAX; i++ ) { gain_fx = L_add( gain_fx, v_fx[i] ); // Q21 gain_fx = L_add( gain_fx, v_fx[i] ); // Q20 } /*gain /= (float) ( N_GAIN_MAX - N_GAIN_MIN );*/ gain_fx = Mpy_32_32( gain_fx, 165191050 /* 1/13 in Q31*/ ); // Q21 gain_fx = Mpy_32_32( gain_fx, 165191050 /* 1/13 in Q31*/ ); // Q20 FOR( i = 0; i < N; i++ ) { v_fx[i] = L_sub( v_fx[i], gain_fx ); // Q21 v_fx[i] = L_sub( v_fx[i], gain_fx ); // Q20 move32(); } v_e = 10; // Q21 v_e = 11; // Q20 move16(); /* MSVQ encoder */ Loading @@ -740,12 +749,12 @@ void FdCng_encodeSID_ivas_fx( /* truncated DCT21 analysis */ create_IDCT_N_Matrix_fx( invTrfMatrix_fx, N, FDCNG_VQ_DCT_MAXTRUNC, sizeof( tmpRAM_fx ) / ( sizeof( Word32 ) ) ); // Q31 dctT2_N_apply_matrix_fx( v_fx /*Q21*/, dct_target_fx, FDCNG_VQ_DCT_MAXTRUNC, N, invTrfMatrix_fx, FDCNG_VQ_DCT_MAXTRUNC, DCT_T2_21_XX ); // Q21 dctT2_N_apply_matrix_fx( v_fx /*Q20*/, dct_target_fx, FDCNG_VQ_DCT_MAXTRUNC, N, invTrfMatrix_fx, FDCNG_VQ_DCT_MAXTRUNC, DCT_T2_21_XX ); // Q20 /* truncated IDCT21 extension to 24 bands */ extend_dctN_input_fx( v_fx, dct_target_fx, N, tot_sig_ext_fx, FDCNG_VQ_MAX_LEN, invTrfMatrix_fx, FDCNG_VQ_DCT_MAXTRUNC, IDCT_T2_XX_21 ); // Q21 extend_dctN_input_fx( v_fx, dct_target_fx, N, tot_sig_ext_fx, FDCNG_VQ_MAX_LEN, invTrfMatrix_fx, FDCNG_VQ_DCT_MAXTRUNC, IDCT_T2_XX_21 ); // Q20 Copy32( tot_sig_ext_fx, v_fx, FDCNG_VQ_MAX_LEN ); /* write extended result as input to VQ stage #1 */ // Q21 Copy32( tot_sig_ext_fx, v_fx, FDCNG_VQ_MAX_LEN ); /* write extended result as input to VQ stage #1 */ // Q20 } create_IDCT_N_Matrix_fx( invTrfMatrix_fx, FDCNG_VQ_MAX_LEN, FDCNG_VQ_DCT_MAXTRUNC, sizeof( tmpRAM_fx ) / ( sizeof( Word32 ) ) ); // Q31 Loading Loading @@ -773,7 +782,7 @@ void FdCng_encodeSID_ivas_fx( gain_fx = L_add( gain_fx, v_fx[i] ); // Q = 31 - v_e } e_fx = L_shl( e_fx, sub( 10, v_e ) ); // Q = 31 - v_e e_fx = L_shl( e_fx, sub( 11, v_e ) ); // Q = 31 - v_e gain_fx = Mpy_32_16_1( L_sub( e_fx, gain_fx ), div_s( 1, N ) ); // Q = 31 - v_e gain_fx = L_shl( gain_fx, sub( v_e, 8 ) ); // Q23 Loading
lib_enc/init_enc.c +21 −13 Original line number Diff line number Diff line Loading @@ -446,9 +446,8 @@ ivas_error init_encoder( st->Bin_E_old = st->hSignalBuf->Bin_E_old; st->mem_decim = st->hSignalBuf->mem_decim_flt; st->mem_decim16k = st->hSignalBuf->mem_decim16k_flt; #endif st->old_inp_12k8 = st->hSignalBuf->old_inp_12k8_flt; st->old_inp_16k = st->hSignalBuf->old_inp_16k_flt; #endif #ifdef IVAS_FLOAT_FIXED st->mem_decim_fx = st->hSignalBuf->mem_decim_fx; st->mem_decim16k_fx = st->hSignalBuf->mem_decim16k_fx; Loading @@ -456,6 +455,7 @@ ivas_error init_encoder( st->old_inp_16k_fx = st->hSignalBuf->old_inp_16k_fx; #endif #ifndef IVAS_FLOAT_FIXED st->old_inp_16k = st->hSignalBuf->old_inp_16k_flt; st->buf_synth_flt = st->hSignalBuf->buf_synth_flt; st->buf_speech_enc_flt = st->hSignalBuf->buf_speech_enc_flt; st->buf_wspeech_enc_flt = st->hSignalBuf->buf_wspeech_enc_flt; Loading @@ -479,12 +479,13 @@ ivas_error init_encoder( set_f( st->Bin_E_old, 0, L_FFT / 2 ); set_f( st->mem_decim, 0, 2 * L_FILT_MAX ); set_f( st->mem_decim16k, 0, 2 * L_FILT_MAX ); #endif set_f( st->old_inp_12k8, 0, L_INP_MEM ); set_f( st->old_inp_16k, 0, L_INP_MEM ); set_f( st->old_inp_12k8, 0, L_INP_MEM ); #endif #ifdef IVAS_FLOAT_FIXED set16_fx( st->old_inp_12k8_fx, 0, L_INP_MEM ); set16_fx( st->old_inp_16k_fx, 0, L_INP_MEM ); st->exp_old_inp_16k = 0; st->input_buff_fx = st->hSignalBuf->input_buff; st->input_buff32_fx = st->hSignalBuf->input_buff32; set32_fx( st->hSignalBuf->input_buff32, 0, L_FRAME48k + L_FRAME48k + NS2SA( 48000, DELAY_FIR_RESAMPL_NS ) ); Loading Loading @@ -533,9 +534,9 @@ ivas_error init_encoder( st->mem_decim_fx = NULL; st->mem_decim16k_fx = NULL; #endif #ifndef IVAS_FLOAT_FIXED st->old_inp_12k8 = NULL; st->old_inp_16k = NULL; #ifndef IVAS_FLOAT_FIXED st->buf_synth_flt = NULL; st->buf_speech_enc_flt = NULL; st->buf_speech_enc = NULL; Loading Loading @@ -1629,6 +1630,10 @@ ivas_error init_encoder_ivas_fx( set16_fx( st->mem_decim16k_fx, 0, shl( L_FILT_MAX, 1 ) ); set16_fx( st->old_inp_12k8_fx, 0, L_INP_MEM ); set16_fx( st->old_inp_16k_fx, 0, L_INP_MEM ); st->exp_old_inp_16k = 0; st->exp_old_inp_12k8 = 0; move16(); move16(); st->input_buff_fx = st->hSignalBuf->input_buff; st->input_buff32_fx = st->hSignalBuf->input_buff32; Loading @@ -1655,16 +1660,14 @@ ivas_error init_encoder_ivas_fx( st->input_fx = st->input_buff_fx + frame_length; } #if 1 // TODO: To be removed later st->old_inp_12k8 = st->hSignalBuf->old_inp_12k8_flt; st->old_inp_16k = st->hSignalBuf->old_inp_16k_flt; #ifndef IVAS_FLOAT_FIXED st->old_inp_12k8 = st->hSignalBuf->old_inp_12k8_flt; st->buf_synth_flt = st->hSignalBuf->buf_synth_flt; st->buf_speech_enc_flt = st->hSignalBuf->buf_speech_enc_flt; st->buf_wspeech_enc_flt = st->hSignalBuf->buf_wspeech_enc_flt; #endif set_f( st->old_inp_12k8, 0, L_INP_MEM ); set_f( st->old_inp_16k, 0, L_INP_MEM ); #ifndef IVAS_FLOAT_FIXED set_f( st->old_inp_12k8, 0, L_INP_MEM ); set_f( st->hSignalBuf->buf_speech_enc_flt, 0, L_PAST_MAX_32k + L_FRAME32k + L_NEXT_MAX_32k ); set_f( st->hSignalBuf->buf_wspeech_enc_flt, 0, L_FRAME16k + L_SUBFR + L_FRAME16k + L_NEXT_MAX_16k + 320 ); #endif Loading @@ -1684,9 +1687,9 @@ ivas_error init_encoder_ivas_fx( st->buf_wspeech_enc = NULL; st->input_buff_fx = NULL; #if 1 #ifndef IVAS_FLOAT_FIXED st->old_inp_12k8 = NULL; st->old_inp_16k = NULL; #ifndef IVAS_FLOAT_FIXED st->buf_synth_flt = NULL; st->buf_speech_enc_flt = NULL; st->buf_wspeech_enc_flt = NULL; Loading Loading @@ -2328,9 +2331,14 @@ ivas_error init_encoder_ivas_fx( #endif /* Initialize Signal Buffers */ f2me_buf_16( st->old_inp_12k8, st->old_inp_12k8_fx, &st->exp_old_inp_12k8, L_INP_MEM ); f2me_buf_16( st->old_inp_16k, st->old_inp_16k_fx, &st->exp_old_inp_16k, L_INP_MEM ); Word16 shift = getScaleFactor16( st->old_inp_16k_fx, L_INP_MEM ); Scale_sig( st->old_inp_16k_fx, L_INP_MEM, shift ); st->exp_old_inp_16k = sub( st->exp_old_inp_16k, shift ); move16(); shift = getScaleFactor16( st->old_inp_12k8_fx, L_INP_MEM ); Scale_sig( st->old_inp_12k8_fx, L_INP_MEM, shift ); st->exp_old_inp_12k8 = sub( st->exp_old_inp_12k8, shift ); move16(); /* Initialize ACELP */ #endif init_coder_ace_plus_ivas_fx( st, st->last_total_brate, 0 ); Loading
lib_enc/ivas_core_pre_proc.c +8 −7 Original line number Diff line number Diff line Loading @@ -542,8 +542,14 @@ ivas_error pre_proc_ivas( Word16 Q_old_inp_16k = -1; Word16 Q_r[2] = { 0 }; inp_16k_fx = old_inp_16k_fx + L_INP_MEM - L_look; f2me_buf_16( st->old_inp_12k8, st->old_inp_12k8_fx, &st->exp_old_inp_12k8, 240 ); floatToFixed_arr16( st->old_inp_16k, st->old_inp_16k_fx, Q_old_inp_16k, L_INP_MEM ); Word16 shift = getScaleFactor16( st->old_inp_12k8_fx, 240 ); Scale_sig( st->old_inp_12k8_fx, 240, shift ); st->exp_old_inp_12k8 = sub( st->exp_old_inp_12k8, shift ); move16(); Scale_sig( st->old_inp_16k_fx, L_INP_MEM, sub( Q_old_inp_16k, sub( Q15, Q_old_inp_16k ) ) ); st->exp_old_inp_16k = sub( Q15, Q_old_inp_16k ); if ( st->hBWE_FD != NULL ) { Scale_sig( st->hBWE_FD->L_old_wtda_swb_fx, L_FRAME48k, sub( -1, st->Q_old_wtda ) ); Loading Loading @@ -621,11 +627,6 @@ ivas_error pre_proc_ivas( st->exp_buf_speech_enc_pe = sub( Q15, *Q_new - 1 ); move16(); #ifdef IVAS_FLOAT_FIXED_CONVERSIONS // No need to do fixed to float for signal_in_fx fixedToFloat_arr( st->old_inp_16k_fx, st->old_inp_16k, *Q_new - 1, L_INP_MEM ); #endif /* set the pointer of the current frame for the ACELP core */ IF( EQ_16( st->L_frame, L_FRAME ) ) { Loading