From 560d90f0d69b6c8f6101e190f9c599c318549878 Mon Sep 17 00:00:00 2001 From: Vladimir Malenovsky Date: Tue, 17 Sep 2024 13:45:04 +0200 Subject: [PATCH 1/4] missing include debug.h --- lib_com/bits_alloc_fx.c | 1 - lib_enc/amr_wb_enc_fx.c | 3 +++ lib_enc/evs_enc_fx.c | 5 +++++ lib_enc/ivas_cpe_enc.c | 3 +++ lib_enc/ivas_enc.c | 9 ++++++++- lib_enc/ivas_omasa_enc.c | 3 +++ lib_enc/ivas_sce_enc.c | 3 +++ lib_enc/ivas_stereo_td_enc.c | 5 ++++- lib_enc/speech_music_classif_fx.c | 5 +++++ 9 files changed, 34 insertions(+), 3 deletions(-) diff --git a/lib_com/bits_alloc_fx.c b/lib_com/bits_alloc_fx.c index 7ef71c40c..2e0c018c8 100644 --- a/lib_com/bits_alloc_fx.c +++ b/lib_com/bits_alloc_fx.c @@ -795,7 +795,6 @@ ivas_error config_acelp1( #ifdef DEBUGGING #ifdef REMOVE_IVAS_UNUSED_PARAMETERS_WARNING (void) active_cnt; - (void) core_brate_inpI; #endif #endif ivas_error error; diff --git a/lib_enc/amr_wb_enc_fx.c b/lib_enc/amr_wb_enc_fx.c index ea0f90059..d2b2569b5 100644 --- a/lib_enc/amr_wb_enc_fx.c +++ b/lib_enc/amr_wb_enc_fx.c @@ -13,6 +13,9 @@ #include "prot_fx.h" /* Function prototypes */ #include "basop_util.h" /* Function prototypes */ #include "prot_fx_enc.h" +#ifdef DEBUGGING +#include "debug.h" +#endif /*-------------------------------------------------------------------* * amr_wb_enc() diff --git a/lib_enc/evs_enc_fx.c b/lib_enc/evs_enc_fx.c index d8d35bd23..ae2dd4aed 100644 --- a/lib_enc/evs_enc_fx.c +++ b/lib_enc/evs_enc_fx.c @@ -1,6 +1,7 @@ /*==================================================================================== EVS Codec 3GPP TS26.452 Aug 12, 2021. Version 16.3.0 ====================================================================================*/ + #include #include #include "options.h" /* Compilation switches */ @@ -10,10 +11,14 @@ #include "prot_fx.h" /* Function prototypes */ #include "basop_util.h" /* Function prototypes */ #include "prot_fx_enc.h" +#ifdef DEBUGGING +#include "debug.h" +#endif /*-------------------------------------------------------------------* * Local function prototypes *-------------------------------------------------------------------*/ + #ifdef IVAS_FLOAT_FIXED static void initFrameHeader_loc( Encoder_State *st ); static void writeFrameHeader_loc( Encoder_State *st ); diff --git a/lib_enc/ivas_cpe_enc.c b/lib_enc/ivas_cpe_enc.c index a016003f5..b4cc9b902 100644 --- a/lib_enc/ivas_cpe_enc.c +++ b/lib_enc/ivas_cpe_enc.c @@ -40,6 +40,9 @@ #include "ivas_prot.h" #include "prot_fx_enc.h" #include "ivas_rom_com.h" +#ifdef DEBUGGING +#include "debug.h" +#endif #include "wmc_auto.h" #ifdef IVAS_FLOAT_FIXED #include "ivas_prot_fx.h" diff --git a/lib_enc/ivas_enc.c b/lib_enc/ivas_enc.c index cfdfe2b66..ea9f15dc0 100644 --- a/lib_enc/ivas_enc.c +++ b/lib_enc/ivas_enc.c @@ -39,6 +39,9 @@ #include "prot.h" #include "ivas_prot.h" #include "ivas_rom_com.h" +#ifdef DEBUGGING +#include "debug.h" +#endif #include "wmc_auto.h" #ifdef IVAS_FLOAT_FIXED #include "prot_fx.h" @@ -953,7 +956,11 @@ ivas_error ivas_enc( } /* Configuration of combined-format bit-budget distribution */ - ivas_set_surplus_brate_enc( st_ivas ); + ivas_set_surplus_brate_enc( st_ivas +#ifdef DEBUG_MODE_INFO + ,nb_bits_metadata +#endif + ); /* Encode MASA transport channels */ if ( ( ivas_cpe_enc( st_ivas, 0, data_f[n], data_f[n + 1], input_frame, nb_bits_metadata[0] ) ) != IVAS_ERR_OK ) diff --git a/lib_enc/ivas_omasa_enc.c b/lib_enc/ivas_omasa_enc.c index d6c786811..b6bf286c9 100644 --- a/lib_enc/ivas_omasa_enc.c +++ b/lib_enc/ivas_omasa_enc.c @@ -42,6 +42,9 @@ #include "ivas_rom_com.h" #include "ivas_rom_enc.h" #include "wmc_auto.h" +#ifdef DEBUGGING +#include "debug.h" +#endif /*------------------------------------------------------------------------- diff --git a/lib_enc/ivas_sce_enc.c b/lib_enc/ivas_sce_enc.c index 48033d670..1c5545f41 100644 --- a/lib_enc/ivas_sce_enc.c +++ b/lib_enc/ivas_sce_enc.c @@ -41,6 +41,9 @@ #include "prot_fx_enc.h" #include "ivas_prot.h" #include "ivas_rom_com.h" +#ifdef DEBUGGING +#include "debug.h" +#endif #include "wmc_auto.h" #ifdef IVAS_FLOAT_FIXED #include "ivas_prot_fx.h" diff --git a/lib_enc/ivas_stereo_td_enc.c b/lib_enc/ivas_stereo_td_enc.c index bd41d6e0c..6a5866ef5 100644 --- a/lib_enc/ivas_stereo_td_enc.c +++ b/lib_enc/ivas_stereo_td_enc.c @@ -31,6 +31,7 @@ *******************************************************************************************************/ #include +#include #include "options.h" #include "cnst.h" #include "rom_com.h" @@ -38,7 +39,9 @@ #include "ivas_prot.h" #include "ivas_rom_com.h" #include "wmc_auto.h" -#include "math.h" +#ifdef DEBUGGING +#include "debug.h" +#endif /*-------------------------------------------------------------------* diff --git a/lib_enc/speech_music_classif_fx.c b/lib_enc/speech_music_classif_fx.c index 13e0f4caf..b9d4237a8 100644 --- a/lib_enc/speech_music_classif_fx.c +++ b/lib_enc/speech_music_classif_fx.c @@ -13,11 +13,16 @@ #include "stl.h" #include "prot_fx.h" /* Function prototypes */ #include "prot_fx_enc.h" /* Function prototypes */ +#ifdef DEBUGGING +#include "debug.h" +#endif #ifdef IVAS_FLOAT_FIXED #include #include "ivas_prot.h" #include "prot.h" #endif + + /*---------------------------------------------------------------------* * Local constants *---------------------------------------------------------------------*/ -- GitLab From 3e360098730475709f320e5cc3b0c295f0353417 Mon Sep 17 00:00:00 2001 From: Vladimir Malenovsky Date: Tue, 17 Sep 2024 14:05:17 +0200 Subject: [PATCH 2/4] add include debug.h --- lib_dec/fd_cng_dec_fx.c | 3 +++ lib_enc/cod_tcx_fx.c | 3 +++ lib_enc/ivas_core_enc.c | 3 +++ lib_enc/ivas_ism_enc.c | 3 +++ 4 files changed, 12 insertions(+) diff --git a/lib_dec/fd_cng_dec_fx.c b/lib_dec/fd_cng_dec_fx.c index 219919f6b..2bfaa4b02 100644 --- a/lib_dec/fd_cng_dec_fx.c +++ b/lib_dec/fd_cng_dec_fx.c @@ -17,6 +17,9 @@ #include "ivas_rom_dec.h" #include "ivas_prot_fx.h" #endif +#ifdef DEBUGGING +#include "debug.h" +#endif #define CNA_ACT_DN_LARGE_PARTITION 50 /* index of the first larger partition */ diff --git a/lib_enc/cod_tcx_fx.c b/lib_enc/cod_tcx_fx.c index 531467d1a..a1282c7e9 100644 --- a/lib_enc/cod_tcx_fx.c +++ b/lib_enc/cod_tcx_fx.c @@ -19,6 +19,9 @@ #include "ivas_prot_fx.h" #include "ivas_rom_com_fx.h" #endif +#ifdef DEBUGGING +#include "debug.h" +#endif /* Up to the Autocorrelation it is the same code as in GetMDCT, with the difference in the parameters in the call to tcx_windowing_analysis */ diff --git a/lib_enc/ivas_core_enc.c b/lib_enc/ivas_core_enc.c index 2e9c14ee2..710e764b3 100644 --- a/lib_enc/ivas_core_enc.c +++ b/lib_enc/ivas_core_enc.c @@ -43,6 +43,9 @@ #include "prot_fx.h" #include "ivas_prot_fx.h" #endif +#ifdef DEBUGGING +#include "debug.h" +#endif /*-------------------------------------------------------------------* diff --git a/lib_enc/ivas_ism_enc.c b/lib_enc/ivas_ism_enc.c index 33250b015..f362c0d3f 100644 --- a/lib_enc/ivas_ism_enc.c +++ b/lib_enc/ivas_ism_enc.c @@ -42,6 +42,9 @@ #include "prot_fx.h" #include "prot_fx_enc.h" #endif +#ifdef DEBUGGING +#include "debug.h" +#endif /*-------------------------------------------------------------------* -- GitLab From 26c8a3bfe7f439925c3fa5dd1b536c081d1e717c Mon Sep 17 00:00:00 2001 From: Vladimir Malenovsky Date: Tue, 17 Sep 2024 14:18:50 +0200 Subject: [PATCH 3/4] add missing output of parameters under DEBUG_MODE_INFO --- lib_enc/ivas_core_enc.c | 36 ++++++++++++++++++++++++++++++++++++ lib_enc/ivas_ism_enc.c | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+) diff --git a/lib_enc/ivas_core_enc.c b/lib_enc/ivas_core_enc.c index 710e764b3..b32bb8118 100644 --- a/lib_enc/ivas_core_enc.c +++ b/lib_enc/ivas_core_enc.c @@ -520,6 +520,42 @@ ivas_error ivas_core_enc( } } +#ifdef DEBUG_MODE_INFO + for ( n = 0; n < n_CoreChannels; n++ ) + { + float tmpF; + short tmpS, id; + + st = sts[n]; + id = st->id_element; + + dbgwrite( &st->core, sizeof( short ), 1, input_frame, fname( debug_dir, "core", n, id, ENC ) ); + dbgwrite( &st->extl, sizeof( short ), 1, input_frame, fname( debug_dir, "extl", n, id, ENC ) ); + dbgwrite( &st->bwidth, sizeof( short ), 1, input_frame, fname( debug_dir, "bwidth", n, id, ENC ) ); + tmpF = st->total_brate / 1000.0f; + dbgwrite( &tmpF, sizeof( float ), 1, input_frame, fname( debug_dir, "total_brate", n, id, ENC ) ); + tmpS = st->bits_frame_nominal; + dbgwrite( &tmpS, sizeof( short ), 1, input_frame, fname( debug_dir, "bits_nominal", n, id, ENC ) ); + tmpF = st->core_brate / 1000.0f; + dbgwrite( &tmpF, sizeof( float ), 1, input_frame, fname( debug_dir, "core_brate", n, id, ENC ) ); + tmpF = st->extl_brate / 1000.0f; + dbgwrite( &tmpF, sizeof( float ), 1, input_frame, fname( debug_dir, "extl_brate", n, id, ENC ) ); + + dbgwrite( &st->coder_type, sizeof( short ), 1, input_frame, fname( debug_dir, "coder_type", n, id, ENC ) ); + dbgwrite( &st->clas, sizeof( short ), 1, input_frame, fname( debug_dir, "clas", n, id, ENC ) ); + dbgwrite( &st->cng_type, sizeof( short ), 1, input_frame, fname( debug_dir, "cng_type", n, id, ENC ) ); + dbgwrite( &st->L_frame, sizeof( short ), 1, input_frame, fname( debug_dir, "L_frame", n, id, ENC ) ); + dbgwrite( &st->vad_flag, sizeof( short ), 1, input_frame, fname( debug_dir, "vad_flag", n, id, ENC ) ); + dbgwrite( &st->localVAD, sizeof( short ), 1, input_frame, fname( debug_dir, "localVAD", n, id, ENC ) ); + + dbgwrite( &st->count_WB, sizeof( int16_t ), 1, input_frame, fname( debug_dir, "count_WB", n, id, ENC ) ); + dbgwrite( &st->count_SWB, sizeof( int16_t ), 1, input_frame, fname( debug_dir, "count_SWB", n, id, ENC ) ); + + dbgwrite( &st->sp_aud_decision0, sizeof( int16_t ), 1, input_frame, fname( debug_dir, "sp_aud_decision0", n, id, ENC ) ); + dbgwrite( &st->sp_aud_decision1, sizeof( int16_t ), 1, input_frame, fname( debug_dir, "sp_aud_decision1", n, id, ENC ) ); + dbgwrite( &st->sp_aud_decision2, sizeof( int16_t ), 1, input_frame, fname( debug_dir, "sp_aud_decision2", n, id, ENC ) ); + } +#endif pop_wmops(); diff --git a/lib_enc/ivas_ism_enc.c b/lib_enc/ivas_ism_enc.c index f362c0d3f..5d40b7690 100644 --- a/lib_enc/ivas_ism_enc.c +++ b/lib_enc/ivas_ism_enc.c @@ -940,6 +940,39 @@ IF( dtx_flag ) } } +#ifdef DEBUG_MODE_INFO +if ( dtx_flag ) +{ + float tmpF; + int16_t id, n; + + n = 0; + for ( sce_id = 0; sce_id < nchan_transport_ism; sce_id++ ) + { + if ( sce_id != st_ivas->hISMDTX->sce_id_dtx ) + { + st = st_ivas->hSCE[sce_id]->hCoreCoder[0]; + id = st->id_element; + + dbgwrite( &st->core, sizeof( int16_t ), 1, input_frame, fname( debug_dir, "core", n, id, ENC ) ); + dbgwrite( &st->extl, sizeof( int16_t ), 1, input_frame, fname( debug_dir, "extl", n, id, ENC ) ); + dbgwrite( &st->bwidth, sizeof( int16_t ), 1, input_frame, fname( debug_dir, "bwidth", n, id, ENC ) ); + tmpF = st->total_brate / 1000.0f; + dbgwrite( &tmpF, sizeof( float ), 1, input_frame, fname( debug_dir, "total_brate", n, id, ENC ) ); + tmpF = st->core_brate / 1000.0f; + dbgwrite( &tmpF, sizeof( float ), 1, input_frame, fname( debug_dir, "core_brate", n, id, ENC ) ); + tmpF = st->extl_brate / 1000.0f; + dbgwrite( &tmpF, sizeof( float ), 1, input_frame, fname( debug_dir, "extl_brate", n, id, ENC ) ); + + dbgwrite( &st->coder_type, sizeof( int16_t ), 1, input_frame, fname( debug_dir, "coder_type", n, id, ENC ) ); + dbgwrite( &st->coder_type_raw, sizeof( int16_t ), 1, input_frame, fname( debug_dir, "coder_type_raw", n, id, ENC ) ); + dbgwrite( &st->vad_flag, sizeof( int16_t ), 1, input_frame, fname( debug_dir, "vad_flag", n, id, ENC ) ); + dbgwrite( &st->localVAD, sizeof( int16_t ), 1, input_frame, fname( debug_dir, "localVAD", n, id, ENC ) ); + } + } +} +#endif + pop_wmops(); return error; -- GitLab From dbeb44fc81c8d3cee1347b5c26a15b6ecbfe3711 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Tue, 17 Sep 2024 16:05:38 +0200 Subject: [PATCH 4/4] Clang format --- lib_enc/ivas_enc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib_enc/ivas_enc.c b/lib_enc/ivas_enc.c index ea9f15dc0..d37b71664 100644 --- a/lib_enc/ivas_enc.c +++ b/lib_enc/ivas_enc.c @@ -958,7 +958,8 @@ ivas_error ivas_enc( /* Configuration of combined-format bit-budget distribution */ ivas_set_surplus_brate_enc( st_ivas #ifdef DEBUG_MODE_INFO - ,nb_bits_metadata + , + nb_bits_metadata #endif ); -- GitLab