From 90878c96c1ec4d5e97d1b4a4a1b2a8423d5cd019 Mon Sep 17 00:00:00 2001 From: rtyag Date: Thu, 5 Dec 2024 20:33:10 +1100 Subject: [PATCH 1/3] IVAS downmix dumping debug code --- lib_com/ivas_prot.h | 4 ++++ lib_com/options.h | 5 +++++ lib_enc/ivas_core_pre_proc_front.c | 34 ++++++++++++++++++++++++++++++ lib_enc/ivas_cpe_enc.c | 7 +++++- lib_enc/ivas_ism_enc.c | 7 +++++- lib_enc/ivas_sce_enc.c | 7 +++++- 6 files changed, 61 insertions(+), 3 deletions(-) diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index da3cac148..27dba3a4d 100644 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -278,6 +278,10 @@ ivas_error pre_proc_front_ivas_fx( const IVAS_FORMAT ivas_format, /* i : IVAS format */ const Word16 MCT_flag, /* i : hMCT handle allocated (1) or not (0) */ const Word32 ivas_total_brate /* i : IVAS total bitrate - for setting the DTX */ +#ifdef DEBUG_MODE_INFO_CORE_CODER_IN + , + const Word16 ch_idx +#endif ); #ifdef IVAS_FLOAT_FIXED ivas_error pre_proc_ivas( diff --git a/lib_com/options.h b/lib_com/options.h index 5ad891b9b..a6fbd8af7 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -51,6 +51,11 @@ #define DEBUG_MODE_INFO_TWEAK /* Enable command line switch to specify subdirectory for debug info output inside "./res/" */ #define DEBUG_FORCE_MDCT_STEREO_MODE /* Force stereo mode decision for MDCT stereo: -stereo 3 1 forces L/R coding and -stereo 3 2 forces full M/S coding */ /*#define DBG_WAV_WRITER*/ /* Enable dbgwrite_wav() function for generating ".wav" files */ +#ifdef DEBUG_MODE_INFO +#ifdef DEBUG_MODE_INFO_TWEAK +#define DEBUG_MODE_INFO_CORE_CODER_IN /*dump core coder input*/ +#endif +#endif #endif #define SUPPORT_JBM_TRACEFILE /* Support for JBM tracefile, which is needed for 3GPP objective/subjective testing, but not relevant for real-world implementations */ diff --git a/lib_enc/ivas_core_pre_proc_front.c b/lib_enc/ivas_core_pre_proc_front.c index 05848dc4c..e0cab7d29 100644 --- a/lib_enc/ivas_core_pre_proc_front.c +++ b/lib_enc/ivas_core_pre_proc_front.c @@ -43,6 +43,10 @@ #include "ivas_prot_fx.h" #include "wmc_auto.h" #include +#ifdef DEBUGGING +#include "debug.h" +#include "string.h" +#endif #ifdef IVAS_FLOAT_FIXED #include "prot_fx_enc.h" @@ -928,6 +932,10 @@ ivas_error pre_proc_front_ivas_fx( const IVAS_FORMAT ivas_format, /* i : IVAS format */ const Word16 MCT_flag, /* i : hMCT handle allocated (1) or not (0) */ const Word32 ivas_total_brate /* i : IVAS total bitrate - for setting the DTX */ +#ifdef DEBUG_MODE_INFO_CORE_CODER_IN + , + const Word16 ch_idx +#endif ) { Encoder_State *st; @@ -1036,10 +1044,15 @@ ivas_error pre_proc_front_ivas_fx( Word16 imagBuffer16[CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; Word16 res_cod_SNR_M_fx_e[STEREO_DFT_BAND_MAX]; Word16 band_energies_fx_exp, Qfact_PS, q_lf_E_fx; +#ifdef DEBUG_MODE_INFO_CORE_CODER_IN + Word32 *in_buff_temp; + Word16 in_q_temp; +#endif mem_decim_dummy_fx = (Word16 *) malloc( 90 * sizeof( Word16 * ) ); temp1F_icatdmResampBuf_fx = (Word16 *) malloc( 45 * sizeof( Word16 * ) ); set16_fx( fft_buff_fx, 0, 512 ); + IF( hSCE != NULL ) { Copy_Scale_sig_16_32( hSCE->hCoreCoder[n]->input_fx, hSCE->hCoreCoder[n]->input32_fx, input_frame, sub( Q11, hSCE->hCoreCoder[n]->q_inp ) ); @@ -1052,6 +1065,11 @@ ivas_error pre_proc_front_ivas_fx( Scale_sig( hSCE->hCoreCoder[n]->old_input_signal_fx, input_frame, sub( -1, hSCE->hCoreCoder[n]->q_old_inp ) ); hSCE->hCoreCoder[n]->q_old_inp = -1; move16(); + +#ifdef DEBUG_MODE_INFO_CORE_CODER_IN + in_buff_temp = hSCE->hCoreCoder[n]->input32_fx; + in_q_temp = hSCE->hCoreCoder[n]->q_inp32; +#endif } ELSE { @@ -1065,7 +1083,23 @@ ivas_error pre_proc_front_ivas_fx( Scale_sig( hCPE->hCoreCoder[n]->old_input_signal_fx, input_frame, sub( -1, hCPE->hCoreCoder[n]->q_old_inp ) ); hCPE->hCoreCoder[n]->q_old_inp = -1; move16(); +#ifdef DEBUG_MODE_INFO_CORE_CODER_IN + in_buff_temp = hCPE->hCoreCoder[n]->input32_fx; + in_q_temp = hCPE->hCoreCoder[n]->q_inp32; +#endif } + +#ifdef DEBUG_MODE_INFO_CORE_CODER_IN + { + int16_t tmpF[L_FRAME48k]; + for ( int16_t isample = 0; isample < input_frame; isample++ ) + { + tmpF[isample] = (int16_t) ( (float) in_buff_temp[isample] / ( (float) ( 1 << in_q_temp ) ) ); + } + dbgwrite( &tmpF, sizeof( int16_t ), input_frame, 1, strcat( fname( debug_dir, "input_dmx", 0, ch_idx + 1, ENC ), ".pcm" ) ); + } +#endif + #ifdef MSAN_FIX FOR( Word16 k = 0; k < CLDFB_NO_COL_MAX; k++ ) { diff --git a/lib_enc/ivas_cpe_enc.c b/lib_enc/ivas_cpe_enc.c index f40980db9..dcbd9111b 100644 --- a/lib_enc/ivas_cpe_enc.c +++ b/lib_enc/ivas_cpe_enc.c @@ -856,7 +856,12 @@ ivas_error ivas_cpe_enc_fx( &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, add( Q_buffer[n], QSCALE ), Etot_LR_fx, lf_E_fx, add( Q_buffer[n], QSCALE - 2 ), localVAD_HE_SAD, - band_energies_LR_fx, sub( add( Q_buffer[n], QSCALE ), band_ener_guardbits ), 0, st_ivas->hSpar != NULL ? st_ivas->hSpar->front_vad_flag : 0, 0, 0, ivas_format, st_ivas->hMCT != NULL, ivas_total_brate ); + band_energies_LR_fx, sub( add( Q_buffer[n], QSCALE ), band_ener_guardbits ), 0, st_ivas->hSpar != NULL ? st_ivas->hSpar->front_vad_flag : 0, 0, 0, ivas_format, st_ivas->hMCT != NULL, ivas_total_brate +#ifdef DEBUG_MODE_INFO_CORE_CODER_IN + , + ( ( cpe_id * CPE_CHANNELS ) + n ) +#endif + ); e_old_wsp[n] = sub( Q15, q_old_wsp ); move16(); #else diff --git a/lib_enc/ivas_ism_enc.c b/lib_enc/ivas_ism_enc.c index e74741273..2a984a2d0 100644 --- a/lib_enc/ivas_ism_enc.c +++ b/lib_enc/ivas_ism_enc.c @@ -609,7 +609,12 @@ ivas_error ivas_ism_enc_fx( error = pre_proc_front_ivas_fx( hSCE, NULL, hSCE->element_brate, nb_bits_metadata[sce_id], input_frame, 0, old_inp_12k8_fx[sce_id][0], old_inp_16k_fx[sce_id][0], &ener_fx[sce_id][0], &relE_fx[sce_id][0], A_fx[sce_id][0], Aw_fx[sce_id][0], epsP_fx[sce_id][0], &epsP_fx_q[sce_id][0], lsp_new_fx[sce_id][0], lsp_mid_fx[sce_id][0], &vad_hover_flag[sce_id][0], &attack_flag[sce_id][0], realBuffer_fx[sce_id][0], imagBuffer_fx[sce_id][0], &q_re_im_buf[sce_id], old_wsp_fx[sce_id][0], &q_old_wsp, pitch_fr_fx[sce_id][0], voicing_fr_fx[sce_id][0], &loc_harm[sce_id][0], &cor_map_sum_fx[sce_id][0], &vad_flag_dtx[sce_id][0], enerBuffer_fx[sce_id][0], &enerBuffer_fx_exp[sce_id][0], - fft_buff_fx[sce_id][0], &fft_buff_fx_q[sce_id][0], A_fx[sce_id][0], lsp_new_fx[sce_id][0], currFlatness_fx[0], 0, fr_bands_fx, 31, Etot_LR_fx, lf_E_fx, 31, localVAD_HE_SAD, NULL, 31, 0, 0, 0, 0, ISM_FORMAT, 0, st_ivas->hEncoderConfig->ivas_total_brate ); + fft_buff_fx[sce_id][0], &fft_buff_fx_q[sce_id][0], A_fx[sce_id][0], lsp_new_fx[sce_id][0], currFlatness_fx[0], 0, fr_bands_fx, 31, Etot_LR_fx, lf_E_fx, 31, localVAD_HE_SAD, NULL, 31, 0, 0, 0, 0, ISM_FORMAT, 0, st_ivas->hEncoderConfig->ivas_total_brate +#ifdef DEBUG_MODE_INFO_CORE_CODER_IN + , + sce_id +#endif + ); e_old_wsp[sce_id][0] = sub( Q15, q_old_wsp ); move16(); IF( NE_32( error, IVAS_ERR_OK ) ) diff --git a/lib_enc/ivas_sce_enc.c b/lib_enc/ivas_sce_enc.c index b77e9009a..82456f02d 100644 --- a/lib_enc/ivas_sce_enc.c +++ b/lib_enc/ivas_sce_enc.c @@ -259,7 +259,12 @@ ivas_error ivas_sce_enc_fx( &ener_fx[0], &relE_fx[0], A_fx[0], Aw_fx[0], epsP_fx[0], &epsP_fx_q[0], lsp_new_fx[0], lsp_mid_fx[0], &vad_hover_flag[0], &attack_flag[0], realBuffer_fx[0], imagBuffer_fx[0], &q_re_im_buf, old_wsp_fx[0], &q_old_wsp, pitch_fr_fx[0], voicing_fr_fx[0], &loc_harm[0], &cor_map_sum_fx[0], &vad_flag_dtx[0], enerBuffer_fx[0], &enerBuffer_fx_exp[0], fft_buff_fx[0], &fft_buff_fx_q[0], A_fx[0], lsp_new_fx[0], currFlatness_fx[0], 0, fr_bands_fx, 31, Etot_LR_fx, lf_E_fx, 31, localVAD_HE_SAD, NULL, 31, flag_16k_smc, - st_ivas->hSpar != NULL ? st_ivas->hSpar->front_vad_flag : 0, st_ivas->hSpar != NULL ? st_ivas->hSpar->force_front_vad : 0, st_ivas->hSpar != NULL ? st_ivas->hSpar->front_vad_dtx_flag : 0, ivas_format, 0, st_ivas->hEncoderConfig->ivas_total_brate ); + st_ivas->hSpar != NULL ? st_ivas->hSpar->front_vad_flag : 0, st_ivas->hSpar != NULL ? st_ivas->hSpar->force_front_vad : 0, st_ivas->hSpar != NULL ? st_ivas->hSpar->front_vad_dtx_flag : 0, ivas_format, 0, st_ivas->hEncoderConfig->ivas_total_brate +#ifdef DEBUG_MODE_INFO_CORE_CODER_IN + , + sce_id +#endif + ); e_old_wsp[0] = sub( Q15, q_old_wsp ); move16(); #else -- GitLab From e0f31ab817ac7752c1b1958aeddad2fdb2597643 Mon Sep 17 00:00:00 2001 From: rtyag Date: Fri, 6 Dec 2024 21:45:57 +1100 Subject: [PATCH 2/3] review comments --- lib_com/ivas_prot.h | 2 +- lib_com/options.h | 5 ----- lib_enc/ivas_core_pre_proc_front.c | 10 +++++----- lib_enc/ivas_cpe_enc.c | 4 ++-- lib_enc/ivas_ism_enc.c | 4 ++-- lib_enc/ivas_sce_enc.c | 4 ++-- lib_enc/ivas_stereo_mdct_stereo_enc.c | 2 +- 7 files changed, 13 insertions(+), 18 deletions(-) diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index 27dba3a4d..c48c97847 100644 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -278,7 +278,7 @@ ivas_error pre_proc_front_ivas_fx( const IVAS_FORMAT ivas_format, /* i : IVAS format */ const Word16 MCT_flag, /* i : hMCT handle allocated (1) or not (0) */ const Word32 ivas_total_brate /* i : IVAS total bitrate - for setting the DTX */ -#ifdef DEBUG_MODE_INFO_CORE_CODER_IN +#ifdef DEBUG_MODE_INFO , const Word16 ch_idx #endif diff --git a/lib_com/options.h b/lib_com/options.h index a6fbd8af7..5ad891b9b 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -51,11 +51,6 @@ #define DEBUG_MODE_INFO_TWEAK /* Enable command line switch to specify subdirectory for debug info output inside "./res/" */ #define DEBUG_FORCE_MDCT_STEREO_MODE /* Force stereo mode decision for MDCT stereo: -stereo 3 1 forces L/R coding and -stereo 3 2 forces full M/S coding */ /*#define DBG_WAV_WRITER*/ /* Enable dbgwrite_wav() function for generating ".wav" files */ -#ifdef DEBUG_MODE_INFO -#ifdef DEBUG_MODE_INFO_TWEAK -#define DEBUG_MODE_INFO_CORE_CODER_IN /*dump core coder input*/ -#endif -#endif #endif #define SUPPORT_JBM_TRACEFILE /* Support for JBM tracefile, which is needed for 3GPP objective/subjective testing, but not relevant for real-world implementations */ diff --git a/lib_enc/ivas_core_pre_proc_front.c b/lib_enc/ivas_core_pre_proc_front.c index e0cab7d29..d1bdfdc5d 100644 --- a/lib_enc/ivas_core_pre_proc_front.c +++ b/lib_enc/ivas_core_pre_proc_front.c @@ -932,7 +932,7 @@ ivas_error pre_proc_front_ivas_fx( const IVAS_FORMAT ivas_format, /* i : IVAS format */ const Word16 MCT_flag, /* i : hMCT handle allocated (1) or not (0) */ const Word32 ivas_total_brate /* i : IVAS total bitrate - for setting the DTX */ -#ifdef DEBUG_MODE_INFO_CORE_CODER_IN +#ifdef DEBUG_MODE_INFO , const Word16 ch_idx #endif @@ -1044,7 +1044,7 @@ ivas_error pre_proc_front_ivas_fx( Word16 imagBuffer16[CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; Word16 res_cod_SNR_M_fx_e[STEREO_DFT_BAND_MAX]; Word16 band_energies_fx_exp, Qfact_PS, q_lf_E_fx; -#ifdef DEBUG_MODE_INFO_CORE_CODER_IN +#ifdef DEBUG_MODE_INFO Word32 *in_buff_temp; Word16 in_q_temp; #endif @@ -1066,7 +1066,7 @@ ivas_error pre_proc_front_ivas_fx( hSCE->hCoreCoder[n]->q_old_inp = -1; move16(); -#ifdef DEBUG_MODE_INFO_CORE_CODER_IN +#ifdef DEBUG_MODE_INFO in_buff_temp = hSCE->hCoreCoder[n]->input32_fx; in_q_temp = hSCE->hCoreCoder[n]->q_inp32; #endif @@ -1083,13 +1083,13 @@ ivas_error pre_proc_front_ivas_fx( Scale_sig( hCPE->hCoreCoder[n]->old_input_signal_fx, input_frame, sub( -1, hCPE->hCoreCoder[n]->q_old_inp ) ); hCPE->hCoreCoder[n]->q_old_inp = -1; move16(); -#ifdef DEBUG_MODE_INFO_CORE_CODER_IN +#ifdef DEBUG_MODE_INFO in_buff_temp = hCPE->hCoreCoder[n]->input32_fx; in_q_temp = hCPE->hCoreCoder[n]->q_inp32; #endif } -#ifdef DEBUG_MODE_INFO_CORE_CODER_IN +#ifdef DEBUG_MODE_INFO { int16_t tmpF[L_FRAME48k]; for ( int16_t isample = 0; isample < input_frame; isample++ ) diff --git a/lib_enc/ivas_cpe_enc.c b/lib_enc/ivas_cpe_enc.c index dcbd9111b..7ce32625d 100644 --- a/lib_enc/ivas_cpe_enc.c +++ b/lib_enc/ivas_cpe_enc.c @@ -857,9 +857,9 @@ ivas_error ivas_cpe_enc_fx( 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, add( Q_buffer[n], QSCALE ), Etot_LR_fx, lf_E_fx, add( Q_buffer[n], QSCALE - 2 ), localVAD_HE_SAD, band_energies_LR_fx, sub( add( Q_buffer[n], QSCALE ), band_ener_guardbits ), 0, st_ivas->hSpar != NULL ? st_ivas->hSpar->front_vad_flag : 0, 0, 0, ivas_format, st_ivas->hMCT != NULL, ivas_total_brate -#ifdef DEBUG_MODE_INFO_CORE_CODER_IN +#ifdef DEBUG_MODE_INFO , - ( ( cpe_id * CPE_CHANNELS ) + n ) + ( st_ivas->nSCE + ( cpe_id * CPE_CHANNELS ) + n ) #endif ); e_old_wsp[n] = sub( Q15, q_old_wsp ); diff --git a/lib_enc/ivas_ism_enc.c b/lib_enc/ivas_ism_enc.c index 2a984a2d0..058f5e21b 100644 --- a/lib_enc/ivas_ism_enc.c +++ b/lib_enc/ivas_ism_enc.c @@ -610,9 +610,9 @@ ivas_error ivas_ism_enc_fx( &ener_fx[sce_id][0], &relE_fx[sce_id][0], A_fx[sce_id][0], Aw_fx[sce_id][0], epsP_fx[sce_id][0], &epsP_fx_q[sce_id][0], lsp_new_fx[sce_id][0], lsp_mid_fx[sce_id][0], &vad_hover_flag[sce_id][0], &attack_flag[sce_id][0], realBuffer_fx[sce_id][0], imagBuffer_fx[sce_id][0], &q_re_im_buf[sce_id], old_wsp_fx[sce_id][0], &q_old_wsp, pitch_fr_fx[sce_id][0], voicing_fr_fx[sce_id][0], &loc_harm[sce_id][0], &cor_map_sum_fx[sce_id][0], &vad_flag_dtx[sce_id][0], enerBuffer_fx[sce_id][0], &enerBuffer_fx_exp[sce_id][0], fft_buff_fx[sce_id][0], &fft_buff_fx_q[sce_id][0], A_fx[sce_id][0], lsp_new_fx[sce_id][0], currFlatness_fx[0], 0, fr_bands_fx, 31, Etot_LR_fx, lf_E_fx, 31, localVAD_HE_SAD, NULL, 31, 0, 0, 0, 0, ISM_FORMAT, 0, st_ivas->hEncoderConfig->ivas_total_brate -#ifdef DEBUG_MODE_INFO_CORE_CODER_IN +#ifdef DEBUG_MODE_INFO , - sce_id + st->id_element #endif ); e_old_wsp[sce_id][0] = sub( Q15, q_old_wsp ); diff --git a/lib_enc/ivas_sce_enc.c b/lib_enc/ivas_sce_enc.c index 82456f02d..04c143538 100644 --- a/lib_enc/ivas_sce_enc.c +++ b/lib_enc/ivas_sce_enc.c @@ -260,9 +260,9 @@ ivas_error ivas_sce_enc_fx( realBuffer_fx[0], imagBuffer_fx[0], &q_re_im_buf, old_wsp_fx[0], &q_old_wsp, pitch_fr_fx[0], voicing_fr_fx[0], &loc_harm[0], &cor_map_sum_fx[0], &vad_flag_dtx[0], enerBuffer_fx[0], &enerBuffer_fx_exp[0], fft_buff_fx[0], &fft_buff_fx_q[0], A_fx[0], lsp_new_fx[0], currFlatness_fx[0], 0, fr_bands_fx, 31, Etot_LR_fx, lf_E_fx, 31, localVAD_HE_SAD, NULL, 31, flag_16k_smc, st_ivas->hSpar != NULL ? st_ivas->hSpar->front_vad_flag : 0, st_ivas->hSpar != NULL ? st_ivas->hSpar->force_front_vad : 0, st_ivas->hSpar != NULL ? st_ivas->hSpar->front_vad_dtx_flag : 0, ivas_format, 0, st_ivas->hEncoderConfig->ivas_total_brate -#ifdef DEBUG_MODE_INFO_CORE_CODER_IN +#ifdef DEBUG_MODE_INFO , - sce_id + st->id_element #endif ); e_old_wsp[0] = sub( Q15, q_old_wsp ); diff --git a/lib_enc/ivas_stereo_mdct_stereo_enc.c b/lib_enc/ivas_stereo_mdct_stereo_enc.c index a444a920c..e2fde7cde 100644 --- a/lib_enc/ivas_stereo_mdct_stereo_enc.c +++ b/lib_enc/ivas_stereo_mdct_stereo_enc.c @@ -650,7 +650,7 @@ void stereo_coder_tcx_fx( } for ( k = 0; k < nSubframes; k++ ) { - convertToMS_fx( L_frameTCX, sts[0]->hTcxEnc->spectrum_fx[k], sts[1]->hTcxEnc->spectrum_fx[k], SQRT2_OVER_2 ); + convertToMS_fx( L_frameTCX, sts[0]->hTcxEnc->spectrum_fx[k], sts[1]->hTcxEnc->spectrum_fx[k], SQRT2_OVER_2_FIXED ); /* Make sure that the MDST is processed in the correct way also */ set_s( &ms_mask[k][0], 1, MAX_SFB ); -- GitLab From 0c87ceda6dc76751585e219fd01a628fe42721cd Mon Sep 17 00:00:00 2001 From: rtyag Date: Mon, 9 Dec 2024 23:14:46 +1100 Subject: [PATCH 3/3] delay the dumped cdmx signal to remove switching issues in stereo modes --- lib_enc/ivas_core_pre_proc_front.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib_enc/ivas_core_pre_proc_front.c b/lib_enc/ivas_core_pre_proc_front.c index d1bdfdc5d..d2e9c3feb 100644 --- a/lib_enc/ivas_core_pre_proc_front.c +++ b/lib_enc/ivas_core_pre_proc_front.c @@ -1094,9 +1094,9 @@ ivas_error pre_proc_front_ivas_fx( int16_t tmpF[L_FRAME48k]; for ( int16_t isample = 0; isample < input_frame; isample++ ) { - tmpF[isample] = (int16_t) ( (float) in_buff_temp[isample] / ( (float) ( 1 << in_q_temp ) ) ); + tmpF[isample] = (int16_t) ( (float) in_buff_temp[isample - NS2SA( st->input_Fs, ACELP_LOOK_NS )] / ( (float) ( 1 << in_q_temp ) ) ); } - dbgwrite( &tmpF, sizeof( int16_t ), input_frame, 1, strcat( fname( debug_dir, "input_dmx", 0, ch_idx + 1, ENC ), ".pcm" ) ); + dbgwrite( &tmpF, sizeof( int16_t ), input_frame, 1, strcat( fname( debug_dir, "ivas_input_dmx", 0, ch_idx + 1, ENC ), ".pcm" ) ); } #endif -- GitLab