diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index 3922b4ac109c1a6d42943f33146efc4c1fcbc7eb..e39433fece03bb7fbc3bc5d59d3e88289dd97d47 100644 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -201,6 +201,9 @@ ivas_error pre_proc_front_ivas( const IVAS_FORMAT ivas_format, /* i : IVAS format */ const int16_t MCT_flag, /* i : hMCT handle allocated (1) or not (0) */ const int32_t ivas_total_brate /* i : IVAS total bitrate */ +#ifdef DEBUG_MODE_INFO + , const int16_t ch_idx +#endif ); ivas_error pre_proc_ivas( diff --git a/lib_com/options.h b/lib_com/options.h index d3a04c4f39018cd80aaf88280ce61df977a21fd5..ee78db378b7511b2b592122744273619549e2457 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -71,7 +71,7 @@ /*#define DEBUG_MODE_MDCT*/ /* output most important MDCT parameters to the subdirectory "res/" */ /*#define DEBUG_MODE_PARAM_MC*/ /* output Parametric MC paramters to the subdirectory "res/" */ /*#define DEBUG_MODE_PARAM_ISM*/ /* output Parametric ISM paramters to the subdirectory "res/" */ -/*#define DEBUG_MODE_INFO_TWEAK*/ /* enable command line switch to specify subdirectory for debug info output inside "./res/" */ +/*#define DEBUG_MODE_INFO_TWEAK*/ /* enable command line switch to specify subdirectory for debug info output inside "./res/" */ /*#define DEBUG_MODE_INFO_PLC */ /* define to output PLC related parameters */ /*#define DEBUG_MODE_INFO_ALLRAD*/ /* define to output generated HOA decoding mtx */ /*#define DEBUG_MODE_LFE */ /* define to output LFE relevant parameters */ diff --git a/lib_enc/ivas_core_pre_proc_front.c b/lib_enc/ivas_core_pre_proc_front.c index d0dbd16034c794aa9678533c6a11dc6ee66f0705..0c31acdf19f510cbe18360ac4e46d9af6cd9d5aa 100644 --- a/lib_enc/ivas_core_pre_proc_front.c +++ b/lib_enc/ivas_core_pre_proc_front.c @@ -43,6 +43,9 @@ #include "ivas_prot.h" #include "wmc_auto.h" #include +#ifdef DEBUG_MODE_INFO +#include "string.h" +#endif /*---------------------------------------------------------------* @@ -110,6 +113,10 @@ ivas_error pre_proc_front_ivas( const IVAS_FORMAT ivas_format, /* i : IVAS format */ const int16_t MCT_flag, /* i : hMCT handle allocated (1) or not (0) */ const int32_t ivas_total_brate /* i : IVAS total bitrate - for setting the DTX */ +#ifdef DEBUG_MODE_INFO + , + const int16_t ch_idx +#endif ) { float *inp_12k8, *new_inp_12k8; /* pointers to current frame and new data */ @@ -219,6 +226,17 @@ ivas_error pre_proc_front_ivas( } } +#ifdef DEBUG_MODE_INFO + { + int16_t tmp_dmx_in[L_FRAME48k]; + for ( int16_t isample = 0; isample < input_frame; isample++ ) + { + tmp_dmx_in[isample] = (int16_t) signal_in[isample - NS2SA( st->input_Fs, ACELP_LOOK_NS )]; + } + dbgwrite( tmp_dmx_in, sizeof( int16_t ), input_frame, 1, strcat( fname( debug_dir, "ivas_input_dmx", 0, ch_idx + 1, ENC ), ".pcm" ) ); + } +#endif + lMemRecalc_12k8 = 0; lMemRecalc = 0; if ( element_mode == IVAS_CPE_TD || element_mode == IVAS_CPE_MDCT ) diff --git a/lib_enc/ivas_cpe_enc.c b/lib_enc/ivas_cpe_enc.c index 480b559dc70aa276fe7af4e354cba67d9e50b4e1..c3c40a55a427b6ed6f6ea275c79ed752cf3f60da 100644 --- a/lib_enc/ivas_cpe_enc.c +++ b/lib_enc/ivas_cpe_enc.c @@ -458,10 +458,6 @@ ivas_error ivas_cpe_enc( } #ifdef DEBUG_MODE_INFO - for ( n = 0; n < n_CoreChannels; n++ ) - { - dbgwrite( sts[0]->input - NS2SA( sts[0]->input_Fs, ACELP_LOOK_NS ), sizeof( float ), input_frame, 1, fname( debug_dir, "input_DMX", n, sts[n]->id_element, ENC ) ); - } dbgwrite( &hCPE->element_mode, sizeof( int16_t ), 1, input_frame, fname( debug_dir, "element_mode", 0, sts[0]->id_element, ENC ) ); #endif @@ -474,7 +470,12 @@ ivas_error ivas_cpe_enc( error = pre_proc_front_ivas( NULL, hCPE, hCPE->element_brate, nb_bits_metadata, input_frame, n, old_inp_12k8[n], old_inp_16k[n], &ener[n], &relE[n], A[n], Aw[n], epsP[n], lsp_new[n], lsp_mid[n], &vad_hover_flag[n], &attack_flag[n], realBuffer[n], imagBuffer[n], old_wsp[n], pitch_fr[n], voicing_fr[n], &loc_harm[n], &cor_map_sum[n], &vad_flag_dtx[n], enerBuffer[n], - fft_buff[n], A[0], lsp_new[0], currFlatness[n], tdm_ratio_idx, fr_bands, Etot_LR, lf_E, localVAD_HE_SAD, band_energies_LR, 0, st_ivas->hSpar != NULL ? st_ivas->hSpar->front_vad_flag : 0, 0, 0, ivas_format, st_ivas->hMCT != NULL, ivas_total_brate ); + fft_buff[n], A[0], lsp_new[0], currFlatness[n], tdm_ratio_idx, fr_bands, Etot_LR, lf_E, localVAD_HE_SAD, band_energies_LR, 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 + , + ( st_ivas->nSCE + ( cpe_id * CPE_CHANNELS ) + n ) +#endif + ); if ( error != IVAS_ERR_OK ) { return error; diff --git a/lib_enc/ivas_ism_enc.c b/lib_enc/ivas_ism_enc.c index db689cc9f10f67be90c237316cde99e24202d6ef..bc7ced57ffc6597380739021f11b7162f9e53fdf 100644 --- a/lib_enc/ivas_ism_enc.c +++ b/lib_enc/ivas_ism_enc.c @@ -175,7 +175,12 @@ ivas_error ivas_ism_enc( error = pre_proc_front_ivas( hSCE, NULL, hSCE->element_brate, nb_bits_metadata[sce_id], input_frame, 0, old_inp_12k8[sce_id][0], old_inp_16k[sce_id][0], &ener[sce_id][0], &relE[sce_id][0], A[sce_id][0], Aw[sce_id][0], epsP[sce_id][0], lsp_new[sce_id][0], lsp_mid[sce_id][0], &vad_hover_flag[sce_id][0], &attack_flag[sce_id][0], realBuffer[sce_id][0], imagBuffer[sce_id][0], old_wsp[sce_id][0], pitch_fr[sce_id][0], voicing_fr[sce_id][0], &loc_harm[sce_id][0], &cor_map_sum[sce_id][0], &vad_flag_dtx[sce_id][0], enerBuffer[sce_id][0], - fft_buff[sce_id][0], A[sce_id][0], lsp_new[sce_id][0], currFlatness[0], 0, fr_bands, Etot_LR, lf_E, localVAD_HE_SAD, NULL, 0, 0, 0, 0, ISM_FORMAT, 0, st_ivas->hEncoderConfig->ivas_total_brate ); + fft_buff[sce_id][0], A[sce_id][0], lsp_new[sce_id][0], currFlatness[0], 0, fr_bands, Etot_LR, lf_E, localVAD_HE_SAD, NULL, 0, 0, 0, 0, ISM_FORMAT, 0, st_ivas->hEncoderConfig->ivas_total_brate +#ifdef DEBUG_MODE_INFO + , + st->id_element +#endif + ); if ( error != IVAS_ERR_OK ) { return error; diff --git a/lib_enc/ivas_sce_enc.c b/lib_enc/ivas_sce_enc.c index ae6496657eefbac42c68773e702fa3b0651c7bad..a1d6d594581625685ab129995381dbcdd87bac38 100644 --- a/lib_enc/ivas_sce_enc.c +++ b/lib_enc/ivas_sce_enc.c @@ -172,7 +172,6 @@ ivas_error ivas_sce_enc( } #ifdef DEBUG_MODE_INFO - dbgwrite( st->input - NS2SA( st->input_Fs, ACELP_LOOK_NS ), sizeof( float ), input_frame, 1, "res/input_DMX" ); dbgwrite( &st->element_mode, sizeof( int16_t ), 1, input_frame, fname( debug_dir, "element_mode", 0, st->id_element, ENC ) ); #endif @@ -184,7 +183,12 @@ ivas_error ivas_sce_enc( &ener[0], &relE[0], A[0], Aw[0], epsP[0], lsp_new[0], lsp_mid[0], &vad_hover_flag[0], &attack_flag[0], realBuffer[0], imagBuffer[0], old_wsp[0], pitch_fr[0], voicing_fr[0], &loc_harm[0], &cor_map_sum[0], &vad_flag_dtx[0], enerBuffer[0], fft_buff[0], A[0], lsp_new[0], currFlatness[0], 0, fr_bands, Etot_LR, lf_E, localVAD_HE_SAD, NULL, 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 + , + st->id_element +#endif + ); if ( error != IVAS_ERR_OK ) { return error;