From 8e696baeed7778ec1a9a6f847932267b9e9bde31 Mon Sep 17 00:00:00 2001 From: Chris Hold Date: Thu, 15 Dec 2022 13:47:22 +0100 Subject: [PATCH] Fix 249 - Compilation Error with DEBUG_MODE_DIRAC --- lib_dec/ivas_dirac_dec.c | 4 ++-- lib_dec/ivas_sba_dec.c | 42 ----------------------------------- lib_rend/ivas_sba_rendering.c | 41 ++++++++++++++++++++++++++++++++++ 3 files changed, 43 insertions(+), 44 deletions(-) diff --git a/lib_dec/ivas_dirac_dec.c b/lib_dec/ivas_dirac_dec.c index 03e0f5f6e0..b6d442ee35 100644 --- a/lib_dec/ivas_dirac_dec.c +++ b/lib_dec/ivas_dirac_dec.c @@ -1859,7 +1859,7 @@ void ivas_dirac_dec( { int16_t n, tmp[IVAS_SPAR_MAX_CH * L_FRAME48k]; char file_name[50] = { 0 }; - const int16_t output_frame = st_ivas->->hDecoderConfig->output_Fs / FRAMES_PER_SEC; + const int16_t output_frame = st_ivas->hDecoderConfig->output_Fs / FRAMES_PER_SEC; for ( n = 0; n < nchan_transport; n++ ) { @@ -2156,7 +2156,7 @@ void ivas_dirac_dec( hDirAC->dirac_estimator_idx = ( hDirAC->dirac_estimator_idx + 1 ) % hDirAC->dirac_md_buffer_length; } -#if DEBUG_MODE_DIRAC +#ifdef DEBUG_MODE_DIRAC { static FILE *fp_direction_vector = NULL, *fp_diffuseness = NULL, *fp_referencePower = NULL; diff --git a/lib_dec/ivas_sba_dec.c b/lib_dec/ivas_sba_dec.c index 4e96c041bd..96acf29750 100644 --- a/lib_dec/ivas_sba_dec.c +++ b/lib_dec/ivas_sba_dec.c @@ -954,45 +954,3 @@ ivas_error ivas_sba_dec_reconfigure( return error; } - - -#ifdef DEBUG_MODE_DIRAC -/*-----------------------------------------------------------------------* - * Debugging function - *-----------------------------------------------------------------------*/ - -static void debug_mode_dirac( - float output[MAX_OUTPUT_CHANNELS][L_FRAME48k], - const int16_t nchan_transport, - const int16_t output_frame ) -{ - int16_t i, n; - int16_t tmp[L_FRAME48k]; - char file_name[50] = { 0 }; - -#ifdef DEBUG_MODE_DIRAC_NOCORE - for ( n = 0; n < nchan_transport; n++ ) - { - sprintf( file_name, "./res/ivas_dirac_enc_%d.%d.pcm", n, (int16_t) ( output_frame * 0.05 ) ); - dbgread( tmp, sizeof( int16_t ), output_frame, file_name ); - for ( i = 0; i < output_frame; i++ ) - { - output[n][i] = (float) ( tmp[i] ); - } - } -#else - for ( n = 0; n < nchan_transport; n++ ) - { - for ( i = 0; i < output_frame; i++ ) - { - tmp[i] = (int16_t) ( output[n][i] + 0.5f ); - } - - sprintf( file_name, "./res/ivas_dirac_dec_%d.%d.pcm", n, (int16_t) ( output_frame * 0.05 ) ); - dbgwrite( tmp, sizeof( int16_t ), output_frame, 1, file_name ); - } -#endif - - return; -} -#endif diff --git a/lib_rend/ivas_sba_rendering.c b/lib_rend/ivas_sba_rendering.c index 0c28a3d432..afa99b767c 100755 --- a/lib_rend/ivas_sba_rendering.c +++ b/lib_rend/ivas_sba_rendering.c @@ -757,3 +757,44 @@ void ivas_sba_prototype_renderer( return; } + +#ifdef DEBUG_MODE_DIRAC +/*-----------------------------------------------------------------------* + * Debugging function + *-----------------------------------------------------------------------*/ + +static void debug_mode_dirac( + float output[MAX_OUTPUT_CHANNELS][L_FRAME48k], + const int16_t nchan_transport, + const int16_t output_frame ) +{ + int16_t i, n; + int16_t tmp[L_FRAME48k]; + char file_name[50] = { 0 }; + +#ifdef DEBUG_MODE_DIRAC_NOCORE + for ( n = 0; n < nchan_transport; n++ ) + { + sprintf( file_name, "./res/ivas_dirac_enc_%d.%d.pcm", n, (int16_t) ( output_frame * 0.05 ) ); + dbgread( tmp, sizeof( int16_t ), output_frame, file_name ); + for ( i = 0; i < output_frame; i++ ) + { + output[n][i] = (float) ( tmp[i] ); + } + } +#else + for ( n = 0; n < nchan_transport; n++ ) + { + for ( i = 0; i < output_frame; i++ ) + { + tmp[i] = (int16_t) ( output[n][i] + 0.5f ); + } + + sprintf( file_name, "./res/ivas_dirac_dec_%d.%d.pcm", n, (int16_t) ( output_frame * 0.05 ) ); + dbgwrite( tmp, sizeof( int16_t ), output_frame, 1, file_name ); + } +#endif + + return; +} +#endif -- GitLab