Loading lib_com/ivas_prot_fx.h +14 −2 Original line number Diff line number Diff line Loading @@ -5856,7 +5856,11 @@ ivas_error ivas_mct_enc_fx( const Word16 nb_bits_metadata /* i : number of metadata bits */ ); #ifdef FIX_2344_ALIGN_PREPROC void ivas_compute_core_buffers_fx( #else ivas_error ivas_compute_core_buffers_fx( #endif Encoder_State *st, /* i/o: encoder state structure */ Word16 **inp16k_out_fx, /* o : ptr. to inp. signal in the current frame */ Word16 *old_inp_16k_fx, /* i/o: buffer of old input signal @ 16kHz */ Loading @@ -5871,7 +5875,7 @@ ivas_error ivas_compute_core_buffers_fx( Word16 lsp_new_fx[M], /* i/o: LSPs at the end of the frame */ Word16 lsp_mid_fx[M], /* i/o: LSPs in the middle of the frame */ const Word16 Q_old_inp_16k, const Word16 Q_r[2], Word16 Q_r[2], Word16 *Q_new ); Loading Loading @@ -5961,7 +5965,11 @@ void ivas_mct_enc_close_fx( MCT_ENC_HANDLE *hMCT /* i/o: MCT encoder structure */ ); #ifdef FIX_2344_ALIGN_PREPROC void pre_proc_front_ivas_fx( #else ivas_error pre_proc_front_ivas_fx( #endif SCE_ENC_HANDLE hSCE, /* i/o: SCE encoder structure */ CPE_ENC_HANDLE hCPE, /* i/o: CPE encoder structure */ const Word32 element_brate, /* i : SCE/CPE element bitrate Q0*/ Loading Loading @@ -6017,7 +6025,11 @@ ivas_error pre_proc_front_ivas_fx( Word16 *Q_new /* i/o : Q factor of speech buffers */ ); #ifdef FIX_2344_ALIGN_PREPROC void pre_proc_ivas_fx( #else ivas_error pre_proc_ivas_fx( #endif Encoder_State *st, /* i/o: encoder state structure */ const Word16 last_element_mode, /* i : last element mode Q0*/ const Word32 element_brate, /* i : element bitrate Q0*/ Loading lib_enc/ivas_core_enc_fx.c +3 −7 Original line number Diff line number Diff line Loading @@ -240,13 +240,9 @@ ivas_error ivas_core_enc_fx( move32(); } IF( NE_32( ( error = pre_proc_ivas_fx( st, last_element_mode, element_brate, last_element_brate_tmp, input_frame, old_inp_12k8_fx[n] /* i: -1, o: Q_new - 1 */, old_inp_16k_fx[n] /* i: -1, o: Q_new - 1 */, pre_proc_ivas_fx( st, last_element_mode, element_brate, last_element_brate_tmp, input_frame, old_inp_12k8_fx[n] /* i: -1, o: Q_new - 1 */, old_inp_16k_fx[n] /* i: -1, o: Q_new - 1 */, &inp_fx[n], &ener_fx[n], A_fx[n], Aw_fx[n], epsP_fx[n], &epsP_fx_q[n], lsp_new_fx[n], lsp_mid_fx[n], new_inp_resamp16k_fx[n], &Voicing_flag[n], old_wsp_fx[n], e_old_wsp[n], loc_harm[n], vad_flag_dtx[n], MCT_flag, vad_hover_flag[n], flag_16k_smc, enerBuffer_fx[n], enerBuffer_fx_exp[n], fft_buff_fx[n], cor_map_sum_fx[n], &Q_new[n] ) ), IVAS_ERR_OK ) ) { return error; } vad_flag_dtx[n], MCT_flag, vad_hover_flag[n], flag_16k_smc, enerBuffer_fx[n], enerBuffer_fx_exp[n], fft_buff_fx[n], cor_map_sum_fx[n], &Q_new[n] ); #else IF( EQ_32( ivas_format, SBA_FORMAT ) ) { Loading lib_enc/ivas_core_pre_proc_front_fx.c +12 −0 Original line number Diff line number Diff line Loading @@ -76,7 +76,11 @@ static Word16 get_zero_flag( const Word32 arr[], const Word16 len ) * (resampling, spectral analysis, LP analysis, VAD, OL pitch calculation, classification) *--------------------------------------------------------------------*/ #ifdef FIX_2344_ALIGN_PREPROC void pre_proc_front_ivas_fx( #else ivas_error pre_proc_front_ivas_fx( #endif SCE_ENC_HANDLE hSCE, /* i/o: SCE encoder structure */ CPE_ENC_HANDLE hCPE, /* i/o: CPE encoder structure */ const Word32 element_brate, /* i : SCE/CPE element bitrate Q0*/ Loading Loading @@ -1476,11 +1480,15 @@ ivas_error pre_proc_front_ivas_fx( move16(); /* Compute core-coder buffers at internal sampling rate */ #ifdef FIX_2344_ALIGN_PREPROC ivas_compute_core_buffers_fx( st, NULL, old_inp_16k_fx, NULL, input_frame, IVAS_SCE /*last_element_mode*/, INT_FS_16k /*sr_core_tmp*/, ener_fx, A_fx, Aw_fx, epsP_fx, lsp_new_fx, lsp_mid_fx, Q_old_inp_16k, Q_r, Q_new ); #else error = ivas_compute_core_buffers_fx( st, NULL, old_inp_16k_fx, NULL, input_frame, IVAS_SCE /*last_element_mode*/, INT_FS_16k /*sr_core_tmp*/, ener_fx, A_fx, Aw_fx, epsP_fx, lsp_new_fx, lsp_mid_fx, Q_old_inp_16k, Q_r, Q_new ); IF( NE_32( error, IVAS_ERR_OK ) ) { return error; } #endif *epsP_fx_q = add( Q_r[0], 1 ); move16(); Loading Loading @@ -1571,7 +1579,11 @@ ivas_error pre_proc_front_ivas_fx( free( temp1F_icatdmResampBuf_fx ); #endif pop_wmops(); #ifdef FIX_2344_ALIGN_PREPROC return; #else return error; #endif } Loading lib_enc/ivas_core_pre_proc_fx.c +29 −11 Original line number Diff line number Diff line Loading @@ -46,7 +46,11 @@ * Decision matrix, Preprocessing at other Fs, core switching decision, ...) *--------------------------------------------------------------------*/ #ifdef FIX_2344_ALIGN_PREPROC void pre_proc_ivas_fx( #else ivas_error pre_proc_ivas_fx( #endif Encoder_State *st, /* i/o: encoder state structure */ const Word16 last_element_mode, /* i : last element mode Q0*/ const Word32 element_brate, /* i : element bitrate Q0*/ Loading Loading @@ -82,13 +86,16 @@ ivas_error pre_proc_ivas_fx( Word16 *inp_16k_fx, *new_inp_12k8_fx, *inp_12k8_fx; /* pointers to current frame and new data */ Word16 *wsp_fx; /* weighted input signal buffer */ Word32 sr_core_tmp, total_brate_tmp; #ifndef FIX_2344_ALIGN_PREPROC ivas_error error; #endif push_wmops( "pre_proc" ); #ifndef FIX_2344_ALIGN_PREPROC error = IVAS_ERR_OK; move32(); #endif /*----------------------------------------------------------------* * Initialization *----------------------------------------------------------------*/ Loading Loading @@ -607,13 +614,14 @@ ivas_error pre_proc_ivas_fx( Word16 Q_inp_12k8 = *Q_new; move16(); Word16 Q_inp_16k; #endif error = ivas_compute_core_buffers_fx( st, &inp_16k_fx, old_inp_16k_fx, new_inp_resamp16k_fx, input_frame, last_element_mode, sr_core_tmp, ener_fx, A_fx, Aw_fx, epsP_fx, lsp_new_fx, lsp_mid_fx, Q_old_inp_16k, Q_r, &Q_inp_16k ); #ifdef FIX_2344_ALIGN_PREPROC IF( error != IVAS_ERR_OK ) { return error; } ivas_compute_core_buffers_fx( st, &inp_16k_fx, old_inp_16k_fx, new_inp_resamp16k_fx, input_frame, last_element_mode, sr_core_tmp, ener_fx, A_fx, Aw_fx, epsP_fx, lsp_new_fx, lsp_mid_fx, Q_old_inp_16k, Q_r, &Q_inp_16k ); #else error = ivas_compute_core_buffers_fx( st, &inp_16k_fx, old_inp_16k_fx, new_inp_resamp16k_fx, input_frame, last_element_mode, sr_core_tmp, ener_fx, A_fx, Aw_fx, epsP_fx, lsp_new_fx, lsp_mid_fx, Q_old_inp_16k, Q_r, &Q_inp_16k ); #endif IF( GT_16( Q_inp_16k, Q_inp_12k8 ) ) Loading Loading @@ -719,7 +727,11 @@ ivas_error pre_proc_ivas_fx( } pop_wmops(); #ifdef FIX_2344_ALIGN_PREPROC return; #else return error; #endif } Loading @@ -729,7 +741,11 @@ ivas_error pre_proc_ivas_fx( * Compute core-coder buffers at internal sampling rate *--------------------------------------------------------------------*/ #ifdef FIX_2344_ALIGN_PREPROC void ivas_compute_core_buffers_fx( #else ivas_error ivas_compute_core_buffers_fx( #endif Encoder_State *st, /* i/o: encoder state structure */ Word16 **inp16k_out_fx, /* o : ptr. to inp. signal in the current frame Q_new-1*/ Word16 *old_inp_16k_fx, /* i/o: buffer of old input signal @ 16kHz Q_new-1*/ Loading @@ -744,7 +760,7 @@ ivas_error ivas_compute_core_buffers_fx( Word16 lsp_new_fx[M], /* i/o: LSPs at the end of the frame Q15*/ Word16 lsp_mid_fx[M], /* i/o: LSPs in the middle of the frame Q15*/ const Word16 Q_old_inp_16k, const Word16 Q_r[2], Word16 Q_r[2], Word16 *Q_new ) { Word16 *inp_16k_fx, *new_inp_16k_fx; Loading Loading @@ -1292,6 +1308,8 @@ ivas_error ivas_compute_core_buffers_fx( move32(); } } #endif return IVAS_ERR_OK; #else return; #endif } lib_enc/ivas_cpe_enc_fx.c +12 −5 Original line number Diff line number Diff line Loading @@ -918,16 +918,23 @@ ivas_error ivas_cpe_enc_fx( { front_vad_flag = 0; } move16(); error = pre_proc_front_ivas_fx( NULL, hCPE, hCPE->element_brate, nb_bits_metadata, input_frame, n, old_inp_12k8_16fx[n], old_inp_16k_16fx[n], #ifndef FIX_2344_ALIGN_PREPROC error = #endif pre_proc_front_ivas_fx( NULL, hCPE, hCPE->element_brate, nb_bits_metadata, input_frame, n, old_inp_12k8_16fx[n], old_inp_16k_16fx[n], &ener_fx[n], &relE_fx[n], A_fx[n], Aw_fx[n], epsP_fx[n], &epsP_fx_q[n], lsp_new_fx[n], lsp_mid_fx[n], &vad_hover_flag[n], &attack_flag[n], realBuffer_fx[n], imagBuffer_fx[n], &q_re_im_buf[n], old_wsp_fx[n], &q_old_wsp, pitch_fr_fx[n], voicing_fr_fx[n], &loc_harm[n], &cor_map_sum_fx[n], &vad_flag_dtx[n], enerBuffer_fx[n], &enerBuffer_fx_exp[n], fft_buff_fx[n], &fft_buff_fx_q[n], A_fx[0], lsp_new_fx[0], currFlatness_fx[n], tdm_ratio_idx, fr_bands_fx, q_fr_bands, Etot_LR_fx, lf_E_fx, q_lf_E[n], localVAD_HE_SAD, band_energies_LR_fx, q_band_energies_LR, 0, front_vad_flag, 0, 0, ivas_format, st_ivas->hMCT != NULL, st_ivas->hEncoderConfig->last_ivas_total_brate, ivas_total_brate, &Q_new[n] ); #ifndef FIX_2344_ALIGN_PREPROC IF( error != IVAS_ERR_OK ) { return error; } #endif e_old_wsp[n] = sub( Q15, q_old_wsp ); move16(); } Loading Loading
lib_com/ivas_prot_fx.h +14 −2 Original line number Diff line number Diff line Loading @@ -5856,7 +5856,11 @@ ivas_error ivas_mct_enc_fx( const Word16 nb_bits_metadata /* i : number of metadata bits */ ); #ifdef FIX_2344_ALIGN_PREPROC void ivas_compute_core_buffers_fx( #else ivas_error ivas_compute_core_buffers_fx( #endif Encoder_State *st, /* i/o: encoder state structure */ Word16 **inp16k_out_fx, /* o : ptr. to inp. signal in the current frame */ Word16 *old_inp_16k_fx, /* i/o: buffer of old input signal @ 16kHz */ Loading @@ -5871,7 +5875,7 @@ ivas_error ivas_compute_core_buffers_fx( Word16 lsp_new_fx[M], /* i/o: LSPs at the end of the frame */ Word16 lsp_mid_fx[M], /* i/o: LSPs in the middle of the frame */ const Word16 Q_old_inp_16k, const Word16 Q_r[2], Word16 Q_r[2], Word16 *Q_new ); Loading Loading @@ -5961,7 +5965,11 @@ void ivas_mct_enc_close_fx( MCT_ENC_HANDLE *hMCT /* i/o: MCT encoder structure */ ); #ifdef FIX_2344_ALIGN_PREPROC void pre_proc_front_ivas_fx( #else ivas_error pre_proc_front_ivas_fx( #endif SCE_ENC_HANDLE hSCE, /* i/o: SCE encoder structure */ CPE_ENC_HANDLE hCPE, /* i/o: CPE encoder structure */ const Word32 element_brate, /* i : SCE/CPE element bitrate Q0*/ Loading Loading @@ -6017,7 +6025,11 @@ ivas_error pre_proc_front_ivas_fx( Word16 *Q_new /* i/o : Q factor of speech buffers */ ); #ifdef FIX_2344_ALIGN_PREPROC void pre_proc_ivas_fx( #else ivas_error pre_proc_ivas_fx( #endif Encoder_State *st, /* i/o: encoder state structure */ const Word16 last_element_mode, /* i : last element mode Q0*/ const Word32 element_brate, /* i : element bitrate Q0*/ Loading
lib_enc/ivas_core_enc_fx.c +3 −7 Original line number Diff line number Diff line Loading @@ -240,13 +240,9 @@ ivas_error ivas_core_enc_fx( move32(); } IF( NE_32( ( error = pre_proc_ivas_fx( st, last_element_mode, element_brate, last_element_brate_tmp, input_frame, old_inp_12k8_fx[n] /* i: -1, o: Q_new - 1 */, old_inp_16k_fx[n] /* i: -1, o: Q_new - 1 */, pre_proc_ivas_fx( st, last_element_mode, element_brate, last_element_brate_tmp, input_frame, old_inp_12k8_fx[n] /* i: -1, o: Q_new - 1 */, old_inp_16k_fx[n] /* i: -1, o: Q_new - 1 */, &inp_fx[n], &ener_fx[n], A_fx[n], Aw_fx[n], epsP_fx[n], &epsP_fx_q[n], lsp_new_fx[n], lsp_mid_fx[n], new_inp_resamp16k_fx[n], &Voicing_flag[n], old_wsp_fx[n], e_old_wsp[n], loc_harm[n], vad_flag_dtx[n], MCT_flag, vad_hover_flag[n], flag_16k_smc, enerBuffer_fx[n], enerBuffer_fx_exp[n], fft_buff_fx[n], cor_map_sum_fx[n], &Q_new[n] ) ), IVAS_ERR_OK ) ) { return error; } vad_flag_dtx[n], MCT_flag, vad_hover_flag[n], flag_16k_smc, enerBuffer_fx[n], enerBuffer_fx_exp[n], fft_buff_fx[n], cor_map_sum_fx[n], &Q_new[n] ); #else IF( EQ_32( ivas_format, SBA_FORMAT ) ) { Loading
lib_enc/ivas_core_pre_proc_front_fx.c +12 −0 Original line number Diff line number Diff line Loading @@ -76,7 +76,11 @@ static Word16 get_zero_flag( const Word32 arr[], const Word16 len ) * (resampling, spectral analysis, LP analysis, VAD, OL pitch calculation, classification) *--------------------------------------------------------------------*/ #ifdef FIX_2344_ALIGN_PREPROC void pre_proc_front_ivas_fx( #else ivas_error pre_proc_front_ivas_fx( #endif SCE_ENC_HANDLE hSCE, /* i/o: SCE encoder structure */ CPE_ENC_HANDLE hCPE, /* i/o: CPE encoder structure */ const Word32 element_brate, /* i : SCE/CPE element bitrate Q0*/ Loading Loading @@ -1476,11 +1480,15 @@ ivas_error pre_proc_front_ivas_fx( move16(); /* Compute core-coder buffers at internal sampling rate */ #ifdef FIX_2344_ALIGN_PREPROC ivas_compute_core_buffers_fx( st, NULL, old_inp_16k_fx, NULL, input_frame, IVAS_SCE /*last_element_mode*/, INT_FS_16k /*sr_core_tmp*/, ener_fx, A_fx, Aw_fx, epsP_fx, lsp_new_fx, lsp_mid_fx, Q_old_inp_16k, Q_r, Q_new ); #else error = ivas_compute_core_buffers_fx( st, NULL, old_inp_16k_fx, NULL, input_frame, IVAS_SCE /*last_element_mode*/, INT_FS_16k /*sr_core_tmp*/, ener_fx, A_fx, Aw_fx, epsP_fx, lsp_new_fx, lsp_mid_fx, Q_old_inp_16k, Q_r, Q_new ); IF( NE_32( error, IVAS_ERR_OK ) ) { return error; } #endif *epsP_fx_q = add( Q_r[0], 1 ); move16(); Loading Loading @@ -1571,7 +1579,11 @@ ivas_error pre_proc_front_ivas_fx( free( temp1F_icatdmResampBuf_fx ); #endif pop_wmops(); #ifdef FIX_2344_ALIGN_PREPROC return; #else return error; #endif } Loading
lib_enc/ivas_core_pre_proc_fx.c +29 −11 Original line number Diff line number Diff line Loading @@ -46,7 +46,11 @@ * Decision matrix, Preprocessing at other Fs, core switching decision, ...) *--------------------------------------------------------------------*/ #ifdef FIX_2344_ALIGN_PREPROC void pre_proc_ivas_fx( #else ivas_error pre_proc_ivas_fx( #endif Encoder_State *st, /* i/o: encoder state structure */ const Word16 last_element_mode, /* i : last element mode Q0*/ const Word32 element_brate, /* i : element bitrate Q0*/ Loading Loading @@ -82,13 +86,16 @@ ivas_error pre_proc_ivas_fx( Word16 *inp_16k_fx, *new_inp_12k8_fx, *inp_12k8_fx; /* pointers to current frame and new data */ Word16 *wsp_fx; /* weighted input signal buffer */ Word32 sr_core_tmp, total_brate_tmp; #ifndef FIX_2344_ALIGN_PREPROC ivas_error error; #endif push_wmops( "pre_proc" ); #ifndef FIX_2344_ALIGN_PREPROC error = IVAS_ERR_OK; move32(); #endif /*----------------------------------------------------------------* * Initialization *----------------------------------------------------------------*/ Loading Loading @@ -607,13 +614,14 @@ ivas_error pre_proc_ivas_fx( Word16 Q_inp_12k8 = *Q_new; move16(); Word16 Q_inp_16k; #endif error = ivas_compute_core_buffers_fx( st, &inp_16k_fx, old_inp_16k_fx, new_inp_resamp16k_fx, input_frame, last_element_mode, sr_core_tmp, ener_fx, A_fx, Aw_fx, epsP_fx, lsp_new_fx, lsp_mid_fx, Q_old_inp_16k, Q_r, &Q_inp_16k ); #ifdef FIX_2344_ALIGN_PREPROC IF( error != IVAS_ERR_OK ) { return error; } ivas_compute_core_buffers_fx( st, &inp_16k_fx, old_inp_16k_fx, new_inp_resamp16k_fx, input_frame, last_element_mode, sr_core_tmp, ener_fx, A_fx, Aw_fx, epsP_fx, lsp_new_fx, lsp_mid_fx, Q_old_inp_16k, Q_r, &Q_inp_16k ); #else error = ivas_compute_core_buffers_fx( st, &inp_16k_fx, old_inp_16k_fx, new_inp_resamp16k_fx, input_frame, last_element_mode, sr_core_tmp, ener_fx, A_fx, Aw_fx, epsP_fx, lsp_new_fx, lsp_mid_fx, Q_old_inp_16k, Q_r, &Q_inp_16k ); #endif IF( GT_16( Q_inp_16k, Q_inp_12k8 ) ) Loading Loading @@ -719,7 +727,11 @@ ivas_error pre_proc_ivas_fx( } pop_wmops(); #ifdef FIX_2344_ALIGN_PREPROC return; #else return error; #endif } Loading @@ -729,7 +741,11 @@ ivas_error pre_proc_ivas_fx( * Compute core-coder buffers at internal sampling rate *--------------------------------------------------------------------*/ #ifdef FIX_2344_ALIGN_PREPROC void ivas_compute_core_buffers_fx( #else ivas_error ivas_compute_core_buffers_fx( #endif Encoder_State *st, /* i/o: encoder state structure */ Word16 **inp16k_out_fx, /* o : ptr. to inp. signal in the current frame Q_new-1*/ Word16 *old_inp_16k_fx, /* i/o: buffer of old input signal @ 16kHz Q_new-1*/ Loading @@ -744,7 +760,7 @@ ivas_error ivas_compute_core_buffers_fx( Word16 lsp_new_fx[M], /* i/o: LSPs at the end of the frame Q15*/ Word16 lsp_mid_fx[M], /* i/o: LSPs in the middle of the frame Q15*/ const Word16 Q_old_inp_16k, const Word16 Q_r[2], Word16 Q_r[2], Word16 *Q_new ) { Word16 *inp_16k_fx, *new_inp_16k_fx; Loading Loading @@ -1292,6 +1308,8 @@ ivas_error ivas_compute_core_buffers_fx( move32(); } } #endif return IVAS_ERR_OK; #else return; #endif }
lib_enc/ivas_cpe_enc_fx.c +12 −5 Original line number Diff line number Diff line Loading @@ -918,16 +918,23 @@ ivas_error ivas_cpe_enc_fx( { front_vad_flag = 0; } move16(); error = pre_proc_front_ivas_fx( NULL, hCPE, hCPE->element_brate, nb_bits_metadata, input_frame, n, old_inp_12k8_16fx[n], old_inp_16k_16fx[n], #ifndef FIX_2344_ALIGN_PREPROC error = #endif pre_proc_front_ivas_fx( NULL, hCPE, hCPE->element_brate, nb_bits_metadata, input_frame, n, old_inp_12k8_16fx[n], old_inp_16k_16fx[n], &ener_fx[n], &relE_fx[n], A_fx[n], Aw_fx[n], epsP_fx[n], &epsP_fx_q[n], lsp_new_fx[n], lsp_mid_fx[n], &vad_hover_flag[n], &attack_flag[n], realBuffer_fx[n], imagBuffer_fx[n], &q_re_im_buf[n], old_wsp_fx[n], &q_old_wsp, pitch_fr_fx[n], voicing_fr_fx[n], &loc_harm[n], &cor_map_sum_fx[n], &vad_flag_dtx[n], enerBuffer_fx[n], &enerBuffer_fx_exp[n], fft_buff_fx[n], &fft_buff_fx_q[n], A_fx[0], lsp_new_fx[0], currFlatness_fx[n], tdm_ratio_idx, fr_bands_fx, q_fr_bands, Etot_LR_fx, lf_E_fx, q_lf_E[n], localVAD_HE_SAD, band_energies_LR_fx, q_band_energies_LR, 0, front_vad_flag, 0, 0, ivas_format, st_ivas->hMCT != NULL, st_ivas->hEncoderConfig->last_ivas_total_brate, ivas_total_brate, &Q_new[n] ); #ifndef FIX_2344_ALIGN_PREPROC IF( error != IVAS_ERR_OK ) { return error; } #endif e_old_wsp[n] = sub( Q15, q_old_wsp ); move16(); } Loading