From b815a28d25266cb42865b050ce98794c9fb1bd75 Mon Sep 17 00:00:00 2001 From: vaclav Date: Fri, 6 Dec 2024 18:40:26 +0100 Subject: [PATCH 1/7] issue 1225: Add disclaimer for renderer application + Add info about IVAS reference version; under FIX_1225_DISCLAIMER --- apps/renderer.c | 49 +++++++++++++++- lib_com/disclaimer.c | 3 + lib_com/options.h | 2 +- lib_dec/lib_dec.c | 4 +- lib_rend/ivas_output_init.c | 108 ++++++++++++++++++++++++++++++++++++ lib_rend/ivas_prot_rend.h | 6 ++ lib_rend/lib_rend.c | 91 ++++++++++++++++++++++++++++++ lib_rend/lib_rend.h | 16 ++++++ 8 files changed, 275 insertions(+), 4 deletions(-) diff --git a/apps/renderer.c b/apps/renderer.c index f90ec711f6..4833e70943 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -737,6 +737,10 @@ int main( lfeRoutingConfigs[i] = NULL; } +#ifdef FIX_1225_DISCLAIMER + IVAS_REND_PrintDisclaimer(); + +#endif CmdlnArgs args = parseCmdlnArgs( argc, argv ); if ( args.nonDiegeticPan && !( ( args.inConfig.numAudioObjects == 0 && args.inConfig.multiChannelBuses[0].audioConfig == IVAS_AUDIO_CONFIG_MONO ) || @@ -894,6 +898,49 @@ int main( exit( -1 ); } +#ifdef FIX_1225_DISCLAIMER + fprintf( stdout, "Input audio file: %s\n", args.inputFilePath ); + fprintf( stdout, "Output audio file: %s\n\n", args.outputFilePath ); + + if ( args.inConfig.numAudioObjects > 0 ) + { + if ( args.inConfig.numAudioObjects == 1 ) + { + IVAS_REND_PrintInputConfig( IVAS_AUDIO_CONFIG_ISM1 ); + } + else if ( args.inConfig.numAudioObjects == 2 ) + { + IVAS_REND_PrintInputConfig( IVAS_AUDIO_CONFIG_ISM2 ); + } + else if ( args.inConfig.numAudioObjects == 3 ) + { + IVAS_REND_PrintInputConfig( IVAS_AUDIO_CONFIG_ISM3 ); + } + else if ( args.inConfig.numAudioObjects == 4 ) + { + IVAS_REND_PrintInputConfig( IVAS_AUDIO_CONFIG_ISM4 ); + } + } + for ( i = 0; i < args.inConfig.numMultiChannelBuses; i++ ) + { + IVAS_REND_PrintInputConfig( args.inConfig.multiChannelBuses[i].audioConfig ); + } + for ( i = 0; i < args.inConfig.numMasaBuses; i++ ) + { + IVAS_REND_PrintInputConfig( args.inConfig.masaBuses[i].audioConfig ); + } + for ( i = 0; i < args.inConfig.numAmbisonicsBuses; i++ ) + { + IVAS_REND_PrintInputConfig( args.inConfig.ambisonicsBuses[i].audioConfig ); + } + + if ( ( error = IVAS_REND_PrintConfig( hIvasRend ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\n IVAS_REND_PrintConfig failed: %s\n\n", ivas_error_to_string( error ) ); + goto cleanup; + } + +#endif if ( !isEmptyString( args.customHrtfFilePath ) ) { if ( hrtfFileReader_open( args.customHrtfFilePath, &hrtfFileReader ) != IVAS_ERR_OK ) @@ -3687,7 +3734,7 @@ static ivas_error parseLfePanMtxFile( } /* set default panning matrix to all zeros - any subsequent issue in file reading will gracefully exit the function */ + any subsequent issue in file reading will gracefully exit the function */ for ( lfe_in = 0; lfe_in < RENDERER_MAX_INPUT_LFE_CHANNELS; lfe_in++ ) { for ( i = 0; i < IVAS_MAX_OUTPUT_CHANNELS; i++ ) diff --git a/lib_com/disclaimer.c b/lib_com/disclaimer.c index 5d23ba1549..71aded4b87 100644 --- a/lib_com/disclaimer.c +++ b/lib_com/disclaimer.c @@ -48,6 +48,9 @@ int16_t print_disclaimer( FILE *fPtr ) fprintf( fPtr, "\n==================================================================================================\n" ); fprintf( fPtr, " IVAS Codec Baseline\n" ); +#ifdef FIX_1225_DISCLAIMER + fprintf( fPtr, " \n Initial IVAS Codec (Floating Point) 3GPP TS26.258 version IVAS-FLP-2.0\n" ); +#endif fprintf( fPtr, " \n" ); fprintf( fPtr, " Based on EVS Codec (Floating Point) 3GPP TS26.443 Nov 04, 2021,\n" ); fprintf( fPtr, " Version 12.14.0 / 13.10.0 / 14.6.0 / 15.4.0 / 16.3.0\n" ); diff --git a/lib_com/options.h b/lib_com/options.h index 484de232aa..588c895397 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -163,7 +163,7 @@ #define FIX_1226_FASTCONV_HRTF_LOADING_OPTIM /* VA: issue 1226: for FastConv binaural renderer in decoder, load only HTRT coefficient set that is needed */ #define FIX_1227_Crend_HRTF_LOADING_OPTIM /* VA: issue 1227: for Crend binaural renderer in decoder, load only HTRT coefficient set that is needed */ #define FIX_1222_OMASA_DEC_CHANNEL_BUFFERS /* VA: issue 1222: Reduction of the number of channel buffers in OMASA decoder */ - +#define FIX_1225_DISCLAIMER /* VA: issue 1225: Add disclaimer for external renderer + Add info about IVAS reference version */ /* #################### End BE switches ################################## */ diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index a71d801ae7..796ed18ad5 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -3934,7 +3934,7 @@ const char *IVAS_DEC_GetErrorMessage( return ivas_error_to_string( error ); } - +#ifndef FIX_1225_DISCLAIMER /*---------------------------------------------------------------------* * get_channel_config() * @@ -4020,7 +4020,7 @@ static ivas_error get_channel_config( return IVAS_ERR_OK; } - +#endif /*---------------------------------------------------------------------* * printConfigInfo_dec( ) diff --git a/lib_rend/ivas_output_init.c b/lib_rend/ivas_output_init.c index 46025d4829..32acac0a1e 100644 --- a/lib_rend/ivas_output_init.c +++ b/lib_rend/ivas_output_init.c @@ -37,6 +37,9 @@ #include "ivas_prot_rend.h" #include "ivas_rom_com.h" #include "ivas_prot.h" +#ifdef FIX_1225_DISCLAIMER +#include +#endif #ifdef DEBUGGING #include "debug.h" #include @@ -480,3 +483,108 @@ int16_t is_split_rendering_enabled( return 0; } } + +#ifdef FIX_1225_DISCLAIMER + +/*---------------------------------------------------------------------* + * get_channel_config() + * + * Gets a str related to input config + *---------------------------------------------------------------------*/ + +ivas_error get_channel_config( + const AUDIO_CONFIG config, + char *str ) +{ + if ( config == IVAS_AUDIO_CONFIG_MONO ) + { + strcpy( str, "Mono" ); + } + else if ( config == IVAS_AUDIO_CONFIG_STEREO ) + { + strcpy( str, "Stereo" ); + } + else if ( config == IVAS_AUDIO_CONFIG_ISM1 ) + { + strcpy( str, "Object-based audio (1 object)" ); + } + else if ( config == IVAS_AUDIO_CONFIG_ISM2 ) + { + strcpy( str, "Object-based audio (2 objects)" ); + } + else if ( config == IVAS_AUDIO_CONFIG_ISM3 ) + { + strcpy( str, "Object-based audio (3 objects)" ); + } + else if ( config == IVAS_AUDIO_CONFIG_ISM4 ) + { + strcpy( str, "Object-based audio (4 objects)" ); + } + else if ( config == IVAS_AUDIO_CONFIG_5_1 ) + { + strcpy( str, "Multichannel 5.1 (CICP6)" ); + } + else if ( config == IVAS_AUDIO_CONFIG_7_1 ) + { + strcpy( str, "Multichannel 7.1 (CICP12)" ); + } + else if ( config == IVAS_AUDIO_CONFIG_5_1_2 ) + { + strcpy( str, "Multichannel 5.1+2 (CICP14)" ); + } + else if ( config == IVAS_AUDIO_CONFIG_5_1_4 ) + { + strcpy( str, "Multichannel 5.1+4 (CICP16)" ); + } + else if ( config == IVAS_AUDIO_CONFIG_7_1_4 ) + { + strcpy( str, "Multichannel 7.1+4 (CICP19)" ); + } + else if ( config == IVAS_AUDIO_CONFIG_LS_CUSTOM ) + { + strcpy( str, "Multichannel (custom loudspeaker layout)" ); + } + else if ( config == IVAS_AUDIO_CONFIG_FOA ) + { + strcpy( str, "Ambisonics: First Order (FOA)" ); + } + else if ( config == IVAS_AUDIO_CONFIG_HOA2 ) + { + strcpy( str, "Ambisonics: Second Order (HOA2)" ); + } + else if ( config == IVAS_AUDIO_CONFIG_HOA3 ) + { + strcpy( str, "Ambisonics: Third Order (HOA3)" ); + } + else if ( config == IVAS_AUDIO_CONFIG_BINAURAL ) + { + strcpy( str, "Binaural: no room" ); + } + else if ( config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) + { + strcpy( str, "Binaural: room with impulse responses" ); + } + else if ( config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) + { + strcpy( str, "Binaural: room with reverb" ); + } + else if ( config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) + { + strcpy( str, "BINAURAL_SPLIT_CODED" ); + } + else if ( config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) + { + strcpy( str, "Binaural_Split_PCM" ); + } + else if ( config == IVAS_AUDIO_CONFIG_EXTERNAL ) + { + strcpy( str, "External renderer" ); + } + else + { + return IVAS_ERROR( IVAS_ERR_INVALID_OUTPUT_FORMAT, "Error: Incorrect Input/Output Configuration" ); + } + + return IVAS_ERR_OK; +} +#endif diff --git a/lib_rend/ivas_prot_rend.h b/lib_rend/ivas_prot_rend.h index d4a75254a3..98d1d5ae7d 100644 --- a/lib_rend/ivas_prot_rend.h +++ b/lib_rend/ivas_prot_rend.h @@ -83,6 +83,12 @@ int16_t is_split_rendering_enabled( const IVAS_RENDER_CONFIG_HANDLE hRenderConfig /* i : Render config data structure */ ); +#ifdef FIX_1225_DISCLAIMER +ivas_error get_channel_config( + const AUDIO_CONFIG config, + char *str +); +#endif /*----------------------------------------------------------------------------------* * TD decorr. function prototypes diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index e9a13a9aa0..641e77576c 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -8723,3 +8723,94 @@ static void freeMasaExtRenderer( return; } + + +#ifdef FIX_1225_DISCLAIMER +static ivas_error printConfigInfo_rend( + IVAS_REND_HANDLE hIvasRend /* i : IVAS renderer handle */ +) +{ + ivas_error error; + char config_str[50]; + + /*-----------------------------------------------------------------* + * Print output audio configuration + *-----------------------------------------------------------------*/ + + error = get_channel_config( hIvasRend->outputConfig, &config_str[0] ); + fprintf( stdout, "Output configuration: %s\n", config_str ); + + /*-----------------------------------------------------------------* + * Print renderer configurations + *-----------------------------------------------------------------*/ + + fprintf( stdout, "Input sampling rate: %d Hz\n", hIvasRend->sampleRateOut ); + + if ( hIvasRend->headRotData.headRotEnabled == 1 ) + { + fprintf( stdout, "Head-tracking: ON\n" ); + } + + if ( hIvasRend->outputConfig == IVAS_AUDIO_CONFIG_BINAURAL || + hIvasRend->outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR || + hIvasRend->outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB || + hIvasRend->outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || + hIvasRend->outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) + { + fprintf( stdout, "Render framesize: %dms\n", hIvasRend->num_subframes * 5 ); + } + + return IVAS_ERR_OK; +} + + +/*---------------------------------------------------------------------* + * IVAS_REND_PrintInputConfig() + * + * + *---------------------------------------------------------------------*/ + +void IVAS_REND_PrintInputConfig( + const AUDIO_CONFIG inputConfig /* i : input audio configuration */ +) +{ + char config_str[50]; + + get_channel_config( inputConfig, &config_str[0] ); + fprintf( stdout, "Input configuration: %s\n", config_str ); + + return; +} + +/*---------------------------------------------------------------------* + * IVAS_REND_PrintConfig() + * + * + *---------------------------------------------------------------------*/ + +ivas_error IVAS_REND_PrintConfig( + IVAS_REND_HANDLE hIvasRend /* i : IVAS renderer handle */ +) +{ + if ( hIvasRend == NULL ) + { + return IVAS_ERR_UNEXPECTED_NULL_POINTER; + } + + return printConfigInfo_rend( hIvasRend ); +} + + +/*---------------------------------------------------------------------* + * IVAS_REND_PrintDisclaimer() + * + * Print IVAS disclaimer to console + *---------------------------------------------------------------------*/ + +void IVAS_REND_PrintDisclaimer( void ) +{ + print_disclaimer( stderr ); + + return; +} +#endif diff --git a/lib_rend/lib_rend.h b/lib_rend/lib_rend.h index 5886ad769c..2e8f2f444c 100644 --- a/lib_rend/lib_rend.h +++ b/lib_rend/lib_rend.h @@ -420,6 +420,22 @@ int32_t IVAS_REND_GetCntFramesLimited( ); #endif + +#ifdef FIX_1225_DISCLAIMER +/* Disclaimer and info printing */ + +void IVAS_REND_PrintInputConfig( + const AUDIO_CONFIG inputConfig /* i : input audio configuration */ +); + +ivas_error IVAS_REND_PrintConfig( + IVAS_REND_HANDLE hIvasRend /* i : IVAS renderer handle */ +); + +void IVAS_REND_PrintDisclaimer( + void +); +#endif /* clang-format on */ #endif -- GitLab From e87ef7ea57fe0e8560fda9dd72b9dec9098e077b Mon Sep 17 00:00:00 2001 From: vaclav Date: Fri, 6 Dec 2024 18:50:56 +0100 Subject: [PATCH 2/7] fix error return --- lib_rend/lib_rend.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 641e77576c..c6adf2889e 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -8737,14 +8737,18 @@ static ivas_error printConfigInfo_rend( * Print output audio configuration *-----------------------------------------------------------------*/ - error = get_channel_config( hIvasRend->outputConfig, &config_str[0] ); + if ( ( error = get_channel_config( hIvasRend->outputConfig, &config_str[0] ) ) != IVAS_ERR_OK ) + { + return error; + } + fprintf( stdout, "Output configuration: %s\n", config_str ); /*-----------------------------------------------------------------* * Print renderer configurations *-----------------------------------------------------------------*/ - fprintf( stdout, "Input sampling rate: %d Hz\n", hIvasRend->sampleRateOut ); + fprintf( stdout, "Output sampling rate: %d Hz\n", hIvasRend->sampleRateOut ); if ( hIvasRend->headRotData.headRotEnabled == 1 ) { -- GitLab From db9cf2a863e69b4dcc464b59e9353ffe4fc75430 Mon Sep 17 00:00:00 2001 From: vaclav Date: Fri, 6 Dec 2024 18:51:40 +0100 Subject: [PATCH 3/7] fix error return --- lib_rend/lib_rend.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index c6adf2889e..343fdc05e1 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -8786,6 +8786,7 @@ void IVAS_REND_PrintInputConfig( return; } + /*---------------------------------------------------------------------* * IVAS_REND_PrintConfig() * -- GitLab From 4371bc6b6b43eedce24bcedb85f9955afdc845c4 Mon Sep 17 00:00:00 2001 From: vaclav Date: Fri, 6 Dec 2024 19:51:46 +0100 Subject: [PATCH 4/7] add MASA cases to get_channel_config() --- lib_rend/ivas_output_init.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib_rend/ivas_output_init.c b/lib_rend/ivas_output_init.c index 32acac0a1e..82f298d6e3 100644 --- a/lib_rend/ivas_output_init.c +++ b/lib_rend/ivas_output_init.c @@ -544,6 +544,14 @@ ivas_error get_channel_config( { strcpy( str, "Multichannel (custom loudspeaker layout)" ); } + else if ( config == IVAS_AUDIO_CONFIG_MASA1 ) + { + strcpy( str, "Metadata-Assisted Spatial Audio mono (MASA1)" ); + } + else if ( config == IVAS_AUDIO_CONFIG_MASA2 ) + { + strcpy( str, "Metadata-Assisted Spatial Audio stereo (MASA2)" ); + } else if ( config == IVAS_AUDIO_CONFIG_FOA ) { strcpy( str, "Ambisonics: First Order (FOA)" ); -- GitLab From a7ece629cfdc96087af4e58d557f0faab6422e59 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Tue, 10 Dec 2024 16:13:36 +0100 Subject: [PATCH 5/7] no need to include string.h --- lib_dec/lib_dec.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index 796ed18ad5..a8e3c6aa6e 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -43,7 +43,9 @@ #include "jbm_pcmdsp_fifo.h" #include #include +#ifndef FIX_1225_DISCLAIMER #include +#endif #ifdef DEBUGGING #include "debug.h" #endif -- GitLab From 78a129a68f184408eaddf386d5c07d8c4b0adc49 Mon Sep 17 00:00:00 2001 From: vaclav Date: Thu, 12 Dec 2024 10:57:55 +0100 Subject: [PATCH 6/7] simplify disclaimer text --- lib_com/disclaimer.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib_com/disclaimer.c b/lib_com/disclaimer.c index 71aded4b87..01710fba15 100644 --- a/lib_com/disclaimer.c +++ b/lib_com/disclaimer.c @@ -47,9 +47,10 @@ int16_t print_disclaimer( FILE *fPtr ) { fprintf( fPtr, "\n==================================================================================================\n" ); - fprintf( fPtr, " IVAS Codec Baseline\n" ); #ifdef FIX_1225_DISCLAIMER - fprintf( fPtr, " \n Initial IVAS Codec (Floating Point) 3GPP TS26.258 version IVAS-FLP-2.0\n" ); + fprintf( fPtr, " \n IVAS Codec (Floating Point) 3GPP TS26.258 version IVAS-FLP-2.0\n" ); +#else + fprintf( fPtr, " IVAS Codec Baseline\n" ); #endif fprintf( fPtr, " \n" ); fprintf( fPtr, " Based on EVS Codec (Floating Point) 3GPP TS26.443 Nov 04, 2021,\n" ); -- GitLab From bb4bc81852a42886dbbda16bf23065cdf7bffc96 Mon Sep 17 00:00:00 2001 From: vaclav Date: Thu, 12 Dec 2024 10:59:37 +0100 Subject: [PATCH 7/7] simplify disclaimer text --- lib_com/disclaimer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_com/disclaimer.c b/lib_com/disclaimer.c index 01710fba15..f49f043ca6 100644 --- a/lib_com/disclaimer.c +++ b/lib_com/disclaimer.c @@ -48,7 +48,7 @@ int16_t print_disclaimer( FILE *fPtr ) fprintf( fPtr, "\n==================================================================================================\n" ); #ifdef FIX_1225_DISCLAIMER - fprintf( fPtr, " \n IVAS Codec (Floating Point) 3GPP TS26.258 version IVAS-FLP-2.0\n" ); + fprintf( fPtr, " \n IVAS Codec Version IVAS-FL-2.0\n" ); #else fprintf( fPtr, " IVAS Codec Baseline\n" ); #endif -- GitLab