diff --git a/apps/renderer.c b/apps/renderer.c index 5df4cc9b4f6379120f5f2b8330648bb4b3270971..4de4a7e5f932543d435e613551fe892818744274 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -733,6 +733,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 ) || @@ -890,6 +894,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 ) @@ -3666,7 +3713,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 5d23ba1549f6aa7f2e7d2c1b6444f0c95255a2b1..f49f043ca6628caa3147ec2e6d412d5df3448ba1 100644 --- a/lib_com/disclaimer.c +++ b/lib_com/disclaimer.c @@ -47,7 +47,11 @@ int16_t print_disclaimer( FILE *fPtr ) { fprintf( fPtr, "\n==================================================================================================\n" ); +#ifdef FIX_1225_DISCLAIMER + fprintf( fPtr, " \n IVAS Codec Version IVAS-FL-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" ); 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 e31bf15805674a6ce7de8813d7bbb0975d0ce091..58337d6abe88d64a1382387104a34812259c42d2 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -161,7 +161,7 @@ /*#define FIX_I4_OL_PITCH*/ /* fix open-loop pitch used for EVS core switching */ #define TMP_FIX_1119_SPLIT_RENDERING_VOIP /* FhG: Add error check for unsupported config: split rendering with VoIP mode */ #define FIX_1228_SAMPLING_RATE_MISMATCH_IN_HRTF_FILE /* VA: issue 1228: Exit the processing when a HRTF binary file with wrong sampling rate is provided */ - +#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 0208a4d76177b8831470890b770033283b6d1fd2..231b4efc6098d0694057eedafae7ffe604c19c09 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 @@ -3883,7 +3885,7 @@ const char *IVAS_DEC_GetErrorMessage( return ivas_error_to_string( error ); } - +#ifndef FIX_1225_DISCLAIMER /*---------------------------------------------------------------------* * get_channel_config() * @@ -3969,7 +3971,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 939c13b93b8a7747690682f1c94ac419977ae3be..cd2330bf095a07816df6ab9415675e0d92612134 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 @@ -476,3 +479,116 @@ 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_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)" ); + } + 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 5c488c88c2cade02796cd424303a178ca1c4a4a7..5d88fab6369174f12b7b473913a20755fbdfaf00 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 e73dfd9001818ea2075cef8fde44eb584e5657e4..d0d8c12116af8ecdb98d886d25e7baedc3e146c9 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -8704,3 +8704,99 @@ 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 + *-----------------------------------------------------------------*/ + + 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, "Output 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 5886ad769c74bbcc70ef9953b4105db705ae53d0..2e8f2f444c83a1d385df582e8a8365b5a104e3a6 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